DOS/32 Advanced DOS Extender - Programmer's Reference


2.32 - DPMI function 0501h - Allocate Memory Block

Allocates and commits a block of linear memory.

 

In: AX = 0501h
BX:CX = size of block (bytes, must be nonzero)
Out:

if successful:
CF clear
BX:CX = linear address of allocated memory block
SI:DI = memory block handle (used to resize and free block)

if failed:
CF set
AX = error code

8012h - linear memory unavailable
8013h - physical memory unavailable
8014h - backing store unavailable
8016h - handle unavailable
8021h - invalid value (BX:CX = 0)

Notes:

a) The allocated block is guaranteed to have at least paragraph alignment. Under DOS/32 Advanced DPMI the blocks will be DWORD aligned only.

b) This function does not allocate any descriptors for the memory block. It is the responsibility of the client to allocate and initialize any descriptors needed to access the memory with additional DPMI function calls.

c) Under DPMI hosts that support virtual memory, the memory block will be allocated unlocked. The client can lock some or all of the memory after it is allocated with the Lock Linear Region DPMI function 0600h.

 


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