我运行了一些代码来检测我认为应该可以工作的 Windows XP,但是我应该用什么替换 '??' 来检测我是否在 Windows XP 上运行?
bool IsWindowsXP()
{
bool isWindowsXp = false;
OSVERSIONINFOEX osvi;
ZeroMemory(&osvi, sizeof(OSVERSIONINFOEX));
osvi.dwOSVersionInfoSize = sizeof(OSVERSIONINFOEX);
if( GetVersionEx((OSVERSIONINFO*)&osvi) )
{
const DWORD MinXpVersion = ??;
const DWORD MaxXpVersion = ??;
if ((osvi.dwPlatformId == VER_PLATFORM_WIN32_NT) &&
(vi.dwMajorVersion >= MinXpVersion) &&
(vi.dwMajorVersion <= MinXpVersion))
{
isWindowsXp = false;
}
}
return isWindowsXp;
}