I want to know, at run time, whether I'm running on 32 bit or 64 bit windows. The OSVERSIONINFOEX structure tells me the major and minor version, but I'm guessing I need the build numbers. Anyone know what they are?
A:
You can get the build number already from the OSVERSIONINFOEX
structure.
If you are a 32-bit process and want to know if you're running under WOW64 (ie., a 64-bit OS), call IsWow64Process()
. (requires XP SP2 or later)
Michael Burr
2009-01-14 15:34:35
+3
A:
If your application is compiled for 64-bit, then the answer's easy: you're running on 64-bit Windows.
If your application is compiled for 32-bit, you need to call IsWow64Process. This function is only exported on Windows XP or later; if you want to support earlier versions of Windows, you'll need to use GetProcAddress to get a pointer to this function.
Roger Lipscombe
2009-01-14 15:42:03