Author: fireball
Date: Fri Oct 8 19:30:23 2010
New Revision: 49057
URL:
http://svn.reactos.org/svn/reactos?rev=49057&view=rev
Log:
[HEAP]
- Set proper heap flags (tail and free checking) in case heap validation is enabled. Fixes
another bunch of winetests.
Modified:
trunk/reactos/lib/rtl/heap_rewrite.c
Modified: trunk/reactos/lib/rtl/heap_rewrite.c
URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/lib/rtl/heap_rewrite.c?rev…
==============================================================================
--- trunk/reactos/lib/rtl/heap_rewrite.c [iso-8859-1] (original)
+++ trunk/reactos/lib/rtl/heap_rewrite.c [iso-8859-1] Fri Oct 8 19:30:23 2010
@@ -1656,6 +1656,24 @@
TotalSize = ROUND_UP(CommitSize, 16 * PAGE_SIZE);
}
+ if (RtlpGetMode() == UserMode)
+ {
+ /* TODO: Here should be a call to special "Debug" heap, which does
parameters validation,
+ however we're just going to simulate setting correct flags here */
+ if (Flags & (HEAP_VALIDATE_ALL_ENABLED |
+ HEAP_VALIDATE_PARAMETERS_ENABLED |
+ HEAP_CAPTURE_STACK_BACKTRACES |
+ HEAP_FLAG_PAGE_ALLOCS |
+ HEAP_CREATE_ENABLE_TRACING) &&
+ !(Flags & HEAP_SKIP_VALIDATION_CHECKS))
+ {
+ // RtlDebugCreateHeap(Flags, Addr, TotalSize, CommitSize, Lock, Parameters);
+ Flags |= HEAP_SKIP_VALIDATION_CHECKS |
+ HEAP_TAIL_CHECKING_ENABLED |
+ HEAP_FREE_CHECKING_ENABLED;
+ }
+ }
+
/* Calculate header size */
HeaderSize = sizeof(HEAP);
if (!(Flags & HEAP_NO_SERIALIZE))