Getting Hardware Information

30 12 2008

Do you know how to get the hardware information such as the OEM identifier, processor type, page size, and so on of your machine.

just a look at the following code snippet,

void GetHardewareInfos
{  
   SYSTEM_INFO siSysInfo;
  
   // Copy the hardware information to the SYSTEM_INFO structure.
  
   ::GetSystemInfo(&siSysInfo);
  
   // Display the contents of the SYSTEM_INFO structure.
  
   printf("Hardware information: \n");
   printf(" OEM ID: %u\n", siSysInfo.dwOemId);
   printf(" Number of processors: %u\n",
      siSysInfo.dwNumberOfProcessors);
   printf(" Page size: %u\n", siSysInfo.dwPageSize);
   printf(" Processor type: %u\n", siSysInfo.dwProcessorType);
   printf(" Minimum application address: %lx\n",
      siSysInfo.lpMinimumApplicationAddress);
   printf(" Maximum application address: %lx\n",
      siSysInfo.lpMaximumApplicationAddress);
   printf(" Active processor mask: %u\n",
      siSysInfo.dwActiveProcessorMask);  
}
Advertisements

Actions

Information

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s




%d bloggers like this: