- Use the correct busy node pointer in RtlpPageHeapDestroy
CORE-9735 #resolve

svn path=/trunk/; revision=68866
This commit is contained in:
Thomas Faber 2015-08-30 07:26:26 +00:00
parent af3114c491
commit 285991f04c

View file

@ -1266,7 +1266,7 @@ RtlpDphFreeDelayedBlocksFromHeap(PDPH_HEAP_ROOT DphRoot,
RtlpDphNumberOfDelayedFreeBlocks--; RtlpDphNumberOfDelayedFreeBlocks--;
/* Free the normal heap */ /* Free the normal heap */
RtlFreeHeap (NormalHeap, 0, BlockInfo); RtlFreeHeap(NormalHeap, 0, BlockInfo);
} }
/* Move to the next one */ /* Move to the next one */
@ -1613,6 +1613,7 @@ PVOID NTAPI
RtlpPageHeapDestroy(HANDLE HeapPtr) RtlpPageHeapDestroy(HANDLE HeapPtr)
{ {
PDPH_HEAP_ROOT DphRoot; PDPH_HEAP_ROOT DphRoot;
PVOID Ptr;
PDPH_HEAP_BLOCK Node, Next; PDPH_HEAP_BLOCK Node, Next;
PHEAP NormalHeap; PHEAP NormalHeap;
ULONG Value; ULONG Value;
@ -1637,10 +1638,11 @@ RtlpPageHeapDestroy(HANDLE HeapPtr)
RtlpDphFreeDelayedBlocksFromHeap(DphRoot, NormalHeap); RtlpDphFreeDelayedBlocksFromHeap(DphRoot, NormalHeap);
/* Go through the busy blocks */ /* Go through the busy blocks */
Node = RtlEnumerateGenericTableAvl(&DphRoot->BusyNodesTable, TRUE); Ptr = RtlEnumerateGenericTableAvl(&DphRoot->BusyNodesTable, TRUE);
while (Node) while (Ptr)
{ {
Node = CONTAINING_RECORD(Ptr, DPH_HEAP_BLOCK, pUserAllocation);
if (!(DphRoot->ExtraFlags & DPH_EXTRA_CHECK_UNDERRUN)) if (!(DphRoot->ExtraFlags & DPH_EXTRA_CHECK_UNDERRUN))
{ {
if (!RtlpDphIsPageHeapBlock(DphRoot, Node->pUserAllocation, &Value, TRUE)) if (!RtlpDphIsPageHeapBlock(DphRoot, Node->pUserAllocation, &Value, TRUE))
@ -1653,7 +1655,7 @@ RtlpPageHeapDestroy(HANDLE HeapPtr)
//AVrfInternalHeapFreeNotification(); //AVrfInternalHeapFreeNotification();
/* Go to the next node */ /* Go to the next node */
Node = RtlEnumerateGenericTableAvl(&DphRoot->BusyNodesTable, FALSE); Ptr = RtlEnumerateGenericTableAvl(&DphRoot->BusyNodesTable, FALSE);
} }
/* Acquire the global heap list lock */ /* Acquire the global heap list lock */