From 9beaabb83b0f3b81170345f169649259028cb612 Mon Sep 17 00:00:00 2001 From: baldurk Date: Sat, 9 Aug 2014 01:45:11 +0100 Subject: [PATCH] Make the lock only cover the ApplyHook function --- renderdoc/os/win32/win32_hook.cpp | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/renderdoc/os/win32/win32_hook.cpp b/renderdoc/os/win32/win32_hook.cpp index f443d6de4..71c450aa8 100644 --- a/renderdoc/os/win32/win32_hook.cpp +++ b/renderdoc/os/win32/win32_hook.cpp @@ -96,8 +96,6 @@ struct CachedHookData void ApplyHooks(const char *modName, HMODULE module) { - SCOPED_LOCK(lock); - string name = strlower(string(modName)); // fraps seems to non-safely modify the assembly around the hook function, if @@ -167,7 +165,10 @@ struct CachedHookData auto found = std::lower_bound(hookset->FunctionHooks.begin(), hookset->FunctionHooks.end(), search); if(found != hookset->FunctionHooks.end() && !(search < *found) && found->excludeModule != module) + { + SCOPED_LOCK(lock); found->ApplyHook(IATentry); + } origFirst++; first++;