[PATCH 5/5] kernel32: Reimplement GetMaximumProcessorGroupCount on top of GetLogicalProcessorInformationEx

Alex Henrie alexhenrie24 at gmail.com
Sun May 23 20:20:11 CDT 2021


Signed-off-by: Alex Henrie <alexhenrie24 at gmail.com>
---
 dlls/kernel32/process.c | 16 ++++++++++++++--
 1 file changed, 14 insertions(+), 2 deletions(-)

diff --git a/dlls/kernel32/process.c b/dlls/kernel32/process.c
index 863f2c67413..f88a613c7b4 100644
--- a/dlls/kernel32/process.c
+++ b/dlls/kernel32/process.c
@@ -690,8 +690,20 @@ DWORD WINAPI GetMaximumProcessorCount(WORD group)
  */
 WORD WINAPI GetMaximumProcessorGroupCount(void)
 {
-    FIXME("semi-stub, always returning 1\n");
-    return 1;
+    WORD groups;
+    DWORD size = 0;
+    SYSTEM_LOGICAL_PROCESSOR_INFORMATION_EX *info;
+
+    TRACE("()\n");
+
+    if (!GetLogicalProcessorInformationEx(RelationGroup, NULL, &size)) return 0;
+    if (!(info = HeapAlloc(GetProcessHeap(), 0, size))) return 0;
+    if (!GetLogicalProcessorInformationEx(RelationGroup, info, &size)) return 0;
+
+    groups = info->Group.MaximumGroupCount;
+
+    HeapFree(GetProcessHeap(), 0, info);
+    return groups;
 }
 
 /***********************************************************************
-- 
2.31.1




More information about the wine-devel mailing list