HANDLE GlobalDiscard(hMem) | |||||
HANDLE hMem; | /* handle of block to discard | */ |
The GlobalDiscard function discards the specified global memory block. The lock count of the memory block must be zero.
hMem
Identifies the global memory block to be discarded. This handle must have been created by a previous call to the GlobalAlloc or GlobalReAlloc function.
The return value identifies the discarded block if the function is successful. Otherwise, the return value is zero. Use the GetLastError function to obtain extended error information.
The GlobalDiscard function discards only global objects that an application allocated with the GMEM_DISCARDABLE flag set. The function fails if an application attempts to discard a fixed or locked object.
Although GlobalDiscard removes the global memory object from memory, the object's handle remains valid. An application can subsequently pass the handle to the GlobalReAlloc function to allocate another global memory object identified by the same handle.
GlobalReAlloc