Author: tfaber
Date: Sun Aug 30 07:26:26 2015
New Revision: 68866
URL: 
http://svn.reactos.org/svn/reactos?rev=68866&view=rev
Log:
[RTL]
- Use the correct busy node pointer in RtlpPageHeapDestroy
CORE-9735 #resolve
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=688…
==============================================================================
--- trunk/reactos/lib/rtl/heappage.c    [iso-8859-1] (original)
+++ trunk/reactos/lib/rtl/heappage.c    [iso-8859-1] Sun Aug 30 07:26:26 2015
@@ -1266,7 +1266,7 @@
             RtlpDphNumberOfDelayedFreeBlocks--;
             /* Free the normal heap */
-            RtlFreeHeap (NormalHeap, 0, BlockInfo);
+            RtlFreeHeap(NormalHeap, 0, BlockInfo);
         }
         /* Move to the next one */
@@ -1613,6 +1613,7 @@
 RtlpPageHeapDestroy(HANDLE HeapPtr)
 {
     PDPH_HEAP_ROOT DphRoot;
+    PVOID Ptr;
     PDPH_HEAP_BLOCK Node, Next;
     PHEAP NormalHeap;
     ULONG Value;
@@ -1637,10 +1638,11 @@
     RtlpDphFreeDelayedBlocksFromHeap(DphRoot, NormalHeap);
     /* Go through the busy blocks */
-    Node = RtlEnumerateGenericTableAvl(&DphRoot->BusyNodesTable, TRUE);
-
-    while (Node)
-    {
+    Ptr = RtlEnumerateGenericTableAvl(&DphRoot->BusyNodesTable, TRUE);
+
+    while (Ptr)
+    {
+        Node = CONTAINING_RECORD(Ptr, DPH_HEAP_BLOCK, pUserAllocation);
         if (!(DphRoot->ExtraFlags & DPH_EXTRA_CHECK_UNDERRUN))
         {
             if (!RtlpDphIsPageHeapBlock(DphRoot, Node->pUserAllocation, &Value,
TRUE))
@@ -1653,7 +1655,7 @@
         //AVrfInternalHeapFreeNotification();
         /* Go to the next node */
-        Node = RtlEnumerateGenericTableAvl(&DphRoot->BusyNodesTable, FALSE);
+        Ptr = RtlEnumerateGenericTableAvl(&DphRoot->BusyNodesTable, FALSE);
     }
     /* Acquire the global heap list lock */