GlobalDosAlloc

3.0

  DWORD GlobalDosAlloc(cbAlloc)    
  DWORD cbAlloc; /* number of bytes to allocate */

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

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

Parameters

cbAlloc

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 cannot allocate a block of memory of the requested size, the return value is zero.

Comments

Memory allocated by using the GlobalDosAlloc function does not need to be locked by using the GlobalLock function.

See Also

GlobalDosFree