Commit 7d1ffb56 authored by Fabian Bieler's avatar Fabian Bieler Committed by Alexandre Julliard

kernel32: GlobalMemoryStatusEx: memory usage reported only reflects physical memory.

parent bd07f3f3
......@@ -1262,14 +1262,6 @@ BOOL WINAPI GlobalMemoryStatusEx( LPMEMORYSTATUSEX lpmemex )
lpmemex->ullAvailPhys += cached*1024;
}
fclose( f );
if (lpmemex->ullTotalPhys)
{
DWORDLONG TotalPhysical = lpmemex->ullTotalPhys+lpmemex->ullTotalPageFile;
DWORDLONG AvailPhysical = lpmemex->ullAvailPhys+lpmemex->ullAvailPageFile;
lpmemex->dwMemoryLoad = (TotalPhysical-AvailPhysical)
/ (TotalPhysical / 100);
}
}
#elif defined(__FreeBSD__) || defined(__FreeBSD_kernel__) || defined(__NetBSD__) || defined(__APPLE__)
mib[0] = CTL_HW;
......@@ -1284,7 +1276,6 @@ BOOL WINAPI GlobalMemoryStatusEx( LPMEMORYSTATUSEX lpmemex )
lpmemex->ullAvailPhys = val;
lpmemex->ullTotalPageFile = val;
lpmemex->ullAvailPageFile = val;
lpmemex->dwMemoryLoad = lpmemex->ullTotalPhys - lpmemex->ullAvailPhys;
#elif defined ( sun )
pagesize=sysconf(_SC_PAGESIZE);
maxpages=sysconf(_SC_PHYS_PAGES);
......@@ -1305,9 +1296,14 @@ BOOL WINAPI GlobalMemoryStatusEx( LPMEMORYSTATUSEX lpmemex )
lpmemex->ullAvailPhys = pagesize*freepages;
lpmemex->ullTotalPageFile = swapspace;
lpmemex->ullAvailPageFile = swapfree;
lpmemex->dwMemoryLoad = lpmemex->ullTotalPhys - lpmemex->ullAvailPhys;
#endif
if (lpmemex->ullTotalPhys)
{
lpmemex->dwMemoryLoad = (lpmemex->ullTotalPhys-lpmemex->ullAvailPhys)
/ (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;
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment