Commit 7aa04f27 authored by Mike Hearn's avatar Mike Hearn Committed by Alexandre Julliard

Implemented GlobalMemoryStatusEx().

parent 37f08173
......@@ -533,7 +533,7 @@
@ stdcall GlobalHandle(ptr) GlobalHandle
@ stdcall GlobalLock(long) GlobalLock
@ stdcall GlobalMemoryStatus(ptr) GlobalMemoryStatus
@ stub GlobalMemoryStatusEx
@ stdcall GlobalMemoryStatusEx(ptr) GlobalMemoryStatusEx
@ stdcall GlobalReAlloc(long long long) GlobalReAlloc
@ stdcall GlobalSize(long) GlobalSize
@ stdcall GlobalUnWire(long) GlobalUnWire
......
......@@ -460,6 +460,18 @@ typedef struct tagMEMORYSTATUS
SIZE_T dwAvailVirtual;
} MEMORYSTATUS, *LPMEMORYSTATUS;
typedef struct tagMEMORYSTATUSEX {
DWORD dwLength;
DWORD dwMemoryLoad;
DWORDLONG ullTotalPhys;
DWORDLONG ullAvailPhys;
DWORDLONG ullTotalPageFile;
DWORDLONG ullAvailPageFile;
DWORDLONG ullTotalVirtual;
DWORDLONG ullAvailVirtual;
DWORDLONG ullAvailExtendedVirtual;
} MEMORYSTATUSEX, *LPMEMORYSTATUSEX;
typedef struct _SYSTEMTIME{
WORD wYear;
......
......@@ -1558,6 +1558,9 @@ SIZE_T WINAPI GlobalCompact( DWORD minfree )
/***********************************************************************
* GlobalMemoryStatus (KERNEL32.@)
* Provides information about the status of the memory, so apps can tell
* roughly how much they are able to allocate
*
* RETURNS
* None
*/
......@@ -1693,6 +1696,38 @@ VOID WINAPI GlobalMemoryStatus(
}
/***********************************************************************
* GlobalMemoryStatusEx (KERNEL32.@)
* A version of GlobalMemoryStatus that can deal with memory over 4GB
*
* RETURNS
* None
*/
BOOL WINAPI GlobalMemoryStatusEx( LPMEMORYSTATUSEX lpBuffer ) {
MEMORYSTATUS memstatus;
/* Because GlobalMemoryStatusEx is identical to GlobalMemoryStatus save
for one extra field in the struct, and the lack of a bug, we simply
call GlobalMemoryStatus and copy the values across. */
FIXME("we should emulate the 4GB bug here, as per MSDN\n");
GlobalMemoryStatus(&memstatus);
lpBuffer->dwMemoryLoad = memstatus.dwMemoryLoad;
lpBuffer->ullTotalPhys = memstatus.dwTotalPhys;
lpBuffer->ullAvailPhys = memstatus.dwAvailPhys;
lpBuffer->ullTotalPageFile = memstatus.dwTotalPageFile;
lpBuffer->ullAvailPageFile = memstatus.dwAvailPageFile;
lpBuffer->ullTotalVirtual = memstatus.dwTotalVirtual;
lpBuffer->ullAvailVirtual = memstatus.dwAvailVirtual;
/* MSDN says about AvailExtendedVirtual: Size of unreserved and uncommitted
memory in the extended portion of the virtual address space of the calling
process, in bytes.
However, I don't know what this means, so set it to zero :(
*/
lpBuffer->ullAvailExtendedVirtual = 0;
return 1;
}
/***********************************************************************
* A20Proc (KERNEL.165)
* A20_Proc (SYSTEM.20)
*/
......
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