[util] Return null if HMODULE is nullptr in GetProcAddress compat

dlsym with NULL will try to find the symbol from anything currently
loaded.
This commit is contained in:
Joshua Ashton 2022-09-01 02:14:22 +00:00 committed by Philip Rebohle
parent 4fc5ba66ed
commit b05ae33273
1 changed files with 3 additions and 0 deletions

View File

@ -16,6 +16,9 @@ inline void FreeLibrary(HMODULE module) {
}
inline void* GetProcAddress(HMODULE module, LPCSTR lpProcName) {
if (!module)
return nullptr;
return dlsym(module, lpProcName);
}