134#define DPH_RESERVE_SIZE 0x100000
135#define DPH_POOL_SIZE 0x4000
136#define DPH_FREE_LIST_MINIMUM 8
139#define DPH_BREAK_ON_RESERVE_FAIL 0x01
140#define DPH_BREAK_ON_COMMIT_FAIL 0x02
141#define DPH_BREAK_ON_RELEASE_FAIL 0x04
142#define DPH_BREAK_ON_FREE_FAIL 0x08
143#define DPH_BREAK_ON_PROTECT_FAIL 0x10
144#define DPH_BREAK_ON_NULL_FREE 0x80
147#define DPH_DEBUG_INTERNAL_VALIDATE 0x01
148#define DPH_DEBUG_VERBOSE 0x04
151#define DPH_EXTRA_LOG_STACK_TRACES 0x02
152#define DPH_EXTRA_CHECK_UNDERRUN 0x10
155#define DPH_FILL 0xEEEEEEEE
156#define DPH_FILL_START_STAMP_1 0xABCDBBBB
157#define DPH_FILL_START_STAMP_2 0xABCDBBBA
158#define DPH_FILL_END_STAMP_1 0xDCBABBBB
159#define DPH_FILL_END_STAMP_2 0xDCBABBBA
160#define DPH_FILL_SUFFIX 0xD0
161#define DPH_FILL_INFIX 0xC0
164#define DPH_VALINFO_BAD_START_STAMP 0x01
165#define DPH_VALINFO_BAD_END_STAMP 0x02
166#define DPH_VALINFO_BAD_POINTER 0x04
167#define DPH_VALINFO_BAD_PREFIX_PATTERN 0x08
168#define DPH_VALINFO_BAD_SUFFIX_PATTERN 0x10
169#define DPH_VALINFO_EXCEPTION 0x20
170#define DPH_VALINFO_1 0x40
171#define DPH_VALINFO_BAD_INFIX_PATTERN 0x80
172#define DPH_VALINFO_ALREADY_FREED 0x100
173#define DPH_VALINFO_CORRUPTED_AFTER_FREE 0x200
176#define DPH_SIGNATURE 0xFFEEDDCC
179#define IS_BIASED_POINTER(ptr) ((ULONG_PTR)(ptr) & 1)
180#define POINTER_REMOVE_BIAS(ptr) ((ULONG_PTR)(ptr) & ~(ULONG_PTR)1)
181#define POINTER_ADD_BIAS(ptr) ((ULONG_PTR)(ptr) | 1)
234 DPRINT1(
"heap handle with incorrect signature\n");
270 DPRINT1(
"multithreaded access in HEAP_NO_SERIALIZE heap\n");
274 DphRoot->
HeapFlags &= ~HEAP_NO_SERIALIZE;
307 if (!DphRoot)
return;
450 BlockInfo->
Heap = DphRoot;
470 PVOID AddressUserData;
472 DPRINT(
"RtlpDphPlaceOnBusyList(%p %p)\n", DphRoot, DphNode);
493 DPRINT(
"RtlpDphPlaceOnFreeList(%p %p)\n", DphRoot,
Node);
513 DPRINT(
"RtlpDphPlaceOnPoolList(%p %p)\n", DphRoot,
Node);
533 DPRINT(
"RtlpDphPlaceOnVirtualList(%p %p)\n", DphRoot,
Node);
552 DPRINT(
"RtlpDphTakeNodeFromUnusedList(%p), ret %p\n", DphRoot,
Node);
558 Next =
Node->pNextAlloc;
572 DPRINT(
"RtlpDphReturnNodeToUnusedList(%p, %p)\n", DphRoot,
Node);
592 DPRINT(
"RtlpDphRemoveFromAvailableList(%p %p)\n", DphRoot,
Node);
608 if (NodeEntry ==
Node)
614 CurEntry = CurEntry->
Flink;
619 DPRINT1(
"Trying to remove non-existing in availlist node!\n");
643 DPRINT(
"RtlpDphRemoveFromBusyList(%p %p)\n", DphRoot,
Node);
662 DPRINT(
"RtlpDphRemoveFromFreeList(%p %p %p)\n", DphRoot,
Node, Prev);
665 Next =
Node->pNextAlloc;
687 DPRINT(
"RtlpDphCoalesceNodeIntoAvailable(%p %p)\n", DphRoot,
Node);
697 CurEntry = AvailListHead->
Flink;
699 while (CurEntry != AvailListHead)
704 PrevNode = NodeEntry;
707 CurEntry = CurEntry->
Flink;
729 sizeof(MemoryBasicInfo),
757 if (
Node->AvailableEntry.Flink != AvailListHead)
761 if (
Node->pVirtualBlock +
Node->nVirtualBlockSize == NextNode->pVirtualBlock)
769 NextNode->pVirtualBlock,
772 sizeof(MemoryBasicInfo),
781 Node->nVirtualBlockSize += NextNode->nVirtualBlockSize;
795 ULONG LeaveOnFreeList)
801 ASSERT(FreeAllocations >= LeaveOnFreeList);
803 DPRINT(
"RtlpDphCoalesceFreeIntoAvailable(%p %lu)\n", DphRoot, LeaveOnFreeList);
808 if (FreeAllocations < LeaveOnFreeList)
break;
811 Next =
Node->pNextAlloc;
832 DphStartNode = Virtual;
835 for (DphNode = Virtual,
i=NodeCount-1;
i > 0;
i--)
886 if (
Node->nVirtualBlockSize >=
Size)
893 CurEntry = CurEntry->
Flink;
1046 SizeVirtual =
Node->nVirtualBlockSize;
1058 SizeVirtual = 0x10000;
1089 if (
Node->nVirtualBlockSize >
Size)
1107 Node->nVirtualBlockSize = SizeVirtual;
1112 Node->nVirtualBlockSize = SizeVirtual -
Size;
1169 Node->nVirtualBlockSize = VirtualSize;
1192 if (FirstBlock < SecondBlock)
1194 else if (FirstBlock > SecondBlock)
1238 DPRINT1(
"Failure initializing delayed free queue critical section\n");
1259 ULONG ValidationInfo;
1272 Next = Current->
Flink;
1277 if (BlockInfo->
Heap == DphRoot)
1335 DPRINT1(
"Corrupted heap block %p\n", Block);
1344 DPRINT1(
"ERROR: Could not read DPH_BLOCK_INFORMATION\n");
1360 Block,
"Heap block",
Size,
"Block size", 0,
"");
1375 SafeInfo.
Heap,
"Actual heap handle");
1382 "Heap handle used", Block,
"Heap block",
Size,
"Block size", 0,
"");
1389 "Heap handle used", Block,
"Heap block",
Size,
"Block size", 0,
"");
1397 "Corrupted start stamp");
1405 "Corrupted end stamp");
1419 PULONG ValidationInformation,
1427 *ValidationInformation = 0;
1436 SomethingWrong =
TRUE;
1442 *ValidationInformation = 0x101;
1449 SomethingWrong =
TRUE;
1453 if (BlockInfo->
Heap != DphRoot)
1456 SomethingWrong =
TRUE;
1470 SomethingWrong =
TRUE;
1476 return (SomethingWrong ==
FALSE);
1481 PULONG ValidationInformation,
1487 *ValidationInformation = 0;
1517 DPRINT1(
"Page heap: pid 0x%p: page heap enabled with flags 0x%X.\n",
1661 DPRINT1(
"Page heap: process 0x%p created heap @ %p (%p, flags 0x%X)\n",
1683 if (HeapPtr == RtlGetProcessHeap())
1691 if (!DphRoot)
return NULL;
1740 Next =
Node->pNextAlloc;
1751 DPRINT1(
"Page heap: process 0x%p destroyed heap @ %p (%p)\n",
1765 ULONG AllocateSize, AccessSize;
1771 if (
Size > 0x7FF00000)
1773 DPRINT1(
"extreme size request\n");
1790 if (!DphRoot)
return NULL;
1824 DPRINT1(
"Page heap: Unable to allocate virtual memory\n");
1864 BusyNode = AvailableNode;
1869 UserActualSize =
Size;
1929 ULONG ValidationInfo;
1937 DPRINT1(
"Page heap: freeing a null pointer\n");
1945 if (!DphRoot)
return FALSE;
1976 if (
Node->nVirtualAccessSize != 0)
1989 if (
Node->nVirtualAccessSize != 0)
2023 ULONG ValidationInfo;
2028 if (
Size > 0x7FF00000)
2030 DPRINT1(
"extreme size request\n");
2047 if (!DphRoot)
return NULL;
2081 OldBlockPageHeap =
FALSE;
2100 UseNormalHeap =
TRUE;
2129 if (AllocatedNode->nUserRequestedSize >
Size)
2132 DataSize = AllocatedNode->nUserRequestedSize;
2144 Node->UserValue = AllocatedNode->UserValue;
2148 Node->UserFlags = AllocatedNode->UserFlags;
2151 if (!OldBlockPageHeap)
2158 if (AllocatedNode->nVirtualAccessSize != 0)
2167 AllocatedNode->StackTrace =
NULL;
2178 DPRINT(
"Allocated new user block pointer: %p\n", NewAlloc);
2196 if (!DphRoot)
return FALSE;
2216 if (UserValue) *UserValue =
Node->UserValue;
2217 if (UserFlags) *UserFlags =
Node->UserFlags;
2237 if (!DphRoot)
return FALSE;
2257 Node->UserValue = UserValue;
2271 ULONG UserFlagsReset,
2279 if (!DphRoot)
return FALSE;
2299 Node->UserFlags &= ~(UserFlagsReset);
2300 Node->UserFlags |= UserFlagsSet;
2320 if (!DphRoot)
return -1;
2361 if (!DphRoot)
return -1;
2421 if (!DphRoot)
return FALSE;
2435 if (!DphRoot)
return FALSE;
VOID NTAPI RtlInitializeGenericTableAvl(IN OUT PRTL_AVL_TABLE Table, IN PRTL_AVL_COMPARE_ROUTINE CompareRoutine, IN PRTL_AVL_ALLOCATE_ROUTINE AllocateRoutine, IN PRTL_AVL_FREE_ROUTINE FreeRoutine, IN PVOID TableContext)
BOOLEAN NTAPI RtlFreeHeap(IN PVOID HeapHandle, IN ULONG Flags, IN PVOID HeapBase)
#define NT_SUCCESS(StatCode)
NTSTATUS NTAPI RtlInitializeHeapLock(IN OUT PHEAP_LOCK *Lock)
NTSTATUS NTAPI RtlEnterHeapLock(IN OUT PHEAP_LOCK Lock, IN BOOLEAN Exclusive)
BOOLEAN NTAPI RtlTryEnterHeapLock(IN OUT PHEAP_LOCK Lock, IN BOOLEAN Exclusive)
NTSTATUS NTAPI RtlDeleteHeapLock(IN OUT PHEAP_LOCK Lock)
NTSTATUS NTAPI RtlLeaveHeapLock(IN OUT PHEAP_LOCK Lock)
#define RemoveEntryList(Entry)
#define InsertTailList(ListHead, Entry)
#define InsertHeadList(ListHead, Entry)
#define InitializeListHead(ListHead)
#define ROUND_UP(n, align)
_Must_inspect_result_ _In_ USHORT NewSize
_Must_inspect_result_ _In_ PLARGE_INTEGER _In_ PLARGE_INTEGER _In_ ULONG _In_ PFILE_OBJECT _In_ PVOID Process
_Must_inspect_result_ _In_ PFSRTL_PER_STREAM_CONTEXT Ptr
GLsizei GLenum const GLvoid GLsizei GLenum GLbyte GLbyte GLbyte GLdouble GLdouble GLdouble GLfloat GLfloat GLfloat GLint GLint GLint GLshort GLshort GLshort GLubyte GLubyte GLubyte GLuint GLuint GLuint GLushort GLushort GLushort GLbyte GLbyte GLbyte GLbyte GLdouble GLdouble GLdouble GLdouble GLfloat GLfloat GLfloat GLfloat GLint GLint GLint GLint GLshort GLshort GLshort GLshort GLubyte GLubyte GLubyte GLubyte GLuint GLuint GLuint GLuint GLushort GLushort GLushort GLushort GLboolean const GLdouble const GLfloat const GLint const GLshort const GLbyte const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLdouble const GLfloat const GLfloat const GLint const GLint const GLshort const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort GLenum GLenum GLenum GLfloat GLenum GLint GLenum GLenum GLenum GLfloat GLenum GLenum GLint GLenum GLfloat GLenum GLint GLint GLushort GLenum GLenum GLfloat GLenum GLenum GLint GLfloat const GLubyte GLenum GLenum GLenum const GLfloat GLenum GLenum const GLint GLenum GLint GLint GLsizei GLsizei GLint GLenum GLenum const GLvoid GLenum GLenum const GLfloat GLenum GLenum const GLint GLenum GLenum const GLdouble GLenum GLenum const GLfloat GLenum GLenum const GLint GLsizei GLuint GLfloat GLuint GLbitfield GLfloat GLint GLuint GLboolean GLenum GLfloat GLenum GLbitfield GLenum GLfloat GLfloat GLint GLint const GLfloat GLenum GLfloat GLfloat GLint GLint GLfloat GLfloat GLint GLint const GLfloat GLint GLfloat GLfloat GLint GLfloat GLfloat GLint GLfloat GLfloat const GLdouble const GLfloat const GLdouble const GLfloat GLint i
#define DPH_FILL_START_STAMP_2
WCHAR RtlpDphTargetDlls[512]
VOID NTAPI RtlpDphPlaceOnPoolList(PDPH_HEAP_ROOT DphRoot, PDPH_HEAP_BLOCK Node)
struct _DPH_HEAP_BLOCK * PDPH_HEAP_BLOCK
BOOLEAN NTAPI RtlpDphWritePageHeapBlockInformation(PDPH_HEAP_ROOT DphRoot, PVOID UserAllocation, SIZE_T Size, SIZE_T UserSize)
BOOLEAN NTAPI RtlpDphIsNormalFreeHeapBlock(PVOID Block, PULONG ValidationInformation, BOOLEAN CheckFillers)
NTSTATUS NTAPI RtlpSecMemFreeVirtualMemory(HANDLE Process, PVOID *Base, PSIZE_T Size, ULONG Type)
VOID NTAPI RtlpDphLeaveCriticalSection(PDPH_HEAP_ROOT DphRoot)
NTSTATUS NTAPI RtlpDphFreeVm(PVOID Base, SIZE_T Size, ULONG Type)
#define DPH_FREE_LIST_MINIMUM
struct _DPH_BLOCK_INFORMATION DPH_BLOCK_INFORMATION
BOOLEAN NTAPI RtlpDphShouldAllocateInPageHeap(PDPH_HEAP_ROOT DphRoot, SIZE_T Size)
PHEAP_LOCK RtlpDphPageHeapListLock
PVOID NTAPI RtlpPageHeapDestroy(HANDLE HeapPtr)
#define DPH_FILL_START_STAMP_1
HEAP_LOCK _RtlpDphPageHeapListLock
ULONG RtlpDphNumberOfDelayedFreeBlocks
LIST_ENTRY RtlpDphPageHeapList
#define POINTER_ADD_BIAS(ptr)
VOID NTAPI RtlpDphVerifyIntegrity(PDPH_HEAP_ROOT DphRoot)
struct _DPH_BLOCK_INFORMATION * PDPH_BLOCK_INFORMATION
SLIST_HEADER RtlpDphDelayedTemporaryPushList
SIZE_T RtlpDphMemoryUsedByDelayedFreeBlocks
BOOLEAN NTAPI RtlpPageHeapLock(HANDLE HeapPtr)
PVOID NTAPI RtlpPageHeapReAllocate(HANDLE HeapPtr, ULONG Flags, PVOID Ptr, SIZE_T Size)
VOID NTAPI RtlpDphPlaceOnFreeList(PDPH_HEAP_ROOT DphRoot, PDPH_HEAP_BLOCK Node)
VOID NTAPI RtlpDphFreeNodeForTable(IN PRTL_AVL_TABLE Table, IN PVOID Buffer)
VOID NTAPI RtlpDphPreProcessing(PDPH_HEAP_ROOT DphRoot, ULONG Flags)
LIST_ENTRY RtlpDphDelayedFreeQueue
#define IS_BIASED_POINTER(ptr)
VOID NTAPI RtlpDphRemoveFromAvailableList(PDPH_HEAP_ROOT DphRoot, PDPH_HEAP_BLOCK Node)
#define DPH_BREAK_ON_RELEASE_FAIL
VOID NTAPI RtlpDphEnterCriticalSection(PDPH_HEAP_ROOT DphRoot, ULONG Flags)
VOID NTAPI RtlpDphRemoveFromBusyList(PDPH_HEAP_ROOT DphRoot, PDPH_HEAP_BLOCK Node)
VOID NTAPI RtlpDphPlaceOnBusyList(PDPH_HEAP_ROOT DphRoot, PDPH_HEAP_BLOCK DphNode)
PDPH_HEAP_BLOCK NTAPI RtlpDphSearchAvailableMemoryListForBestFit(PDPH_HEAP_ROOT DphRoot, SIZE_T Size)
HEAP_LOCK _RtlpDphDelayedFreeQueueLock
NTSTATUS NTAPI RtlpDphProtectVm(PVOID Base, SIZE_T Size, ULONG Protection)
BOOLEAN NTAPI RtlpDphGrowVirtual(PDPH_HEAP_ROOT DphRoot, SIZE_T Size)
#define DPH_VALINFO_BAD_END_STAMP
#define DPH_EXTRA_CHECK_UNDERRUN
#define POINTER_REMOVE_BIAS(ptr)
#define DPH_BREAK_ON_PROTECT_FAIL
BOOLEAN RtlpDphPageHeapListInitialized
ULONG RtlpPageHeapDllRangeEnd
VOID NTAPI RtlpDphReturnNodeToUnusedList(PDPH_HEAP_ROOT DphRoot, PDPH_HEAP_BLOCK Node)
#define DPH_BREAK_ON_COMMIT_FAIL
ULONG NTAPI RtlpDphGetBlockSizeFromCorruptedBlock(PVOID Block)
VOID NTAPI RtlpDphRemoveFromFreeList(PDPH_HEAP_ROOT DphRoot, PDPH_HEAP_BLOCK Node, PDPH_HEAP_BLOCK Prev)
#define DPH_VALINFO_EXCEPTION
ULONG RtlpDphBreakOptions
BOOLEAN NTAPI RtlpPageHeapSetUserValue(PVOID HeapHandle, ULONG Flags, PVOID BaseAddress, PVOID UserValue)
PDPH_HEAP_BLOCK NTAPI RtlpDphAllocateNode(PDPH_HEAP_ROOT DphRoot)
#define DPH_VALINFO_ALREADY_FREED
#define DPH_VALINFO_BAD_POINTER
VOID NTAPI RtlpDphInternalValidatePageHeap(PDPH_HEAP_ROOT DphRoot, PVOID Address, ULONG Value)
BOOLEAN NTAPI RtlpPageHeapGetUserInfo(PVOID HeapHandle, ULONG Flags, PVOID BaseAddress, PVOID *UserValue, PULONG UserFlags)
VOID NTAPI RtlpDphAddNewPool(PDPH_HEAP_ROOT DphRoot, PDPH_HEAP_BLOCK NodeBlock, PVOID Virtual, SIZE_T Size, BOOLEAN PlaceOnPool)
VOID NTAPI RtlpDphCoalesceNodeIntoAvailable(PDPH_HEAP_ROOT DphRoot, PDPH_HEAP_BLOCK Node)
NTSTATUS NTAPI RtlpDphSetProtectionBeforeUse(PDPH_HEAP_ROOT DphRoot, PUCHAR VirtualBlock, ULONG UserSize)
PVOID NTAPI RtlpDphPointerFromHandle(PVOID Handle)
NTSTATUS NTAPI RtlpDphSetProtectionAfterUse(PDPH_HEAP_ROOT DphRoot, PDPH_HEAP_BLOCK Node)
ULONG RtlpDphPageHeapListLength
#define DPH_BREAK_ON_NULL_FREE
BOOLEAN NTAPI RtlpDphIsPageHeapBlock(PDPH_HEAP_ROOT DphRoot, PVOID Block, PULONG ValidationInformation, BOOLEAN CheckFillers)
BOOLEAN RtlpPageHeapEnabled
PVOID NTAPI RtlpDphAllocateNodeForTable(IN PRTL_AVL_TABLE Table, IN CLONG ByteSize)
#define DPH_VALINFO_BAD_START_STAMP
BOOLEAN NTAPI RtlpPageHeapFree(HANDLE HeapPtr, ULONG Flags, PVOID Ptr)
struct _DPH_HEAP_ROOT DPH_HEAP_ROOT
#define DPH_DEBUG_INTERNAL_VALIDATE
ULONG RtlpPageHeapSizeRangeStart
UNICODE_STRING RtlpDphTargetDllsUnicode
VOID NTAPI RtlpDphPostProcessing(PDPH_HEAP_ROOT DphRoot)
NTSTATUS NTAPI RtlpDphProcessStartupInitialization(VOID)
VOID NTAPI RtlpDphCoalesceFreeIntoAvailable(PDPH_HEAP_ROOT DphRoot, ULONG LeaveOnFreeList)
#define DPH_DEBUG_VERBOSE
SIZE_T NTAPI RtlpPageHeapSize(HANDLE HeapHandle, ULONG Flags, PVOID BaseAddress)
#define DPH_VALINFO_CORRUPTED_AFTER_FREE
PDPH_HEAP_BLOCK NTAPI RtlpDphTakeNodeFromUnusedList(PDPH_HEAP_ROOT DphRoot)
VOID NTAPI RtlpDphRaiseException(NTSTATUS Status)
NTSTATUS NTAPI RtlpDphInitializeDelayedFreeQueue(VOID)
#define DPH_BREAK_ON_FREE_FAIL
BOOLEAN NTAPI RtlpDebugPageHeapValidate(PVOID HeapHandle, ULONG Flags, PVOID BaseAddress)
BOOLEAN NTAPI RtlpDphNormalHeapValidate(PDPH_HEAP_ROOT DphRoot, ULONG Flags, PVOID BaseAddress)
PVOID NTAPI RtlpPageHeapAllocate(IN PVOID HeapPtr, IN ULONG Flags, IN SIZE_T Size)
struct _DPH_HEAP_ROOT * PDPH_HEAP_ROOT
BOOLEAN NTAPI RtlpPageHeapUnlock(HANDLE HeapPtr)
ULONG RtlpPageHeapDllRangeStart
#define DPH_BREAK_ON_RESERVE_FAIL
#define DPH_VALINFO_BAD_PREFIX_PATTERN
PVOID NTAPI RtlpDphHeapFromPointer(PDPH_HEAP_ROOT DphHeap)
PDPH_HEAP_BLOCK NTAPI RtlpDphFindAvailableMemory(PDPH_HEAP_ROOT DphRoot, SIZE_T Size, BOOLEAN Grow)
#define DPH_VALINFO_BAD_INFIX_PATTERN
NTSTATUS NTAPI RtlpDphTargetDllsLogicInitialize(VOID)
PHEAP_LOCK RtlpDphDelayedFreeQueueLock
BOOLEAN NTAPI RtlpPageHeapSetUserFlags(PVOID HeapHandle, ULONG Flags, PVOID BaseAddress, ULONG UserFlagsReset, ULONG UserFlagsSet)
RTL_GENERIC_COMPARE_RESULTS NTAPI RtlpDphCompareNodeForTable(IN PRTL_AVL_TABLE Table, IN PVOID FirstStruct, IN PVOID SecondStruct)
#define DPH_FILL_END_STAMP_2
VOID NTAPI RtlpDphFreeDelayedBlocksFromHeap(PDPH_HEAP_ROOT DphRoot, PHEAP NormalHeap)
VOID NTAPI RtlpDphReportCorruptedBlock(_In_ PDPH_HEAP_ROOT DphRoot, _In_ ULONG Reserved, _In_ PVOID Block, _In_ ULONG ValidationInfo)
#define DPH_VALINFO_BAD_SUFFIX_PATTERN
HANDLE NTAPI RtlpPageHeapCreate(ULONG Flags, PVOID Addr, SIZE_T TotalSize, SIZE_T CommitSize, PVOID Lock, PRTL_HEAP_PARAMETERS Parameters)
ULONG RtlpPageHeapSizeRangeEnd
#define DPH_FILL_END_STAMP_1
ULONG RtlpDphDebugOptions
PDPH_HEAP_BLOCK NTAPI RtlpDphFindBusyMemory(PDPH_HEAP_ROOT DphRoot, PVOID pUserMem)
NTSTATUS NTAPI RtlpDphAllocateVm(PVOID *Base, SIZE_T Size, ULONG Type, ULONG Protection)
struct _DPH_HEAP_BLOCK DPH_HEAP_BLOCK
VOID NTAPI RtlpDphPlaceOnVirtualList(PDPH_HEAP_ROOT DphRoot, PDPH_HEAP_BLOCK Node)
#define RtlFillMemory(Dest, Length, Fill)
NTSYSAPI void WINAPI DbgBreakPoint(void)
NTSYSAPI BOOLEAN WINAPI RtlValidateHeap(HANDLE, ULONG, LPCVOID)
#define EXCEPTION_EXECUTE_HANDLER
long __cdecl _InterlockedIncrement(_Interlocked_operand_ long volatile *_Addend)
#define RtlFillMemoryUlong(dst, len, val)
_In_ NDIS_STATUS _In_ ULONG _In_ USHORT _In_opt_ PVOID _In_ ULONG DataSize
NTSYSAPI NTSTATUS NTAPI ZwQueryPerformanceCounter(_Out_ PLARGE_INTEGER Counter, _Out_opt_ PLARGE_INTEGER Frequency)
NTSYSAPI NTSTATUS NTAPI ZwQueryVirtualMemory(_In_ HANDLE ProcessHandle, _In_ PVOID Address, _In_ MEMORY_INFORMATION_CLASS VirtualMemoryInformationClass, _Out_ PVOID VirtualMemoryInformation, _In_ SIZE_T Length, _Out_opt_ PSIZE_T ResultLength)
_In_ HANDLE _Outptr_result_bytebuffer_ ViewSize PVOID * BaseAddress
_In_ HANDLE _Outptr_result_bytebuffer_ ViewSize PVOID _In_ ULONG_PTR _In_ SIZE_T CommitSize
NTSYSAPI NTSTATUS NTAPI ZwProtectVirtualMemory(_In_ HANDLE ProcessHandle, _In_ PVOID *BaseAddress, _In_ SIZE_T *NumberOfBytesToProtect, _In_ ULONG NewAccessProtection, _Out_ PULONG OldAccessProtection)
NTSYSAPI VOID NTAPI RtlRaiseException(_In_ PEXCEPTION_RECORD ExceptionRecord)
struct _HEAP_LOCK * PHEAP_LOCK
#define HEAP_FLAG_PAGE_ALLOCS
#define HEAP_NO_ALIGNMENT
NTSYSAPI PVOID NTAPI RtlDestroyHeap(IN PVOID HeapHandle)
NTSYSAPI VOID NTAPI RtlInitUnicodeString(PUNICODE_STRING DestinationString, PCWSTR SourceString)
#define HEAP_GENERATE_EXCEPTIONS
NTSYSAPI PVOID NTAPI RtlCreateHeap(IN ULONG Flags, IN PVOID HeapBase OPTIONAL, IN ULONG ReserveSize OPTIONAL, IN ULONG CommitSize OPTIONAL, IN PVOID Lock OPTIONAL, IN PRTL_HEAP_PARAMETERS Parameters OPTIONAL)
#define NtCurrentProcess()
#define HEAP_SETTABLE_USER_FLAGS
#define HEAP_REALLOC_IN_PLACE_ONLY
#define HEAP_NO_SERIALIZE
#define STATUS_INVALID_PAGE_PROTECTION
#define _SEH2_EXCEPT(...)
BOOLEAN NTAPI RtlFlushSecureMemoryCache(IN PVOID MemoryCache, IN OPTIONAL SIZE_T MemoryLength)
RTL_BALANCED_LINKS TableLinks
LIST_ENTRY AdjacencyEntry
SIZE_T nVirtualAccessSize
SIZE_T nUserRequestedSize
PRTL_TRACE_BLOCK StackTrace
struct _DPH_HEAP_BLOCK * pNextAlloc
LIST_ENTRY AvailableEntry
PDPH_HEAP_BLOCK pNodePoolListTail
PDPH_HEAP_BLOCK pVirtualStorageListTail
PDPH_HEAP_BLOCK NodeToAllocate
PDPH_HEAP_BLOCK pNodePoolListHead
PDPH_HEAP_BLOCK pVirtualStorageListHead
LIST_ENTRY AvailableAllocationHead
ULONG nVirtualStorageRanges
SIZE_T nAvailableAllocationBytesCommitted
ULONG nRemoteLockAcquired
PRTL_TRACE_BLOCK CreateStackTrace
PDPH_HEAP_BLOCK pUnusedNodeListHead
SIZE_T nBusyAllocationBytesCommitted
SIZE_T nBusyAllocationBytesAccessible
SIZE_T nFreeAllocationBytesCommitted
PDPH_HEAP_BLOCK pFreeAllocationListTail
PDPH_HEAP_BLOCK pUnusedNodeListTail
RTL_AVL_TABLE BusyNodesTable
PDPH_HEAP_BLOCK pFreeAllocationListHead
SIZE_T nVirtualStorageBytes
ULONG nAvailableAllocations
struct _EXCEPTION_RECORD * ExceptionRecord
struct _LIST_ENTRY * Flink
struct _LIST_ENTRY * PLIST_ENTRY
#define RtlCopyMemory(Destination, Source, Length)
#define RtlZeroMemory(Destination, Length)
#define CONTAINING_RECORD(address, type, field)
#define APPLICATION_VERIFIER_CORRUPTED_END_STAMP
VOID NTAPI RtlApplicationVerifierStop(_In_ ULONG_PTR Code, _In_ PCSTR Message, _In_ PVOID Value1, _In_ PCSTR Description1, _In_ PVOID Value2, _In_ PCSTR Description2, _In_ PVOID Value3, _In_ PCSTR Description3, _In_ PVOID Value4, _In_ PCSTR Description4)
#define APPLICATION_VERIFIER_CORRUPTED_SUFFIX_PATTERN
#define APPLICATION_VERIFIER_CORRUPT_HEAP_POINTER
#define APPLICATION_VERIFIER_CORRUPTED_INFIX_PATTERN
#define APPLICATION_VERIFIER_DOUBLE_FREE
#define APPLICATION_VERIFIER_CORRUPTED_HEAP_BLOCK_AFTER_FREE
#define APPLICATION_VERIFIER_CORRUPTED_START_STAMP
#define APPLICATION_VERIFIER_CORRUPTED_PREFIX_PATTERN
#define APPLICATION_VERIFIER_EXCEPTION_WHILE_VERIFYING_BLOCK_HEADER
_Must_inspect_result_ _In_ WDFCHILDLIST _In_ PWDF_CHILD_LIST_ITERATOR _Out_ WDFDEVICE _Inout_opt_ PWDF_CHILD_RETRIEVE_INFO Info
_Must_inspect_result_ _In_ WDFDEVICE _In_ PWDF_DEVICE_PROPERTY_DATA _In_ DEVPROPTYPE _In_ ULONG Size
_Must_inspect_result_ _In_ WDFQUEUE _In_opt_ WDFREQUEST _In_opt_ WDFFILEOBJECT _Inout_opt_ PWDF_REQUEST_PARAMETERS Parameters
_Must_inspect_result_ _In_ WDFKEY _In_ PCUNICODE_STRING _Out_opt_ PUSHORT _Inout_opt_ PUNICODE_STRING Value
_Must_inspect_result_ _In_opt_ PWDF_OBJECT_ATTRIBUTES _Out_ WDFWAITLOCK * Lock
_Reserved_ PVOID Reserved
NTSYSAPI VOID NTAPI RtlInitializeSListHead(_Out_ PSLIST_HEADER ListHead)
_Must_inspect_result_ _In_ ULONG Flags
_Out_ PCLIENT_ID ClientId
_Must_inspect_result_ NTSYSAPI PVOID NTAPI RtlLookupElementGenericTableAvl(_In_ PRTL_AVL_TABLE Table, _In_ PVOID Buffer)
NTSYSAPI BOOLEAN NTAPI RtlDeleteElementGenericTableAvl(_In_ PRTL_AVL_TABLE Table, _In_ PVOID Buffer)
NTSYSAPI PVOID NTAPI RtlInsertElementGenericTableAvl(_In_ PRTL_AVL_TABLE Table, _In_reads_bytes_(BufferSize) PVOID Buffer, _In_ CLONG BufferSize, _Out_opt_ PBOOLEAN NewElement)
_Must_inspect_result_ NTSYSAPI PVOID NTAPI RtlEnumerateGenericTableAvl(_In_ PRTL_AVL_TABLE Table, _In_ BOOLEAN Restart)
_IRQL_requires_same_ _In_ PVOID _In_ PVOID SecondStruct
_IRQL_requires_same_ _In_ CLONG ByteSize
_IRQL_requires_same_ _In_ PVOID FirstStruct
enum _RTL_GENERIC_COMPARE_RESULTS RTL_GENERIC_COMPARE_RESULTS
#define ZwCurrentProcess()