判断系统64位(使用GetNativeSystemInfo函数,XP时代就有这个函数了)

判断系统64位

复制代码
static bool IsWin64 (void)
{
    SYSTEM_INFO si = {0};
    typedef void (WINAPI *LPFN_PGNSI)(LPSYSTEM_INFO);
    LPFN_PGNSI pGNSI = (LPFN_PGNSI)GetProcAddress(GetModuleHandleA(("kernel32.dll")),"GetNativeSystemInfo");

    if (pGNSI) pGNSI(&si);

    if (si.wProcessorArchitecture == PROCESSOR_ARCHITECTURE_AMD64)
    {
        return true;
    }
    return false;
}

https://www.cnblogs.com/sz-leez/p/6537004.html

原文地址:https://www.cnblogs.com/findumars/p/4569305.html