#ifndef _NTRTL_H
/**
* The RtlDestroyHeap routine destroys the specified heap object. RtlDestroyHeap decommits and releases all the pages of a private heap object,
* and it invalidates the handle to the heap.
*
* \param HeapHandle Handle for the heap to be destroyed. This parameter is a heap handle returned by RtlCreateHeap.
* \return If the call to RtlDestroyHeap succeeds, the return value is a NULL pointer. If the call to RtlDestroyHeap fails, the return value is a handle for the heap.
* \remarks https://learn.microsoft.com/en-us/windows-hardware/drivers/ddi/ntifs/nf-ntifs-rtldestroyheap
* \remarks Own private heaps created for the component; do not destroy the process default heap. DestroyHeap returns NULL on successful destruction and can return the original handle on failure. All allocations and references from a destroyed heap become invalid; use the correct heap for every block operation.
*/
_Success_(return == 0)
NTSYSAPI
PVOID
NTAPI
RtlDestroyHeap(
_In_ _Post_invalid_ HANDLE HeapHandle
);
View code on GitHub// ntifs.h
NTSYSAPI PVOID RtlDestroyHeap(
[in] PVOID HeapHandle
);
View the official Windows Driver Kit DDI referenceNo description available.
The RtlDestroyHeap routine destroys the specified heap object. RtlDestroyHeap decommits and releases all the pages of a private heap object, and it invalidates the handle to the heap.
HeapHandle [in]Handle for the heap to be destroyed. This parameter is a heap handle returned by RtlCreateHeap.
If the call to RtlDestroyHeap succeeds, the return value is a NULL pointer.
If the call to RtlDestroyHeap fails, the return value is a handle for the heap.
Processes can call RtlDestroyHeap without first calling RtlFreeHeap to free memory that was allocated from the heap.
This function is documented in Windows Driver Kit.
Pointer to heap memory block.