Add lock around hook apply function

This commit is contained in:
baldurk
2014-08-09 00:36:15 +01:00
parent f8bf111e9a
commit aa690d7183
+4
View File
@@ -25,6 +25,7 @@
#include "os/os_specific.h"
#include "common/string_utils.h"
#include "common/threading.h"
#include <windows.h>
#include <tlhelp32.h>
@@ -88,9 +89,12 @@ struct CachedHookData
{
map<string, DllHookset> DllHooks;
HMODULE module;
Threading::CriticalSection lock;
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