Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 6 additions & 4 deletions renderdoc/os/win32/win32_hook.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -761,7 +761,7 @@ static bool OrdinalAsString(void *func)
return uint64_t(func) <= 0xffff;
}

FARPROC WINAPI Hooked_GetProcAddress(HMODULE mod, LPCSTR func)
FARPROC WINAPI Hooked_GetProcAddress(HMODULE mod, const LPCSTR func)
{
if(mod == NULL || func == NULL || mod == s_HookData->ownmodule)
return GetProcAddress(mod, func);
Expand Down Expand Up @@ -807,6 +807,8 @@ FARPROC WINAPI Hooked_GetProcAddress(HMODULE mod, LPCSTR func)
RDCDEBUG("Located module %s", it->first.c_str());
#endif

LPCSTR searchFunc = func;

if(OrdinalAsString((void *)func))
{
#if ENABLED(VERBOSE_DEBUG_HOOK)
Expand Down Expand Up @@ -835,14 +837,14 @@ FARPROC WINAPI Hooked_GetProcAddress(HMODULE mod, LPCSTR func)
return GetProcAddress(mod, func);
}

func = it->second.OrdinalNames[ordinal].c_str();
searchFunc = it->second.OrdinalNames[ordinal].c_str();

#if ENABLED(VERBOSE_DEBUG_HOOK)
RDCDEBUG("found ordinal %s", func);
RDCDEBUG("found ordinal %s", searchFunc);
#endif
}

FunctionHook search(func, NULL, NULL);
FunctionHook search(searchFunc, NULL, NULL);

auto found =
std::lower_bound(it->second.FunctionHooks.begin(), it->second.FunctionHooks.end(), search);
Expand Down
Loading