Author: tkreuzer Date: Sun Feb 5 16:42:22 2012 New Revision: 55431
URL: http://svn.reactos.org/svn/reactos?rev=55431&view=rev Log: [NTOSKRNL/NEWCC] Fix MSVC build and warnings
Modified: trunk/reactos/ntoskrnl/cache/cachesub.c trunk/reactos/ntoskrnl/cache/fssup.c trunk/reactos/ntoskrnl/cache/pinsup.c trunk/reactos/ntoskrnl/cache/section/fault.c trunk/reactos/ntoskrnl/cache/section/newmm.h trunk/reactos/ntoskrnl/cache/section/sptab.c trunk/reactos/ntoskrnl/cache/section/swapout.c trunk/reactos/ntoskrnl/mm/section.c
Modified: trunk/reactos/ntoskrnl/cache/cachesub.c URL: http://svn.reactos.org/svn/reactos/trunk/reactos/ntoskrnl/cache/cachesub.c?r... ============================================================================== --- trunk/reactos/ntoskrnl/cache/cachesub.c [iso-8859-1] (original) +++ trunk/reactos/ntoskrnl/cache/cachesub.c [iso-8859-1] Sun Feb 5 16:42:22 2012 @@ -143,7 +143,7 @@ PNOCC_BCB Bcb = NULL; LARGE_INTEGER LowerBound, UpperBound; PLIST_ENTRY ListEntry; - IO_STATUS_BLOCK IOSB = { }; + IO_STATUS_BLOCK IOSB = {0};
DPRINT1("CcFlushCache (while file) (%s:%d)\n", File, Line);
@@ -164,7 +164,7 @@ while (ListEntry != &Map->AssociatedBcb) { Bcb = CONTAINING_RECORD(ListEntry, NOCC_BCB, ThisFileList); - CcpReferenceCache(Bcb - CcCacheSections); + CcpReferenceCache((ULONG)(Bcb - CcCacheSections));
if (Bcb->FileOffset.QuadPart + Bcb->Length >= LowerBound.QuadPart && Bcb->FileOffset.QuadPart < UpperBound.QuadPart) @@ -186,7 +186,7 @@ if (Delete && Bcb->RefCount < 2) { Bcb->RefCount = 1; - CcpDereferenceCache(Bcb - CcCacheSections, FALSE); + CcpDereferenceCache((ULONG)(Bcb - CcCacheSections), FALSE); } else CcpUnpinData(Bcb, TRUE); @@ -276,9 +276,10 @@ NTAPI CcRemapBcb(IN PVOID Bcb) { + ULONG Number = (ULONG)(((PNOCC_BCB)Bcb) - CcCacheSections); CcpLock(); - ASSERT(RtlTestBit(CcCacheBitmap, ((PNOCC_BCB)Bcb) - CcCacheSections)); - CcpReferenceCache(((PNOCC_BCB)Bcb) - CcCacheSections); + ASSERT(RtlTestBit(CcCacheBitmap, Number)); + CcpReferenceCache(Number); CcpUnlock(); return Bcb; } @@ -315,10 +316,11 @@ NTAPI CcRepinBcb(IN PVOID Bcb) { + ULONG Number = (ULONG)(((PNOCC_BCB)Bcb) - CcCacheSections); CcpLock(); - ASSERT(RtlTestBit(CcCacheBitmap, ((PNOCC_BCB)Bcb) - CcCacheSections)); - DPRINT("CcRepinBcb(#%x)\n", ((PNOCC_BCB)Bcb) - CcCacheSections); - CcpReferenceCache(((PNOCC_BCB)Bcb) - CcCacheSections); + ASSERT(RtlTestBit(CcCacheBitmap, Number)); + DPRINT("CcRepinBcb(#%x)\n", Number); + CcpReferenceCache(Number); CcpUnlock(); }
Modified: trunk/reactos/ntoskrnl/cache/fssup.c URL: http://svn.reactos.org/svn/reactos/trunk/reactos/ntoskrnl/cache/fssup.c?rev=... ============================================================================== --- trunk/reactos/ntoskrnl/cache/fssup.c [iso-8859-1] (original) +++ trunk/reactos/ntoskrnl/cache/fssup.c [iso-8859-1] Sun Feb 5 16:42:22 2012 @@ -297,9 +297,11 @@ IN PCC_FILE_SIZES FileSizes) { PNOCC_CACHE_MAP Map = (PNOCC_CACHE_MAP)FileObject->SectionObjectPointer->SharedCacheMap; + PNOCC_BCB Bcb; + 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: trunk/reactos/ntoskrnl/cache/pinsup.c URL: http://svn.reactos.org/svn/reactos/trunk/reactos/ntoskrnl/cache/pinsup.c?rev... ============================================================================== --- trunk/reactos/ntoskrnl/cache/pinsup.c [iso-8859-1] (original) +++ trunk/reactos/ntoskrnl/cache/pinsup.c [iso-8859-1] Sun Feb 5 16:42:22 2012 @@ -318,6 +318,8 @@ PMM_CACHE_SECTION_SEGMENT SectionObject = NULL; NTSTATUS Status; PNOCC_CACHE_MAP Map = (PNOCC_CACHE_MAP)FileObject->SectionObjectPointer->SharedCacheMap; + ULONG SectionSize; + ULONG ViewSize = CACHE_STRIPE;
if (!Map) { @@ -358,8 +360,6 @@ goto cleanup; }
- ULONG SectionSize; - DPRINT("File size %08x%08x\n", Map->FileSizes.ValidDataLength.HighPart, Map->FileSizes.ValidDataLength.LowPart); if (Map->FileSizes.ValidDataLength.QuadPart) @@ -424,7 +424,6 @@ } DPRINT("Selected BCB #%x\n", BcbHead); - ULONG ViewSize = CACHE_STRIPE;
Bcb = &CcCacheSections[BcbHead]; Status = MmMapCacheViewInSystemSpaceAtOffset
Modified: trunk/reactos/ntoskrnl/cache/section/fault.c URL: http://svn.reactos.org/svn/reactos/trunk/reactos/ntoskrnl/cache/section/faul... ============================================================================== --- trunk/reactos/ntoskrnl/cache/section/fault.c [iso-8859-1] (original) +++ trunk/reactos/ntoskrnl/cache/section/fault.c [iso-8859-1] Sun Feb 5 16:42:22 2012 @@ -266,12 +266,13 @@ Region->Protect == PAGE_EXECUTE_READWRITE) #endif { + ULONG Entry; DPRINTC("setting non-cow page %x %x:%x offset %x (%x) to writable\n", Segment, Process, PAddress, Offset.u.LowPart, MmGetPfnForProcess(Process, Address)); if (Segment->FileObject) { DPRINTC("file %wZ\n", &Segment->FileObject->FileName); } - ULONG Entry = MiGetPageEntryCacheSectionSegment(Segment, &Offset); + Entry = MiGetPageEntryCacheSectionSegment(Segment, &Offset); DPRINT("Entry %x\n", Entry); if (Entry && !IS_SWAP_FROM_SSE(Entry) && @@ -478,7 +479,7 @@ { if (Thread->ActiveFaultCount > 0) { - WORK_QUEUE_WITH_CONTEXT Context = { }; + WORK_QUEUE_WITH_CONTEXT Context = {0}; DPRINT("Already fault handling ... going to work item (%x)\n", Address); Context.AddressSpace = AddressSpace; Context.MemoryArea = MemoryArea; @@ -659,7 +660,7 @@ { if (Thread->ActiveFaultCount > 1) { - WORK_QUEUE_WITH_CONTEXT Context = { }; + WORK_QUEUE_WITH_CONTEXT Context = {0}; DPRINTC("Already fault handling ... going to work item (%x)\n", Address); Context.AddressSpace = AddressSpace; Context.MemoryArea = MemoryArea;
Modified: trunk/reactos/ntoskrnl/cache/section/newmm.h URL: http://svn.reactos.org/svn/reactos/trunk/reactos/ntoskrnl/cache/section/newm... ============================================================================== --- trunk/reactos/ntoskrnl/cache/section/newmm.h [iso-8859-1] (original) +++ trunk/reactos/ntoskrnl/cache/section/newmm.h [iso-8859-1] Sun Feb 5 16:42:22 2012 @@ -19,7 +19,7 @@ #define MEMORY_AREA_CACHE (2) #define MM_SEGMENT_FINALIZE (0x40000000)
-#define RMAP_SEGMENT_MASK ~0xff +#define RMAP_SEGMENT_MASK ~((ULONG_PTR)0xff) #define RMAP_IS_SEGMENT(x) (((ULONG_PTR)(x) & RMAP_SEGMENT_MASK) == RMAP_SEGMENT_MASK)
#define MIN(x,y) (((x)<(y))?(x):(y))
Modified: trunk/reactos/ntoskrnl/cache/section/sptab.c URL: http://svn.reactos.org/svn/reactos/trunk/reactos/ntoskrnl/cache/section/spta... ============================================================================== --- trunk/reactos/ntoskrnl/cache/section/sptab.c [iso-8859-1] (original) +++ trunk/reactos/ntoskrnl/cache/section/sptab.c [iso-8859-1] Sun Feb 5 16:42:22 2012 @@ -107,7 +107,7 @@ MiSectionPageTableGet(Table, FileOffset); if (!PageTableSlice) { - CACHE_SECTION_PAGE_TABLE SectionZeroPageTable = { }; + CACHE_SECTION_PAGE_TABLE SectionZeroPageTable = {0}; SearchFileOffset.QuadPart = ROUND_DOWN(FileOffset->QuadPart, ENTRIES_PER_ELEMENT * PAGE_SIZE); SectionZeroPageTable.FileOffset = SearchFileOffset; SectionZeroPageTable.Refcount = 1;
Modified: trunk/reactos/ntoskrnl/cache/section/swapout.c URL: http://svn.reactos.org/svn/reactos/trunk/reactos/ntoskrnl/cache/section/swap... ============================================================================== --- trunk/reactos/ntoskrnl/cache/section/swapout.c [iso-8859-1] (original) +++ trunk/reactos/ntoskrnl/cache/section/swapout.c [iso-8859-1] Sun Feb 5 16:42:22 2012 @@ -422,6 +422,8 @@
if (Segment) { + ULONG RefCount; + DPRINTC("About to finalize section page %x (%x:%x) Status %x %s\n", Page, Segment, FileOffset.LowPart, Status, Dirty ? "dirty" : "clean");
if (!NT_SUCCESS(Status) || @@ -438,7 +440,6 @@ }
// Alas, we had the last reference - ULONG RefCount; if ((RefCount = InterlockedDecrementUL(&Segment->ReferenceCount)) == 0) MmFinalizeSegment(Segment); }
Modified: trunk/reactos/ntoskrnl/mm/section.c URL: http://svn.reactos.org/svn/reactos/trunk/reactos/ntoskrnl/mm/section.c?rev=5... ============================================================================== --- trunk/reactos/ntoskrnl/mm/section.c [iso-8859-1] (original) +++ trunk/reactos/ntoskrnl/mm/section.c [iso-8859-1] Sun Feb 5 16:42:22 2012 @@ -1290,7 +1290,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 + @@ -1300,7 +1301,7 @@
DPRINT1("%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; }