Author: pschweitzer
Date: Thu May 26 11:50:42 2016
New Revision: 71404
URL:
http://svn.reactos.org/svn/reactos?rev=71404&view=rev
Log:
[NTOSKRNL]
On CcInitializeCacheMap() call, keep track of the PinAccess value so that we can later
check it on pinning.
It shouldn't be set to FALSE when the user attempts to perform pinning
CORE-11310
Modified:
trunk/reactos/ntoskrnl/cc/fs.c
trunk/reactos/ntoskrnl/cc/pin.c
trunk/reactos/ntoskrnl/cc/view.c
trunk/reactos/ntoskrnl/include/internal/cc.h
Modified: trunk/reactos/ntoskrnl/cc/fs.c
URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/ntoskrnl/cc/fs.c?rev=71404…
==============================================================================
--- trunk/reactos/ntoskrnl/cc/fs.c [iso-8859-1] (original)
+++ trunk/reactos/ntoskrnl/cc/fs.c [iso-8859-1] Thu May 26 11:50:42 2016
@@ -103,6 +103,7 @@
/* Call old ROS cache init function */
Status = CcRosInitializeFileCache(FileObject,
FileSizes,
+ PinAccess,
CallBacks,
LazyWriterContext);
if (!NT_SUCCESS(Status))
Modified: trunk/reactos/ntoskrnl/cc/pin.c
URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/ntoskrnl/cc/pin.c?rev=7140…
==============================================================================
--- trunk/reactos/ntoskrnl/cc/pin.c [iso-8859-1] (original)
+++ trunk/reactos/ntoskrnl/cc/pin.c [iso-8859-1] Thu May 26 11:50:42 2016
@@ -133,8 +133,18 @@
IN ULONG Flags,
OUT PVOID * Bcb)
{
+ PROS_SHARED_CACHE_MAP SharedCacheMap;
+
CCTRACE(CC_API_DEBUG, "FileOffset=%p FileOffset=%p Length=%lu
Flags=0x%lx\n",
FileObject, FileOffset, Length, Flags);
+
+ ASSERT(FileObject);
+ ASSERT(FileObject->SectionObjectPointer);
+ ASSERT(FileObject->SectionObjectPointer->SharedCacheMap);
+
+ SharedCacheMap = FileObject->SectionObjectPointer->SharedCacheMap;
+ ASSERT(SharedCacheMap);
+ ASSERT(SharedCacheMap->PinAccess);
/* no-op for current implementation. */
return TRUE;
Modified: trunk/reactos/ntoskrnl/cc/view.c
URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/ntoskrnl/cc/view.c?rev=714…
==============================================================================
--- trunk/reactos/ntoskrnl/cc/view.c [iso-8859-1] (original)
+++ trunk/reactos/ntoskrnl/cc/view.c [iso-8859-1] Thu May 26 11:50:42 2016
@@ -1141,6 +1141,7 @@
CcRosInitializeFileCache (
PFILE_OBJECT FileObject,
PCC_FILE_SIZES FileSizes,
+ BOOLEAN PinAccess,
PCACHE_MANAGER_CALLBACKS CallBacks,
PVOID LazyWriterContext)
/*
@@ -1172,6 +1173,7 @@
SharedCacheMap->LazyWriteContext = LazyWriterContext;
SharedCacheMap->SectionSize = FileSizes->AllocationSize;
SharedCacheMap->FileSize = FileSizes->FileSize;
+ SharedCacheMap->PinAccess = PinAccess;
KeInitializeSpinLock(&SharedCacheMap->CacheMapLock);
InitializeListHead(&SharedCacheMap->CacheMapVacbListHead);
FileObject->SectionObjectPointer->SharedCacheMap = SharedCacheMap;
Modified: trunk/reactos/ntoskrnl/include/internal/cc.h
URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/ntoskrnl/include/internal/…
==============================================================================
--- trunk/reactos/ntoskrnl/include/internal/cc.h [iso-8859-1] (original)
+++ trunk/reactos/ntoskrnl/include/internal/cc.h [iso-8859-1] Thu May 26 11:50:42 2016
@@ -149,6 +149,7 @@
PFILE_OBJECT FileObject;
LARGE_INTEGER SectionSize;
LARGE_INTEGER FileSize;
+ BOOLEAN PinAccess;
PCACHE_MANAGER_CALLBACKS Callbacks;
PVOID LazyWriteContext;
KSPIN_LOCK CacheMapLock;
@@ -320,6 +321,7 @@
CcRosInitializeFileCache(
PFILE_OBJECT FileObject,
PCC_FILE_SIZES FileSizes,
+ BOOLEAN PinAccess,
PCACHE_MANAGER_CALLBACKS CallBacks,
PVOID LazyWriterContext
);