为了能让32位应用程序能在64位版本的windows上运行,Microsoft提供了一个称为Windows 32-bit On Windows 64-bit的模拟层,又称为WOW64。
可以调用BOOL IsWow64Process(HANDLE hProcess, PBOOL pbWow64Process) 来判断进程是否在WOW64上运行。
BOOL bIsWow64 = FALSE;
if (!IsWow64Process(GetCurrentProcess(), &bIsWow64)) {
chFAIL("Failed to get WOW64 state.");
return;
}
if (bIsWow64) {
StringCchPrintf(szFullTitle, _countof(szFullTitle),
TEXT("32-bit %s on WOW64"), szTitle);
} else {
StringCchPrintf(szFullTitle, _countof(szFullTitle),
TEXT("32-bit %s on 32-bit Windows"), szTitle);
}