mirror of
https://github.com/pbatard/rufus.git
synced 2025-05-09 12:31:57 -04:00
[misc] fix an issue with Far Manager
* Closes #161 * Also fix a couple warnings from MinGW and VS
This commit is contained in:
parent
70d2784165
commit
ae08fe3ac2
11 changed files with 263 additions and 45 deletions
40
res/hogger/hogger.c
Normal file
40
res/hogger/hogger.c
Normal file
|
@ -0,0 +1,40 @@
|
|||
/*
|
||||
* Rufus: The Reliable USB Formatting Utility
|
||||
* Commandline hogger, C version
|
||||
* Copyright © 2014 Pete Batard <pete@akeo.ie>
|
||||
*
|
||||
* This program is free software: you can redistribute it and/or modify
|
||||
* it under the terms of the GNU General Public License as published by
|
||||
* the Free Software Foundation, either version 3 of the License, or
|
||||
* (at your option) any later version.
|
||||
*
|
||||
* This program is distributed in the hope that it will be useful,
|
||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
* GNU General Public License for more details.
|
||||
*
|
||||
* You should have received a copy of the GNU General Public License
|
||||
* along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||
*/
|
||||
|
||||
#include <windows.h>
|
||||
|
||||
const char error_msg[] = "Unable to synchronize with UI application.";
|
||||
|
||||
int __cdecl main(int argc_ansi, char** argv_ansi)
|
||||
{
|
||||
DWORD size;
|
||||
register HANDLE mutex, stdout;
|
||||
stdout = GetStdHandle(STD_OUTPUT_HANDLE);
|
||||
mutex = OpenMutexA(SYNCHRONIZE, FALSE, "Global/Rufus_CmdLine");
|
||||
if (mutex == NULL)
|
||||
goto error;
|
||||
WaitForSingleObject(mutex, INFINITE);
|
||||
goto out;
|
||||
|
||||
error:
|
||||
WriteFile(stdout, error_msg, sizeof(error_msg), &size, 0);
|
||||
|
||||
out:
|
||||
ExitProcess(0);
|
||||
}
|
Loading…
Add table
Add a link
Reference in a new issue