Previous: CreateDataDescriptor function To the Table of Content Next: DosMemoryFree function

- 4.28.2.12 -
Standard Units
DPMI Unit
DPMI Unit Procedures and Functions

DosMemoryAlloc function

Targets: MS-DOS only


DPMI Unit

This function will allocate a block of memory from the DOS free memory pool. It returns real mode only segment of allocated DOS memory block.

Declaration:
function DOSMemoryAlloc(SizeInBytes: DWord): Word;
Remarks:
Returns segment value if successful. Otherwise returns zero.

To get access to allocated DOS memory block you should multiply the returned paragraph-segment by 16.

Example:
function MkDOSPointer (Segment: Word): Pointer;
begin
  Result := DWord(Segment)*16;
end.
This function makes a protected mode pointer on a given segment of allocated DOS memory block.

See also:
DosMemoryFree


Previous: CreateDataDescriptor function To the Table of Content Next: DosMemoryFree function
CreateDataDescriptor function Table of Content DosMemoryFree function

- 4.28.2.12 -