From cd3bef1ceac543d93a5838e982ddb2195dcb6ee9 Mon Sep 17 00:00:00 2001 From: FunkyFr3sh Date: Sun, 14 Jul 2024 01:11:55 +0200 Subject: [PATCH] use LoadLibrary --- src/utils.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/src/utils.c b/src/utils.c index bae65bc..fe1db06 100644 --- a/src/utils.c +++ b/src/utils.c @@ -149,13 +149,13 @@ FARPROC util_get_iat_proc(HMODULE mod, char* module_name, char* function_name) BOOL util_caller_is_ddraw_wrapper(void* return_address) { BOOL (WINAPI *getModuleHandleExA)(DWORD, LPCSTR, HMODULE*) = - (void*)real_GetProcAddress(GetModuleHandleA("Kernel32.dll"), "GetModuleHandleExA"); + (void*)real_GetProcAddress(real_LoadLibraryA("Kernel32.dll"), "GetModuleHandleExA"); if (!getModuleHandleExA) return FALSE; - void* directDrawCreate = util_get_iat_proc(GetModuleHandleA(NULL), "ddraw.dll", "DirectDrawCreate"); - void* directDrawCreateEx = util_get_iat_proc(GetModuleHandleA(NULL), "ddraw.dll", "DirectDrawCreateEx"); + void* directDrawCreate = (void*)util_get_iat_proc(GetModuleHandleA(NULL), "ddraw.dll", "DirectDrawCreate"); + void* directDrawCreateEx = (void*)util_get_iat_proc(GetModuleHandleA(NULL), "ddraw.dll", "DirectDrawCreateEx"); TRACE("%s directDrawCreate = %p, directDrawCreateEx = %p\n", __FUNCTION__, directDrawCreate, directDrawCreateEx);