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?
Asked
Active
Viewed 1,401 times
4 Answers
3
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
- 89,048
- 55
- 235
- 380
0
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
- 333,147
- 50
- 533
- 760
0
I use WMI.
select * from Win32_OperatingSystem
Get the first instance, and then select the Version attribute. For WinXP, it returns 5.1.2600.