1

I tried this but it will shows number of logical processors only

    SYSTEM_INFO sysinfo;
GetSystemInfo(&sysinfo);
int numCPU = sysinfo.dwNumberOfProcessors;
Piraisudan M
  • 55
  • 10

1 Answers1

2

From https://msdn.microsoft.com/en-us/library/windows/desktop/ms724958(v=vs.85).aspx:

Note For information about the physical processors shared by logical processors, call GetLogicalProcessorInformationEx with the RelationshipType parameter set to RelationProcessorPackage (3).

You can get the related hardware of the logical processors, and infer how many physical processors are there

Yuval Ben-Arie
  • 1,280
  • 9
  • 14