diff options
author | Jose Fonseca <jfonseca@vmware.com> | 2015-08-25 11:36:09 +0100 |
---|---|---|
committer | Jose Fonseca <jfonseca@vmware.com> | 2015-08-25 11:36:09 +0100 |
commit | bafc84295df205d0db53353734ec6d61e0f180c5 (patch) | |
tree | 9d1730c8341e5cb8b7958fae2f7665f35b06dfa0 /inject | |
parent | ba0d9915742b28a6e705aa1af4310bb26a3098f2 (diff) |
inject: Take in account that IsWow64Process returns false on 32-bits Windows.
Regression introduced by 6ddfd98cdafefaa1b60273d5568b8dbd13730dae.
Fixes https://github.com/apitrace/apitrace/issues/378
Diffstat (limited to 'inject')
-rw-r--r-- | inject/inject.h | 13 |
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; } |