[PATCH] kernel32: Add stub for GetProcessWorkingSetSizeEx.

Alex Henrie alexhenrie24 at gmail.com
Wed Sep 13 00:10:49 CDT 2017


From: Sebastian Lackner <sebastian at fds-team.de>

Patch from Wine Staging.

Needed for the new StarCraft, see:
https://bugs.winehq.org/show_bug.cgi?id=43434#c2
https://us.battle.net/forums/en/starcraft/topic/20758346067
https://bbs.archlinux.org/viewtopic.php?id=228522

Signed-off-by: Alex Henrie <alexhenrie24 at gmail.com>
---
 .../api-ms-win-core-memory-l1-1-1.spec               |  2 +-
 .../api-ms-win-core-memory-l1-1-2.spec               |  2 +-
 dlls/kernel32/kernel32.spec                          |  2 +-
 dlls/kernel32/process.c                              | 20 ++++++++++++++++----
 dlls/kernelbase/kernelbase.spec                      |  2 +-
 5 files changed, 20 insertions(+), 8 deletions(-)

diff --git a/dlls/api-ms-win-core-memory-l1-1-1/api-ms-win-core-memory-l1-1-1.spec b/dlls/api-ms-win-core-memory-l1-1-1/api-ms-win-core-memory-l1-1-1.spec
index 959e65d2ee..42630c1048 100644
--- a/dlls/api-ms-win-core-memory-l1-1-1/api-ms-win-core-memory-l1-1-1.spec
+++ b/dlls/api-ms-win-core-memory-l1-1-1/api-ms-win-core-memory-l1-1-1.spec
@@ -4,7 +4,7 @@
 @ stdcall CreateMemoryResourceNotification(long) kernel32.CreateMemoryResourceNotification
 @ stdcall FlushViewOfFile(ptr long) kernel32.FlushViewOfFile
 @ stdcall GetLargePageMinimum() kernel32.GetLargePageMinimum
-@ stub GetProcessWorkingSetSizeEx
+@ stdcall GetProcessWorkingSetSizeEx(long ptr ptr ptr) kernel32.GetProcessWorkingSetSizeEx
 @ stdcall GetSystemFileCacheSize(ptr ptr ptr) kernel32.GetSystemFileCacheSize
 @ stdcall GetWriteWatch(long ptr long ptr ptr ptr) kernel32.GetWriteWatch
 @ stdcall MapViewOfFile(long long long long long) kernel32.MapViewOfFile
diff --git a/dlls/api-ms-win-core-memory-l1-1-2/api-ms-win-core-memory-l1-1-2.spec b/dlls/api-ms-win-core-memory-l1-1-2/api-ms-win-core-memory-l1-1-2.spec
index 866d20e7fc..6100213eb7 100644
--- a/dlls/api-ms-win-core-memory-l1-1-2/api-ms-win-core-memory-l1-1-2.spec
+++ b/dlls/api-ms-win-core-memory-l1-1-2/api-ms-win-core-memory-l1-1-2.spec
@@ -8,7 +8,7 @@
 @ stdcall FreeUserPhysicalPages(long ptr ptr) kernel32.FreeUserPhysicalPages
 @ stdcall GetLargePageMinimum() kernel32.GetLargePageMinimum
 @ stub GetMemoryErrorHandlingCapabilities
-@ stub GetProcessWorkingSetSizeEx
+@ stdcall GetProcessWorkingSetSizeEx(long ptr ptr ptr) kernel32.GetProcessWorkingSetSizeEx
 @ stdcall GetSystemFileCacheSize(ptr ptr ptr) kernel32.GetSystemFileCacheSize
 @ stdcall GetWriteWatch(long ptr long ptr ptr ptr) kernel32.GetWriteWatch
 @ stub MapUserPhysicalPages
diff --git a/dlls/kernel32/kernel32.spec b/dlls/kernel32/kernel32.spec
index c61e6aceb7..cf27aea766 100644
--- a/dlls/kernel32/kernel32.spec
+++ b/dlls/kernel32/kernel32.spec
@@ -793,7 +793,7 @@
 # @ stub GetProcessUserModeExceptionPolicy
 @ stdcall GetProcessVersion(long)
 @ stdcall GetProcessWorkingSetSize(long ptr ptr)
-# @ stub GetProcessWorkingSetSizeEx
+@ stdcall GetProcessWorkingSetSizeEx(long ptr ptr ptr)
 @ stdcall GetProductInfo(long long long long ptr)
 @ stub GetProductName
 @ stdcall GetProfileIntA(str str long)
diff --git a/dlls/kernel32/process.c b/dlls/kernel32/process.c
index 292317ce00..2c6229eded 100644
--- a/dlls/kernel32/process.c
+++ b/dlls/kernel32/process.c
@@ -3424,20 +3424,32 @@ BOOL WINAPI K32EmptyWorkingSet(HANDLE hProcess)
     return SetProcessWorkingSetSize(hProcess, (SIZE_T)-1, (SIZE_T)-1);
 }
 
+
 /***********************************************************************
- *           GetProcessWorkingSetSize    (KERNEL32.@)
+ *           GetProcessWorkingSetSizeEx    (KERNEL32.@)
  */
-BOOL WINAPI GetProcessWorkingSetSize(HANDLE hProcess, PSIZE_T minset,
-                                     PSIZE_T maxset)
+BOOL WINAPI GetProcessWorkingSetSizeEx(HANDLE process, SIZE_T *minset,
+                                       SIZE_T *maxset, DWORD *flags)
 {
-    FIXME("(%p,%p,%p): stub\n",hProcess,minset,maxset);
+    FIXME("(%p,%p,%p,%p): stub\n", process, minset, maxset, flags);
     /* 32 MB working set size */
     if (minset) *minset = 32*1024*1024;
     if (maxset) *maxset = 32*1024*1024;
+    if (flags) *flags = QUOTA_LIMITS_HARDWS_MIN_DISABLE |
+                        QUOTA_LIMITS_HARDWS_MAX_DISABLE;
     return TRUE;
 }
 
 
+/***********************************************************************
+ *           GetProcessWorkingSetSize    (KERNEL32.@)
+ */
+BOOL WINAPI GetProcessWorkingSetSize(HANDLE process, SIZE_T *minset, SIZE_T *maxset)
+{
+    return GetProcessWorkingSetSizeEx(process, minset, maxset, NULL);
+}
+
+
 /***********************************************************************
  *           SetProcessShutdownParameters    (KERNEL32.@)
  */
diff --git a/dlls/kernelbase/kernelbase.spec b/dlls/kernelbase/kernelbase.spec
index c7e02a803f..3766dcc4e2 100644
--- a/dlls/kernelbase/kernelbase.spec
+++ b/dlls/kernelbase/kernelbase.spec
@@ -637,7 +637,7 @@
 @ stdcall GetProcessShutdownParameters(ptr ptr) kernel32.GetProcessShutdownParameters
 @ stdcall GetProcessTimes(long ptr ptr ptr ptr) kernel32.GetProcessTimes
 @ stdcall GetProcessVersion(long) kernel32.GetProcessVersion
-# @ stub GetProcessWorkingSetSizeEx
+@ stdcall GetProcessWorkingSetSizeEx(long ptr ptr ptr) kernel32.GetProcessWorkingSetSizeEx
 # @ stub GetProcessorSystemCycleTime
 @ stdcall GetProductInfo(long long long long ptr) kernel32.GetProductInfo
 @ stub GetPtrCalData
-- 
2.14.1




More information about the wine-patches mailing list