LocalSize

  UINT LocalSize(hloc)    
  HLOCAL hloc; /* handle of local memory object */

The LocalSize function returns the current size, in bytes, of the specified local memory block.

Parameters

hloc

Identifies the local memory block.

Return Value

The return value specifies the size, in bytes, of the memory block, if the function is successful. Otherwise, the return value is zero. Use the GetLastError function to obtain extended error information.

Comments

The size of a memory block sometimes is larger than the size requested when the memory was allocated.

To verify that the memory block has not been discarded, an application should call the LocalFlags function prior to calling the LocalSize function. If the memory block has been discarded, the return value for LocalSize is meaningless.

See Also

LocalAlloc, LocalFlags