[NTOS]: Fix another bug in the continuous memory allocation code, which would go off-by-one while looping the PFN entries for the allocation, and corrupt the PteFrame/PteAddress of an unrelated PFN entry. If this PFN was in the active lists, it would cause page table leaks and faults, if the page was on a free list, it would override the colored list backlink and corrupt the list, later causing unlinked pages to remain linked to the list.

svn path=/trunk/; revision=49556
This commit is contained in:
Sir Richard 2010-11-11 13:05:52 +00:00
parent 0cb645cb12
commit 7a047a7902

View file

@ -79,7 +79,6 @@ MiFindContiguousPages(IN PFN_NUMBER LowestPfn,
//
if (MiIsPfnInUse(Pfn1))
{
//DPRINT1("In use: reset\n");
Length = 0;
continue;
}
@ -94,7 +93,6 @@ MiFindContiguousPages(IN PFN_NUMBER LowestPfn,
//
// It does not, so bail out
//
//DPRINT1("Doesn't match restrictions: reset\n");
continue;
}
@ -368,7 +366,7 @@ MiFindContiguousMemory(IN PFN_NUMBER LowestPfn,
/* Write the PTE address */
Pfn1->PteAddress = PointerPte;
Pfn1->u4.PteFrame = PFN_FROM_PTE(MiAddressToPte(PointerPte++));
} while (Pfn1++ < EndPfn);
} while (++Pfn1 < EndPfn);
/* Return the address */
return BaseAddress;