GetSystemInfo()

关于“GetSystemInfo()”的详细信息,参考:https://msdn.microsoft.com/en-us/library/windows/desktop/ms724381(v=vs.85).aspx

Getting Hardware Information 例程:https://msdn.microsoft.com/en-us/library/windows/desktop/ms724423(v=vs.85).aspx

函数原型:void WINAPI GetSystemInfo(   _Out_ LPSYSTEM_INFO lpSystemInfo );

作用:获取当前系统的信息。

参数:lpSystemInfo - A pointer to a SYSTEM_INFO structure that receives the information.

 1 #include <windows.h>
 2 #include <stdio.h>
 3 #pragma comment(lib, "user32.lib")
 4 
 5 int main()
 6 {
 7    SYSTEM_INFO siSysInfo;
 8 
 9    // Copy the hardware information to the SYSTEM_INFO structure.
10 
11    GetSystemInfo(&siSysInfo);
12 
13    // Display the contents of the SYSTEM_INFO structure.
14 
15    printf("Hardware information: \n");
16    printf("  OEM ID: %u\n", siSysInfo.dwOemId);
17    printf("  Number of processors: %u\n",
18       siSysInfo.dwNumberOfProcessors);
19    printf("  Page size: %u\n", siSysInfo.dwPageSize);
20    printf("  Processor type: %u\n", siSysInfo.dwProcessorType);
21    printf("  Minimum application address: %lx\n",
22       siSysInfo.lpMinimumApplicationAddress);
23    printf("  Maximum application address: %lx\n",
24       siSysInfo.lpMaximumApplicationAddress);
25    printf("  Active processor mask: %u\n",
26       siSysInfo.dwActiveProcessorMask);
27     return 0;
28 }
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值