GetInfo声明如下:
WINBASEAPI
VOID
WINAPI
GetInfo(
__out LPSYSTEM_INFO lpInfo
);
lpInfo是返回硬件信息结构
例子如下:
#001 //
#002 //获取当前系统硬件信息
#003 //蔡军生 2007/11/15 QQ:9073204 深圳
#004 void GetHardInfo(void)
#005 {
#006 //
#007 SYSTEM_INFO sysInfo;
#008
#009 //获取系统信息
#010 ::GetInfo(&sysInfo);
#011
#012 //显示当前系统信息
#013 //
#014 const nBufSize = 512;
#015 TCHAR chBuf[nBufSize];
#016 ZeroMemory(chBuf,nBufSize);
#017
#018 wsprf(chBuf,_T("OEM ID: %u\n"),sysInfo.dwOemId);
#019 OutputDebugString(chBuf);
#020
#021 wsprf(chBuf,_T("CPU个数: %u\n"),sysInfo.dwNumberOfProcessors);
#022 OutputDebugString(chBuf);
#023
#024 wsprf(chBuf,_T("内存分页大小: %u\n"),sysInfo.dwPageSize);
#025 OutputDebugString(chBuf);
#026
#027 wsprf(chBuf,_T("CPU类型: %u\n"),sysInfo.dwProcessorType);
#028 OutputDebugString(chBuf);
#029
#030 wsprf(chBuf,_T("CPU架构: %u\n"),sysInfo.wProcessorArchitecture);
#031 OutputDebugString(chBuf);
#032
#033 wsprf(chBuf,_T("CPU级别: %u\n"),sysInfo.wProcessorLevel);
#034 OutputDebugString(chBuf);
#035
#036 wsprf(chBuf,_T("CPU版本: %u\n"),sysInfo.wProcessorRevision);
#037 OutputDebugString(chBuf);
#038
#039 }
#040
最新评论