Signed-off-by: Alex Henrie alexhenrie24@gmail.com --- dlls/kernel32/process.c | 23 +++++++++++++++++++++-- 1 file changed, 21 insertions(+), 2 deletions(-)
diff --git a/dlls/kernel32/process.c b/dlls/kernel32/process.c index 3ad63cf5371..863f2c67413 100644 --- a/dlls/kernel32/process.c +++ b/dlls/kernel32/process.c @@ -660,9 +660,28 @@ DWORD WINAPI GetActiveProcessorCount(WORD group) */ DWORD WINAPI GetMaximumProcessorCount(WORD group) { - DWORD cpus = system_info.NumberOfProcessors; + DWORD cpus = 0; + DWORD size = 0; + SYSTEM_LOGICAL_PROCESSOR_INFORMATION_EX *info; + + TRACE("(0x%x)\n", group);
- FIXME("(0x%x): semi-stub, returning %u\n", group, cpus); + if (!GetLogicalProcessorInformationEx(RelationGroup, NULL, &size)) return 0; + if (!(info = HeapAlloc(GetProcessHeap(), 0, size))) return 0; + if (!GetLogicalProcessorInformationEx(RelationGroup, info, &size)) return 0; + + if (group == ALL_PROCESSOR_GROUPS) + { + for (group = 0; group < info->Group.ActiveGroupCount; group++) + cpus += info->Group.GroupInfo[group].MaximumProcessorCount; + } + else + { + if (group < info->Group.ActiveGroupCount) + cpus = info->Group.GroupInfo[group].MaximumProcessorCount; + } + + HeapFree(GetProcessHeap(), 0, info); return cpus; }