1
1
Fork 0
mirror of https://github.com/pbatard/rufus.git synced 2024-08-14 23:57:05 +00:00

Merge branch 'master' into pe-resource-desc

This commit is contained in:
Wes 2021-04-09 07:36:13 -04:00 committed by GitHub
commit 05fbd44293
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
7 changed files with 20 additions and 6 deletions

View file

@ -311,7 +311,7 @@ static BOOL ExtractMSDOS(const char* path)
goto out; goto out;
} }
static_strcat(dllname, "\\diskcopy.dll"); static_strcat(dllname, "\\diskcopy.dll");
hDLL = LoadLibraryA(dllname); hDLL = LoadLibraryExA(dllname, NULL, LOAD_LIBRARY_SEARCH_SYSTEM32);
if (hDLL == NULL) { if (hDLL == NULL) {
uprintf("Unable to open %s: %s\n", dllname, WindowsErrorString()); uprintf("Unable to open %s: %s\n", dllname, WindowsErrorString());
goto out; goto out;

View file

@ -317,6 +317,18 @@ static __inline HMODULE LoadLibraryU(LPCSTR lpFileName)
return ret; return ret;
} }
static __inline HMODULE LoadLibraryExU(LPCSTR lpFileName, HANDLE hFile, DWORD dwFlags)
{
HMODULE ret;
DWORD err = ERROR_INVALID_DATA;
wconvert(lpFileName);
ret = LoadLibraryExW(wlpFileName, hFile, dwFlags);
err = GetLastError();
wfree(lpFileName);
SetLastError(err);
return ret;
}
static __inline int DrawTextU(HDC hDC, LPCSTR lpText, int nCount, LPRECT lpRect, UINT uFormat) static __inline int DrawTextU(HDC hDC, LPCSTR lpText, int nCount, LPRECT lpRect, UINT uFormat)
{ {
int ret; int ret;

View file

@ -3148,7 +3148,8 @@ int WINAPI WinMain(HINSTANCE hInstance, HINSTANCE hPrevInstance, LPSTR lpCmdLine
// nail... Also, no, Coverity, we never need to care about freeing kernel32 as a library. // nail... Also, no, Coverity, we never need to care about freeing kernel32 as a library.
// coverity[leaked_storage] // coverity[leaked_storage]
pfSetDefaultDllDirectories = (SetDefaultDllDirectories_t) pfSetDefaultDllDirectories = (SetDefaultDllDirectories_t)
GetProcAddress(LoadLibraryW(kernel32_path), "SetDefaultDllDirectories"); GetProcAddress(LoadLibraryExW(kernel32_path, NULL, LOAD_LIBRARY_SEARCH_SYSTEM32),
"SetDefaultDllDirectories");
if (pfSetDefaultDllDirectories != NULL) if (pfSetDefaultDllDirectories != NULL)
pfSetDefaultDllDirectories(LOAD_LIBRARY_SEARCH_SYSTEM32); pfSetDefaultDllDirectories(LOAD_LIBRARY_SEARCH_SYSTEM32);

View file

@ -658,7 +658,7 @@ static __inline HMODULE GetLibraryHandle(char* szLibraryName) {
if (OpenedLibrariesHandleSize >= MAX_LIBRARY_HANDLES) { if (OpenedLibrariesHandleSize >= MAX_LIBRARY_HANDLES) {
uprintf("Error: MAX_LIBRARY_HANDLES is too small\n"); uprintf("Error: MAX_LIBRARY_HANDLES is too small\n");
} else { } else {
h = LoadLibraryA(szLibraryName); h = LoadLibraryExA(szLibraryName, NULL, LOAD_LIBRARY_SEARCH_SYSTEM32);
if (h != NULL) if (h != NULL)
OpenedLibrariesHandle[OpenedLibrariesHandleSize++] = h; OpenedLibrariesHandle[OpenedLibrariesHandleSize++] = h;
} }

View file

@ -414,6 +414,7 @@ BEGIN
VALUE "Comments", "https://rufus.ie" VALUE "Comments", "https://rufus.ie"
VALUE "CompanyName", "Akeo Consulting" VALUE "CompanyName", "Akeo Consulting"
VALUE "FileDescription", "The Reliable USB Formatting Utility" VALUE "FileDescription", "The Reliable USB Formatting Utility"
VALUE "FileDescription", "Rufus"
VALUE "FileVersion", "3.14.1769" VALUE "FileVersion", "3.14.1769"
VALUE "InternalName", "Rufus" VALUE "InternalName", "Rufus"
VALUE "LegalCopyright", "© 2011-2021 Pete Batard (GPL v3)" VALUE "LegalCopyright", "© 2011-2021 Pete Batard (GPL v3)"

View file

@ -2047,7 +2047,7 @@ void SetAlertPromptMessages(void)
// Fetch the localized strings in the relevant MUI // Fetch the localized strings in the relevant MUI
// Must use sysnative_dir rather than system_dir as we may not find the MUI's otherwise // Must use sysnative_dir rather than system_dir as we may not find the MUI's otherwise
static_sprintf(mui_path, "%s\\%s\\shell32.dll.mui", sysnative_dir, GetCurrentMUI()); static_sprintf(mui_path, "%s\\%s\\shell32.dll.mui", sysnative_dir, GetCurrentMUI());
mui_lib = LoadLibraryU(mui_path); mui_lib = LoadLibraryExU(mui_path, NULL, LOAD_LIBRARY_SEARCH_DLL_LOAD_DIR);
if (mui_lib != NULL) { if (mui_lib != NULL) {
// 4097 = "You need to format the disk in drive %c: before you can use it." (dialog text) // 4097 = "You need to format the disk in drive %c: before you can use it." (dialog text)
// 4125 = "Microsoft Windows" (dialog title) // 4125 = "Microsoft Windows" (dialog title)
@ -2063,7 +2063,7 @@ void SetAlertPromptMessages(void)
FreeLibrary(mui_lib); FreeLibrary(mui_lib);
} }
static_sprintf(mui_path, "%s\\%s\\urlmon.dll.mui", sysnative_dir, GetCurrentMUI()); static_sprintf(mui_path, "%s\\%s\\urlmon.dll.mui", sysnative_dir, GetCurrentMUI());
mui_lib = LoadLibraryU(mui_path); mui_lib = LoadLibraryExU(mui_path, NULL, LOAD_LIBRARY_SEARCH_DLL_LOAD_DIR);
if (mui_lib != NULL) { if (mui_lib != NULL) {
// 2070 = "Windows Security Warning" (yes, that's what MS uses for a stupid cookie!) // 2070 = "Windows Security Warning" (yes, that's what MS uses for a stupid cookie!)
if (LoadStringU(mui_lib, 2070, title_str[1], sizeof(title_str[1])) <= 0) { if (LoadStringU(mui_lib, 2070, title_str[1], sizeof(title_str[1])) <= 0) {

View file

@ -307,7 +307,7 @@ DWORD M_NTFSSECT_API NtfsSectLoadXpFuncs(S_NTFSSECT_XPFUNCS * XpFuncs) {
XpFuncs->Size = sizeof *XpFuncs; XpFuncs->Size = sizeof *XpFuncs;
XpFuncs->Kernel32 = LoadLibraryA("kernel32.dll"); XpFuncs->Kernel32 = LoadLibraryExA("kernel32.dll", NULL, LOAD_LIBRARY_SEARCH_SYSTEM32);
rc = GetLastError(); rc = GetLastError();
if (!XpFuncs->Kernel32) { if (!XpFuncs->Kernel32) {
M_ERR("KERNEL32.DLL not found!"); M_ERR("KERNEL32.DLL not found!");