[NTOS]: You can't just set MDL_LOCKED_PAGES without actually... locking the page. Add a MmReferencePage when doing so, so when that a paging read/write IRP gets completed (and MmUnlockPages is called), the page gets handled correctly. Can now boot with 64MB RAM without ASSERTs.

[NTOS]: Fix one of the MDL code paths that isn't getting called frequently.

svn path=/trunk/; revision=49438
This commit is contained in:
Sir Richard 2010-11-02 14:46:46 +00:00
parent 55256a107f
commit 36429c0a64
2 changed files with 9 additions and 5 deletions

View file

@ -246,12 +246,14 @@ MiAllocatePagesForMdl(IN PHYSICAL_ADDRESS LowAddress,
//
ASSERT(Pfn1->u3.e2.ReferenceCount == 0);
//
// Allocate it and mark it
//
/* Now setup the page and mark it */
Pfn1->u3.e2.ReferenceCount = 1;
Pfn1->u2.ShareCount = 1;
MI_SET_PFN_DELETED(Pfn1);
Pfn1->u4.PteFrame = 0x1FFEDCB;
Pfn1->u3.e1.StartOfAllocation = 1;
Pfn1->u3.e1.EndOfAllocation = 1;
Pfn1->u3.e2.ReferenceCount = 1;
Pfn1->u4.VerifierAllocation = 0;
//
// Save it into the MDL
@ -370,7 +372,7 @@ MiAllocatePagesForMdl(IN PHYSICAL_ADDRESS LowAddress,
}
//
// We're done, mark the pages as locked (should we lock them, though???)
// We're done, mark the pages as locked
//
Mdl->Process = NULL;
Mdl->MdlFlags |= MDL_PAGES_LOCKED;

View file

@ -252,6 +252,7 @@ MmWriteToSwapPage(SWAPENTRY SwapEntry, PFN_NUMBER Page)
MmInitializeMdl(Mdl, NULL, PAGE_SIZE);
MmBuildMdlFromPages(Mdl, &Page);
MmReferencePage(Page);
Mdl->MdlFlags |= MDL_PAGES_LOCKED;
file_offset.QuadPart = offset * PAGE_SIZE;
@ -313,6 +314,7 @@ MmReadFromSwapPage(SWAPENTRY SwapEntry, PFN_NUMBER Page)
MmInitializeMdl(Mdl, NULL, PAGE_SIZE);
MmBuildMdlFromPages(Mdl, &Page);
MmReferencePage(Page);
Mdl->MdlFlags |= MDL_PAGES_LOCKED;
file_offset.QuadPart = offset * PAGE_SIZE;