#ifndef _NTRTL_H
_Must_inspect_result_
NTSYSAPI
PVOID
NTAPI
RtlCreateHeap(
_In_ ULONG Flags,
_In_opt_ PVOID HeapBase,
_In_opt_ SIZE_T ReserveSize,
_In_opt_ SIZE_T CommitSize,
_In_opt_ PVOID Lock,
_When_((Flags & HEAP_CREATE_SEGMENT_HEAP) != 0, _In_reads_bytes_opt_(sizeof(RTL_SEGMENT_HEAP_PARAMETERS)))
_When_((Flags & HEAP_CREATE_SEGMENT_HEAP) == 0, _In_reads_bytes_opt_(sizeof(RTL_HEAP_PARAMETERS)))
_In_opt_ PVOID Parameters
);
View code on GitHubThis function is documented in Windows Driver Kit.
Flags are defined in <WinNT.h>. Can be one of following:
HEAP_NO_SERIALIZEHEAP_GROWABLEHEAP_GENERATE_EXCEPTIONSHEAP_ZERO_MEMORYHEAP_REALLOC_IN_PLACE_ONLYHEAP_TAIL_CHECKING_ENABLEDHEAP_FREE_CHECKING_ENABLEDHEAP_DISABLE_COALESCE_ON_FREEHEAP_CREATE_ALIGN_16HEAP_CREATE_ENABLE_TRACINGBase address, where heap should be created. If memory was previously allocated at this address, heap is created at the nearest possible virtual address.
How much bytes should be reserved. See NtAllocateVirtualMemory.
How many bytes should be committed. If Reserve is greater than zero, Commit must be less or equal to Reserve.
If set, heap will be locked. See RtlLockHeap / RtlUnlockHeap.
Pointer to RTL_HEAP_DEFINITION structure. On NT 4.0 all bytes of this (except length field) are set to zero.
NtAllocateVirtualMemoryNtLockVirtualMemoryRTL_HEAP_DEFINITIONRtlDestroyHeapRtlLockHeapRtlUnlockHeap