On x86 windows IsWow64 returns false always. Closes #66

* On x64 windows IsWow64 returns true for 32bit programs, but on x86
  windows there is no such thing as Wow64 so it returns false. Detect this
  by checking our own processes Wow64 nature (which should always return
  true if Wow64 is a thing).
This commit is contained in:
baldurk
2014-07-27 22:24:12 +01:00
parent 6e9b08e382
commit d10e9e239f
+15 -1
View File
@@ -216,7 +216,21 @@ uint32_t Process::InjectIntoProcess(uint32_t pid, const wchar_t *logfile, const
}
#if !defined(WIN64)
if(!isWow64)
BOOL selfWow64 = FALSE;
HANDLE hSelfProcess = GetCurrentProcess();
success = IsWow64Process(hSelfProcess, &selfWow64);
CloseHandle(hSelfProcess);
if(!success)
{
RDCERR("Couldn't determine bitness of self");
return 0;
}
if(selfWow64 && !isWow64)
{
RDCERR("Can't capture x64 process with x86 renderdoc");
CloseHandle(hProcess);