Skip to content

Commit

Permalink
add bIs32BitProcess and non bIs32BitExe check.
Browse files Browse the repository at this point in the history
  • Loading branch information
number201724 committed Dec 25, 2020
1 parent 0a1627e commit b610a01
Showing 1 changed file with 10 additions and 3 deletions.
13 changes: 10 additions & 3 deletions src/creatwth.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -718,10 +718,17 @@ BOOL WINAPI DetourUpdateProcessWithDllEx(_In_ HANDLE hProcess,
return FALSE;
}
#elif defined(DETOURS_64BIT)
if (bIs32BitProcess || bIs32BitExe) {
if (!UpdateImports32(hProcess, hModule, rlpDlls, nDlls)) {
if (bIs32BitProcess) {
if(bIs32BitExe) {
if (!UpdateImports32(hProcess, hModule, rlpDlls, nDlls)) {
return FALSE;
}
}
else {
// Can't detour a 32-bit process with 64-bit code.
SetLastError(ERROR_INVALID_HANDLE);
return FALSE;
}
}
}
else {
// 64-bit native or 64-bit managed process on any platform.
Expand Down

0 comments on commit b610a01

Please sign in to comment.