From cd07888265f372bb380ee68495e645f174586119 Mon Sep 17 00:00:00 2001 From: Jeffrey Altman Date: Wed, 21 Aug 2013 12:27:35 -0400 Subject: [PATCH] Windows: Call AFSExeceptionFilter for all exceptions In many cases we capture exceptions record and the Exception Code as ntStatus and move on with life. This patchset changes that. All exceptions are passed to AFSExceptionFilter so we do not miss anything. Change-Id: I4bc8836047a8735becf2f9efaca2a6fa7749b3ca Reviewed-on: http://gerrit.openafs.org/10180 Tested-by: BuildBot Reviewed-by: Jeffrey Altman --- src/WINNT/afsrdr/kernel/lib/AFSCleanup.cpp | 2 +- src/WINNT/afsrdr/kernel/lib/AFSCreate.cpp | 4 ++-- src/WINNT/afsrdr/kernel/lib/AFSFileInfo.cpp | 8 ++++---- src/WINNT/afsrdr/kernel/lib/AFSFlushBuffers.cpp | 2 +- src/WINNT/afsrdr/kernel/lib/AFSGeneric.cpp | 20 ++++++++++---------- src/WINNT/afsrdr/kernel/lib/AFSLockControl.cpp | 4 ++-- src/WINNT/afsrdr/kernel/lib/AFSRead.cpp | 8 ++++---- src/WINNT/afsrdr/kernel/lib/AFSWrite.cpp | 8 ++++---- 8 files changed, 28 insertions(+), 28 deletions(-) diff --git a/src/WINNT/afsrdr/kernel/lib/AFSCleanup.cpp b/src/WINNT/afsrdr/kernel/lib/AFSCleanup.cpp index 5d61754..af150ca 100644 --- a/src/WINNT/afsrdr/kernel/lib/AFSCleanup.cpp +++ b/src/WINNT/afsrdr/kernel/lib/AFSCleanup.cpp @@ -318,7 +318,7 @@ AFSCleanup( IN PDEVICE_OBJECT LibDeviceObject, NULL, NULL); } - __except( EXCEPTION_EXECUTE_HANDLER) + __except( AFSExceptionFilter( __FUNCTION__, GetExceptionCode(), GetExceptionInformation())) { ntStatus = GetExceptionCode(); diff --git a/src/WINNT/afsrdr/kernel/lib/AFSCreate.cpp b/src/WINNT/afsrdr/kernel/lib/AFSCreate.cpp index 4a70c1d..8ec3d8b 100644 --- a/src/WINNT/afsrdr/kernel/lib/AFSCreate.cpp +++ b/src/WINNT/afsrdr/kernel/lib/AFSCreate.cpp @@ -3033,7 +3033,7 @@ AFSProcessOpen( IN PIRP Irp, bMmFlushed = MmFlushImageSection( &pObjectInfo->Fcb->NPFcb->SectionObjectPointers, MmFlushForWrite); } - __except( EXCEPTION_EXECUTE_HANDLER) + __except( AFSExceptionFilter( __FUNCTION__, GetExceptionCode(), GetExceptionInformation())) { bMmFlushed = FALSE; @@ -3537,7 +3537,7 @@ AFSProcessOverwriteSupersede( IN PDEVICE_OBJECT DeviceObject, bUserMapped = !MmCanFileBeTruncated( &pObjectInfo->Fcb->NPFcb->SectionObjectPointers, &liZero); } - __except( EXCEPTION_EXECUTE_HANDLER) + __except( AFSExceptionFilter( __FUNCTION__, GetExceptionCode(), GetExceptionInformation())) { bUserMapped = FALSE; diff --git a/src/WINNT/afsrdr/kernel/lib/AFSFileInfo.cpp b/src/WINNT/afsrdr/kernel/lib/AFSFileInfo.cpp index 18eafc3..91633ee 100644 --- a/src/WINNT/afsrdr/kernel/lib/AFSFileInfo.cpp +++ b/src/WINNT/afsrdr/kernel/lib/AFSFileInfo.cpp @@ -2255,7 +2255,7 @@ AFSSetDispositionInfo( IN PIRP Irp, } } } - __except( EXCEPTION_EXECUTE_HANDLER) + __except( AFSExceptionFilter( __FUNCTION__, GetExceptionCode(), GetExceptionInformation())) { bMmFlushed = FALSE; @@ -3488,7 +3488,7 @@ AFSSetRenameInfo( IN PIRP Irp) &uniTargetName)); } } - __except( EXCEPTION_EXECUTE_HANDLER) + __except( AFSExceptionFilter( __FUNCTION__, GetExceptionCode(), GetExceptionInformation())) { ntStatus = GetExceptionCode(); @@ -3660,7 +3660,7 @@ AFSSetAllocationInfo( IN PIRP Irp, bUserMapped = !MmCanFileBeTruncated( pFileObject->SectionObjectPointer, &pBuffer->AllocationSize); } - __except( EXCEPTION_EXECUTE_HANDLER) + __except( AFSExceptionFilter( __FUNCTION__, GetExceptionCode(), GetExceptionInformation())) { bUserMapped = FALSE; @@ -3886,7 +3886,7 @@ AFSSetEndOfFileInfo( IN PIRP Irp, bUserMapped = !MmCanFileBeTruncated( pFileObject->SectionObjectPointer, &pBuffer->EndOfFile); } - __except( EXCEPTION_EXECUTE_HANDLER) + __except( AFSExceptionFilter( __FUNCTION__, GetExceptionCode(), GetExceptionInformation())) { bUserMapped = FALSE; diff --git a/src/WINNT/afsrdr/kernel/lib/AFSFlushBuffers.cpp b/src/WINNT/afsrdr/kernel/lib/AFSFlushBuffers.cpp index e9cbc7f..2803f85 100644 --- a/src/WINNT/afsrdr/kernel/lib/AFSFlushBuffers.cpp +++ b/src/WINNT/afsrdr/kernel/lib/AFSFlushBuffers.cpp @@ -124,7 +124,7 @@ AFSFlushBuffers( IN PDEVICE_OBJECT LibDeviceObject, try_return( ntStatus = iosb.Status ); } } - __except( EXCEPTION_EXECUTE_HANDLER) + __except( AFSExceptionFilter( __FUNCTION__, GetExceptionCode(), GetExceptionInformation())) { try_return( ntStatus = GetExceptionCode()); diff --git a/src/WINNT/afsrdr/kernel/lib/AFSGeneric.cpp b/src/WINNT/afsrdr/kernel/lib/AFSGeneric.cpp index 129f93d..88f6db7 100644 --- a/src/WINNT/afsrdr/kernel/lib/AFSGeneric.cpp +++ b/src/WINNT/afsrdr/kernel/lib/AFSGeneric.cpp @@ -1919,7 +1919,7 @@ AFSInvalidateObject( IN OUT AFSObjectInfoCB **ppObjectInfo, } } } - __except( EXCEPTION_EXECUTE_HANDLER) + __except( AFSExceptionFilter( __FUNCTION__, GetExceptionCode(), GetExceptionInformation())) { ntStatus = GetExceptionCode(); @@ -3111,7 +3111,7 @@ AFSVerifyEntry( IN GUID *AuthGroup, } } } - __except( EXCEPTION_EXECUTE_HANDLER) + __except( AFSExceptionFilter( __FUNCTION__, GetExceptionCode(), GetExceptionInformation())) { ntStatus = GetExceptionCode(); @@ -3200,7 +3200,7 @@ AFSVerifyEntry( IN GUID *AuthGroup, (PCC_FILE_SIZES)&pObjectInfo->Fcb->Header.AllocationSize); } } - __except( EXCEPTION_EXECUTE_HANDLER) + __except( AFSExceptionFilter( __FUNCTION__, GetExceptionCode(), GetExceptionInformation())) { ntStatus = GetExceptionCode(); @@ -4264,7 +4264,7 @@ AFSValidateEntry( IN AFSDirectoryCB *DirEntry, } } } - __except( EXCEPTION_EXECUTE_HANDLER) + __except( AFSExceptionFilter( __FUNCTION__, GetExceptionCode(), GetExceptionInformation())) { ntStatus = GetExceptionCode(); @@ -4381,7 +4381,7 @@ AFSValidateEntry( IN AFSDirectoryCB *DirEntry, (PCC_FILE_SIZES)&pObjectInfo->Fcb->Header.AllocationSize); } } - __except( EXCEPTION_EXECUTE_HANDLER) + __except( AFSExceptionFilter( __FUNCTION__, GetExceptionCode(), GetExceptionInformation())) { ntStatus = GetExceptionCode(); @@ -6926,7 +6926,7 @@ AFSCleanupFcb( IN AFSFcb *Fcb, } } } - __except( EXCEPTION_EXECUTE_HANDLER) + __except( AFSExceptionFilter( __FUNCTION__, GetExceptionCode(), GetExceptionInformation())) { ntStatus = GetExceptionCode(); @@ -7093,7 +7093,7 @@ AFSCleanupFcb( IN AFSFcb *Fcb, } } } - __except( EXCEPTION_EXECUTE_HANDLER) + __except( AFSExceptionFilter( __FUNCTION__, GetExceptionCode(), GetExceptionInformation())) { ntStatus = GetExceptionCode(); @@ -9146,7 +9146,7 @@ AFSPerformObjectInvalidate( IN AFSObjectInfoCB *ObjectInfo, bCleanExtents = TRUE; } } - __except( EXCEPTION_EXECUTE_HANDLER) + __except( AFSExceptionFilter( __FUNCTION__, GetExceptionCode(), GetExceptionInformation())) { ntStatus = GetExceptionCode(); @@ -9265,7 +9265,7 @@ AFSPerformObjectInvalidate( IN AFSObjectInfoCB *ObjectInfo, bCleanExtents = TRUE; } } - __except( EXCEPTION_EXECUTE_HANDLER) + __except( AFSExceptionFilter( __FUNCTION__, GetExceptionCode(), GetExceptionInformation())) { ntStatus = GetExceptionCode(); @@ -9507,7 +9507,7 @@ AFSPerformObjectInvalidate( IN AFSObjectInfoCB *ObjectInfo, } } } - __except( EXCEPTION_EXECUTE_HANDLER) + __except( AFSExceptionFilter( __FUNCTION__, GetExceptionCode(), GetExceptionInformation())) { ntStatus = GetExceptionCode(); diff --git a/src/WINNT/afsrdr/kernel/lib/AFSLockControl.cpp b/src/WINNT/afsrdr/kernel/lib/AFSLockControl.cpp index 3354bdc..05ff81c 100644 --- a/src/WINNT/afsrdr/kernel/lib/AFSLockControl.cpp +++ b/src/WINNT/afsrdr/kernel/lib/AFSLockControl.cpp @@ -185,7 +185,7 @@ AFSLockControl( IN PDEVICE_OBJECT LibDeviceObject, 0, &stIoStatus); } - __except( EXCEPTION_EXECUTE_HANDLER) + __except( AFSExceptionFilter( __FUNCTION__, GetExceptionCode(), GetExceptionInformation())) { ntStatus = GetExceptionCode(); @@ -271,7 +271,7 @@ AFSLockControl( IN PDEVICE_OBJECT LibDeviceObject, pIrpSp->Parameters.LockControl.Length->LowPart, &stIoStatus); } - __except( EXCEPTION_EXECUTE_HANDLER) + __except( AFSExceptionFilter( __FUNCTION__, GetExceptionCode(), GetExceptionInformation())) { ntStatus = GetExceptionCode(); diff --git a/src/WINNT/afsrdr/kernel/lib/AFSRead.cpp b/src/WINNT/afsrdr/kernel/lib/AFSRead.cpp index 6c5eea8..ed0b180 100644 --- a/src/WINNT/afsrdr/kernel/lib/AFSRead.cpp +++ b/src/WINNT/afsrdr/kernel/lib/AFSRead.cpp @@ -128,7 +128,7 @@ AFSCachedRead( IN PDEVICE_OBJECT DeviceObject, try_return( ntStatus = Irp->IoStatus.Status); } } - __except( EXCEPTION_EXECUTE_HANDLER) + __except( AFSExceptionFilter( __FUNCTION__, GetExceptionCode(), GetExceptionInformation())) { ntStatus = GetExceptionCode(); @@ -1155,7 +1155,7 @@ AFSCommonRead( IN PDEVICE_OBJECT DeviceObject, try_return( ntStatus = STATUS_SUCCESS ); } - __except( EXCEPTION_EXECUTE_HANDLER) + __except( AFSExceptionFilter( __FUNCTION__, GetExceptionCode(), GetExceptionInformation())) { ntStatus = GetExceptionCode(); @@ -1339,7 +1339,7 @@ AFSCommonRead( IN PDEVICE_OBJECT DeviceObject, CcSetDirtyPageThreshold( pFileObject, AFS_DIRTY_CHUNK_THRESHOLD * pDeviceExt->Specific.RDR.MaximumRPCLength / 4096); } - __except( EXCEPTION_EXECUTE_HANDLER) + __except( AFSExceptionFilter( __FUNCTION__, GetExceptionCode(), GetExceptionInformation())) { ntStatus = GetExceptionCode(); @@ -1376,7 +1376,7 @@ AFSCommonRead( IN PDEVICE_OBJECT DeviceObject, &Irp->IoStatus); ntStatus = Irp->IoStatus.Status; } - __except( EXCEPTION_EXECUTE_HANDLER) + __except( AFSExceptionFilter( __FUNCTION__, GetExceptionCode(), GetExceptionInformation())) { ntStatus = GetExceptionCode(); diff --git a/src/WINNT/afsrdr/kernel/lib/AFSWrite.cpp b/src/WINNT/afsrdr/kernel/lib/AFSWrite.cpp index f6148b9..3007a37 100644 --- a/src/WINNT/afsrdr/kernel/lib/AFSWrite.cpp +++ b/src/WINNT/afsrdr/kernel/lib/AFSWrite.cpp @@ -386,7 +386,7 @@ AFSCommonWrite( IN PDEVICE_OBJECT DeviceObject, CcSetDirtyPageThreshold( pFileObject, AFS_DIRTY_CHUNK_THRESHOLD * pDeviceExt->Specific.RDR.MaximumRPCLength / 4096); } - __except( EXCEPTION_EXECUTE_HANDLER) + __except( AFSExceptionFilter( __FUNCTION__, GetExceptionCode(), GetExceptionInformation())) { ntStatus = GetExceptionCode(); @@ -779,7 +779,7 @@ try_exit: SetFlag( pFcb->Flags, AFS_FCB_FLAG_PURGE_ON_CLOSE); } } - __except( EXCEPTION_EXECUTE_HANDLER) + __except( AFSExceptionFilter( __FUNCTION__, GetExceptionCode(), GetExceptionInformation())) { DWORD ntStatus2 = GetExceptionCode(); @@ -1792,7 +1792,7 @@ AFSCachedWrite( IN PDEVICE_OBJECT DeviceObject, ntStatus = Irp->IoStatus.Status; } - __except( EXCEPTION_EXECUTE_HANDLER) + __except( AFSExceptionFilter( __FUNCTION__, GetExceptionCode(), GetExceptionInformation())) { ntStatus = GetExceptionCode(); @@ -1890,7 +1890,7 @@ AFSCachedWrite( IN PDEVICE_OBJECT DeviceObject, try_return( ntStatus = STATUS_UNSUCCESSFUL); } } - __except( EXCEPTION_EXECUTE_HANDLER) + __except( AFSExceptionFilter( __FUNCTION__, GetExceptionCode(), GetExceptionInformation())) { ntStatus = GetExceptionCode(); -- 1.9.4