HANDLE GlobalDiscard(hMem)
This function discards a global memory block specified by the hMem parameter. The lock count of the memory block must be zero.
The global memory block is removed from memory, but its handle remains valid. An application can subsequently pass the handle to the GlobalReAlloc function to allocate another global memory block identified by the same handle.
Parameter | Type/Description |
hMem | HANDLE Identifies the global memory block to be discarded. |
The return value identifies the discarded block if the function is successful. Otherwise,
it is zero.
The GlobalDiscard function discards only global objects that an application allocated with the GMEM_DISCARDABLE and GMEM_MOVEABLE flags set. The function fails if an application attempts to discard a fixed or locked object.