Author: pschweitzer
Date: Sun Jun 21 09:26:15 2015
New Revision: 68228
URL:
http://svn.reactos.org/svn/reactos?rev=68228&view=rev
Log:
[NTFS]
CcInitializeCacheMap can raise exceptions, wrap it into a SEH block
Modified:
trunk/reactos/drivers/filesystems/ntfs/fcb.c
trunk/reactos/drivers/filesystems/ntfs/fsctl.c
Modified: trunk/reactos/drivers/filesystems/ntfs/fcb.c
URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/drivers/filesystems/ntfs/f…
==============================================================================
--- trunk/reactos/drivers/filesystems/ntfs/fcb.c [iso-8859-1] (original)
+++ trunk/reactos/drivers/filesystems/ntfs/fcb.c [iso-8859-1] Sun Jun 21 09:26:15 2015
@@ -263,11 +263,23 @@
Fcb->Vcb = Vcb;
Status = STATUS_SUCCESS;
- CcInitializeCacheMap(FileObject,
- (PCC_FILE_SIZES)(&Fcb->RFCB.AllocationSize),
- FALSE,
- &(NtfsGlobalData->CacheMgrCallbacks),
- Fcb);
+ _SEH2_TRY
+ {
+ CcInitializeCacheMap(FileObject,
+ (PCC_FILE_SIZES)(&Fcb->RFCB.AllocationSize),
+ FALSE,
+ &(NtfsGlobalData->CacheMgrCallbacks),
+ Fcb);
+ }
+ _SEH2_EXCEPT(EXCEPTION_EXECUTE_HANDLER)
+ {
+ FileObject->FsContext2 = NULL;
+ ExFreePoolWithTag(newCCB, TAG_CCB);
+ ObDereferenceObject(FileObject);
+ Fcb->FileObject = NULL;
+ return _SEH2_GetExceptionCode();
+ }
+ _SEH2_END;
ObDereferenceObject(FileObject);
Fcb->Flags |= FCB_CACHE_INITIALIZED;
@@ -483,11 +495,21 @@
if (!(Fcb->Flags & FCB_CACHE_INITIALIZED))
{
- CcInitializeCacheMap(FileObject,
- (PCC_FILE_SIZES)(&Fcb->RFCB.AllocationSize),
- FALSE,
- &(NtfsGlobalData->CacheMgrCallbacks),
- Fcb);
+ _SEH2_TRY
+ {
+ CcInitializeCacheMap(FileObject,
+ (PCC_FILE_SIZES)(&Fcb->RFCB.AllocationSize),
+ FALSE,
+ &(NtfsGlobalData->CacheMgrCallbacks),
+ Fcb);
+ }
+ _SEH2_EXCEPT(EXCEPTION_EXECUTE_HANDLER)
+ {
+ FileObject->FsContext2 = NULL;
+ ExFreePoolWithTag(newCCB, TAG_CCB);
+ return _SEH2_GetExceptionCode();
+ }
+ _SEH2_END;
Fcb->Flags |= FCB_CACHE_INITIALIZED;
}
Modified: trunk/reactos/drivers/filesystems/ntfs/fsctl.c
URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/drivers/filesystems/ntfs/f…
==============================================================================
--- trunk/reactos/drivers/filesystems/ntfs/fsctl.c [iso-8859-1] (original)
+++ trunk/reactos/drivers/filesystems/ntfs/fsctl.c [iso-8859-1] Sun Jun 21 09:26:15 2015
@@ -495,11 +495,20 @@
// Fcb->Entry.ExtentLocationL = 0;
// Fcb->Entry.DataLengthL = DeviceExt->CdInfo.VolumeSpaceSize * BLOCKSIZE;
- CcInitializeCacheMap(Vcb->StreamFileObject,
- (PCC_FILE_SIZES)(&Fcb->RFCB.AllocationSize),
- FALSE,
- &(NtfsGlobalData->CacheMgrCallbacks),
- Fcb);
+ _SEH2_TRY
+ {
+ CcInitializeCacheMap(Vcb->StreamFileObject,
+ (PCC_FILE_SIZES)(&Fcb->RFCB.AllocationSize),
+ TRUE,
+ &(NtfsGlobalData->CacheMgrCallbacks),
+ Fcb);
+ }
+ _SEH2_EXCEPT(EXCEPTION_EXECUTE_HANDLER)
+ {
+ Status = _SEH2_GetExceptionCode();
+ goto ByeBye;
+ }
+ _SEH2_END;
ExInitializeResourceLite(&Vcb->DirResource);