summaryrefslogtreecommitdiff
path: root/inject
diff options
context:
space:
mode:
authorJose Fonseca <jfonseca@vmware.com>2015-07-10 11:07:10 +0100
committerJose Fonseca <jfonseca@vmware.com>2015-07-13 15:53:34 +0100
commita316c6e87916853c0e8f31bc73503e469cd77e96 (patch)
treeaa58d5ac388d417c0e5efd81c66db62ad293f26b /inject
parent2ec73fad5120d57ebd0f63841373c8858e5dd43d (diff)
trace,inject: Don't increment refcount on GetModuleHandleExA.
Diffstat (limited to 'inject')
-rw-r--r--inject/injectee.cpp7
1 files changed, 4 insertions, 3 deletions
diff --git a/inject/injectee.cpp b/inject/injectee.cpp
index 4ed8488d..89cd6129 100644
--- a/inject/injectee.cpp
+++ b/inject/injectee.cpp
@@ -747,9 +747,10 @@ MyLoadLibraryA(LPCSTR lpLibFileName)
void *caller = __builtin_return_address (0);
HMODULE hModule = 0;
- BOOL bRet = GetModuleHandleEx(GET_MODULE_HANDLE_EX_FLAG_FROM_ADDRESS,
- (LPCTSTR)caller,
- &hModule);
+ BOOL bRet = GetModuleHandleEx(GET_MODULE_HANDLE_EX_FLAG_FROM_ADDRESS |
+ GET_MODULE_HANDLE_EX_FLAG_UNCHANGED_REFCOUNT,
+ (LPCTSTR)caller,
+ &hModule);
assert(bRet);
char szCaller[MAX_PATH];
DWORD dwRet = GetModuleFileNameA(hModule, szCaller, sizeof szCaller);