mirror of
https://github.com/baldurk/renderdoc.git
synced 2026-09-19 04:05:41 +00:00
Fix original pointers not being fetched for modules fetched last-minute
This commit is contained in:
@@ -707,7 +707,18 @@ FARPROC WINAPI Hooked_GetProcAddress(HMODULE mod, LPCSTR func)
|
||||
{
|
||||
it->second.module = GetModuleHandleA(it->first.c_str());
|
||||
if(it->second.module)
|
||||
{
|
||||
// fetch all function hooks here, since we want to fill out the original function pointer
|
||||
// even in case nothing imports from that function (which means it would not get filled
|
||||
// out through FunctionHook::ApplyHook)
|
||||
for(FunctionHook &hook : it->second.FunctionHooks)
|
||||
{
|
||||
if(hook.orig && *hook.orig == NULL)
|
||||
*hook.orig = GetProcAddress(it->second.module, hook.function.c_str());
|
||||
}
|
||||
|
||||
it->second.FetchOrdinalNames();
|
||||
}
|
||||
}
|
||||
|
||||
bool match = (mod == it->second.module);
|
||||
|
||||
Reference in New Issue
Block a user