The GlobalDiscard function discards the specified global memory block. The lock count of the memory object must be zero.
This function is provided only for compatibility with 16-bit versions of Windows.
HGLOBAL GlobalDiscard(
HGLOBAL hglbMem // handle to the global memory object
);
If the function succeeds, the return value is a handle to the memory object.
If the function fails, the return value is NULL. To get extended error information, call GetLastError.
Although GlobalDiscard discards the object's memory block, the handle to the object remains valid. The process can subsequently pass the handle to the GlobalReAlloc function to allocate another global memory block identified by the same handle.
Windows NT: Requires version 3.1 or later.
Windows: Requires Windows 95 or later.
Windows CE: Unsupported.
Header: Declared in winbase.h.
Memory Management Overview, Memory Management Functions, GlobalAlloc, GlobalReAlloc