ReactOS  0.4.15-dev-326-g1c504f4
heapdbg.c
Go to the documentation of this file.
1 /*
2  * PROJECT: ReactOS Runtime Library
3  * LICENSE: GPL - See COPYING in the top level directory
4  * FILE: lib/rtl/heapdbg.c
5  * PURPOSE: Heap manager debug heap
6  * PROGRAMMERS: Copyright 2010 Aleksey Bragin
7  */
8 
9 /* INCLUDES ******************************************************************/
10 
11 #include <rtl.h>
12 #include <heap.h>
13 
14 #define NDEBUG
15 #include <debug.h>
16 
17 /* FUNCTIONS ******************************************************************/
18 
21  PVOID Addr,
24  PVOID Lock,
26 {
27  MEMORY_BASIC_INFORMATION MemoryInfo;
29  PHEAP Heap;
30 
31  /* Validate parameters */
33  {
34  DPRINT1("HEAP: Incorrect ReserveSize %x\n", ReserveSize);
35  return NULL;
36  }
37 
38  if (ReserveSize < CommitSize)
39  {
40  DPRINT1("HEAP: Incorrect CommitSize %x\n", CommitSize);
41  return NULL;
42  }
43 
44  if (Flags & HEAP_NO_SERIALIZE && Lock)
45  {
46  DPRINT1("HEAP: Can't specify Lock routine and have HEAP_NO_SERIALIZE flag set\n");
47  return NULL;
48  }
49 
50  /* If the address is specified, check it's virtual memory */
51  if (Addr)
52  {
54  Addr,
56  &MemoryInfo,
57  sizeof(MemoryInfo),
58  NULL);
59 
60  if (!NT_SUCCESS(Status))
61  {
62  DPRINT1("HEAP: Specified heap base address %p is invalid, Status 0x%08X\n", Addr, Status);
63  return NULL;
64  }
65 
66  if (MemoryInfo.BaseAddress != Addr)
67  {
68  DPRINT1("HEAP: Specified heap base address %p is not really a base one %p\n", Addr, MemoryInfo.BaseAddress);
69  return NULL;
70  }
71 
72  if (MemoryInfo.State == MEM_FREE)
73  {
74  DPRINT1("HEAP: Specified heap base address %p is free\n", Addr);
75  return NULL;
76  }
77  }
78 
79  /* All validation performed, now call the real routine with skip validation check flag */
83 
85  if (!Heap) return NULL;
86 
87  // FIXME: Capture stack backtrace
88 
90 
91  return Heap;
92 }
93 
96 {
97  SIZE_T Size = 0;
98  PHEAP Heap = (PHEAP)HeapPtr;
99 
100  if (Heap == RtlGetCurrentPeb()->ProcessHeap)
101  {
102  DPRINT1("HEAP: It's forbidden delete process heap!");
103  return FALSE;
104  }
105 
106  if (Heap->Signature != HEAP_SIGNATURE)
107  {
108  DPRINT1("HEAP: Invalid heap %p signature 0x%x\n", Heap, Heap->Signature);
109  return FALSE;
110  }
111 
112  if (!RtlpValidateHeap(Heap, FALSE)) return FALSE;
113 
114  /* Make heap invalid by zeroing its signature */
115  Heap->Signature = 0;
116 
117  /* Free validate headers copy if it was existing */
118  if (Heap->HeaderValidateCopy)
119  {
120  ZwFreeVirtualMemory(NtCurrentProcess(),
121  &Heap->HeaderValidateCopy,
122  &Size,
123  MEM_RELEASE);
124  }
125 
126  return TRUE;
127 }
128 
129 PVOID NTAPI
131  ULONG Flags,
132  SIZE_T Size)
133 {
134  PHEAP Heap = (PHEAP)HeapPtr;
135  SIZE_T AllocSize = 1;
136  BOOLEAN HeapLocked = FALSE;
137  PVOID Result;
138 
139  if (Heap->ForceFlags & HEAP_FLAG_PAGE_ALLOCS)
140  return RtlpPageHeapAllocate(HeapPtr, Flags, Size);
141 
142  if (Heap->Signature != HEAP_SIGNATURE)
143  {
144  DPRINT1("HEAP: Invalid heap %p signature 0x%x\n", Heap, Heap->Signature);
145  return NULL;
146  }
147 
148  /* Add settable user value flag */
150 
151  /* Calculate size */
152  if (Size) AllocSize = Size;
153  AllocSize = ((AllocSize + Heap->AlignRound) & Heap->AlignMask) + sizeof(HEAP_ENTRY_EXTRA);
154 
155  /* Check if size didn't exceed max one */
156  if (AllocSize < Size ||
157  AllocSize > Heap->MaximumAllocationSize)
158  {
159  DPRINT1("HEAP: Too big allocation size %x (max allowed %x)\n", Size, Heap->MaximumAllocationSize);
160  return NULL;
161  }
162 
163  /* Lock the heap ourselves */
164  if (!(Flags & HEAP_NO_SERIALIZE))
165  {
167  HeapLocked = TRUE;
168 
169  /* Add no serialize flag so that the main routine won't try to acquire the lock again */
171  }
172 
173  /* Validate the heap if necessary */
174  RtlpValidateHeap(Heap, FALSE);
175 
176  /* Call main routine to do the stuff */
177  Result = RtlAllocateHeap(HeapPtr, Flags, Size);
178 
179  /* Validate heap headers */
181 
182  if (Result)
183  {
184  if (Heap->Flags & HEAP_VALIDATE_ALL_ENABLED)
185  RtlpValidateHeap(Heap, FALSE);
186  }
187 
188  /* Release the lock */
189  if (HeapLocked) RtlLeaveHeapLock(Heap->LockVariable);
190 
191  return Result;
192 }
193 
194 PVOID NTAPI
196  ULONG Flags,
197  PVOID Ptr,
198  SIZE_T Size)
199 {
200  PHEAP Heap = (PHEAP)HeapPtr;
201  SIZE_T AllocSize = 1;
202  BOOLEAN HeapLocked = FALSE;
203  PVOID Result = NULL;
204  PHEAP_ENTRY HeapEntry;
205 
206  if (Heap->ForceFlags & HEAP_FLAG_PAGE_ALLOCS)
207  return RtlpPageHeapReAllocate(HeapPtr, Flags, Ptr, Size);
208 
209  if (Heap->Signature != HEAP_SIGNATURE)
210  {
211  DPRINT1("HEAP: Invalid heap %p signature 0x%x\n", Heap, Heap->Signature);
212  return NULL;
213  }
214 
215  /* Add settable user value flag */
217 
218  /* Calculate size */
219  if (Size) AllocSize = Size;
220  AllocSize = ((AllocSize + Heap->AlignRound) & Heap->AlignMask) + sizeof(HEAP_ENTRY_EXTRA);
221 
222  /* Check if size didn't exceed max one */
223  if (AllocSize < Size ||
224  AllocSize > Heap->MaximumAllocationSize)
225  {
226  DPRINT1("HEAP: Too big allocation size %x (max allowed %x)\n", Size, Heap->MaximumAllocationSize);
227  return NULL;
228  }
229 
230  /* Lock the heap ourselves */
231  if (!(Flags & HEAP_NO_SERIALIZE))
232  {
234  HeapLocked = TRUE;
235 
236  /* Add no serialize flag so that the main routine won't try to acquire the lock again */
238  }
239 
240  /* Validate the heap if necessary */
241  RtlpValidateHeap(Heap, FALSE);
242 
243  /* Get the existing heap entry */
244  HeapEntry = (PHEAP_ENTRY)Ptr - 1;
245 
246  /* Validate it */
247  if (RtlpValidateHeapEntry(Heap, HeapEntry))
248  {
249  /* Call main routine to do the stuff */
250  Result = RtlReAllocateHeap(HeapPtr, Flags, Ptr, Size);
251 
252  if (Result)
253  {
254  /* Validate heap headers and then heap itself */
256  RtlpValidateHeap(Heap, FALSE);
257  }
258  }
259 
260  /* Release the lock */
261  if (HeapLocked) RtlLeaveHeapLock(Heap->LockVariable);
262 
263  return Result;
264 }
265 
268  ULONG Flags,
269  PVOID Ptr)
270 {
271  PHEAP Heap = (PHEAP)HeapPtr;
272  BOOLEAN HeapLocked = FALSE;
273  PHEAP_ENTRY HeapEntry;
274  BOOLEAN Result = FALSE;
275 
276  if (Heap->ForceFlags & HEAP_FLAG_PAGE_ALLOCS)
277  return RtlpPageHeapFree(HeapPtr, Flags, Ptr);
278 
279  if (Heap->Signature != HEAP_SIGNATURE)
280  {
281  DPRINT1("HEAP: Invalid heap %p signature 0x%x\n", Heap, Heap->Signature);
282  return FALSE;
283  }
284 
285  /* Add skip validation flag */
287 
288  /* Lock the heap ourselves */
289  if (!(Flags & HEAP_NO_SERIALIZE))
290  {
292  HeapLocked = TRUE;
293 
294  /* Add no serialize flag so that the main routine won't try to acquire the lock again */
296  }
297 
298  /* Validate the heap if necessary */
299  RtlpValidateHeap(Heap, FALSE);
300 
301  /* Get the existing heap entry */
302  HeapEntry = (PHEAP_ENTRY)Ptr - 1;
303 
304  /* Validate it */
305  if (RtlpValidateHeapEntry(Heap, HeapEntry))
306  {
307  /* If it succeeded - call the main routine */
308  Result = RtlFreeHeap(HeapPtr, Flags, Ptr);
309 
310  /* Validate heap headers and then heap itself */
312  RtlpValidateHeap(Heap, FALSE);
313  }
314 
315  /* Release the lock */
316  if (HeapLocked) RtlLeaveHeapLock(Heap->LockVariable);
317 
318  return Result;
319 }
320 
323  ULONG Flags,
325  PVOID *UserValue,
326  PULONG UserFlags)
327 {
328  PHEAP Heap = (PHEAP)HeapHandle;
329  BOOLEAN HeapLocked = FALSE;
330  PHEAP_ENTRY HeapEntry;
331  BOOLEAN Result = FALSE;
332 
333  if (Heap->ForceFlags & HEAP_FLAG_PAGE_ALLOCS)
334  return RtlpPageHeapGetUserInfo(HeapHandle, Flags, BaseAddress, UserValue, UserFlags);
335 
336  if (Heap->Signature != HEAP_SIGNATURE)
337  {
338  DPRINT1("HEAP: Invalid heap %p signature 0x%x\n", Heap, Heap->Signature);
339  return FALSE;
340  }
341 
342  /* Add skip validation flag */
344 
345  /* Lock the heap ourselves */
346  if (!(Flags & HEAP_NO_SERIALIZE))
347  {
349  HeapLocked = TRUE;
350 
351  /* Add no serialize flag so that the main routine won't try to acquire the lock again */
353  }
354 
355  /* Validate the heap if necessary */
356  RtlpValidateHeap(Heap, FALSE);
357 
358  /* Get the existing heap entry */
359  HeapEntry = (PHEAP_ENTRY)BaseAddress - 1;
360 
361  /* Validate it */
362  if (RtlpValidateHeapEntry(Heap, HeapEntry))
363  {
364  /* If it succeeded - call the main routine */
365  Result = RtlGetUserInfoHeap(HeapHandle, Flags, BaseAddress, UserValue, UserFlags);
366  }
367 
368  /* Release the lock */
369  if (HeapLocked) RtlLeaveHeapLock(Heap->LockVariable);
370 
371  return Result;
372 }
373 
376  ULONG Flags,
378  PVOID UserValue)
379 {
380  PHEAP Heap = (PHEAP)HeapHandle;
381  BOOLEAN HeapLocked = FALSE;
382  PHEAP_ENTRY HeapEntry;
383  BOOLEAN Result = FALSE;
384 
385  if (Heap->ForceFlags & HEAP_FLAG_PAGE_ALLOCS)
386  return RtlpPageHeapSetUserValue(HeapHandle, Flags, BaseAddress, UserValue);
387 
388  if (Heap->Signature != HEAP_SIGNATURE)
389  {
390  DPRINT1("HEAP: Invalid heap %p signature 0x%x\n", Heap, Heap->Signature);
391  return FALSE;
392  }
393 
394  /* Add skip validation flag */
396 
397  /* Lock the heap ourselves */
398  if (!(Flags & HEAP_NO_SERIALIZE))
399  {
401  HeapLocked = TRUE;
402 
403  /* Add no serialize flag so that the main routine won't try to acquire the lock again */
405  }
406 
407  /* Validate the heap if necessary */
408  RtlpValidateHeap(Heap, FALSE);
409 
410  /* Get the existing heap entry */
411  HeapEntry = (PHEAP_ENTRY)BaseAddress - 1;
412 
413  /* Validate it */
414  if (RtlpValidateHeapEntry(Heap, HeapEntry))
415  {
416  /* If it succeeded - call the main routine */
417  Result = RtlSetUserValueHeap(HeapHandle, Flags, BaseAddress, UserValue);
418 
419  /* Validate the heap */
420  RtlpValidateHeap(Heap, FALSE);
421  }
422 
423  /* Release the lock */
424  if (HeapLocked) RtlLeaveHeapLock(Heap->LockVariable);
425 
426  return Result;
427 }
428 
429 BOOLEAN
430 NTAPI
432  ULONG Flags,
434  ULONG UserFlagsReset,
435  ULONG UserFlagsSet)
436 {
437  PHEAP Heap = (PHEAP)HeapHandle;
438  BOOLEAN HeapLocked = FALSE;
439  PHEAP_ENTRY HeapEntry;
440  BOOLEAN Result = FALSE;
441 
442  if (Heap->ForceFlags & HEAP_FLAG_PAGE_ALLOCS)
443  return RtlpPageHeapSetUserFlags(HeapHandle, Flags, BaseAddress, UserFlagsReset, UserFlagsSet);
444 
445  /* Check if this heap allows flags to be set at all */
446  if (UserFlagsSet & ~HEAP_SETTABLE_USER_FLAGS ||
447  UserFlagsReset & ~HEAP_SETTABLE_USER_FLAGS)
448  {
449  return FALSE;
450  }
451 
452  if (Heap->Signature != HEAP_SIGNATURE)
453  {
454  DPRINT1("HEAP: Invalid heap %p signature 0x%x\n", Heap, Heap->Signature);
455  return FALSE;
456  }
457 
458  /* Add skip validation flag */
460 
461  /* Lock the heap ourselves */
462  if (!(Flags & HEAP_NO_SERIALIZE))
463  {
465  HeapLocked = TRUE;
466 
467  /* Add no serialize flag so that the main routine won't try to acquire the lock again */
469  }
470 
471  /* Validate the heap if necessary */
472  RtlpValidateHeap(Heap, FALSE);
473 
474  /* Get the existing heap entry */
475  HeapEntry = (PHEAP_ENTRY)BaseAddress - 1;
476 
477  /* Validate it */
478  if (RtlpValidateHeapEntry(Heap, HeapEntry))
479  {
480  /* If it succeeded - call the main routine */
481  Result = RtlSetUserFlagsHeap(HeapHandle, Flags, BaseAddress, UserFlagsReset, UserFlagsSet);
482 
483  /* Validate the heap */
484  RtlpValidateHeap(Heap, FALSE);
485  }
486 
487  /* Release the lock */
488  if (HeapLocked) RtlLeaveHeapLock(Heap->LockVariable);
489 
490  return Result;
491 }
492 
495  ULONG Flags,
496  PVOID Ptr)
497 {
498  PHEAP Heap = (PHEAP)HeapPtr;
499  BOOLEAN HeapLocked = FALSE;
500  PHEAP_ENTRY HeapEntry;
501  SIZE_T Result = ~(SIZE_T)0;
502 
503  if (Heap->ForceFlags & HEAP_FLAG_PAGE_ALLOCS)
504  return RtlpPageHeapSize(HeapPtr, Flags, Ptr);
505 
506  /* Check heap signature */
507  if (Heap->Signature != HEAP_SIGNATURE)
508  {
509  DPRINT1("HEAP: Invalid heap %p signature 0x%x\n", Heap, Heap->Signature);
510  return FALSE;
511  }
512 
513  /* Add skip validation flag */
515 
516  /* Lock the heap ourselves */
517  if (!(Flags & HEAP_NO_SERIALIZE))
518  {
520  HeapLocked = TRUE;
521 
522  /* Add no serialize flag so that the main routine won't try to acquire the lock again */
524  }
525 
526  /* Validate the heap if necessary */
527  RtlpValidateHeap(Heap, FALSE);
528 
529  /* Get the existing heap entry */
530  HeapEntry = (PHEAP_ENTRY)Ptr - 1;
531 
532  /* Validate it */
533  if (RtlpValidateHeapEntry(Heap, HeapEntry))
534  {
535  /* If it succeeded - call the main routine */
536  Result = RtlSizeHeap(HeapPtr, Flags, Ptr);
537  }
538 
539  /* Release the lock */
540  if (HeapLocked) RtlLeaveHeapLock(Heap->LockVariable);
541 
542  return Result;
543 }
544 
545 /* EOF */
BOOLEAN NTAPI RtlDebugSetUserFlagsHeap(PVOID HeapHandle, ULONG Flags, PVOID BaseAddress, ULONG UserFlagsReset, ULONG UserFlagsSet)
Definition: heapdbg.c:431
#define TRUE
Definition: types.h:120
BOOLEAN NTAPI RtlDebugFreeHeap(HANDLE HeapPtr, ULONG Flags, PVOID Ptr)
Definition: heapdbg.c:267
#define HEAP_NO_SERIALIZE
Definition: nt_native.h:1692
NTSTATUS NTAPI RtlEnterHeapLock(IN OUT PHEAP_LOCK Lock, IN BOOLEAN Exclusive)
Definition: libsupp.c:108
BOOLEAN NTAPI RtlpValidateHeapEntry(PHEAP Heap, PHEAP_ENTRY HeapEntry)
Definition: heap.c:3154
_Must_inspect_result_ _In_ PFSRTL_PER_STREAM_CONTEXT Ptr
Definition: fsrtlfuncs.h:898
LONG NTSTATUS
Definition: precomp.h:26
BOOLEAN NTAPI RtlFreeHeap(IN PVOID HeapHandle, IN ULONG Flags, IN PVOID HeapBase)
Definition: heap.c:606
SIZE_T MaximumAllocationSize
Definition: heap.h:237
ULONG Signature
Definition: heap.h:231
#define HEAP_TAIL_CHECKING_ENABLED
Definition: nt_native.h:1697
PVOID HeaderValidateCopy
Definition: heap.h:240
BOOLEAN NTAPI RtlpValidateHeap(PHEAP Heap, BOOLEAN ForceValidation)
Definition: heap.c:3398
#define HEAP_SETTABLE_USER_VALUE
Definition: nt_native.h:1704
BOOLEAN NTAPI RtlpValidateHeapHeaders(PHEAP Heap, BOOLEAN Recalculate)
Definition: heap.c:3145
#define HEAP_SKIP_VALIDATION_CHECKS
Definition: rtltypes.h:165
_Must_inspect_result_ _In_ ULONG Flags
Definition: wsk.h:170
BOOLEAN NTAPI RtlSetUserValueHeap(IN PVOID HeapHandle, IN ULONG Flags, IN PVOID BaseAddress, IN PVOID UserValue)
Definition: heap.c:3665
ULONG_PTR AlignMask
Definition: heap.h:247
NTSTATUS(* NTAPI)(IN PFILE_FULL_EA_INFORMATION EaBuffer, IN ULONG EaLength, OUT PULONG ErrorOffset)
Definition: IoEaTest.cpp:117
BOOLEAN NTAPI RtlDebugGetUserInfoHeap(PVOID HeapHandle, ULONG Flags, PVOID BaseAddress, PVOID *UserValue, PULONG UserFlags)
Definition: heapdbg.c:322
PHEAP_LOCK LockVariable
Definition: heap.h:263
unsigned char BOOLEAN
struct _HEAP_ENTRY * PHEAP_ENTRY
smooth NULL
Definition: ftsmooth.c:416
PVOID NTAPI RtlDebugAllocateHeap(PVOID HeapPtr, ULONG Flags, SIZE_T Size)
Definition: heapdbg.c:130
_At_(*)(_In_ PWSK_CLIENT Client, _In_opt_ PUNICODE_STRING NodeName, _In_opt_ PUNICODE_STRING ServiceName, _In_opt_ ULONG NameSpace, _In_opt_ GUID *Provider, _In_opt_ PADDRINFOEXW Hints, _Outptr_ PADDRINFOEXW *Result, _In_opt_ PEPROCESS OwningProcess, _In_opt_ PETHREAD OwningThread, _Inout_ PIRP Irp Result)(Mem)) NTSTATUS(WSKAPI *PFN_WSK_GET_ADDRESS_INFO
Definition: wsk.h:426
HANDLE NTAPI RtlDebugCreateHeap(ULONG Flags, PVOID Addr, SIZE_T ReserveSize, SIZE_T CommitSize, PVOID Lock, PRTL_HEAP_PARAMETERS Parameters)
Definition: heapdbg.c:20
BOOLEAN NTAPI RtlGetUserInfoHeap(IN PVOID HeapHandle, IN ULONG Flags, IN PVOID BaseAddress, OUT PVOID *UserValue, OUT PULONG UserFlags)
Definition: heap.c:3782
BOOLEAN NTAPI RtlpPageHeapSetUserValue(PVOID HeapHandle, ULONG Flags, PVOID BaseAddress, PVOID UserValue)
Definition: heappage.c:2166
#define HEAP_FREE_CHECKING_ENABLED
Definition: nt_native.h:1698
NTSTATUS NTAPI RtlLeaveHeapLock(IN OUT PHEAP_LOCK Lock)
Definition: libsupp.c:133
#define NtCurrentProcess()
Definition: nt_native.h:1657
PVOID NTAPI RtlAllocateHeap(IN PVOID HeapHandle, IN ULONG Flags, IN SIZE_T Size)
Definition: heap.c:588
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)
#define MEM_FREE
Definition: nt_native.h:1317
BOOLEAN NTAPI RtlpPageHeapGetUserInfo(PVOID HeapHandle, ULONG Flags, PVOID BaseAddress, PVOID *UserValue, PULONG UserFlags)
Definition: heappage.c:2124
_In_ HANDLE _Outptr_result_bytebuffer_ ViewSize PVOID * BaseAddress
Definition: mmfuncs.h:404
#define NT_SUCCESS(StatCode)
Definition: apphelp.c:32
#define HEAP_VALIDATE_ALL_ENABLED
Definition: rtltypes.h:166
_In_ HANDLE _Outptr_result_bytebuffer_ ViewSize PVOID _In_ ULONG_PTR _In_ SIZE_T CommitSize
Definition: mmfuncs.h:404
PVOID NTAPI RtlpPageHeapReAllocate(HANDLE HeapPtr, ULONG Flags, PVOID Ptr, SIZE_T Size)
Definition: heappage.c:1954
#define HEAP_ENTRY_SIZE
Definition: heap.h:18
PVOID NTAPI RtlDebugReAllocateHeap(HANDLE HeapPtr, ULONG Flags, PVOID Ptr, SIZE_T Size)
Definition: heapdbg.c:195
PPEB NTAPI RtlGetCurrentPeb(VOID)
Definition: libsupp.c:63
#define HEAP_SETTABLE_USER_FLAGS
Definition: nt_native.h:1708
_In_ PPCI_DEVICE_PRESENCE_PARAMETERS Parameters
Definition: iotypes.h:872
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)
IN OUT PLONG IN OUT PLONG Addend IN OUT PLONG IN LONG IN OUT PLONG IN LONG Increment IN PNDIS_RW_LOCK Lock
Definition: CrNtStubs.h:75
NTSYSAPI SIZE_T NTAPI RtlSizeHeap(_In_ PVOID HeapHandle, _In_ ULONG Flags, _In_ PVOID MemoryPointer)
#define HEAP_FLAG_PAGE_ALLOCS
Definition: rtltypes.h:160
IN PVOID IN PVOID IN USHORT IN USHORT Size
Definition: pci.h:361
SIZE_T NTAPI RtlDebugSizeHeap(HANDLE HeapPtr, ULONG Flags, PVOID Ptr)
Definition: heapdbg.c:494
BOOLEAN NTAPI RtlSetUserFlagsHeap(IN PVOID HeapHandle, IN ULONG Flags, IN PVOID BaseAddress, IN ULONG UserFlagsReset, IN ULONG UserFlagsSet)
Definition: heap.c:3727
SIZE_T NTAPI RtlpPageHeapSize(HANDLE HeapPtr, ULONG Flags, PVOID Ptr)
Definition: heappage.c:2249
PVOID NTAPI RtlpPageHeapAllocate(IN PVOID HeapPtr, IN ULONG Flags, IN SIZE_T Size)
Definition: heappage.c:1697
Status
Definition: gdiplustypes.h:24
ULONG_PTR SIZE_T
Definition: typedefs.h:79
ULONG_PTR AlignRound
Definition: heap.h:246
Definition: heap.h:136
PVOID ProcessHeap
Definition: ntddk_ex.h:249
ULONG Flags
Definition: heap.h:223
BOOLEAN NTAPI RtlpPageHeapSetUserFlags(PVOID HeapHandle, ULONG Flags, PVOID BaseAddress, ULONG UserFlagsReset, ULONG UserFlagsSet)
Definition: heappage.c:2207
#define HEAP_SIGNATURE
Definition: heap.h:52
struct _HEAP_ENTRY_EXTRA HEAP_ENTRY_EXTRA
unsigned int * PULONG
Definition: retypes.h:1
_In_opt_ PVOID _In_opt_ SIZE_T ReserveSize
Definition: rtlfuncs.h:2169
#define DPRINT1
Definition: precomp.h:8
#define MEM_RELEASE
Definition: nt_native.h:1316
BOOLEAN NTAPI RtlDebugSetUserValueHeap(PVOID HeapHandle, ULONG Flags, PVOID BaseAddress, PVOID UserValue)
Definition: heapdbg.c:375
unsigned int ULONG
Definition: retypes.h:1
struct _HEAP * PHEAP
NTSYSAPI PVOID WINAPI RtlReAllocateHeap(HANDLE, ULONG, PVOID, SIZE_T)
Definition: heap.c:2562
ULONG ForceFlags
Definition: heap.h:224
BOOLEAN NTAPI RtlpPageHeapFree(HANDLE HeapPtr, ULONG Flags, PVOID Ptr)
Definition: heappage.c:1862
BOOLEAN NTAPI RtlDebugDestroyHeap(HANDLE HeapPtr)
Definition: heapdbg.c:95
Definition: heap.c:51