erbere

How can I differenciate Windows vista 32-bit from windows vista 64-bit, using GetVersionEx

Is there preprocessor define I canu use for that purpose




Re: Windows SDK Differenciate Vista 32-bit and vista 64 bit

Kenny Kerr

Your best bet is to use the GetNativeSystemInfo function. For example:

WORD GetProcessorArchitecture()
{
SYSTEM_INFO info = { 0 };

::GetNativeSystemInfo(&info);

return info.wProcessorArchitecture;
}

It will return PROCESSOR_ARCHITECTURE_INTEL for x86 and PROCESSOR_ARCHITECTURE_AMD64 indicating x64.

Cheers,
Kenny Kerr

http://weblogs.asp.net/kennykerr/





Re: Windows SDK Differenciate Vista 32-bit and vista 64 bit

erbere

Thanks, it is very useful but if I run vista 32bit on a x64 processor, I will not get the right OS version.

Any idea how I can differenciate Vista 32-bit and Vista 64-bit on a 64-bit machine




Re: Windows SDK Differenciate Vista 32-bit and vista 64 bit

donelder

You can call IsWow64Process. See the help on this for an example using GetProcAddress.