GlobalSize

Syntax

DWORD GlobalSize(hMem)

This function retrieves the current size (in bytes) of the global memory block specified by the hMem parameter.

Parameter Type/Description  

hMem HANDLE Identifies the global memory block.  

Return Value

The return value specifies the actual size (in bytes) of the specified memory block. It is zero if the given handle is not valid or if the object has been discarded.

Comments

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

An application should call the GlobalFlags function prior to calling the GlobalSize function in order to verify that the specified memory block was not discarded. If the memory block were discarded, the return value for GlobalSize would be meaningless.