Sign in to follow this  

[WinAPI] How to get CPU type

This topic is 3744 days old which is more than the 365 day threshold we allow for new replies. Please post a new topic.

If you intended to correct an error in the post then please contact us.

Recommended Posts

This is one way of finding the architecture as a string.

std::string getProcessorArchitecture()
{
SYSTEM_INFO siSysInfo;
GetSystemInfo(&siSysInfo);

std::string architecture = "unknown";

switch(siSysInfo.wProcessorArchitecture)
{
case PROCESSOR_ARCHITECTURE_AMD64:
architecture = "x64 (AMD or Intel)";
break;
case PROCESSOR_ARCHITECTURE_IA32_ON_WIN64:
architecture = "WOW64";
break;
case PROCESSOR_ARCHITECTURE_IA64:
architecture = "Intel Itanium Processor Family (IPF)";
break;
case PROCESSOR_ARCHITECTURE_INTEL:
architecture = "x86";
break;
default:
break;
}

return architecture;
}

Share this post


Link to post
Share on other sites
Quote:
Original post by madRenEGadE
Yeah that's a beginning but I would rather like to know how to get
something like "Intel Core 2 Duo T7400"? (like it can be found on linux in /proc/cpuinfo)


Just query the registry for the following:

HKEY_LOCAL_MACHINE\HARDWARE\DESCRIPTION\System\CentralProcessor\0

What you want is in that area.

Share this post


Link to post
Share on other sites

This topic is 3744 days old which is more than the 365 day threshold we allow for new replies. Please post a new topic.

If you intended to correct an error in the post then please contact us.

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now

Sign in to follow this