Previous: 4.28.2.11. CreateDataDescriptor To the Table of Contents Next: 4.28.2.13. DosMemoryFree
4.28.2.11. CreateDataDescriptor Table of Contents 4.28.2.13. DosMemoryFree

- 4.28.2.12. -
Table of Contents
4. Standard Units
4.28. DPMI - DOS Protected Mode Interface support unit
4.28.2. DPMI Unit Procedures and Functions
4.28.2.12. DosMemoryAlloc


4.28.2.12. DosMemoryAlloc

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: 4.28.2.11. CreateDataDescriptor To the Table of Contents Next: 4.28.2.13. DosMemoryFree
4.28.2.11. CreateDataDescriptor Table of Contents 4.28.2.13. DosMemoryFree

- 4.28.2.12. -