Following is IsWow64 implemenation from
"http://download.microsoft.com/download/5/D/6/5D6EAF2B-7DDF-476B-93DC-7CF0072878E6/32-64bit_install.doc"
typedef UINT (WINAPI* GETSYSTEMWOW64DIRECTORY)(LPTSTR, UINT);
BOOL IsWow64(void)
{
#ifdef _WIN64
return FALSE;
#else
GETSYSTEMWOW64DIRECTORY getSystemWow64Directory;
HMODULE hKernel32;
TCHAR Wow64Directory[MAX_PATH];
hKernel32 = GetModuleHandle(TEXT("kernel32.dll"));
if (hKernel32 == NULL) {
//
// This shouldn't happen, but if we can't get
// kernel32's module handle then assume we are
//on x86. We won't ever install 32-bit drivers
// on 64-bit machines, we just want to catch it
// up front to give users a better error message.
//
return FALSE;
}
getSystemWow64Directory = (GETSYSTEMWOW64DIRECTORY)
GetProcAddress(hKernel32, "GetSystemWow64DirectoryW");
if (getSystemWow64Directory == NULL) {
//
// This most likely means we are running
// on Windows 2000, which didn't have this API
// and didn't have a 64-bit counterpart.
//
return FALSE;
}
if ((getSystemWow64Directory(Wow64Directory,
sizeof(Wow64Directory)/sizeof(TCHAR)) == 0) &&
(GetLastError() == ERROR_CALL_NOT_IMPLEMENTED)) {
return FALSE;
}
//
// GetSystemWow64Directory succeeded
// so we are on a 64-bit OS.
//
return TRUE;
#endif
}
Please help explain the code at very beginning of the method as of:
"#ifdef _WIN64 return FALSE;" Why does it return 'FALSE' instead of
'TRUE'? I am confused.