Alexandre Julliard : kernel32: Yet another workaround for broken apps in GlobalMemoryStatus.

Alexandre Julliard julliard at winehq.org
Fri Dec 21 07:28:33 CST 2007


Module: wine
Branch: master
Commit: 16aadb2785600cc73cfe705a3a64e0315b14d99c
URL:    http://source.winehq.org/git/wine.git/?a=commit;h=16aadb2785600cc73cfe705a3a64e0315b14d99c

Author: Alexandre Julliard <julliard at winehq.org>
Date:   Fri Dec 21 14:27:40 2007 +0100

kernel32: Yet another workaround for broken apps in GlobalMemoryStatus.

---

 dlls/kernel32/heap.c |   13 +++++++++++++
 1 files changed, 13 insertions(+), 0 deletions(-)

diff --git a/dlls/kernel32/heap.c b/dlls/kernel32/heap.c
index 7c72e6d..dc86d1c 100644
--- a/dlls/kernel32/heap.c
+++ b/dlls/kernel32/heap.c
@@ -1422,4 +1422,17 @@ VOID WINAPI GlobalMemoryStatus( LPMEMORYSTATUS lpBuffer )
     /* work around for broken photoshop 4 installer */
     if ( lpBuffer->dwAvailPhys +  lpBuffer->dwAvailPageFile >= 2U*1024*1024*1024)
          lpBuffer->dwAvailPageFile = 2U*1024*1024*1024 -  lpBuffer->dwAvailPhys - 1;
+
+    /* limit page file size for really old binaries */
+    if (nt->OptionalHeader.MajorSubsystemVersion < 4)
+    {
+        if (lpBuffer->dwTotalPageFile > MAXLONG) lpBuffer->dwTotalPageFile = MAXLONG;
+        if (lpBuffer->dwAvailPageFile > MAXLONG) lpBuffer->dwAvailPageFile = MAXLONG;
+    }
+
+    TRACE("Length %u, MemoryLoad %u, TotalPhys %lx, AvailPhys %lx,"
+          " TotalPageFile %lx, AvailPageFile %lx, TotalVirtual %lx, AvailVirtual %lx\n",
+          lpBuffer->dwLength, lpBuffer->dwMemoryLoad, lpBuffer->dwTotalPhys,
+          lpBuffer->dwAvailPhys, lpBuffer->dwTotalPageFile, lpBuffer->dwAvailPageFile,
+          lpBuffer->dwTotalVirtual, lpBuffer->dwAvailVirtual );
 }




More information about the wine-cvs mailing list