Advertisement
obernardovieira

Get Hardware Information

May 31st, 2013
160
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C++ 0.90 KB | None | 0 0
  1. //by MSDN - Microsoft
  2.  
  3. #include <windows.h>
  4. #include <stdio.h>
  5. #pragma comment(lib, "user32.lib")
  6.  
  7. void main()
  8. {
  9.    SYSTEM_INFO siSysInfo;
  10.  
  11.    // Copy the hardware information to the SYSTEM_INFO structure.
  12.  
  13.    GetSystemInfo(&siSysInfo);
  14.  
  15.    // Display the contents of the SYSTEM_INFO structure.
  16.  
  17.    printf("Hardware information: \n");  
  18.    printf("  OEM ID: %u\n", siSysInfo.dwOemId);
  19.    printf("  Number of processors: %u\n",
  20.       siSysInfo.dwNumberOfProcessors);
  21.    printf("  Page size: %u\n", siSysInfo.dwPageSize);
  22.    printf("  Processor type: %u\n", siSysInfo.dwProcessorType);
  23.    printf("  Minimum application address: %lx\n",
  24.       siSysInfo.lpMinimumApplicationAddress);
  25.    printf("  Maximum application address: %lx\n",
  26.       siSysInfo.lpMaximumApplicationAddress);
  27.    printf("  Active processor mask: %u\n",
  28.       siSysInfo.dwActiveProcessorMask);
  29.    system("pause");
  30. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement