Platform SDK: Memory |
The GlobalDiscard function discards the specified global memory block. The lock count of the memory object must be zero.
Note The global functions are slower than other memory management functions and do not provide as many features. Therefore, new applications should use the heap functions. However, the global functions are still used with DDE and the clipboard functions.
HGLOBAL GlobalDiscard( HGLOBAL hglbMem // handle to 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/2000: Requires Windows NT 3.1 or later.
Windows 95/98: Requires Windows 95 or later.
Header: Declared in Winbase.h; include Windows.h.
Memory Management Overview, Memory Management Functions, GlobalAlloc, GlobalReAlloc