Series

Detect Windows Architecture [C++] IsWow64Process SYSTEM_INFO GetNativeSystemInfo

More Code 2018. 6. 25. 05:37

참고 :

IsWow64Process function

SYSTEM_INFO structure

GetSystemInfo function

GetNativeSystemInfo function


// C++

#include <iostream>
#include <cstdlib>
#include <windows.h>
#include <tchar.h>

using namespace std;

int _tmain(int argc, TCHAR *argv[])
{
BOOL isWow64 = false;
if (IsWow64Process(GetCurrentProcess(), &isWow64) != 0)
cout << _T("IsWow64Process : ") << isWow64 << endl;

SYSTEM_INFO si;
GetSystemInfo(&si);
cout << _T("GetSystemInfo : ") << si.wProcessorArchitecture << endl;
GetNativeSystemInfo(&si);
cout << _T("GetNativeSystemInfo : ") << si.wProcessorArchitecture << endl;

return EXIT_SUCCESS;
}

/* Output
IsWow64Process : 1
GetSystemInfo : 0
GetNativeSystemInfo : 9
*/