[PATCH] kernel32: Don't limit physical memory size even if not large address aware.

Zebediah Figura z.figura12 at gmail.com
Wed Jun 7 12:39:33 CDT 2017


>From testing on Windows 7, it appears Windows doesn't do this either. Also,
the virtual size is already limited in ntdll, so that check is unnecessary
as well.

This fixes a bug with sndrec32.exe giving OOM errors when recording.

Signed-off-by: Zebediah Figura <z.figura12 at gmail.com>
---
 dlls/kernel32/heap.c | 10 ----------
 1 file changed, 10 deletions(-)

diff --git a/dlls/kernel32/heap.c b/dlls/kernel32/heap.c
index fd6414a34e..15953c3731 100644
--- a/dlls/kernel32/heap.c
+++ b/dlls/kernel32/heap.c
@@ -1413,16 +1413,6 @@ VOID WINAPI GlobalMemoryStatus( LPMEMORYSTATUS lpBuffer )
         lpBuffer->dwAvailVirtual = memstatus.ullAvailVirtual;
     }
 
-    /* values are limited to 2Gb unless the app has the IMAGE_FILE_LARGE_ADDRESS_AWARE flag */
-    /* page file sizes are not limited (Adobe Illustrator 8 depends on this) */
-    if (!(nt->FileHeader.Characteristics & IMAGE_FILE_LARGE_ADDRESS_AWARE))
-    {
-        if (lpBuffer->dwTotalPhys > MAXLONG) lpBuffer->dwTotalPhys = MAXLONG;
-        if (lpBuffer->dwAvailPhys > MAXLONG) lpBuffer->dwAvailPhys = MAXLONG;
-        if (lpBuffer->dwTotalVirtual > MAXLONG) lpBuffer->dwTotalVirtual = MAXLONG;
-        if (lpBuffer->dwAvailVirtual > MAXLONG) lpBuffer->dwAvailVirtual = MAXLONG;
-    }
-
     /* 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;
-- 
2.13.0




More information about the wine-patches mailing list