Was this page helpful?
Your feedback about this content is important. Let us know what you think.
Additional feedback?
1500 characters remaining
LocalDiscard
Collapse the table of content
Expand the table of content

LocalDiscard macro

Discards the specified local memory object. The lock count of the memory object must be zero.

Note  The local functions have greater overhead and provide fewer features than other memory management functions. New applications should use the heap functions unless documentation states that a local function should be used. For more information, see Global and Local Functions.
 

Syntax


HLOCAL WINAPI LocalDiscard(
  [in] HLOCAL hlocMem
);

Parameters

hlocMem [in]

A handle to the local memory object. This handle is returned by either the LocalAlloc or LocalReAlloc function.

Return value

If the function succeeds, the return value is a handle to the local memory object.

If the function fails, the return value is NULL. To get extended error information, call GetLastError.

Remarks

Although LocalDiscard discards the object's memory block, the handle to the object remains valid. A process can subsequently pass the handle to the LocalReAlloc function to allocate another local memory object identified by the same handle.

Requirements

Minimum supported client

Windows XP [desktop apps only]

Minimum supported server

Windows Server 2003 [desktop apps only]

Header

WinBase.h (include Windows.h)

See also

Global and Local Functions
LocalAlloc
LocalReAlloc
Memory Management Functions

 

 

Community Additions

ADD
Show:
© 2015 Microsoft