GlobalDosAlloc

Version 3.0

Syntax

DWORD GlobalDosAlloc(dwBytes)

This function allocates global memory which can be accessed by DOS running in real mode. The memory is guaranteed to exist in the first megabyte of linear address space.

Parameter Type/Description  

dwBytes DWORD Specifies the number of bytes to be allocated.  

Return Value

The return value contains a paragraph-segment value in its high-order word and a selector in its low-order word. An application can use the paragraph-segment value to access memory in real mode and the selector to access memory in protected mode. If Windows is running in real mode, the high-order and low-order words will be equal. If Windows cannot allocate a block of memory of the requested size, the return value is NULL.

Comments

An application should not use this function unless it is absolutely necessary. The memory pool from which the object is allocated is a scarce system resource.