summaryrefslogtreecommitdiff
path: root/inject
diff options
context:
space:
mode:
Diffstat (limited to 'inject')
-rw-r--r--inject/inject.h13
1 files changed, 5 insertions, 8 deletions
diff --git a/inject/inject.h b/inject/inject.h
index 703735ce..be9da508 100644
--- a/inject/inject.h
+++ b/inject/inject.h
@@ -218,14 +218,11 @@ isDifferentArch(HANDLE hProcess)
return FALSE;
}
-#ifdef _WIN64
- BOOL isThisWow64 = FALSE;
-#else
- BOOL isThisWow64 = TRUE;
-#endif
-
- BOOL isOtherWow64 = FALSE;
- if (!pfnIsWow64Process(hProcess, &isOtherWow64)) {
+ // NOTE: IsWow64Process will return false on 32-bits Windows
+ BOOL isThisWow64;
+ BOOL isOtherWow64;
+ if (!pfnIsWow64Process(GetCurrentProcess(), &isThisWow64) ||
+ !pfnIsWow64Process(hProcess, &isOtherWow64)) {
logLastError("IsWow64Process failed");
return FALSE;
}