[NTOSKRNL]

- Only unmap pages if they were mapped
- Make sure the page reference counts are sane when freeing the cache memory area

svn path=/trunk/; revision=54690
This commit is contained in:
Cameron Gutman 2011-12-19 02:56:58 +00:00
parent 35c9fc7ae8
commit 4be8d4740d
2 changed files with 4 additions and 0 deletions

View file

@ -645,7 +645,10 @@ CcZeroData (IN PFILE_OBJECT FileObject,
KeWaitForSingleObject(&Event, Executive, KernelMode, FALSE, NULL);
Status = Iosb.Status;
}
if (Mdl->MdlFlags & MDL_MAPPED_TO_SYSTEM_VA)
{
MmUnmapLockedPages(Mdl->MappedSystemVa, Mdl);
}
if (!NT_SUCCESS(Status))
{
return(FALSE);

View file

@ -899,6 +899,7 @@ CcFreeCachePage(PVOID Context, MEMORY_AREA* MemoryArea, PVOID Address,
ASSERT(SwapEntry == 0);
if (Page != 0)
{
ASSERT(MmGetReferenceCountPage(Page) == 1);
MmReleasePageMemoryConsumer(MC_CACHE, Page);
}
}