mirror of
https://github.com/baldurk/renderdoc.git
synced 2026-07-11 01:57:13 +00:00
Lock inside FetchOrdinalNames just in case
* It's possible for two threads to hit GetProcAddress on the same module at once, try to late-fetch the ordinals, and clash. If we lock then only one thread will perform the fetch, the other thread can wait and bail out once it finds the ordinals already filled out.
This commit is contained in:
@@ -98,9 +98,16 @@ struct DllHookset
|
||||
DWORD OrdinalBase = 0;
|
||||
vector<string> OrdinalNames;
|
||||
std::vector<FunctionLoadCallback> Callbacks;
|
||||
Threading::CriticalSection ordinallock;
|
||||
|
||||
void FetchOrdinalNames()
|
||||
{
|
||||
SCOPED_LOCK(ordinallock);
|
||||
|
||||
// return if we already fetched the ordinals
|
||||
if(!OrdinalNames.empty())
|
||||
return;
|
||||
|
||||
byte *baseAddress = (byte *)module;
|
||||
|
||||
#if ENABLED(VERBOSE_DEBUG_HOOK)
|
||||
|
||||
Reference in New Issue
Block a user