Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Detect 32-bit or 64-bit of Windows

I want to detect whether the current Windows OS is 32-bit or 64-bit. How to achieve it using C++? I don't want processor type I want OS's bit type. This is because you can install 32-bit OS on 64-bit processor.

like image 767
Rahul Avatar asked Aug 10 '11 12:08

Rahul


1 Answers

The function to call is IsWow64Process or IsWow64Process2. It tells your 32-bit application if it is running on a 64 bit Windows.

If the program is compiled for 64 bits, it will already know.

like image 162
Bo Persson Avatar answered Sep 30 '22 18:09

Bo Persson