mirror of
https://github.com/panda3d/panda3d.git
synced 2025-09-29 00:06:44 -04:00
load_dso: we can expect LoadLibraryExW to be available
This commit is contained in:
parent
d92b440617
commit
b4fd82b812
@ -50,19 +50,7 @@ load_dso(const DSearchPath &path, const Filename &filename) {
|
||||
return nullptr;
|
||||
}
|
||||
std::wstring os_specific_w = abspath.to_os_specific_w();
|
||||
|
||||
// Try using LoadLibraryEx, if possible.
|
||||
typedef HMODULE (WINAPI *tLoadLibraryEx)(LPCWSTR, HANDLE, DWORD);
|
||||
tLoadLibraryEx pLoadLibraryEx;
|
||||
HINSTANCE hLib = LoadLibrary("kernel32.dll");
|
||||
if (hLib) {
|
||||
pLoadLibraryEx = (tLoadLibraryEx)GetProcAddress(hLib, "LoadLibraryExW");
|
||||
if (pLoadLibraryEx) {
|
||||
return pLoadLibraryEx(os_specific_w.c_str(), nullptr, LOAD_WITH_ALTERED_SEARCH_PATH);
|
||||
}
|
||||
}
|
||||
|
||||
return LoadLibraryW(os_specific_w.c_str());
|
||||
return LoadLibraryExW(os_specific_w.c_str(), nullptr, LOAD_WITH_ALTERED_SEARCH_PATH);
|
||||
}
|
||||
|
||||
bool
|
||||
|
Loading…
x
Reference in New Issue
Block a user