kernel32: Also check OS version to detect old binaries in GlobalMemoryStatus.

Signed-off-by: Alexandre Julliard <julliard@winehq.org>
This commit is contained in:
Alexandre Julliard 2015-12-01 21:02:19 +09:00
parent 49e1ba7d4b
commit 5468e37508

View file

@ -1436,7 +1436,8 @@ VOID WINAPI GlobalMemoryStatus( LPMEMORYSTATUS lpBuffer )
lpBuffer->dwAvailPageFile = 2U*1024*1024*1024 - lpBuffer->dwAvailPhys - 1;
/* limit page file size for really old binaries */
if (nt->OptionalHeader.MajorSubsystemVersion < 4)
if (nt->OptionalHeader.MajorSubsystemVersion < 4 ||
nt->OptionalHeader.MajorOperatingSystemVersion < 4)
{
if (lpBuffer->dwTotalPageFile > MAXLONG) lpBuffer->dwTotalPageFile = MAXLONG;
if (lpBuffer->dwAvailPageFile > MAXLONG) lpBuffer->dwAvailPageFile = MAXLONG;