Mark PFN as deleted instead of clearing PteAddress when freeing pages
All checks were successful
Builds / ExectOS (amd64, debug) (push) Successful in 26s
Builds / ExectOS (i686, debug) (push) Successful in 28s
Builds / ExectOS (amd64, release) (push) Successful in 37s
Builds / ExectOS (i686, release) (push) Successful in 35s

This commit is contained in:
2026-03-25 09:51:09 +01:00
parent 33665839ad
commit 441e4f510b

View File

@@ -818,14 +818,14 @@ MM::Allocator::FreeNonPagedPoolPages(IN PVOID VirtualAddress,
PageFrameNumber = MM::Paging::GetPageFrameNumber(PointerPte); PageFrameNumber = MM::Paging::GetPageFrameNumber(PointerPte);
Pfn = MM::Pfn::GetPfnEntry(PageFrameNumber); Pfn = MM::Pfn::GetPfnEntry(PageFrameNumber);
/* Clear PFN shared count */ /* Clear PFN shared count and mark the PFN as deleted */
Pfn->u2.ShareCount = 0; Pfn->u2.ShareCount = 0;
Pfn->PteAddress = (PMMPTE)((ULONG_PTR)Pfn->PteAddress | 0x1);
/* Decrement the reference count of the page table */ /* Decrement the reference count of the page table */
MM::Pfn::DecrementReferenceCount(Pfn, PageFrameNumber, FALSE); MM::Pfn::DecrementReferenceCount(Pfn, PageFrameNumber, FALSE);
/* Clear the PTE address and invalidate the PTE */ /* Invalidate the PTE */
Pfn->PteAddress = NULLPTR;
MM::Paging::ClearPte(PointerPte); MM::Paging::ClearPte(PointerPte);
/* Get the next PTE */ /* Get the next PTE */