[NTOS:CC]
authorThomas Faber <thomas.faber@reactos.org>
Sun, 17 Aug 2014 21:47:43 +0000 (21:47 +0000)
committerThomas Faber <thomas.faber@reactos.org>
Sun, 17 Aug 2014 21:47:43 +0000 (21:47 +0000)
- Use the passed-in file sizes in CcInitializeCacheMap

svn path=/trunk/; revision=63901

reactos/ntoskrnl/cc/fs.c
reactos/ntoskrnl/cc/view.c
reactos/ntoskrnl/include/internal/cc.h

index 27f6455..b4c3b1d 100644 (file)
@@ -87,6 +87,7 @@ CcInitializeCacheMap (
 
     /* Call old ROS cache init function */
     CcRosInitializeFileCache(FileObject,
+                             FileSizes,
                              CallBacks,
                              LazyWriterContext);
 }
index 10bf34c..05544f9 100644 (file)
@@ -1187,6 +1187,7 @@ NTSTATUS
 NTAPI
 CcRosInitializeFileCache (
     PFILE_OBJECT FileObject,
+    PCC_FILE_SIZES FileSizes,
     PCACHE_MANAGER_CALLBACKS CallBacks,
     PVOID LazyWriterContext)
 /*
@@ -1216,13 +1217,8 @@ CcRosInitializeFileCache (
         SharedCacheMap->FileObject = FileObject;
         SharedCacheMap->Callbacks = CallBacks;
         SharedCacheMap->LazyWriteContext = LazyWriterContext;
-        if (FileObject->FsContext)
-        {
-            SharedCacheMap->SectionSize =
-                ((PFSRTL_COMMON_FCB_HEADER)FileObject->FsContext)->AllocationSize;
-            SharedCacheMap->FileSize =
-                ((PFSRTL_COMMON_FCB_HEADER)FileObject->FsContext)->FileSize;
-        }
+        SharedCacheMap->SectionSize = FileSizes->AllocationSize;
+        SharedCacheMap->FileSize = FileSizes->FileSize;
         KeInitializeSpinLock(&SharedCacheMap->CacheMapLock);
         InitializeListHead(&SharedCacheMap->CacheMapVacbListHead);
         FileObject->SectionObjectPointer->SharedCacheMap = SharedCacheMap;
index 3e559f8..30c657d 100644 (file)
@@ -287,6 +287,7 @@ NTSTATUS
 NTAPI
 CcRosInitializeFileCache(
     PFILE_OBJECT FileObject,
+    PCC_FILE_SIZES FileSizes,
     PCACHE_MANAGER_CALLBACKS CallBacks,
     PVOID LazyWriterContext
 );