Windows: Call AFSExeceptionFilter for all exceptions
authorJeffrey Altman <jaltman@your-file-system.com>
Wed, 21 Aug 2013 16:27:35 +0000 (12:27 -0400)
committerJeffrey Altman <jaltman@your-file-system.com>
Fri, 30 Aug 2013 19:09:18 +0000 (12:09 -0700)
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 <buildbot@rampaginggeek.com>
Reviewed-by: Jeffrey Altman <jaltman@your-file-system.com>

src/WINNT/afsrdr/kernel/lib/AFSCleanup.cpp
src/WINNT/afsrdr/kernel/lib/AFSCreate.cpp
src/WINNT/afsrdr/kernel/lib/AFSFileInfo.cpp
src/WINNT/afsrdr/kernel/lib/AFSFlushBuffers.cpp
src/WINNT/afsrdr/kernel/lib/AFSGeneric.cpp
src/WINNT/afsrdr/kernel/lib/AFSLockControl.cpp
src/WINNT/afsrdr/kernel/lib/AFSRead.cpp
src/WINNT/afsrdr/kernel/lib/AFSWrite.cpp

index 5d61754..af150ca 100644 (file)
@@ -318,7 +318,7 @@ AFSCleanup( IN PDEVICE_OBJECT LibDeviceObject,
                                            NULL,
                                            NULL);
                }
-               __except( EXCEPTION_EXECUTE_HANDLER)
+               __except( AFSExceptionFilter( __FUNCTION__, GetExceptionCode(), GetExceptionInformation()))
                {
 
                    ntStatus = GetExceptionCode();
index 4a70c1d..8ec3d8b 100644 (file)
@@ -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;
index 18eafc3..91633ee 100644 (file)
@@ -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;
index e9cbc7f..2803f85 100644 (file)
@@ -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());
index 129f93d..88f6db7 100644 (file)
@@ -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();
index 3354bdc..05ff81c 100644 (file)
@@ -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();
index 6c5eea8..ed0b180 100644 (file)
@@ -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();
 
index f6148b9..3007a37 100644 (file)
@@ -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();