forked from Dniel97/segatools
hooklib/dll.c: Ensure LoadLibraryExW is always available
This commit is contained in:
parent
dd363ed000
commit
5a383b804b
@ -131,7 +131,8 @@ static void dll_hook_init(void)
|
|||||||
InitializeCriticalSection(&dll_hook_lock);
|
InitializeCriticalSection(&dll_hook_lock);
|
||||||
|
|
||||||
/* Protect against the (probably impossible) scenario where nothing in the
|
/* Protect against the (probably impossible) scenario where nothing in the
|
||||||
process imports LoadLibraryW but something imports LoadLibraryA.
|
process imports LoadLibraryW but something imports LoadLibraryA. Also
|
||||||
|
do the same with LoadLibraryExW.
|
||||||
|
|
||||||
We know something imports GetModuleHandleW because we do, right here.
|
We know something imports GetModuleHandleW because we do, right here.
|
||||||
|
|
||||||
@ -140,6 +141,7 @@ static void dll_hook_init(void)
|
|||||||
|
|
||||||
kernel32 = GetModuleHandleW(L"kernel32.dll");
|
kernel32 = GetModuleHandleW(L"kernel32.dll");
|
||||||
next_LoadLibraryW = (void *) GetProcAddress(kernel32, "LoadLibraryW");
|
next_LoadLibraryW = (void *) GetProcAddress(kernel32, "LoadLibraryW");
|
||||||
|
next_LoadLibraryExW = (void *) GetProcAddress(kernel32, "LoadLibraryExW");
|
||||||
|
|
||||||
/* Now we can apply the hook table */
|
/* Now we can apply the hook table */
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user