diff --git a/.gitignore b/.gitignore index 436d7ab5..990d8dd4 100644 --- a/.gitignore +++ b/.gitignore @@ -41,5 +41,4 @@ install-sh libtool ltmain.sh missing -sources stamp-h1 diff --git a/rufus.c b/rufus.c index 68256d68..33b54cbd 100644 --- a/rufus.c +++ b/rufus.c @@ -26,6 +26,7 @@ #include #include #include +#include // TODO: MinGW32 requires #include // http://doc.sch130.nsc.ru/www.sysinternals.com/ntw2k/source/fmifs.shtml @@ -263,6 +264,7 @@ static BOOL GetUSBDevices(void) HANDLE hDrive; char drive_letter; char *label, entry[MAX_PATH], buffer[MAX_PATH]; + const char* usbstor_name = "USBSTOR"; IGNORE_RETVAL(ComboBox_ResetContent(hDeviceList)); @@ -281,7 +283,7 @@ static BOOL GetUSBDevices(void) continue; } - if (safe_strcmp(buffer, "USBSTOR") != 0) + if (safe_strcmp(buffer, usbstor_name) != 0) continue; memset(buffer, 0, sizeof(buffer)); if (!SetupDiGetDeviceRegistryPropertyA(dev_info, &dev_info_data, SPDRP_FRIENDLYNAME, diff --git a/rufus.rc b/rufus.rc index 06552450..eff3d740 100644 --- a/rufus.rc +++ b/rufus.rc @@ -7,7 +7,10 @@ // // Generated from the TEXTINCLUDE 2 resource. // -#include "afxres.h" +#include +#ifndef IDC_STATIC +#define IDC_STATIC -1 +#endif ///////////////////////////////////////////////////////////////////////////// #undef APSTUDIO_READONLY_SYMBOLS @@ -55,7 +58,10 @@ END 2 TEXTINCLUDE BEGIN - "#include ""afxres.h""\r\n" + "#include \r\n" + "#ifndef IDC_STATIC\r\n" + "#define IDC_STATIC -1\r\n" + "#endif\r\n" "\0" END diff --git a/sources b/sources new file mode 100644 index 00000000..72e5b040 --- /dev/null +++ b/sources @@ -0,0 +1,24 @@ +TARGETNAME=rufus +TARGETTYPE=PROGRAM +UMTYPE=windows +UMENTRY=winmain + +!IFNDEF MSC_WARNING_LEVEL +MSC_WARNING_LEVEL=/W3 +!ENDIF + +USE_MSVCRT=1 + +INCLUDES=$(DDK_INC_PATH) +C_DEFINES = $(C_DEFINES) /DDDKBUILD /DISOLATION_AWARE_ENABLED + +TARGETLIBS=$(SDK_LIB_PATH)\kernel32.lib \ + $(SDK_LIB_PATH)\user32.lib \ + $(SDK_LIB_PATH)\setupapi.lib \ + $(SDK_LIB_PATH)\ole32.lib + +# http://jpassing.com/2008/02/01/how-to-use-manifests-with-buildexe/ +SXS_APPLICATION_MANIFEST=common_controls_and_elevation.manifest + +SOURCES=rufus.c \ + rufus.rc