kernel32: GlobalMemoryStatusEx: always report at least 1 byte of virtual memory even if none is available.

This commit is contained in:
Fabian Bieler 2007-03-15 00:22:53 +01:00 committed by Alexandre Julliard
parent e1c6c97fc5
commit 70ff521a24
1 changed files with 7 additions and 0 deletions

View File

@ -1312,6 +1312,13 @@ BOOL WINAPI GlobalMemoryStatusEx( LPMEMORYSTATUSEX lpmemex )
lpmemex->ullTotalPageFile += lpmemex->ullTotalPhys;
lpmemex->ullAvailPageFile += lpmemex->ullAvailPhys;
/* Titan Quest refuses to run if TotalPageFile <= ullTotalPhys */
if(lpmemex->ullTotalPageFile == lpmemex->ullTotalPhys)
{
lpmemex->ullTotalPhys -= 1;
lpmemex->ullAvailPhys -= 1;
}
/* FIXME: should do something for other systems */
GetSystemInfo(&si);
lpmemex->ullTotalVirtual = (char*)si.lpMaximumApplicationAddress-(char*)si.lpMinimumApplicationAddress;