From c56a79ad0689b91bc3d1830a899cb508a34ac67d Mon Sep 17 00:00:00 2001 From: Mike McCormack Date: Thu, 4 Jan 2001 19:52:51 +0000 Subject: [PATCH] Some borken memory monitoring programs divide by dwTotalPageFile, which probably isn't zero on windows. --- memory/global.c | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/memory/global.c b/memory/global.c index 7fb7a3d9a3d..bdaca561f14 100644 --- a/memory/global.c +++ b/memory/global.c @@ -1576,6 +1576,13 @@ VOID WINAPI GlobalMemoryStatus( /* FIXME: we should track down all the already allocated VM pages and substract them, for now arbitrarily remove 64KB so that it matches NT */ lpmem->dwAvailVirtual = lpmem->dwTotalVirtual-64*1024; memcpy(&cached_memstatus,lpmem,sizeof(MEMORYSTATUS)); + + /* it appears some memory display programs want to divide by these values */ + if(lpmem->dwTotalPageFile==0) + lpmem->dwTotalPageFile++; + + if(lpmem->dwAvailPageFile==0) + lpmem->dwAvailPageFile++; } /***********************************************************************