Cap the reported physical memory to 2GB to prevent applications

(e.g. QuickTime 6) from crashing.
This commit is contained in:
Francois Gouget 2002-11-13 19:48:07 +00:00 committed by Alexandre Julliard
parent db45e1ea28
commit 1f0e33cb13
1 changed files with 9 additions and 0 deletions

View File

@ -1623,6 +1623,15 @@ VOID WINAPI GlobalMemoryStatus(
}
#endif
/* Some applications (e.g. QuickTime 6) crash if we tell them there
* is more than 2GB of physical memory.
*/
if (lpmem->dwTotalPhys>2U*1024*1024*1024)
{
lpmem->dwTotalPhys=2U*1024*1024*1024;
lpmem->dwAvailPhys=2U*1024*1024*1024;
}
/* FIXME: should do something for other systems */
GetSystemInfo(&si);
lpmem->dwTotalVirtual = (char*)si.lpMaximumApplicationAddress-(char*)si.lpMinimumApplicationAddress;