Author: pschweitzer
Date: Tue Oct 14 10:41:42 2008
New Revision: 36749
URL:
http://svn.reactos.org/svn/reactos?rev=36749&view=rev
Log:
Apply patch by Cameron Gutman from bug #3315
This encapsulates CcInitializeCacheMap calls using SEH
Modified:
branches/pierre-fsd/drivers/filesystems/fastfat/fcb.c
branches/pierre-fsd/drivers/filesystems/fastfat/fsctl.c
branches/pierre-fsd/drivers/filesystems/fastfat/rw.c
Modified: branches/pierre-fsd/drivers/filesystems/fastfat/fcb.c
URL:
http://svn.reactos.org/svn/reactos/branches/pierre-fsd/drivers/filesystems/…
==============================================================================
--- branches/pierre-fsd/drivers/filesystems/fastfat/fcb.c [iso-8859-1] (original)
+++ branches/pierre-fsd/drivers/filesystems/fastfat/fcb.c [iso-8859-1] Tue Oct 14 10:41:42
2008
@@ -314,6 +314,7 @@
static NTSTATUS
vfatFCBInitializeCacheFromVolume (PVCB vcb, PVFATFCB fcb)
{
+ NTSTATUS Status = STATUS_SUCCESS;
PFILE_OBJECT fileObject;
PVFATCCB newCCB;
@@ -332,14 +333,27 @@
fcb->FileObject = fileObject;
fcb->RefCount++;
- CcInitializeCacheMap(fileObject,
- (PCC_FILE_SIZES)(&fcb->RFCB.AllocationSize),
- FALSE,
- &VfatGlobalData->CacheMgrCallbacks,
- fcb);
+ _SEH_TRY
+ {
+ CcInitializeCacheMap(fileObject,
+ (PCC_FILE_SIZES)(&fcb->RFCB.AllocationSize),
+ FALSE,
+ &VfatGlobalData->CacheMgrCallbacks,
+ fcb);
+ }
+ _SEH_HANDLE
+ {
+ Status = _SEH_GetExceptionCode();
+ }
+ _SEH_END;
+
+ if (!NT_SUCCESS(Status))
+ {
+ return Status;
+ }
fcb->Flags |= FCB_CACHE_INITIALIZED;
- return STATUS_SUCCESS;
+ return Status;
}
PVFATFCB
Modified: branches/pierre-fsd/drivers/filesystems/fastfat/fsctl.c
URL:
http://svn.reactos.org/svn/reactos/branches/pierre-fsd/drivers/filesystems/…
==============================================================================
--- branches/pierre-fsd/drivers/filesystems/fastfat/fsctl.c [iso-8859-1] (original)
+++ branches/pierre-fsd/drivers/filesystems/fastfat/fsctl.c [iso-8859-1] Tue Oct 14
10:41:42 2008
@@ -537,11 +537,25 @@
Fcb->RFCB.ValidDataLength = Fcb->RFCB.FileSize;
Fcb->RFCB.AllocationSize = Fcb->RFCB.FileSize;
- CcInitializeCacheMap(DeviceExt->FATFileObject,
- (PCC_FILE_SIZES)(&Fcb->RFCB.AllocationSize),
- FALSE,
- &VfatGlobalData->CacheMgrCallbacks,
- Fcb);
+ _SEH_TRY
+ {
+ CcInitializeCacheMap(DeviceExt->FATFileObject,
+ (PCC_FILE_SIZES)(&Fcb->RFCB.AllocationSize),
+ FALSE,
+ &VfatGlobalData->CacheMgrCallbacks,
+ Fcb);
+ }
+ _SEH_HANDLE
+ {
+ Status = _SEH_GetExceptionCode();
+ }
+ _SEH_END;
+
+ if (!NT_SUCCESS(Status))
+ {
+ goto ByeBye;
+ }
+
DeviceExt->LastAvailableCluster = 2;
ExInitializeResourceLite(&DeviceExt->FatResource);
Modified: branches/pierre-fsd/drivers/filesystems/fastfat/rw.c
URL:
http://svn.reactos.org/svn/reactos/branches/pierre-fsd/drivers/filesystems/…
==============================================================================
--- branches/pierre-fsd/drivers/filesystems/fastfat/rw.c [iso-8859-1] (original)
+++ branches/pierre-fsd/drivers/filesystems/fastfat/rw.c [iso-8859-1] Tue Oct 14 10:41:42
2008
@@ -671,11 +671,24 @@
CHECKPOINT;
if (IrpContext->FileObject->PrivateCacheMap == NULL)
{
- CcInitializeCacheMap(IrpContext->FileObject,
- (PCC_FILE_SIZES)(&Fcb->RFCB.AllocationSize),
- FALSE,
- &(VfatGlobalData->CacheMgrCallbacks),
- Fcb);
+ _SEH_TRY
+ {
+ CcInitializeCacheMap(IrpContext->FileObject,
+ (PCC_FILE_SIZES)(&Fcb->RFCB.AllocationSize),
+ FALSE,
+ &(VfatGlobalData->CacheMgrCallbacks),
+ Fcb);
+ }
+ _SEH_HANDLE
+ {
+ Status = _SEH_GetExceptionCode();
+ }
+ _SEH_END;
+
+ if (!NT_SUCCESS(Status))
+ {
+ goto ByeBye;
+ }
}
if (!CcCopyRead(IrpContext->FileObject, &ByteOffset, Length,
(BOOLEAN)(IrpContext->Flags & IRPCONTEXT_CANWAIT), Buffer,
@@ -964,11 +977,24 @@
if (IrpContext->FileObject->PrivateCacheMap == NULL)
{
- CcInitializeCacheMap(IrpContext->FileObject,
- (PCC_FILE_SIZES)(&Fcb->RFCB.AllocationSize),
- FALSE,
- &VfatGlobalData->CacheMgrCallbacks,
- Fcb);
+ _SEH_TRY
+ {
+ CcInitializeCacheMap(IrpContext->FileObject,
+ (PCC_FILE_SIZES)(&Fcb->RFCB.AllocationSize),
+ FALSE,
+ &(VfatGlobalData->CacheMgrCallbacks),
+ Fcb);
+ }
+ _SEH_HANDLE
+ {
+ Status = _SEH_GetExceptionCode();
+ }
+ _SEH_END;
+
+ if (!NT_SUCCESS(Status))
+ {
+ goto ByeBye;
+ }
}
if (ByteOffset.QuadPart > OldFileSize.QuadPart)
{