Skip to content

Instantly share code, notes, and snippets.

@UCyborg
Last active June 28, 2018 16:51
Show Gist options
  • Save UCyborg/a499100d9d96a8c08aa3182563ca18b6 to your computer and use it in GitHub Desktop.
Save UCyborg/a499100d9d96a8c08aa3182563ca18b6 to your computer and use it in GitHub Desktop.
diff --git a/configure b/configure
index 284af7b..d7ba7c9 100755
--- a/configure
+++ b/configure
@@ -3813,7 +3813,7 @@ esac
$as_echo "#define _GNU_SOURCE /**/" >>confdefs.h
-AM_CFLAGS="${AM_CFLAGS} -DWINVER=0x601 -D_WIN32_WINNT=0x601 -D_WIN32_IE=0x800"
+AM_CFLAGS="${AM_CFLAGS} -DWINVER=0x601 -D_WIN32_WINNT=0x601 -D_WIN32_IE=0x800 -DPSAPI_VERSION=1"
# "-Wl,--nxcompat" to enable DEP (Data Execution Prevention)
AM_LDFLAGS="${AM_LDFLAGS} -Wl,-no-undefined -Wl,--nxcompat"
diff --git a/src/rufus.c b/src/rufus.c
index 026ee9c..4db3dfa 100644
--- a/src/rufus.c
+++ b/src/rufus.c
@@ -3765,7 +3765,7 @@ int WINAPI WinMain(HINSTANCE hInstance, HINSTANCE hPrevInstance, LPSTR lpCmdLine
#endif
{
const char* rufus_loc = "rufus.loc";
- wchar_t kernel32_path[MAX_PATH];
+ //wchar_t kernel32_path[MAX_PATH];
int i, opt, option_index = 0, argc = 0, si = 0, lcid = GetUserDefaultUILanguage();
int wait_for_mutex = 0;
FILE* fd;
@@ -3777,7 +3777,7 @@ int WINAPI WinMain(HINSTANCE hInstance, HINSTANCE hPrevInstance, LPSTR lpCmdLine
char *tmp, *locale_name = NULL, **argv = NULL;
wchar_t **wenv, **wargv;
PF_TYPE_DECL(CDECL, int, __wgetmainargs, (int*, wchar_t***, wchar_t***, int, int*));
- PF_TYPE_DECL(WINAPI, BOOL, SetDefaultDllDirectories, (DWORD));
+ //PF_TYPE_DECL(WINAPI, BOOL, SetDefaultDllDirectories, (DWORD));
HANDLE mutex = NULL, hogmutex = NULL, hFile = NULL;
HWND hDlg = NULL;
HDC hDC;
@@ -3797,7 +3797,7 @@ int WINAPI WinMain(HINSTANCE hInstance, HINSTANCE hPrevInstance, LPSTR lpCmdLine
// indicates that "If the parameter is an empty string (""), the call removes the current
// directory from the default DLL search order"? Yeah, that doesn't work. At all.
// Still, we invoke it, for platforms where the following call might not work...
- SetDllDirectoryA("");
+ //SetDllDirectoryA("");
// Also, even if you use SetDefaultDllDirectories(LOAD_LIBRARY_SEARCH_SYSTEM32), you're
// still going to be brought down if you link to wininet.lib or dwmapi.lib, as these two
@@ -3807,16 +3807,16 @@ int WINAPI WinMain(HINSTANCE hInstance, HINSTANCE hPrevInstance, LPSTR lpCmdLine
// generic URLs around and deliberately refusing to practice *responsible disclosure*...
// Finally, we need to perform the whole gymkhana below, where we can't call on
// SetDefaultDllDirectories() directly, because Windows 7 doesn't have the API exposed.
- GetSystemDirectoryW(kernel32_path, ARRAYSIZE(kernel32_path));
- wcsncat(kernel32_path, L"\\kernel32.dll", ARRAYSIZE(kernel32_path) - wcslen(kernel32_path) - 1);
+ /*GetSystemDirectoryW(kernel32_path, ARRAYSIZE(kernel32_path));
+ wcsncat(kernel32_path, L"\\kernel32.dll", ARRAYSIZE(kernel32_path) - wcslen(kernel32_path) - 1);*/
// NB: Because kernel32 should already be loaded, what we do above to ensure that we
// (re)pick the system one is mostly unnecessary. But since for a hammer everything is a
// nail... Also, no, Coverity, we never need to care about freeing kernel32 as a library.
// coverity[leaked_storage]
- pfSetDefaultDllDirectories = (SetDefaultDllDirectories_t)
+ /*pfSetDefaultDllDirectories = (SetDefaultDllDirectories_t)
GetProcAddress(LoadLibraryW(kernel32_path), "SetDefaultDllDirectories");
if (pfSetDefaultDllDirectories != NULL)
- pfSetDefaultDllDirectories(LOAD_LIBRARY_SEARCH_SYSTEM32);
+ pfSetDefaultDllDirectories(LOAD_LIBRARY_SEARCH_SYSTEM32);*/
uprintf("*** " APPLICATION_NAME " init ***\n");
@@ -4004,7 +4004,7 @@ int WINAPI WinMain(HINSTANCE hInstance, HINSTANCE hPrevInstance, LPSTR lpCmdLine
GetWindowsVersion();
// ...and nothing of value was lost
- if (nWindowsVersion < WINDOWS_7) {
+ if (nWindowsVersion < WINDOWS_VISTA) {
// Load the translation before we print the error
get_loc_data_file(loc_file, selected_locale);
right_to_left_mode = ((selected_locale->ctrl_id) & LOC_RIGHT_TO_LEFT);
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment