判断32/64位

来源:互联网 发布:柳岩淘宝直播视频 编辑:程序博客网 时间:2024/04/29 19:23
  1. #include <windows.h>
  2.  typedef BOOL (WINAPI *LPFN_ISWOW64PROCESS)
  3. (HANDLE, PBOOL);
  4. LPFN_ISWOW64PROCESS fnIsWow64Process = (LPFN_ISWOW64PROCESS)
  5. GetProcAddress( GetModuleHandle( "kernel32 "), "IsWow64Process ");
  6.  BOOL IsWow64()
  7.  {
  8.  BOOL bIsWow64 = FALSE;
  9. if (NULL != fnIsWow64Process)
  10. {
  11. if (!fnIsWow64Process(GetCurrentProcess(),&bIsWow64))
  12.  {
  13. // handle error
  14. std::cout < < "Handle Error " < <std::endl;
  15. }
  16. }
  17. return bIsWow64;
  18.  }
原创粉丝点击