RtlFreeHeap function

The RtlFreeHeap routine frees a memory block that was allocated from a heap by RtlAllocateHeap.

Syntax

NTSYSAPI LOGICAL RtlFreeHeap(
  PVOID                 HeapHandle,
  ULONG                 Flags,
  _Frees_ptr_opt_ PVOID BaseAddress
);

Parameters

HeapHandle

A handle for the heap whose memory block is to be freed. This parameter is a handle returned by RtlCreateHeap.

Flags

A set of flags that controls aspects of freeing a memory block. Specifying the following value overrides the corresponding value that was specified in the Flags parameter when the heap was created by RtlCreateHeap.

Flag Meaning
HEAP_NO_SERIALIZE Mutual exclusion will not be used when RtlFreeHeap is accessing the heap.

BaseAddress

TBD

Return Value

RtlFreeHeap returns TRUE if the block was freed successfully; FALSE otherwise.

Note Starting with Windows 8 the return value is typed as LOGICAL, which has a different size than BOOLEAN.

Requirements

   
Windows version Available starting in Windows XP.
Target Platform Universal
Header ntifs.h (include Ntifs.h)
Library NtosKrnl.lib
DLL NtosKrnl.exe
IRQL "< DISPATCH_LEVEL"

See Also

RtlAllocateHeap

RtlCreateHeap

RtlDestroyHeap