From 7ad303f6ad0e74afbb26f843aff338a08cf58a28 Mon Sep 17 00:00:00 2001 From: baldurk Date: Tue, 30 Jul 2019 16:49:36 +0100 Subject: [PATCH] Defer to real GetProcAddress for NULL parameters. Closes #1476 * Returning NULL as the result is not necessarily correct - a NULL module is an alias for the executable itself. --- renderdoc/os/win32/win32_hook.cpp | 5 +---- 1 file changed, 1 insertion(+), 4 deletions(-) diff --git a/renderdoc/os/win32/win32_hook.cpp b/renderdoc/os/win32/win32_hook.cpp index c130212a1..32db251c2 100644 --- a/renderdoc/os/win32/win32_hook.cpp +++ b/renderdoc/os/win32/win32_hook.cpp @@ -703,10 +703,7 @@ static bool OrdinalAsString(void *func) FARPROC WINAPI Hooked_GetProcAddress(HMODULE mod, LPCSTR func) { - if(mod == NULL || func == NULL) - return (FARPROC)NULL; - - if(mod == s_HookData->ownmodule) + if(mod == NULL || func == NULL || mod == s_HookData->ownmodule) return GetProcAddress(mod, func); #if ENABLED(VERBOSE_DEBUG_HOOK)