Commit e3181e3f authored by Dmitry Timoshkov's avatar Dmitry Timoshkov Committed by Alexandre Julliard

Report swap file total/free sizes to be the same as physical memory.

Make sure that we cache all calculated values.
parent 2fac564c
...@@ -1140,19 +1140,17 @@ BOOL WINAPI GlobalMemoryStatusEx( LPMEMORYSTATUSEX lpmemex ) ...@@ -1140,19 +1140,17 @@ BOOL WINAPI GlobalMemoryStatusEx( LPMEMORYSTATUSEX lpmemex )
} }
#endif #endif
/* 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;
/* FIXME: should do something for other systems */ /* FIXME: should do something for other systems */
GetSystemInfo(&si); GetSystemInfo(&si);
lpmemex->ullTotalVirtual = (char*)si.lpMaximumApplicationAddress-(char*)si.lpMinimumApplicationAddress; lpmemex->ullTotalVirtual = (char*)si.lpMaximumApplicationAddress-(char*)si.lpMinimumApplicationAddress;
/* FIXME: we should track down all the already allocated VM pages and substract them, for now arbitrarily remove 64KB so that it matches NT */ /* FIXME: we should track down all the already allocated VM pages and substract them, for now arbitrarily remove 64KB so that it matches NT */
lpmemex->ullAvailVirtual = lpmemex->ullTotalVirtual-64*1024; lpmemex->ullAvailVirtual = lpmemex->ullTotalVirtual-64*1024;
memcpy(&cached_memstatus,lpmemex,sizeof(*lpmemex));
/* it appears some memory display programs want to divide by these values */
if(lpmemex->ullTotalPageFile==0)
lpmemex->ullTotalPageFile++;
if(lpmemex->ullAvailPageFile==0)
lpmemex->ullAvailPageFile++;
/* MSDN says about AvailExtendedVirtual: Size of unreserved and uncommitted /* MSDN says about AvailExtendedVirtual: Size of unreserved and uncommitted
memory in the extended portion of the virtual address space of the calling memory in the extended portion of the virtual address space of the calling
...@@ -1161,6 +1159,8 @@ BOOL WINAPI GlobalMemoryStatusEx( LPMEMORYSTATUSEX lpmemex ) ...@@ -1161,6 +1159,8 @@ BOOL WINAPI GlobalMemoryStatusEx( LPMEMORYSTATUSEX lpmemex )
*/ */
lpmemex->ullAvailExtendedVirtual = 0; lpmemex->ullAvailExtendedVirtual = 0;
memcpy(&cached_memstatus,lpmemex,sizeof(*lpmemex));
TRACE("<-- LPMEMORYSTATUSEX: dwLength %ld, dwMemoryLoad %ld, ullTotalPhys %s, ullAvailPhys %s," TRACE("<-- LPMEMORYSTATUSEX: dwLength %ld, dwMemoryLoad %ld, ullTotalPhys %s, ullAvailPhys %s,"
" ullTotalPageFile %s, ullAvailPageFile %s, ullTotalVirtual %s, ullAvailVirtual %s\n", " ullTotalPageFile %s, ullAvailPageFile %s, ullTotalVirtual %s, ullAvailVirtual %s\n",
lpmemex->dwLength, lpmemex->dwMemoryLoad, wine_dbgstr_longlong(lpmemex->ullTotalPhys), lpmemex->dwLength, lpmemex->dwMemoryLoad, wine_dbgstr_longlong(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