C++判断系统位数
BOOL Is64BitSystem() { typedef void (WINAPI *PGNSI)(LPSYSTEM_INFO); PGNSI pGNSI; SYSTEM_INFO si; ZeroMemory(&si, sizeof(SYSTEM_INFO)); pGNSI =(PGNSI) GetProcAddress(GetModuleHandle(TEXT("kernel32.dll")), "GetNativeSystemInfo"); if (pGNSI) { pGNSI(&si); if (si.wProcessorArchitecture == PROCESSOR_ARCHITECTURE_AMD64 || si.wProcessorArchitecture == PROCESSOR_ARCHITECTURE_IA64 || si.wProcessorArchitecture == PROCESSOR_ARCHITECTURE_ARM64) { return TRUE; } } return FALSE; }