现在的位置: 首页 > 综合 > 正文

判断是不是64bit 64位Windows的函数

2013年02月14日 ⁄ 综合 ⁄ 共 415字 ⁄ 字号 评论关闭
BOOL IsWindows64bit()
{
    BOOL bIs64BitOS = FALSE;
    // We check if the OS is 64 Bit
    typedef BOOL (WINAPI *LPFN_ISWOW64PROCESS) (HANDLE, PBOOL);

    LPFN_ISWOW64PROCESS
        fnIsWow64Process = (LPFN_ISWOW64PROCESS)GetProcAddress(
        GetModuleHandle("kernel32"),"IsWow64Process");

    if (NULL != fnIsWow64Process)
    {
        if (!fnIsWow64Process(GetCurrentProcess(),&bIs64BitOS))
        {
            // handle error
        }
    }
    return bIs64BitOS;

}

抱歉!评论已关闭.