DOS/32 Advanced DOS Extender - Programmer's Reference



2.14 - DPMI function 0100h - Allocate DOS Memory Block

Allocates a block of memory from the DOS memory pool, ie memory below the 1 MB boundary that is controlled by DOS. Such memory blocks are typically used to exchange data with real mode programs, TSRs, or device drivers. The function returns both the real mode segment base address of the block and one or more descriptors that can be used by protected mode applications to access the block.

 

In: AX = 0100h
BX = number of (16-byte) paragraphs desired
Out:

if successful:
CF clear
AX = real mode segment base address of allocated block
DX = selector for allocated block

if failed
CF set
AX = error code
BX = size of largest available block in paragraphs

0007h - memory control blocks damaged
0008h - insufficient memory
8011h - descriptor unavailable

Notes:

a) The selector returned by this function will be a writeable data selector with the base set to the linear address of the allocated memory block and limit set to the size of the memory block.

b) Client programs should never modify or free any descriptors allocated by this function. The Free DOS Memory Block DPMI function 0101h will deallocate the descriptors automatically.

c) The DOS allocation function (INT 21h function 48h) is used.

 


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