https://git.reactos.org/?p=reactos.git;a=commitdiff;h=bd6fb80867fc9ac5f7216f8695803d16d1de9ee9

commit bd6fb80867fc9ac5f7216f8695803d16d1de9ee9
Author:     Jérôme Gardou <[email protected]>
AuthorDate: Fri Jul 30 15:59:40 2021 +0200
Commit:     Jérôme Gardou <[email protected]>
CommitDate: Tue Aug 3 23:13:19 2021 +0200

    [WIN32K:NTUSER] In debug builds, enable free & tail checking when creating 
heaps
    
    Actually catches bugs
---
 win32ss/user/ntuser/usrheap.c | 6 +++++-
 1 file changed, 5 insertions(+), 1 deletion(-)

diff --git a/win32ss/user/ntuser/usrheap.c b/win32ss/user/ntuser/usrheap.c
index 69845d4432c..f668331b374 100644
--- a/win32ss/user/ntuser/usrheap.c
+++ b/win32ss/user/ntuser/usrheap.c
@@ -163,7 +163,11 @@ IntUserHeapCreate(IN PVOID SectionObject,
     Parameters.InitialReserve = (SIZE_T)HeapSize;
     Parameters.CommitRoutine = IntUserHeapCommitRoutine;
 
-    pHeap = RtlCreateHeap(HEAP_ZERO_MEMORY | HEAP_NO_SERIALIZE,
+    pHeap = RtlCreateHeap(
+#if DBG /* Enable checks on debug builds */
+                          HEAP_FREE_CHECKING_ENABLED | 
HEAP_TAIL_CHECKING_ENABLED |
+#endif
+                          HEAP_ZERO_MEMORY | HEAP_NO_SERIALIZE,
                           *SystemMappedBase,
                           (SIZE_T)HeapSize,
                           ViewSize,

Reply via email to