GlobalSize

  DWORD GlobalSize(hglb)    
  HGLOBAL hglb; /* global memory block handle */

The GlobalSize function retrieves the current size, in bytes, of the specified global memory block.

Parameters

hglb

Identifies the global memory block.

Return Value

The return value specifies the size, in bytes, of the specified memory block. It is zero if the specified handle is not valid or if the block has been discarded. Use the GetLastError function to obtain extended error information.

Comments

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

An application should call the GlobalFlags function prior to calling the GlobalSize function, to verify that the specified memory block was not discarded. If the memory block has been discarded, the return value for GlobalSize is meaningless.

See Also

GlobalAlloc, GlobalFlags