mirror of
https://github.com/reactos/reactos.git
synced 2025-08-03 20:35:43 +00:00
2002-12-15 Casper S. Hornstrup <chorns@users.sourceforge.net>
* drivers/fs/vfat/cleanup.c (VfatCleanupFile): Only uninitialize caching when initialized. * drivers/fs/vfat/fcb.c (vfatReleaseFCB): Ditto. * lib/kernel32/mem/section.c (CreateFileMappingW): Pass NULL as MaximumSize to NtCreateSection if dwMaximumSizeHigh and dwMaximumSizeLow are both 0. * ntoskrnl/cc/pin.c (CcMapData): Assert if Bcb is NULL. * ntoskrnl/cc/view.c (CcRosReleaseCacheSegment, CcRosLookupCacheSegment, CcRosMarkDirtyCacheSegment, CcRosUnmapCacheSegment, CcRosCreateCacheSegment, CcRosGetCacheSegmentChain, CcRosGetCacheSegment, CcRosRequestCacheSegment, CcFlushCache, CcRosDeleteFileCache, CcRosReferenceCache, CcRosDereferenceCache, CcRosReleaseFileCache, CcGetFileObjectFromSectionPtrs): Ditto. * ntoskrnl/mm/section.c (MiReadPage): Assert if Fcb->Bcb is NULL. (MmCreateDataFileSection): Make sure caching is initialized for the file stream. svn path=/trunk/; revision=3879
This commit is contained in:
parent
d774049979
commit
3aa9d2d9ba
7 changed files with 101 additions and 14 deletions
|
@ -1,3 +1,22 @@
|
||||||
|
2002-12-15 Casper S. Hornstrup <chorns@users.sourceforge.net>
|
||||||
|
|
||||||
|
* drivers/fs/vfat/cleanup.c (VfatCleanupFile): Only uninitialize caching
|
||||||
|
when initialized.
|
||||||
|
* drivers/fs/vfat/fcb.c (vfatReleaseFCB): Ditto.
|
||||||
|
* lib/kernel32/mem/section.c (CreateFileMappingW): Pass NULL as
|
||||||
|
MaximumSize to NtCreateSection if dwMaximumSizeHigh and dwMaximumSizeLow
|
||||||
|
are both 0.
|
||||||
|
* ntoskrnl/cc/pin.c (CcMapData): Assert if Bcb is NULL.
|
||||||
|
* ntoskrnl/cc/view.c (CcRosReleaseCacheSegment, CcRosLookupCacheSegment,
|
||||||
|
CcRosMarkDirtyCacheSegment, CcRosUnmapCacheSegment,
|
||||||
|
CcRosCreateCacheSegment, CcRosGetCacheSegmentChain,
|
||||||
|
CcRosGetCacheSegment, CcRosRequestCacheSegment, CcFlushCache,
|
||||||
|
CcRosDeleteFileCache, CcRosReferenceCache, CcRosDereferenceCache,
|
||||||
|
CcRosReleaseFileCache, CcGetFileObjectFromSectionPtrs): Ditto.
|
||||||
|
* ntoskrnl/mm/section.c (MiReadPage): Assert if Fcb->Bcb is NULL.
|
||||||
|
(MmCreateDataFileSection): Make sure caching is initialized for the file
|
||||||
|
stream.
|
||||||
|
|
||||||
2002-11-15 Casper S. Hornstrup <chorns@users.sourceforge.net>
|
2002-11-15 Casper S. Hornstrup <chorns@users.sourceforge.net>
|
||||||
|
|
||||||
* include/ddk/ldrtypes.h: Move ...
|
* include/ddk/ldrtypes.h: Move ...
|
||||||
|
|
|
@ -1,4 +1,4 @@
|
||||||
/* $Id: cleanup.c,v 1.7 2002/08/14 20:58:31 dwelch Exp $
|
/* $Id: cleanup.c,v 1.8 2002/12/15 17:01:51 chorns Exp $
|
||||||
*
|
*
|
||||||
* COPYRIGHT: See COPYING in the top level directory
|
* COPYRIGHT: See COPYING in the top level directory
|
||||||
* PROJECT: ReactOS kernel
|
* PROJECT: ReactOS kernel
|
||||||
|
@ -48,8 +48,11 @@ VfatCleanupFile(PDEVICE_EXTENSION DeviceExt,
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
/* Uninitialize the file cache. */
|
/* Uninitialize file cache if initialized for this file object. */
|
||||||
|
if (pFcb->RFCB.Bcb != NULL)
|
||||||
|
{
|
||||||
CcRosReleaseFileCache (FileObject, pFcb->RFCB.Bcb);
|
CcRosReleaseFileCache (FileObject, pFcb->RFCB.Bcb);
|
||||||
|
}
|
||||||
|
|
||||||
return STATUS_SUCCESS;
|
return STATUS_SUCCESS;
|
||||||
}
|
}
|
||||||
|
|
|
@ -1,4 +1,4 @@
|
||||||
/* $Id: fcb.c,v 1.22 2002/11/11 21:49:18 hbirr Exp $
|
/* $Id: fcb.c,v 1.23 2002/12/15 17:01:51 chorns Exp $
|
||||||
*
|
*
|
||||||
*
|
*
|
||||||
* FILE: fcb.c
|
* FILE: fcb.c
|
||||||
|
@ -148,8 +148,12 @@ vfatReleaseFCB(PDEVICE_EXTENSION pVCB, PVFATFCB pFCB)
|
||||||
}
|
}
|
||||||
KeReleaseSpinLock (&pVCB->FcbListLock, oldIrql);
|
KeReleaseSpinLock (&pVCB->FcbListLock, oldIrql);
|
||||||
if (vfatFCBIsDirectory(pFCB))
|
if (vfatFCBIsDirectory(pFCB))
|
||||||
|
{
|
||||||
|
/* Uninitialize file cache if initialized for this file object. */
|
||||||
|
if (pFCB->RFCB.Bcb != NULL)
|
||||||
{
|
{
|
||||||
CcRosReleaseFileCache(pFCB->FileObject, pFCB->RFCB.Bcb);
|
CcRosReleaseFileCache(pFCB->FileObject, pFCB->RFCB.Bcb);
|
||||||
|
}
|
||||||
vfatDestroyCCB(pFCB->FileObject->FsContext2);
|
vfatDestroyCCB(pFCB->FileObject->FsContext2);
|
||||||
pFCB->FileObject->FsContext2 = NULL;
|
pFCB->FileObject->FsContext2 = NULL;
|
||||||
ObDereferenceObject(pFCB->FileObject);
|
ObDereferenceObject(pFCB->FileObject);
|
||||||
|
|
|
@ -1,4 +1,4 @@
|
||||||
/* $Id: section.c,v 1.16 2002/09/08 10:22:43 chorns Exp $
|
/* $Id: section.c,v 1.17 2002/12/15 17:01:51 chorns Exp $
|
||||||
*
|
*
|
||||||
* COPYRIGHT: See COPYING in the top level directory
|
* COPYRIGHT: See COPYING in the top level directory
|
||||||
* PROJECT: ReactOS kernel
|
* PROJECT: ReactOS kernel
|
||||||
|
@ -82,6 +82,7 @@ CreateFileMappingW(HANDLE hFile,
|
||||||
NTSTATUS Status;
|
NTSTATUS Status;
|
||||||
HANDLE SectionHandle;
|
HANDLE SectionHandle;
|
||||||
LARGE_INTEGER MaximumSize;
|
LARGE_INTEGER MaximumSize;
|
||||||
|
PLARGE_INTEGER MaximumSizePointer;
|
||||||
OBJECT_ATTRIBUTES ObjectAttributes;
|
OBJECT_ATTRIBUTES ObjectAttributes;
|
||||||
UNICODE_STRING UnicodeName;
|
UNICODE_STRING UnicodeName;
|
||||||
PSECURITY_DESCRIPTOR SecurityDescriptor;
|
PSECURITY_DESCRIPTOR SecurityDescriptor;
|
||||||
|
@ -95,8 +96,16 @@ CreateFileMappingW(HANDLE hFile,
|
||||||
SecurityDescriptor = NULL;
|
SecurityDescriptor = NULL;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if ((dwMaximumSizeLow == 0) && (dwMaximumSizeHigh == 0))
|
||||||
|
{
|
||||||
|
MaximumSizePointer = NULL;
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
MaximumSize.u.LowPart = dwMaximumSizeLow;
|
MaximumSize.u.LowPart = dwMaximumSizeLow;
|
||||||
MaximumSize.u.HighPart = dwMaximumSizeHigh;
|
MaximumSize.u.HighPart = dwMaximumSizeHigh;
|
||||||
|
MaximumSizePointer = &MaximumSize;
|
||||||
|
}
|
||||||
RtlInitUnicodeString(&UnicodeName,
|
RtlInitUnicodeString(&UnicodeName,
|
||||||
lpName);
|
lpName);
|
||||||
InitializeObjectAttributes(&ObjectAttributes,
|
InitializeObjectAttributes(&ObjectAttributes,
|
||||||
|
@ -107,7 +116,7 @@ CreateFileMappingW(HANDLE hFile,
|
||||||
Status = NtCreateSection(&SectionHandle,
|
Status = NtCreateSection(&SectionHandle,
|
||||||
SECTION_ALL_ACCESS,
|
SECTION_ALL_ACCESS,
|
||||||
&ObjectAttributes,
|
&ObjectAttributes,
|
||||||
&MaximumSize,
|
MaximumSizePointer,
|
||||||
flProtect,
|
flProtect,
|
||||||
0,
|
0,
|
||||||
hFile);
|
hFile);
|
||||||
|
|
|
@ -1,4 +1,4 @@
|
||||||
/* $Id: pin.c,v 1.8 2002/10/02 19:23:42 hbirr Exp $
|
/* $Id: pin.c,v 1.9 2002/12/15 17:01:52 chorns Exp $
|
||||||
*
|
*
|
||||||
* COPYRIGHT: See COPYING in the top level directory
|
* COPYRIGHT: See COPYING in the top level directory
|
||||||
* PROJECT: ReactOS kernel
|
* PROJECT: ReactOS kernel
|
||||||
|
@ -57,6 +57,7 @@ CcMapData (IN PFILE_OBJECT FileObject,
|
||||||
|
|
||||||
ReadOffset = FileOffset->QuadPart;
|
ReadOffset = FileOffset->QuadPart;
|
||||||
Bcb = ((REACTOS_COMMON_FCB_HEADER*)FileObject->FsContext)->Bcb;
|
Bcb = ((REACTOS_COMMON_FCB_HEADER*)FileObject->FsContext)->Bcb;
|
||||||
|
assert(Bcb);
|
||||||
|
|
||||||
DPRINT("AllocationSize %d, FileSize %d\n",
|
DPRINT("AllocationSize %d, FileSize %d\n",
|
||||||
(ULONG)Bcb->AllocationSize.QuadPart,
|
(ULONG)Bcb->AllocationSize.QuadPart,
|
||||||
|
|
|
@ -16,7 +16,7 @@
|
||||||
* along with this program; if not, write to the Free Software
|
* along with this program; if not, write to the Free Software
|
||||||
* Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
|
* Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
|
||||||
*/
|
*/
|
||||||
/* $Id: view.c,v 1.53 2002/10/02 19:20:51 hbirr Exp $
|
/* $Id: view.c,v 1.54 2002/12/15 17:01:52 chorns Exp $
|
||||||
*
|
*
|
||||||
* PROJECT: ReactOS kernel
|
* PROJECT: ReactOS kernel
|
||||||
* FILE: ntoskrnl/cc/view.c
|
* FILE: ntoskrnl/cc/view.c
|
||||||
|
@ -227,6 +227,8 @@ CcRosReleaseCacheSegment(PBCB Bcb,
|
||||||
BOOLEAN WasDirty = CacheSeg->Dirty;
|
BOOLEAN WasDirty = CacheSeg->Dirty;
|
||||||
KIRQL oldIrql;
|
KIRQL oldIrql;
|
||||||
|
|
||||||
|
assert(Bcb);
|
||||||
|
|
||||||
DPRINT("CcReleaseCacheSegment(Bcb %x, CacheSeg %x, Valid %d)\n",
|
DPRINT("CcReleaseCacheSegment(Bcb %x, CacheSeg %x, Valid %d)\n",
|
||||||
Bcb, CacheSeg, Valid);
|
Bcb, CacheSeg, Valid);
|
||||||
|
|
||||||
|
@ -268,6 +270,8 @@ PCACHE_SEGMENT CcRosLookupCacheSegment(PBCB Bcb, ULONG FileOffset)
|
||||||
PCACHE_SEGMENT current;
|
PCACHE_SEGMENT current;
|
||||||
KIRQL oldIrql;
|
KIRQL oldIrql;
|
||||||
|
|
||||||
|
assert(Bcb);
|
||||||
|
|
||||||
DPRINT("CcRosLookupCacheSegment(Bcb %x, FileOffset %d)\n", Bcb, FileOffset);
|
DPRINT("CcRosLookupCacheSegment(Bcb %x, FileOffset %d)\n", Bcb, FileOffset);
|
||||||
|
|
||||||
KeAcquireSpinLock(&Bcb->BcbLock, &oldIrql);
|
KeAcquireSpinLock(&Bcb->BcbLock, &oldIrql);
|
||||||
|
@ -295,6 +299,8 @@ CcRosMarkDirtyCacheSegment(PBCB Bcb, ULONG FileOffset)
|
||||||
PCACHE_SEGMENT CacheSeg;
|
PCACHE_SEGMENT CacheSeg;
|
||||||
KIRQL oldIrql;
|
KIRQL oldIrql;
|
||||||
|
|
||||||
|
assert(Bcb);
|
||||||
|
|
||||||
DPRINT("CcRosMarkDirtyCacheSegment(Bcb %x, FileOffset %d)\n", Bcb, FileOffset);
|
DPRINT("CcRosMarkDirtyCacheSegment(Bcb %x, FileOffset %d)\n", Bcb, FileOffset);
|
||||||
|
|
||||||
CacheSeg = CcRosLookupCacheSegment(Bcb, FileOffset);
|
CacheSeg = CcRosLookupCacheSegment(Bcb, FileOffset);
|
||||||
|
@ -330,6 +336,8 @@ CcRosUnmapCacheSegment(PBCB Bcb, ULONG FileOffset, BOOLEAN NowDirty)
|
||||||
BOOLEAN WasDirty;
|
BOOLEAN WasDirty;
|
||||||
KIRQL oldIrql;
|
KIRQL oldIrql;
|
||||||
|
|
||||||
|
assert(Bcb);
|
||||||
|
|
||||||
DPRINT("CcRosUnmapCacheSegment(Bcb %x, FileOffset %d, NowDirty %d)\n",
|
DPRINT("CcRosUnmapCacheSegment(Bcb %x, FileOffset %d, NowDirty %d)\n",
|
||||||
Bcb, FileOffset, NowDirty);
|
Bcb, FileOffset, NowDirty);
|
||||||
|
|
||||||
|
@ -380,6 +388,8 @@ CcRosCreateCacheSegment(PBCB Bcb,
|
||||||
NTSTATUS Status;
|
NTSTATUS Status;
|
||||||
KIRQL oldIrql;
|
KIRQL oldIrql;
|
||||||
|
|
||||||
|
assert(Bcb);
|
||||||
|
|
||||||
DPRINT("CcRosCreateCacheSegment()\n");
|
DPRINT("CcRosCreateCacheSegment()\n");
|
||||||
|
|
||||||
current = ExAllocatePoolWithTag(NonPagedPool, sizeof(CACHE_SEGMENT),
|
current = ExAllocatePoolWithTag(NonPagedPool, sizeof(CACHE_SEGMENT),
|
||||||
|
@ -487,6 +497,8 @@ CcRosGetCacheSegmentChain(PBCB Bcb,
|
||||||
PCACHE_SEGMENT* CacheSegList;
|
PCACHE_SEGMENT* CacheSegList;
|
||||||
PCACHE_SEGMENT Previous = NULL;
|
PCACHE_SEGMENT Previous = NULL;
|
||||||
|
|
||||||
|
assert(Bcb);
|
||||||
|
|
||||||
DPRINT("CcRosGetCacheSegmentChain()\n");
|
DPRINT("CcRosGetCacheSegmentChain()\n");
|
||||||
|
|
||||||
Length = ROUND_UP(Length, Bcb->CacheSegmentSize);
|
Length = ROUND_UP(Length, Bcb->CacheSegmentSize);
|
||||||
|
@ -542,6 +554,8 @@ CcRosGetCacheSegment(PBCB Bcb,
|
||||||
PCACHE_SEGMENT current;
|
PCACHE_SEGMENT current;
|
||||||
NTSTATUS Status;
|
NTSTATUS Status;
|
||||||
|
|
||||||
|
assert(Bcb);
|
||||||
|
|
||||||
DPRINT("CcRosGetCacheSegment()\n");
|
DPRINT("CcRosGetCacheSegment()\n");
|
||||||
|
|
||||||
/*
|
/*
|
||||||
|
@ -582,6 +596,8 @@ CcRosRequestCacheSegment(PBCB Bcb,
|
||||||
{
|
{
|
||||||
ULONG BaseOffset;
|
ULONG BaseOffset;
|
||||||
|
|
||||||
|
assert(Bcb);
|
||||||
|
|
||||||
if ((FileOffset % Bcb->CacheSegmentSize) != 0)
|
if ((FileOffset % Bcb->CacheSegmentSize) != 0)
|
||||||
{
|
{
|
||||||
CPRINT("Bad fileoffset %x should be multiple of %x",
|
CPRINT("Bad fileoffset %x should be multiple of %x",
|
||||||
|
@ -634,6 +650,8 @@ CcRosFreeCacheSegment(PBCB Bcb, PCACHE_SEGMENT CacheSeg)
|
||||||
NTSTATUS Status;
|
NTSTATUS Status;
|
||||||
KIRQL oldIrql;
|
KIRQL oldIrql;
|
||||||
|
|
||||||
|
assert(Bcb);
|
||||||
|
|
||||||
DPRINT("CcRosFreeCacheSegment(Bcb %x, CacheSeg %x)\n",
|
DPRINT("CcRosFreeCacheSegment(Bcb %x, CacheSeg %x)\n",
|
||||||
Bcb, CacheSeg);
|
Bcb, CacheSeg);
|
||||||
|
|
||||||
|
@ -671,6 +689,7 @@ CcFlushCache(IN PSECTION_OBJECT_POINTERS SectionObjectPointers,
|
||||||
if (SectionObjectPointers && SectionObjectPointers->SharedCacheMap)
|
if (SectionObjectPointers && SectionObjectPointers->SharedCacheMap)
|
||||||
{
|
{
|
||||||
Bcb = (PBCB)SectionObjectPointers->SharedCacheMap;
|
Bcb = (PBCB)SectionObjectPointers->SharedCacheMap;
|
||||||
|
assert(Bcb);
|
||||||
if (FileOffset)
|
if (FileOffset)
|
||||||
{
|
{
|
||||||
Offset = *FileOffset;
|
Offset = *FileOffset;
|
||||||
|
@ -739,6 +758,8 @@ CcRosDeleteFileCache(PFILE_OBJECT FileObject, PBCB Bcb)
|
||||||
LIST_ENTRY FreeList;
|
LIST_ENTRY FreeList;
|
||||||
KIRQL oldIrql;
|
KIRQL oldIrql;
|
||||||
|
|
||||||
|
assert(Bcb);
|
||||||
|
|
||||||
DPRINT("CcRosDeleteFileCache(FileObject %x, Bcb %x)\n",
|
DPRINT("CcRosDeleteFileCache(FileObject %x, Bcb %x)\n",
|
||||||
Bcb->FileObject, Bcb);
|
Bcb->FileObject, Bcb);
|
||||||
|
|
||||||
|
@ -792,6 +813,7 @@ VOID CcRosReferenceCache(PFILE_OBJECT FileObject)
|
||||||
PBCB Bcb;
|
PBCB Bcb;
|
||||||
ExAcquireFastMutex(&ViewLock);
|
ExAcquireFastMutex(&ViewLock);
|
||||||
Bcb = (PBCB)FileObject->SectionObjectPointers->SharedCacheMap;
|
Bcb = (PBCB)FileObject->SectionObjectPointers->SharedCacheMap;
|
||||||
|
assert(Bcb);
|
||||||
Bcb->RefCount++;
|
Bcb->RefCount++;
|
||||||
ExReleaseFastMutex(&ViewLock);
|
ExReleaseFastMutex(&ViewLock);
|
||||||
}
|
}
|
||||||
|
@ -801,6 +823,7 @@ VOID CcRosDereferenceCache(PFILE_OBJECT FileObject)
|
||||||
PBCB Bcb;
|
PBCB Bcb;
|
||||||
ExAcquireFastMutex(&ViewLock);
|
ExAcquireFastMutex(&ViewLock);
|
||||||
Bcb = (PBCB)FileObject->SectionObjectPointers->SharedCacheMap;
|
Bcb = (PBCB)FileObject->SectionObjectPointers->SharedCacheMap;
|
||||||
|
assert(Bcb);
|
||||||
Bcb->RefCount--;
|
Bcb->RefCount--;
|
||||||
if (Bcb->RefCount == 0)
|
if (Bcb->RefCount == 0)
|
||||||
{
|
{
|
||||||
|
@ -816,6 +839,8 @@ CcRosReleaseFileCache(PFILE_OBJECT FileObject, PBCB Bcb)
|
||||||
* has been closed.
|
* has been closed.
|
||||||
*/
|
*/
|
||||||
{
|
{
|
||||||
|
assert(Bcb);
|
||||||
|
|
||||||
ExAcquireFastMutex(&ViewLock);
|
ExAcquireFastMutex(&ViewLock);
|
||||||
|
|
||||||
if (FileObject->SectionObjectPointers->SharedCacheMap != NULL)
|
if (FileObject->SectionObjectPointers->SharedCacheMap != NULL)
|
||||||
|
@ -889,6 +914,7 @@ CcGetFileObjectFromSectionPtrs(IN PSECTION_OBJECT_POINTERS SectionObjectPointers
|
||||||
if (SectionObjectPointers && SectionObjectPointers->SharedCacheMap)
|
if (SectionObjectPointers && SectionObjectPointers->SharedCacheMap)
|
||||||
{
|
{
|
||||||
Bcb = (PBCB)SectionObjectPointers->SharedCacheMap;
|
Bcb = (PBCB)SectionObjectPointers->SharedCacheMap;
|
||||||
|
assert(Bcb);
|
||||||
return Bcb->FileObject;
|
return Bcb->FileObject;
|
||||||
}
|
}
|
||||||
return NULL;
|
return NULL;
|
||||||
|
|
|
@ -16,7 +16,7 @@
|
||||||
* along with this program; if not, write to the Free Software
|
* along with this program; if not, write to the Free Software
|
||||||
* Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
|
* Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
|
||||||
*/
|
*/
|
||||||
/* $Id: section.c,v 1.101 2002/11/10 18:17:42 chorns Exp $
|
/* $Id: section.c,v 1.102 2002/12/15 17:01:52 chorns Exp $
|
||||||
*
|
*
|
||||||
* PROJECT: ReactOS kernel
|
* PROJECT: ReactOS kernel
|
||||||
* FILE: ntoskrnl/mm/section.c
|
* FILE: ntoskrnl/mm/section.c
|
||||||
|
@ -329,6 +329,8 @@ MiReadPage(PMEMORY_AREA MemoryArea,
|
||||||
FileObject = MemoryArea->Data.SectionData.Section->FileObject;
|
FileObject = MemoryArea->Data.SectionData.Section->FileObject;
|
||||||
Fcb = (PREACTOS_COMMON_FCB_HEADER)FileObject->FsContext;
|
Fcb = (PREACTOS_COMMON_FCB_HEADER)FileObject->FsContext;
|
||||||
|
|
||||||
|
assert(Fcb->Bcb);
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* If the file system is letting us go directly to the cache and the
|
* If the file system is letting us go directly to the cache and the
|
||||||
* memory area was mapped at an offset in the file which is page aligned
|
* memory area was mapped at an offset in the file which is page aligned
|
||||||
|
@ -2044,6 +2046,9 @@ MmCreateDataFileSection(PHANDLE SectionHandle,
|
||||||
PFILE_OBJECT FileObject;
|
PFILE_OBJECT FileObject;
|
||||||
PMM_SECTION_SEGMENT Segment;
|
PMM_SECTION_SEGMENT Segment;
|
||||||
ULONG FileAccess;
|
ULONG FileAccess;
|
||||||
|
IO_STATUS_BLOCK Iosb;
|
||||||
|
LARGE_INTEGER Offset;
|
||||||
|
CHAR Buffer;
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* Check the protection
|
* Check the protection
|
||||||
|
@ -2054,6 +2059,26 @@ MmCreateDataFileSection(PHANDLE SectionHandle,
|
||||||
return(STATUS_INVALID_PAGE_PROTECTION);
|
return(STATUS_INVALID_PAGE_PROTECTION);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/*
|
||||||
|
* Read a bit so caching is initiated for the file object.
|
||||||
|
* This is only needed because MiReadPage currently cannot
|
||||||
|
* handle non-cached streams.
|
||||||
|
*/
|
||||||
|
Offset.QuadPart = 0;
|
||||||
|
Status = ZwReadFile(FileHandle,
|
||||||
|
NULL,
|
||||||
|
NULL,
|
||||||
|
NULL,
|
||||||
|
&Iosb,
|
||||||
|
&Buffer,
|
||||||
|
sizeof (Buffer),
|
||||||
|
&Offset,
|
||||||
|
0);
|
||||||
|
if (!NT_SUCCESS(Status) && (Status != STATUS_END_OF_FILE))
|
||||||
|
{
|
||||||
|
return(Status);
|
||||||
|
}
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* Create the section
|
* Create the section
|
||||||
*/
|
*/
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue