Bug 1843701 - Unconditionally use LOAD_LIBRARY_SEARCH_SYSTEM32. r=handyman

Differential Revision: https://phabricator.services.mozilla.com/D183631
This commit is contained in:
Masatoshi Kimura 2023-07-17 18:13:51 +00:00
parent 5bb76f890a
commit 5647f7c0f5

View File

@ -298,16 +298,7 @@ bool inline ConstructSystem32Path(LPCWSTR aModule, WCHAR* aSystemPath,
} }
HMODULE inline LoadLibrarySystem32(LPCWSTR aModule) { HMODULE inline LoadLibrarySystem32(LPCWSTR aModule) {
static const auto setDefaultDllDirectories = return LoadLibraryExW(aModule, nullptr, LOAD_LIBRARY_SEARCH_SYSTEM32);
GetProcAddress(GetModuleHandleW(L"kernel32"), "SetDefaultDllDirectories");
if (setDefaultDllDirectories) {
return LoadLibraryExW(aModule, nullptr, LOAD_LIBRARY_SEARCH_SYSTEM32);
}
WCHAR systemPath[MAX_PATH + 1];
if (!ConstructSystem32Path(aModule, systemPath, MAX_PATH + 1)) {
return NULL;
}
return LoadLibraryExW(systemPath, nullptr, LOAD_WITH_ALTERED_SEARCH_PATH);
} }
// for UniquePtr // for UniquePtr