WOWGlobalAllocLock16

The WOWGlobalAllocLock16 function combines the functionality of the WOWGlobalAlloc16 and WOWGlobalLock16 functions.

DWORD WINAPI WOWGlobalAllocLock16(
  WORD wFlags,  // object allocation flags
  DWORD cb,     // number of bytes to allocate
  LPWORD phMem  // handle to global memory object
);
 

Parameters

wFlags
Specifies how to allocate memory. This parameter can be a combination of the following values: GHND, GMEM_DDESHARE, GMEM_DISCARDABLE, GMEM_FIXED, GMEM_LOWER, GMEM_MOVEABLE, GMEM_NOCOMPACT, GMEM_NODISCARD, GMEM_NOT_BANKED, GMEM_NOTIFY, GMEM_SHARE, GMEM_ZEROINIT, and GPTR.
cb
Specifies the number of bytes to allocate.
phMem
Handle to the object in the 16-bit global heap. This value is returned by WOWGlobalAllocLock16.

Return Values

Returns a pointer to the first byte of the memory block if successful. Otherwise, returns NULL.

Remarks

The pointer returned is a 16:16 pointer that cannot be dereferenced directly in 32-bit code. Instead, call the WOWGetVDMPointerFix function.

See Also

WOWGetVDMPointerFix, WOWGlobalAlloc16, WOWGlobalLock16