ResMemDOS Resize a block of DOS (conventional) memory allocated with GetMemDOS.

Inputs: AX = 0ff22h

BX = New block size in paragraphs

DX = Selector of block to modify

Outputs: Carry set on error, AX = DOS error code, BX = Maximum block size in paragraphs.

Errors: If an invalid block is passed or if not enough selectors or memory are available when expanding the block this function returns carry set.

Notes: Growing a memory block is often likely to fail since other DOS block allocations prevent increasing the size of the block. Also, if the size of a block grows past a 64K boundary then the allocation fails if the next descriptor in the LDT is not free.

ResMemLinear Resize a previously allocated block of memory without a selector.

Inputs: AX = 0ff12h

SI:DI = Linear address of block to resize.

CX:DX = Size of block required in bytes.

Outputs: Carry set on error else,

SI:DI = New linear address of block.

Errors: If not enough memory is available when extending the block size this function returns carry set.

Notes: If the memory block cannot be expanded to the desired size, and a free block of sufficient size exists, the existing memory is copied to the free block and released. The new block is allocated in place of the old.

Next Page

Previous Page

Go to Table of Contents