DOS/32 Advanced DOS Extender - Programmer's Reference


2.31 - DPMI function 0500h - Get Free Memory Information

Returns information about the amount of available physical memory, linear address space, and disk space for page swapping. Since DPMI clients will often run in multitasking environments, the information returned by this function should only be considered as advisory.

 

In: AX = 0500h
ES:EDI = selector:offset of 48-byte buffer
Out:

CF clear
the buffer is filled in with the following information:

 Offset  Length  Contents
 00h  4  Largest available free block in bytes
 04h  4  Maximum unlocked page allocation in pages
 08h  4  Maximum locked page allocation in pages
 0Ch  4  Linear address space size in pages
 10h  4  Total number of unlocked pages
 14h  4  Total number of free pages
 18h  4  Total number of physical pages
 1Ch  4  Free linear address space in pages
 20h  4  Size of paging file/partition in pages
 24h  0Ch  Reserved, all bytes set to 0FFh

Notes:

a) Only the first field of the returned structure is guaranteed to contain a valid value. Any fields that are not supported by the DPMI host will be set by the host to -1 (0FFFFFFFFh) to indicate that the information is not available.

b) The field at buffer offset 00h specifies the largest block of contiguous linear memory in bytes that could be allocated if the memory were to be allocated and left unlocked.

c) The field at buffer offset 04h specifies the largest number of pages that could be allocated (the value at offset 00h divided by the page size).

d) The field at buffer offset 08h specifies the largest block of memory in pages that could be allocated and then locked.

e) The field at buffer offset 0Ch specifies the size of the total linear address space in pages. This value includes all linear address space that has already been allocated.

f) The field at buffer offset 10h specifies the total number of pages that are currently unlocked and could be paged out. This value also contains any free pages.

g) The field at buffer offset 14h specifies the number of physical pages that currently are not in use.

h) The field at offset 18h specifies the total number of physical pages that the DPMI host manages. This value includes all free, locked, and unlocked physical pages.

i) The field at offset 20h specifies the size of the DPMI host's paging partition or file in pages.

j) The size of the pages used by the DPMI host can be obtained with the Get Page Size DPMI function 0604h.

 


Copyright Supernar Systems, Ltd. 1996-2005
All Rights Reserved.