Author: hpoussin
Date: Sun Nov 23 13:48:01 2014
New Revision: 65452
URL:
http://svn.reactos.org/svn/reactos?rev=65452&view=rev
Log:
[NTOS:MM] Fix warnings when NEWCC is enabled
Modified:
trunk/reactos/ntoskrnl/mm/mminit.c
trunk/reactos/ntoskrnl/mm/section.c
Modified: trunk/reactos/ntoskrnl/mm/mminit.c
URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/ntoskrnl/mm/mminit.c?rev=6…
==============================================================================
--- trunk/reactos/ntoskrnl/mm/mminit.c [iso-8859-1] (original)
+++ trunk/reactos/ntoskrnl/mm/mminit.c [iso-8859-1] Sun Nov 23 13:48:01 2014
@@ -300,7 +300,9 @@
MmMpwThreadMain(PVOID Parameter)
{
NTSTATUS Status;
+#ifndef NEWCC
ULONG PagesWritten;
+#endif
LARGE_INTEGER Timeout;
UNREFERENCED_PARAMETER(Parameter);
@@ -321,9 +323,9 @@
return;
}
+#ifndef NEWCC
PagesWritten = 0;
-#ifndef NEWCC
// XXX arty -- we flush when evicting pages or destorying cache
// sections.
CcRosFlushDirtyPages(128, &PagesWritten, FALSE);
Modified: trunk/reactos/ntoskrnl/mm/section.c
URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/ntoskrnl/mm/section.c?rev=…
==============================================================================
--- trunk/reactos/ntoskrnl/mm/section.c [iso-8859-1] (original)
+++ trunk/reactos/ntoskrnl/mm/section.c [iso-8859-1] Sun Nov 23 13:48:01 2014
@@ -904,17 +904,16 @@
if (SHARE_COUNT_FROM_SSE(Entry) == 0)
{
PFILE_OBJECT FileObject;
+ SWAPENTRY SavedSwapEntry;
+ PFN_NUMBER Page;
#ifndef NEWCC
PROS_SHARED_CACHE_MAP SharedCacheMap;
-#endif
- SWAPENTRY SavedSwapEntry;
- PFN_NUMBER Page;
BOOLEAN IsImageSection;
LARGE_INTEGER FileOffset;
FileOffset.QuadPart = Offset->QuadPart + Segment->Image.FileOffset;
-
IsImageSection = Section->AllocationAttributes & SEC_IMAGE ? TRUE :
FALSE;
+#endif
Page = PFN_FROM_SSE(Entry);
FileObject = Section->FileObject;
@@ -1873,14 +1872,14 @@
PFN_NUMBER Page;
MM_SECTION_PAGEOUT_CONTEXT Context;
SWAPENTRY SwapEntry;
+ NTSTATUS Status;
+#ifndef NEWCC
ULONGLONG FileOffset;
- NTSTATUS Status;
PFILE_OBJECT FileObject;
-#ifndef NEWCC
PROS_SHARED_CACHE_MAP SharedCacheMap = NULL;
+ BOOLEAN IsImageSection;
#endif
BOOLEAN DirectMapped;
- BOOLEAN IsImageSection;
PEPROCESS Process = MmGetAddressSpaceOwner(AddressSpace);
KIRQL OldIrql;
@@ -1896,16 +1895,16 @@
Context.Offset.QuadPart = (ULONG_PTR)Address -
(ULONG_PTR)MemoryArea->StartingAddress
+ MemoryArea->Data.SectionData.ViewOffset.QuadPart;
+
+ DirectMapped = FALSE;
+
+ MmLockSectionSegment(Context.Segment);
+
+#ifndef NEWCC
FileOffset = Context.Offset.QuadPart + Context.Segment->Image.FileOffset;
-
IsImageSection = Context.Section->AllocationAttributes & SEC_IMAGE ? TRUE :
FALSE;
-
FileObject = Context.Section->FileObject;
- DirectMapped = FALSE;
-
- MmLockSectionSegment(Context.Segment);
-
-#ifndef NEWCC
+
if (FileObject != NULL &&
!(Context.Segment->Image.Characteristics & IMAGE_SCN_MEM_SHARED))
{
@@ -2284,7 +2283,9 @@
BOOLEAN Private;
NTSTATUS Status;
PFILE_OBJECT FileObject;
+#ifndef NEWCC
PROS_SHARED_CACHE_MAP SharedCacheMap = NULL;
+#endif
BOOLEAN DirectMapped;
BOOLEAN IsImageSection;
PEPROCESS Process = MmGetAddressSpaceOwner(AddressSpace);
@@ -2306,7 +2307,9 @@
if (FileObject != NULL &&
!(Segment->Image.Characteristics & IMAGE_SCN_MEM_SHARED))
{
+#ifndef NEWCC
SharedCacheMap = FileObject->SectionObjectPointer->SharedCacheMap;
+#endif
/*
* If the file system is letting us go directly to the cache and the
@@ -3987,8 +3990,10 @@
PFN_NUMBER Page, SWAPENTRY SwapEntry, BOOLEAN Dirty)
{
ULONG_PTR Entry;
+#ifndef NEWCC
PFILE_OBJECT FileObject;
PROS_SHARED_CACHE_MAP SharedCacheMap;
+#endif
LARGE_INTEGER Offset;
SWAPENTRY SavedSwapEntry;
PROS_SECTION_OBJECT Section;
@@ -4028,9 +4033,9 @@
{
if (Page == PFN_FROM_SSE(Entry) && Dirty)
{
+#ifndef NEWCC
FileObject = MemoryArea->Data.SectionData.Section->FileObject;
SharedCacheMap = FileObject->SectionObjectPointer->SharedCacheMap;
-#ifndef NEWCC
CcRosMarkDirtyVacb(SharedCacheMap, Offset.QuadPart +
Segment->Image.FileOffset);
#endif
ASSERT(SwapEntry == 0);