[ros-diffs] [akhaldi] 53442: [NEWCC] * MSVC fixes.

akhaldi at svn.reactos.org akhaldi at svn.reactos.org
Thu Aug 25 12:38:42 UTC 2011


Author: akhaldi
Date: Thu Aug 25 12:38:41 2011
New Revision: 53442

URL: http://svn.reactos.org/svn/reactos?rev=53442&view=rev
Log:
[NEWCC]
* MSVC fixes.

Modified:
    branches/arty-newcc/ntoskrnl/cache/cachesub.c
    branches/arty-newcc/ntoskrnl/cache/fssup.c
    branches/arty-newcc/ntoskrnl/cache/pinsup.c
    branches/arty-newcc/ntoskrnl/cache/section/fault.c
    branches/arty-newcc/ntoskrnl/cache/section/sptab.c
    branches/arty-newcc/ntoskrnl/cache/section/swapout.c
    branches/arty-newcc/ntoskrnl/mm/section.c

Modified: branches/arty-newcc/ntoskrnl/cache/cachesub.c
URL: http://svn.reactos.org/svn/reactos/branches/arty-newcc/ntoskrnl/cache/cachesub.c?rev=53442&r1=53441&r2=53442&view=diff
==============================================================================
--- branches/arty-newcc/ntoskrnl/cache/cachesub.c [iso-8859-1] (original)
+++ branches/arty-newcc/ntoskrnl/cache/cachesub.c [iso-8859-1] Thu Aug 25 12:38:41 2011
@@ -143,7 +143,7 @@
     PNOCC_BCB Bcb = NULL;
 	LARGE_INTEGER LowerBound, UpperBound;
 	PLIST_ENTRY ListEntry;
-    IO_STATUS_BLOCK IOSB = { };
+    IO_STATUS_BLOCK IOSB = {0};
 
 	DPRINT("CcFlushCache (while file) (%s:%d)\n", File, Line);
 
@@ -287,7 +287,8 @@
 NTAPI
 CcShutdownSystem()
 {
-	ULONG i;
+	ULONG i, Result;
+	NTSTATUS Status;
 
 	DPRINT1("CC: Shutdown\n");
 
@@ -308,8 +309,7 @@
 	}
 
 	// Evict all section pages
-	ULONG Result;
-	NTSTATUS Status = MiRosTrimCache(~0, 0, &Result);
+	Status = MiRosTrimCache(~0, 0, &Result);
 
 	DPRINT1("Done (Evicted %d, Status %x)\n", Result, Status);
 }

Modified: branches/arty-newcc/ntoskrnl/cache/fssup.c
URL: http://svn.reactos.org/svn/reactos/branches/arty-newcc/ntoskrnl/cache/fssup.c?rev=53442&r1=53441&r2=53442&view=diff
==============================================================================
--- branches/arty-newcc/ntoskrnl/cache/fssup.c [iso-8859-1] (original)
+++ branches/arty-newcc/ntoskrnl/cache/fssup.c [iso-8859-1] Thu Aug 25 12:38:41 2011
@@ -250,10 +250,12 @@
 CcSetFileSizes(IN PFILE_OBJECT FileObject,
                IN PCC_FILE_SIZES FileSizes)
 {
-    PNOCC_CACHE_MAP Map = (PNOCC_CACHE_MAP)FileObject->SectionObjectPointer->SharedCacheMap;
+    PNOCC_BCB Bcb;
+	PNOCC_CACHE_MAP Map = (PNOCC_CACHE_MAP)FileObject->SectionObjectPointer->SharedCacheMap;
+
     if (!Map) return;
     Map->FileSizes = *FileSizes;
-	PNOCC_BCB Bcb = Map->AssociatedBcb.Flink == &Map->AssociatedBcb ? 
+    Bcb = Map->AssociatedBcb.Flink == &Map->AssociatedBcb ? 
 		NULL : CONTAINING_RECORD(Map->AssociatedBcb.Flink, NOCC_BCB, ThisFileList);
 	if (!Bcb) return;
 	MmExtendCacheSection(Bcb->SectionObject, &FileSizes->FileSize, FALSE);

Modified: branches/arty-newcc/ntoskrnl/cache/pinsup.c
URL: http://svn.reactos.org/svn/reactos/branches/arty-newcc/ntoskrnl/cache/pinsup.c?rev=53442&r1=53441&r2=53442&view=diff
==============================================================================
--- branches/arty-newcc/ntoskrnl/cache/pinsup.c [iso-8859-1] (original)
+++ branches/arty-newcc/ntoskrnl/cache/pinsup.c [iso-8859-1] Thu Aug 25 12:38:41 2011
@@ -310,7 +310,7 @@
     /* Note: windows 2000 drivers treat this as a bool */
     //BOOLEAN Wait = (Flags & MAP_WAIT) || (Flags == TRUE);
     LARGE_INTEGER Target, EndInterval;
-	ULONG BcbHead;
+	ULONG BcbHead, SectionSize, ViewSize;
     PNOCC_BCB Bcb = NULL;
     PROS_SECTION_OBJECT SectionObject = NULL;
     NTSTATUS Status;
@@ -355,8 +355,6 @@
 		goto cleanup;
 	}
 
-	ULONG SectionSize;
-	
 	DPRINT("File size %08x%08x\n", Map->FileSizes.ValidDataLength.HighPart, Map->FileSizes.ValidDataLength.LowPart);
 	
 	if (Map->FileSizes.ValidDataLength.QuadPart)
@@ -421,7 +419,7 @@
     }
 	
     DPRINT("Selected BCB #%x\n", BcbHead);
-	ULONG ViewSize = CACHE_STRIPE;
+	ViewSize = CACHE_STRIPE;
 
     Bcb = &CcCacheSections[BcbHead];
 	Status = MmMapCacheViewInSystemSpaceAtOffset

Modified: branches/arty-newcc/ntoskrnl/cache/section/fault.c
URL: http://svn.reactos.org/svn/reactos/branches/arty-newcc/ntoskrnl/cache/section/fault.c?rev=53442&r1=53441&r2=53442&view=diff
==============================================================================
--- branches/arty-newcc/ntoskrnl/cache/section/fault.c [iso-8859-1] (original)
+++ branches/arty-newcc/ntoskrnl/cache/section/fault.c [iso-8859-1] Thu Aug 25 12:38:41 2011
@@ -238,6 +238,7 @@
    PVOID PAddress;
    LARGE_INTEGER Offset;
    PEPROCESS Process = MmGetAddressSpaceOwner(AddressSpace);
+   ULONG Entry;
     
    DPRINT("MmAccessFaultSectionView(%x, %x, %x, %x)\n", AddressSpace, MemoryArea, Address, Locked);
 
@@ -269,7 +270,7 @@
            {
                DPRINTC("file %wZ\n", &Segment->FileObject->FileName);
            }
-           ULONG Entry = MmGetPageEntrySectionSegment(Segment, &Offset);
+           Entry = MmGetPageEntrySectionSegment(Segment, &Offset);
            DPRINT("Entry %x\n", Entry);
            if (Entry &&
                !IS_SWAP_FROM_SSE(Entry) &&
@@ -393,6 +394,7 @@
    NTSTATUS Status;
    BOOLEAN Locked = FromMdl;
    MM_REQUIRED_RESOURCES Resources = { 0 };
+   WORK_QUEUE_WITH_CONTEXT Context = { 0 };
 
    DPRINT("MmAccessFault(Mode %d, Address %x)\n", Mode, Address);
 
@@ -476,7 +478,6 @@
 	  {
 		  if (Thread->ActiveFaultCount > 0)
 		  {
-			  WORK_QUEUE_WITH_CONTEXT Context = { };
 			  DPRINT("Already fault handling ... going to work item (%x)\n", Address);
 			  Context.AddressSpace = AddressSpace;
 			  Context.MemoryArea = MemoryArea;
@@ -586,6 +587,7 @@
 	BOOLEAN Locked = FromMdl;
 	PMEMORY_AREA MemoryArea;
 	MM_REQUIRED_RESOURCES Resources = { 0 };
+	WORK_QUEUE_WITH_CONTEXT Context = { 0 };
 	NTSTATUS Status = STATUS_SUCCESS;
 
 	if (!FromMdl)
@@ -657,7 +659,6 @@
 		{
 			if (Thread->ActiveFaultCount > 2)
 			{
-				WORK_QUEUE_WITH_CONTEXT Context = { };
 				DPRINTC("Already fault handling ... going to work item (%x)\n", Address);
 				Context.AddressSpace = AddressSpace;
 				Context.MemoryArea = MemoryArea;

Modified: branches/arty-newcc/ntoskrnl/cache/section/sptab.c
URL: http://svn.reactos.org/svn/reactos/branches/arty-newcc/ntoskrnl/cache/section/sptab.c?rev=53442&r1=53441&r2=53442&view=diff
==============================================================================
--- branches/arty-newcc/ntoskrnl/cache/section/sptab.c [iso-8859-1] (original)
+++ branches/arty-newcc/ntoskrnl/cache/section/sptab.c [iso-8859-1] Thu Aug 25 12:38:41 2011
@@ -105,11 +105,11 @@
  PLARGE_INTEGER FileOffset)
 {
     LARGE_INTEGER SearchFileOffset;
+	CACHE_SECTION_PAGE_TABLE SectionZeroPageTable = {0};
     PCACHE_SECTION_PAGE_TABLE PageTableSlice = 
         MiSectionPageTableGet(Table, FileOffset);
     if (!PageTableSlice)
     {
-		CACHE_SECTION_PAGE_TABLE SectionZeroPageTable = { };
         SearchFileOffset.QuadPart = ROUND_DOWN(FileOffset->QuadPart, ENTRIES_PER_ELEMENT * PAGE_SIZE);
         SectionZeroPageTable.FileOffset = SearchFileOffset;
         SectionZeroPageTable.Refcount = 1;

Modified: branches/arty-newcc/ntoskrnl/cache/section/swapout.c
URL: http://svn.reactos.org/svn/reactos/branches/arty-newcc/ntoskrnl/cache/section/swapout.c?rev=53442&r1=53441&r2=53442&view=diff
==============================================================================
--- branches/arty-newcc/ntoskrnl/cache/section/swapout.c [iso-8859-1] (original)
+++ branches/arty-newcc/ntoskrnl/cache/section/swapout.c [iso-8859-1] Thu Aug 25 12:38:41 2011
@@ -247,6 +247,7 @@
    PEPROCESS Process = NULL;
    NTSTATUS Status = STATUS_SUCCESS;
    MM_REQUIRED_RESOURCES Resources = { 0 };
+   ULONG RefCount;
 
    DPRINTC("Page out %x (ref ct %x)\n", Page, MmGetReferenceCountPage(Page));
 
@@ -438,7 +439,6 @@
 	   }
 
 	   // Alas, we had the last reference
-	   ULONG RefCount;
 	   if ((RefCount = InterlockedDecrementUL(&Segment->ReferenceCount)) == 0)
 		   MmFinalizeSegment(Segment);
    }

Modified: branches/arty-newcc/ntoskrnl/mm/section.c
URL: http://svn.reactos.org/svn/reactos/branches/arty-newcc/ntoskrnl/mm/section.c?rev=53442&r1=53441&r2=53442&view=diff
==============================================================================
--- branches/arty-newcc/ntoskrnl/mm/section.c [iso-8859-1] (original)
+++ branches/arty-newcc/ntoskrnl/mm/section.c [iso-8859-1] Thu Aug 25 12:38:41 2011
@@ -1197,7 +1197,8 @@
  *       Page - Variable that receives a page contains the read data.
  */
 {
-   MM_REQUIRED_RESOURCES Resources = { };
+   MM_REQUIRED_RESOURCES Resources = {0};
+   NTSTATUS Status;
   
    Resources.Context = MemoryArea->Data.SectionData.Section->FileObject;
    Resources.FileOffset.QuadPart = SegOffset + 
@@ -1205,7 +1206,7 @@
    Resources.Consumer = MC_USER;
    Resources.Amount = PAGE_SIZE;
    DPRINT("%S, offset %x, len %d, page %x\n", ((PFILE_OBJECT)Resources.Context)->FileName.Buffer, Resources.FileOffset.LowPart, Resources.Amount, Resources.Page[0]);
-   NTSTATUS Status = MiReadFilePage(NULL, NULL, &Resources);
+   Status = MiReadFilePage(NULL, NULL, &Resources);
    *Page = Resources.Page[0];
    return Status;
 }
@@ -4748,6 +4749,9 @@
 MmFlushImageSection (IN PSECTION_OBJECT_POINTERS SectionObjectPointer,
                      IN MMFLUSH_TYPE   FlushType)
 {
+   BOOLEAN Result = TRUE;
+   PMM_SECTION_SEGMENT Segment;
+
    switch(FlushType)
    {
       case MmFlushForDelete:
@@ -4763,10 +4767,8 @@
       case MmFlushForWrite:
 	  {
 		  DPRINT("MmFlushImageSection(%d)\n", FlushType);
-		  BOOLEAN Result = TRUE;
 #ifdef NEWCC
-		  PMM_SECTION_SEGMENT Segment = 
-			  (PMM_SECTION_SEGMENT)SectionObjectPointer->DataSectionObject;
+		  Segment = (PMM_SECTION_SEGMENT)SectionObjectPointer->DataSectionObject;
 #endif
 
 		  if (SectionObjectPointer->ImageSectionObject) {
@@ -4998,7 +5000,7 @@
 	   IO_STATUS_BLOCK Iosb;
 	   NTSTATUS Status;
 	   CHAR Buffer;
-	   LARGE_INTEGER ByteOffset = { };
+	   LARGE_INTEGER ByteOffset = {0};
 	   Status = ZwReadFile
 		   (FileHandle,
 			NULL,




More information about the Ros-diffs mailing list