In GlobalMemoryStatus, also cap the sum of dwAvailPhys and

dwAvailPageFile at 2Gb to avoid a bug in Photoshop 4.
This commit is contained in:
Alexandre Julliard 2004-06-24 04:08:33 +00:00
parent 9bfe0c4ec4
commit 2130f61310
1 changed files with 7 additions and 3 deletions

View File

@ -1141,12 +1141,16 @@ VOID WINAPI GlobalMemoryStatus(
/* 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)
if (lpmem->dwTotalPhys >= 2U*1024*1024*1024)
{
lpmem->dwTotalPhys=2U*1024*1024*1024;
lpmem->dwAvailPhys=2U*1024*1024*1024;
lpmem->dwTotalPhys=2U*1024*1024*1024 - 1;
lpmem->dwAvailPhys=2U*1024*1024*1024 - 1;
}
/* work around for broken photoshop 4 installer */
if (lpmem->dwAvailPhys + lpmem->dwAvailPageFile >= 2U*1024*1024*1024)
lpmem->dwAvailPageFile = 2U*1024*1024*1024 - lpmem->dwAvailPhys - 1;
/* FIXME: should do something for other systems */
GetSystemInfo(&si);
lpmem->dwTotalVirtual = (char*)si.lpMaximumApplicationAddress-(char*)si.lpMinimumApplicationAddress;