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. DPMI 1.0 clients
should avoid use of this function (see the last note of the
call).

Call With:

AX = 0500H
ES:(E)DI= selector:offset of 48-byte buffer

Returns:

Carry flag= clear (this function always succeeds)

and 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:

o 32-bit programs must use ES:EDI to point to the buffer.
16-bit programs should use ES:DI.
o 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.
o 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.
o 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).
o The field at buffer offset 08H specifies the largest
block of memory in pages that could be allocated and then
locked.
o 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.
o The field at buffer offset 10H specifies the total number
of pages that are currently un
locked and could be paged out. This value also contains any free
pages.
o The field at buffer offset 14H specifies the number of
physical pages that currently are not in use.
o 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.
o The field at offset 20H specifies the size of the DPMI
host's paging partition or file in pages.
o The size of the pages used by the DPMI host can be
obtained with the Get Page Size function (Int 31H
Function 0604H).
o DPMI 1.0 clients should use Int 31H Fn 050BH in
preference to this function. This function is supported
in DPMI 1.0 solely for backward compatibility with DPMI
0.9.