Platform SDK: Memory

LocalHandle

The LocalHandle function retrieves the handle associated with the specified pointer to a local memory object.

Note  The local functions are slower than other memory management functions and do not provide as many features. Therefore, new applications should use the heap functions.

HLOCAL LocalHandle(
  LPCVOID pMem   // pointer to local memory object
);

Parameters

pMem
[in] Pointer to the first byte of the local memory object. This pointer is returned by the LocalLock function.

Return Values

If the function succeeds, the return value is a handle to the specified local memory object.

If the function fails, the return value is NULL. To get extended error information, call GetLastError.

Remarks

When the LocalAlloc function allocates a local memory object with LMEM_MOVEABLE, it returns a handle to the object. The LocalLock function converts this handle into a pointer to the object's memory block, and LocalHandle converts the pointer back into a handle.

Requirements

  Windows NT/2000: Requires Windows NT 3.1 or later.
  Windows 95/98: Requires Windows 95 or later.
  Header: Declared in Winbase.h; include Windows.h.
  Library: Use Kernel32.lib.

See Also

Memory Management Overview, Memory Management Functions, LocalAlloc, LocalLock