kernel32: GlobalMemoryStatusEx: return the size of physical memory + swapsize in ullTotalPageFile/ullAvailPageFile.

This commit is contained in:
Fabian Bieler 2007-03-15 00:21:25 +01:00 committed by Alexandre Julliard
parent 7d1ffb564f
commit e1c6c97fc5
1 changed files with 7 additions and 5 deletions

View File

@ -1304,11 +1304,13 @@ BOOL WINAPI GlobalMemoryStatusEx( LPMEMORYSTATUSEX lpmemex )
/ (lpmemex->ullTotalPhys / 100);
}
/* Project2k refuses to start if it sees less than 1Mb of free swap */
if (lpmemex->ullTotalPageFile < lpmemex->ullTotalPhys)
lpmemex->ullTotalPageFile = lpmemex->ullTotalPhys;
if (lpmemex->ullAvailPageFile < lpmemex->ullAvailPhys)
lpmemex->ullAvailPageFile = lpmemex->ullAvailPhys;
/* Win98 returns only the swapsize in ullTotalPageFile/ullAvailPageFile,
WinXP returns the size of physical memory + swapsize;
mimic the behavior of XP.
Note: Project2k refuses to start if it sees less than 1Mb of free swap.
*/
lpmemex->ullTotalPageFile += lpmemex->ullTotalPhys;
lpmemex->ullAvailPageFile += lpmemex->ullAvailPhys;
/* FIXME: should do something for other systems */
GetSystemInfo(&si);