_SHELL_LocalAllocEx


include shell.inc
VxDcall SHELL_LocalAllocEx, <fl, cb, <OFFSET32 lpvBuf>>
mov [Handle], eax
mov [LinearAddress], edx

Allocates memory from the local heap of the message server application. Uses C calling conventions.

fl

Flags. Can be a combination of these values:

LMEM_ZEROINIT

Fill block with zeroes.

LMEM_FIXED

Allocate non-moveable memory.

LPTR

Same as LMEM_ZEROINIT and LMEM_FIXED.

LMEM_STRING

Allocate a block having the same size in bytes as a null-terminated string. The cb parameter must be zero and lpvBuf must be the address of the null-terminated string.


Do not use LMEM_MOVEABLE or LMEM_DISCARDABLE.

cb

Size of block to allocate, in bytes.

lpvBuf

Address of buffer containing initialization data or NULL if no initialization is needed. The contents of this buffer will be copied into ring 3.

This service may be called only during application time. Failure to observe this restriction may crash the system.

The message server application runs without a window on the Windows desktop. VxDs should be frugal with the use of this memory since it is a limited resource. Because Windows moves segments, the 32-bit linear address returned in EDX becomes invalid as soon as control is given to the Windows memory manager. The 16:16 pointer remains valid however.