summaryrefslogtreecommitdiff
path: root/inject
diff options
context:
space:
mode:
authorJose Fonseca <jfonseca@vmware.com>2015-11-16 15:02:00 +0000
committerJose Fonseca <jfonseca@vmware.com>2015-11-16 15:02:00 +0000
commit94bbf7890326d37f03fd2a6822b6618b08bec8e2 (patch)
tree1000985539e863dcb2b576b899c835637b5dc404 /inject
parent482c17d37f18cfd147d8f8a4f2ab780cae2d7aad (diff)
injectee: Rename Mutex to g_Mutex.
For consistency.
Diffstat (limited to 'inject')
-rw-r--r--inject/injectee.cpp20
1 files changed, 10 insertions, 10 deletions
diff --git a/inject/injectee.cpp b/inject/injectee.cpp
index 3e694df1..54120037 100644
--- a/inject/injectee.cpp
+++ b/inject/injectee.cpp
@@ -58,7 +58,7 @@ static int VERBOSITY = 0;
#define NOOP 0
-static CRITICAL_SECTION Mutex;
+static CRITICAL_SECTION g_Mutex;
@@ -379,21 +379,21 @@ replaceAddress(LPVOID *lpOldAddress, LPVOID lpNewAddress)
return TRUE;
}
- EnterCriticalSection(&Mutex);
+ EnterCriticalSection(&g_Mutex);
if (!(VirtualProtect(lpOldAddress, sizeof *lpOldAddress, PAGE_READWRITE, &flOldProtect))) {
- LeaveCriticalSection(&Mutex);
+ LeaveCriticalSection(&g_Mutex);
return FALSE;
}
*lpOldAddress = lpNewAddress;
if (!(VirtualProtect(lpOldAddress, sizeof *lpOldAddress, flOldProtect, &flOldProtect))) {
- LeaveCriticalSection(&Mutex);
+ LeaveCriticalSection(&g_Mutex);
return FALSE;
}
- LeaveCriticalSection(&Mutex);
+ LeaveCriticalSection(&g_Mutex);
return TRUE;
}
@@ -642,9 +642,9 @@ patchModule(HMODULE hModule,
/* Hook modules only once */
if (action == ACTION_HOOK) {
std::pair< std::set<HMODULE>::iterator, bool > ret;
- EnterCriticalSection(&Mutex);
+ EnterCriticalSection(&g_Mutex);
ret = g_hHookedModules.insert(hModule);
- LeaveCriticalSection(&Mutex);
+ LeaveCriticalSection(&g_Mutex);
if (!ret.second) {
return;
}
@@ -951,10 +951,10 @@ MyFreeLibrary(HMODULE hModule)
BOOL bRet = FreeLibrary(hModule);
DWORD dwLastError = GetLastError();
- EnterCriticalSection(&Mutex);
+ EnterCriticalSection(&g_Mutex);
// TODO: Only clear the modules that have been freed
g_hHookedModules.clear();
- LeaveCriticalSection(&Mutex);
+ LeaveCriticalSection(&g_Mutex);
SetLastError(dwLastError);
return bRet;
@@ -1037,7 +1037,7 @@ DllMain(HINSTANCE hinstDLL, DWORD fdwReason, LPVOID lpvReserved)
switch (fdwReason) {
case DLL_PROCESS_ATTACH:
- InitializeCriticalSection(&Mutex);
+ InitializeCriticalSection(&g_Mutex);
g_hThisModule = hinstDLL;