Author: cgutman
Date: Mon Dec 19 02:56:58 2011
New Revision: 54690
URL:
http://svn.reactos.org/svn/reactos?rev=54690&view=rev
Log:
[NTOSKRNL]
- Only unmap pages if they were mapped
- Make sure the page reference counts are sane when freeing the cache memory area
Modified:
trunk/reactos/ntoskrnl/cc/copy.c
trunk/reactos/ntoskrnl/cc/view.c
Modified: trunk/reactos/ntoskrnl/cc/copy.c
URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/ntoskrnl/cc/copy.c?rev=546…
==============================================================================
--- trunk/reactos/ntoskrnl/cc/copy.c [iso-8859-1] (original)
+++ trunk/reactos/ntoskrnl/cc/copy.c [iso-8859-1] Mon Dec 19 02:56:58 2011
@@ -645,7 +645,10 @@
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);
Modified: trunk/reactos/ntoskrnl/cc/view.c
URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/ntoskrnl/cc/view.c?rev=546…
==============================================================================
--- trunk/reactos/ntoskrnl/cc/view.c [iso-8859-1] (original)
+++ trunk/reactos/ntoskrnl/cc/view.c [iso-8859-1] Mon Dec 19 02:56:58 2011
@@ -899,6 +899,7 @@
ASSERT(SwapEntry == 0);
if (Page != 0)
{
+ ASSERT(MmGetReferenceCountPage(Page) == 1);
MmReleasePageMemoryConsumer(MC_CACHE, Page);
}
}