运行时是否正确检查Windows是否为64位? (C )

bool Win64bit = (sizeof(int*) == 8) ? 1 : 0;

我需要这个,所以我的应用程序可以正常使用Windows注册功能(或者我需要?).

我做得对吗?

以下是Raymond Chen在 http://blogs.msdn.com/oldnewthing/archive/2005/02/01/364563.aspx博客中建议的内容
BOOL Is64Bitwindows()
{
#if defined(_WIN64)
    return TRUE;  // 64-bit programs run only on Win64
#elif defined(_WIN32)
    // 32-bit programs run on both 32-bit and 64-bit Windows
    // so must sniff
    BOOL f64 = FALSE;
    return IsWow64Process(GetCurrentProcess(),&f64) && f64;
#else
    return FALSE; // Win64 does not support Win16
#endif
}

相关文章

Windows2012R2备用域控搭建 前置操作 域控主域控的主dns:自...
主域控角色迁移和夺取(转载) 转载自:http://yupeizhi.blo...
Windows2012R2 NTP时间同步 Windows2012R2里没有了internet时...
Windows注册表操作基础代码 Windows下对注册表进行操作使用的...
黑客常用WinAPI函数整理之前的博客写了很多关于Windows编程的...
一个简单的Windows Socket可复用框架说起网络编程,无非是建...