Author: fireball
Date: Fri Nov 11 11:55:49 2011
New Revision: 54349
URL: http://svn.reactos.org/svn/reactos?rev=54349&view=rev
Log:
[RTL]
- A bit more of the DPH code cleanup, no bugs found so far.
Modified:
trunk/reactos/lib/rtl/heappage.c
Modified: trunk/reactos/lib/rtl/heappage.c
URL: http://svn.reactos.org/svn/reactos/trunk/reactos/lib/rtl/heappage.c?rev=543…
==============================================================================
--- trunk/reactos/lib/rtl/heappage.c [iso-8859-1] (original)
+++ trunk/reactos/lib/rtl/heappage.c [iso-8859-1] Fri Nov 11 11:55:49 2011
@@ -909,14 +909,13 @@
ULONG Protection;
PVOID Base;
- // FIXME: Check this, when we should add up usersize and when we shouldn't!
- if (!(DphRoot->ExtraFlags & DPH_EXTRA_CHECK_UNDERRUN))
+ if (DphRoot->ExtraFlags & DPH_EXTRA_CHECK_UNDERRUN)
+ {
+ Base = VirtualBlock + PAGE_SIZE;
+ }
+ else
{
Base = VirtualBlock;
- }
- else
- {
- Base = VirtualBlock + PAGE_SIZE;
}
// FIXME: It should be different, but for now it's fine
@@ -928,6 +927,8 @@
NTSTATUS NTAPI
RtlpDphSetProtectionAfterUse(PDPH_HEAP_ROOT DphRoot, /*PUCHAR VirtualBlock*/PDPH_HEAP_BLOCK Node)
{
+ ASSERT((Node->nVirtualAccessSize + PAGE_SIZE) <= Node->nVirtualBlockSize);
+
// FIXME: Bring stuff here
if (DphRoot->ExtraFlags & DPH_EXTRA_CHECK_UNDERRUN)
{
@@ -1679,7 +1680,6 @@
if (!DphRoot) return NULL;
/* Acquire the heap lock */
- //RtlpDphEnterCriticalSection(DphRoot, Flags);
RtlpDphPreProcessing(DphRoot, Flags);
/* Perform internal validation if specified by flags */
@@ -1881,7 +1881,7 @@
}
/* Set new protection */
- RtlpDphSetProtectionAfterUse(DphRoot, Node);
+ //RtlpDphSetProtectionAfterUse(DphRoot, Node);
/* Remove it from the list of busy nodes */
RtlpDphRemoveFromBusyList(DphRoot, Node);