LocalDiscard

2.x

  HLOCAL LocalDiscard(hloc)    
  HLOCAL hloc; /* handle of object to discard */

The LocalDiscard macro discards the given local memory object. The lock count of the memory object must be zero.

Parameters

hloc

Identifies the local memory object to be discarded.

Return Value

The return value is equal to the hloc parameter if the macro is successful. Otherwise, it is NULL.

Comments

Although the LocalDiscard macro removes the local memory object from memory, the object's handle remains valid. An application can subsequently pass the handle to the LocalReAlloc function to allocate another local memory object identified by the same handle.

The LocalLock function increments (increases by one) a memory object's lock count. The LocalUnlock function decrements (decreases by one) the lock count.

The LocalDiscard macro is defined in WINDOWS.H as follows:

#define LocalDiscard(h)   LocalReAlloc(h, 0, LMEM_MOVEABLE)

See Also

LocalLock, LocalReAlloc, LocalUnlock