[PATCH v2] kernel32: Implement GetMaximumProcessorCount

Alex Henrie alexhenrie24 at gmail.com
Mon Nov 12 00:37:49 CST 2018


Wine-Bug: https://bugs.winehq.org/show_bug.cgi?id=45961
Signed-off-by: Alex Henrie <alexhenrie24 at gmail.com>
---
v2: Remove accidentally included tests for GetActiveProcessorCount and
implement GetMaximumProcessorCount in a hopefully more correct way by
copying the current implementation of GetActiveProcessorCount
---
 dlls/kernel32/cpu.c         | 15 +++++++++++++++
 dlls/kernel32/kernel32.spec |  2 +-
 2 files changed, 16 insertions(+), 1 deletion(-)

diff --git a/dlls/kernel32/cpu.c b/dlls/kernel32/cpu.c
index 1e99951993..89482a65e1 100644
--- a/dlls/kernel32/cpu.c
+++ b/dlls/kernel32/cpu.c
@@ -328,6 +328,21 @@ DWORD WINAPI GetActiveProcessorCount(WORD group)
     return cpus;
 }
 
+/***********************************************************************
+ *           GetMaximumProcessorCount (KERNEL32.@)
+ */
+DWORD WINAPI GetMaximumProcessorCount(WORD group)
+{
+    SYSTEM_INFO si;
+    DWORD cpus;
+
+    GetSystemInfo( &si );
+    cpus = si.dwNumberOfProcessors;
+
+    FIXME("semi-stub, returning %u\n", cpus);
+    return cpus;
+}
+
 /***********************************************************************
  *           GetEnabledXStateFeatures (KERNEL32.@)
  */
diff --git a/dlls/kernel32/kernel32.spec b/dlls/kernel32/kernel32.spec
index 74af2a4570..c370a068c2 100644
--- a/dlls/kernel32/kernel32.spec
+++ b/dlls/kernel32/kernel32.spec
@@ -718,7 +718,7 @@
 # @ stub GetLongPathNameTransactedW
 @ stdcall GetLongPathNameW (wstr long long)
 @ stdcall GetMailslotInfo(long ptr ptr ptr ptr)
-# @ stub GetMaximumProcessorCount
+@ stdcall GetMaximumProcessorCount(long)
 # @ stub GetMaximumProcessorGroupCount
 @ stdcall GetModuleFileNameA(long ptr long)
 @ stdcall GetModuleFileNameW(long ptr long)
-- 
2.19.1




More information about the wine-devel mailing list