mirror of
https://github.com/mozilla/gecko-dev.git
synced 2024-11-23 12:51:06 +00:00
Bug 1843701 - Unconditionally use LOAD_LIBRARY_SEARCH_SYSTEM32. r=handyman
Differential Revision: https://phabricator.services.mozilla.com/D183631
This commit is contained in:
parent
5bb76f890a
commit
5647f7c0f5
@ -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
|
||||||
|
Loading…
Reference in New Issue
Block a user