# HG changeset patch # User moel.mich # Date 1265220611 0 # Node ID 1662dea7a261624b26427327b013b7ca123537c7 # Parent e6832d4b89d2feeaf9937a72a7b8758d5c3c013c Fixed Intel CPU coreCount in case CPUID 0x0B is supported but returns only 0. diff -r e6832d4b89d2 -r 1662dea7a261 Hardware/CPU/IntelCPU.cs --- a/Hardware/CPU/IntelCPU.cs Tue Feb 02 21:58:54 2010 +0000 +++ b/Hardware/CPU/IntelCPU.cs Wed Feb 03 18:10:11 2010 +0000 @@ -63,17 +63,21 @@ this.name = name; this.icon = Utilities.EmbeddedResources.GetImage("cpu.png"); - logicalProcessorsPerCore = 1; + logicalProcessors = 0; if (cpuidData.GetLength(0) > 0x0B) { uint eax, ebx, ecx, edx; WinRing0.CpuidEx(0x0B, 0, out eax, out ebx, out ecx, out edx); - logicalProcessorsPerCore = ebx & 0xFF; - WinRing0.CpuidEx(0x0B, 1, out eax, out ebx, out ecx, out edx); - logicalProcessors = ebx & 0xFF; - } else if (cpuidData.GetLength(0) > 0x04) { + logicalProcessorsPerCore = ebx & 0xFF; + if (logicalProcessorsPerCore > 0) { + WinRing0.CpuidEx(0x0B, 1, out eax, out ebx, out ecx, out edx); + logicalProcessors = ebx & 0xFF; + } + } + if (logicalProcessors <= 0 && cpuidData.GetLength(0) > 0x04) { logicalProcessors = ((cpuidData[4, 0] >> 26) & 0x3F) + 1; logicalProcessorsPerCore = 1; - } else { + } + if (logicalProcessors <= 0) { logicalProcessors = 1; logicalProcessorsPerCore = 1; }