Last active
August 29, 2015 14:10
-
-
Save takamin/72cc136506ad402203b3 to your computer and use it in GitHub Desktop.
[Windows VC++] Check whether the current process is running on the x64
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#include <Windows.h> | |
BOOL IsRunningOnX64() | |
{ | |
BOOL isRunningOnX64 = FALSE; | |
typedef BOOL(WINAPI *LPFN_ISWOW64PROCESS) (HANDLE, PBOOL); | |
LPFN_ISWOW64PROCESS IsWow64Process = | |
(LPFN_ISWOW64PROCESS)GetProcAddress( | |
GetModuleHandle(TEXT("kernel32")), "IsWow64Process"); | |
if (IsWow64Process != 0) { | |
IsWow64Process(GetCurrentProcess(), &isRunningOnX64); | |
} | |
return isRunningOnX64; | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment