Windows: More useful AFSDumpFile exception info
authorJeffrey Altman <jaltman@your-file-system.com>
Mon, 30 Apr 2012 10:22:41 +0000 (06:22 -0400)
committerJeffrey Altman <jaltman@secure-endpoints.com>
Fri, 4 May 2012 17:24:00 +0000 (10:24 -0700)
Modify AFSExceptionFilter to accept the __FUNCTION__ name
where the exception occurred.

Generate the trace dump file after the exception has been
handled so that it is possible to see where it happened
in the trace output.

Change-Id: Icddafc1066dd85b63d8d97c40c0f76c54d181ebe
Reviewed-on: http://gerrit.openafs.org/7308
Tested-by: BuildBot <buildbot@rampaginggeek.com>
Reviewed-by: Jeffrey Altman <jaltman@secure-endpoints.com>
Tested-by: Jeffrey Altman <jaltman@secure-endpoints.com>

45 files changed:
src/WINNT/afsrdr/common/AFSRedirCommonDefines.h
src/WINNT/afsrdr/kernel/fs/AFSCleanup.cpp
src/WINNT/afsrdr/kernel/fs/AFSClose.cpp
src/WINNT/afsrdr/kernel/fs/AFSCommSupport.cpp
src/WINNT/afsrdr/kernel/fs/AFSCreate.cpp
src/WINNT/afsrdr/kernel/fs/AFSDevControl.cpp
src/WINNT/afsrdr/kernel/fs/AFSDirControl.cpp
src/WINNT/afsrdr/kernel/fs/AFSEa.cpp
src/WINNT/afsrdr/kernel/fs/AFSFSControl.cpp
src/WINNT/afsrdr/kernel/fs/AFSFileInfo.cpp
src/WINNT/afsrdr/kernel/fs/AFSGeneric.cpp
src/WINNT/afsrdr/kernel/fs/AFSInit.cpp
src/WINNT/afsrdr/kernel/fs/AFSInternalDevControl.cpp
src/WINNT/afsrdr/kernel/fs/AFSLockControl.cpp
src/WINNT/afsrdr/kernel/fs/AFSQuota.cpp
src/WINNT/afsrdr/kernel/fs/AFSRDRSupport.cpp
src/WINNT/afsrdr/kernel/fs/AFSRead.cpp
src/WINNT/afsrdr/kernel/fs/AFSSecurity.cpp
src/WINNT/afsrdr/kernel/fs/AFSShutdown.cpp
src/WINNT/afsrdr/kernel/fs/AFSSystemControl.cpp
src/WINNT/afsrdr/kernel/fs/AFSVolumeInfo.cpp
src/WINNT/afsrdr/kernel/fs/AFSWrite.cpp
src/WINNT/afsrdr/kernel/fs/Include/AFSCommon.h
src/WINNT/afsrdr/kernel/lib/AFSCleanup.cpp
src/WINNT/afsrdr/kernel/lib/AFSClose.cpp
src/WINNT/afsrdr/kernel/lib/AFSCreate.cpp
src/WINNT/afsrdr/kernel/lib/AFSDevControl.cpp
src/WINNT/afsrdr/kernel/lib/AFSDirControl.cpp
src/WINNT/afsrdr/kernel/lib/AFSEa.cpp
src/WINNT/afsrdr/kernel/lib/AFSExtentsSupport.cpp
src/WINNT/afsrdr/kernel/lib/AFSFSControl.cpp
src/WINNT/afsrdr/kernel/lib/AFSFileInfo.cpp
src/WINNT/afsrdr/kernel/lib/AFSGeneric.cpp
src/WINNT/afsrdr/kernel/lib/AFSInit.cpp
src/WINNT/afsrdr/kernel/lib/AFSInternalDevControl.cpp
src/WINNT/afsrdr/kernel/lib/AFSLockControl.cpp
src/WINNT/afsrdr/kernel/lib/AFSQuota.cpp
src/WINNT/afsrdr/kernel/lib/AFSRead.cpp
src/WINNT/afsrdr/kernel/lib/AFSSecurity.cpp
src/WINNT/afsrdr/kernel/lib/AFSShutdown.cpp
src/WINNT/afsrdr/kernel/lib/AFSSystemControl.cpp
src/WINNT/afsrdr/kernel/lib/AFSVolumeInfo.cpp
src/WINNT/afsrdr/kernel/lib/AFSWorker.cpp
src/WINNT/afsrdr/kernel/lib/AFSWrite.cpp
src/WINNT/afsrdr/kernel/lib/Include/AFSCommon.h

index 26035a5..4772fad 100644 (file)
@@ -202,7 +202,6 @@ static inline void AFS_ASSERT() {
 //#define AFS_VALIDATE_EXTENTS            0
 
 static inline void AFSBreakPoint() {
-    AFSDumpTraceFilesFnc();
 #if !defined(KD_DEBUGGER_ENABLED)
 #define KD_DEBUGGER_ENABLED DBG
 #endif // KD_DEBUGGER_ENABLED
@@ -222,7 +221,7 @@ static inline void AFSBreakPoint() {
 #else
 
 static inline void AFSBreakPoint() {
-    AFSDumpTraceFilesFnc();
+    NOTHING;
 }
 
 #define AFSPrint
index 0402dac..96e7502 100644 (file)
@@ -102,12 +102,14 @@ try_exit:
 
         NOTHING;
     }
-    __except( AFSExceptionFilter( GetExceptionCode(), GetExceptionInformation()) )
+    __except( AFSExceptionFilter( __FUNCTION__, GetExceptionCode(), GetExceptionInformation()) )
     {
 
         AFSDbgLogMsg( 0,
                       0,
                       "EXCEPTION - AFSCleanup\n");
+
+        AFSDumpTraceFilesFnc();
     }
 
     return ntStatus;
index 93ae387..64e8168 100644 (file)
@@ -76,12 +76,14 @@ try_exit:
 
         NOTHING;
     }
-    __except( AFSExceptionFilter( GetExceptionCode(), GetExceptionInformation()) )
+    __except( AFSExceptionFilter( __FUNCTION__, GetExceptionCode(), GetExceptionInformation()) )
     {
 
         AFSDbgLogMsg( 0,
                       0,
                       "EXCEPTION - AFSClose\n");
+
+        AFSDumpTraceFilesFnc();
     }
 
     return ntStatus;
index 0baab22..b049a00 100644 (file)
@@ -356,9 +356,11 @@ try_exit:
                         FALSE);
         }
     }
-    __except( AFSExceptionFilter( GetExceptionCode(), GetExceptionInformation()))
+    __except( AFSExceptionFilter( __FUNCTION__, GetExceptionCode(), GetExceptionInformation()))
     {
 
+        AFSDumpTraceFilesFnc();
+
         if( bReleasePool)
         {
 
@@ -783,10 +785,12 @@ AFSProcessControlRequest( IN PIRP Irp)
 //try_exit:
 
     }
-    __except( AFSExceptionFilter( GetExceptionCode(), GetExceptionInformation()))
+    __except( AFSExceptionFilter( __FUNCTION__, GetExceptionCode(), GetExceptionInformation()))
     {
 
         ntStatus = STATUS_UNSUCCESSFUL;
+
+        AFSDumpTraceFilesFnc();
     }
 
     if( bCompleteRequest)
index 547c58b..fde3259 100644 (file)
@@ -77,7 +77,7 @@ try_exit:
 
         NOTHING;
     }
-    __except( AFSExceptionFilter( GetExceptionCode(), GetExceptionInformation()) )
+    __except( AFSExceptionFilter( __FUNCTION__, GetExceptionCode(), GetExceptionInformation()) )
     {
 
         AFSDbgLogMsg( 0,
@@ -85,6 +85,8 @@ try_exit:
                       "EXCEPTION - AFSCreate\n");
 
         ntStatus = STATUS_ACCESS_DENIED;
+
+        AFSDumpTraceFilesFnc();
     }
 
     return ntStatus;
index 31c2957..3c764d9 100644 (file)
@@ -78,12 +78,14 @@ try_exit:
 
         NOTHING;
     }
-    __except( AFSExceptionFilter( GetExceptionCode(), GetExceptionInformation()) )
+    __except( AFSExceptionFilter( __FUNCTION__, GetExceptionCode(), GetExceptionInformation()) )
     {
 
         AFSDbgLogMsg( 0,
                       0,
                       "EXCEPTION - AFSDevControl\n");
+
+        AFSDumpTraceFilesFnc();
     }
 
     return ntStatus;
index c4e2ff6..0f9f952 100644 (file)
@@ -107,12 +107,14 @@ try_exit:
 
         NOTHING;
     }
-    __except( AFSExceptionFilter( GetExceptionCode(), GetExceptionInformation()) )
+    __except( AFSExceptionFilter( __FUNCTION__, GetExceptionCode(), GetExceptionInformation()) )
     {
 
         AFSDbgLogMsg( 0,
                       0,
                       "EXCEPTION - AFSDirControl\n");
+
+        AFSDumpTraceFilesFnc();
     }
 
     return ntStatus;
index adf9066..4c5a377 100644 (file)
@@ -103,12 +103,14 @@ try_exit:
 
         NOTHING;
     }
-    __except( AFSExceptionFilter( GetExceptionCode(), GetExceptionInformation()) )
+    __except( AFSExceptionFilter( __FUNCTION__, GetExceptionCode(), GetExceptionInformation()) )
     {
 
         AFSDbgLogMsg( 0,
                       0,
                       "EXCEPTION - AFSQueryEA\n");
+
+        AFSDumpTraceFilesFnc();
     }
 
     return ntStatus;
@@ -179,12 +181,14 @@ try_exit:
 
         NOTHING;
     }
-    __except( AFSExceptionFilter( GetExceptionCode(), GetExceptionInformation()) )
+    __except( AFSExceptionFilter( __FUNCTION__, GetExceptionCode(), GetExceptionInformation()) )
     {
 
         AFSDbgLogMsg( 0,
                       0,
                       "EXCEPTION - AFSSetEA\n");
+
+        AFSDumpTraceFilesFnc();
     }
 
     return ntStatus;
index d2a4868..f00eec0 100644 (file)
@@ -96,12 +96,14 @@ try_exit:
 
         NOTHING;
     }
-    __except( AFSExceptionFilter( GetExceptionCode(), GetExceptionInformation()) )
+    __except( AFSExceptionFilter( __FUNCTION__, GetExceptionCode(), GetExceptionInformation()) )
     {
 
         AFSDbgLogMsg( 0,
                       0,
                       "EXCEPTION - AFSFSControl\n");
+
+        AFSDumpTraceFilesFnc();
     }
 
     return ntStatus;
index cc3c950..9d3d921 100644 (file)
@@ -124,7 +124,7 @@ try_exit:
 
         NOTHING;
     }
-    __except( AFSExceptionFilter( GetExceptionCode(), GetExceptionInformation()) )
+    __except( AFSExceptionFilter( __FUNCTION__, GetExceptionCode(), GetExceptionInformation()) )
     {
 
         AFSDbgLogMsg( 0,
@@ -132,6 +132,8 @@ try_exit:
                       "EXCEPTION - AFSQueryFileInfo\n");
 
         ntStatus = STATUS_UNSUCCESSFUL;
+
+        AFSDumpTraceFilesFnc();
     }
 
     return ntStatus;
@@ -225,7 +227,7 @@ try_exit:
 
         NOTHING;
     }
-    __except( AFSExceptionFilter( GetExceptionCode(), GetExceptionInformation()) )
+    __except( AFSExceptionFilter( __FUNCTION__, GetExceptionCode(), GetExceptionInformation()) )
     {
 
         AFSDbgLogMsg( 0,
@@ -233,6 +235,8 @@ try_exit:
                       "EXCEPTION - AFSSetFileInfo\n");
 
         ntStatus = STATUS_UNSUCCESSFUL;
+
+        AFSDumpTraceFilesFnc();
     }
 
     return ntStatus;
index b92444f..e526077 100644 (file)
@@ -51,7 +51,8 @@
 //
 
 ULONG
-AFSExceptionFilter( IN ULONG Code,
+AFSExceptionFilter( IN CHAR *FunctionString,
+                    IN ULONG Code,
                     IN PEXCEPTION_POINTERS ExceptPtrs)
 {
 
@@ -67,11 +68,13 @@ AFSExceptionFilter( IN ULONG Code,
 
         AFSDbgLogMsg( 0,
                       0,
-                      "AFSExceptionFilter (Framework) - EXR %p CXR %p Code %08lX Address %p\n",
+                      "AFSExceptionFilter (Framework) - EXR %p CXR %p Function %s Code %08lX Address %p Routine %p\n",
                       ExceptRec,
                       Context,
+                      FunctionString,
                       ExceptRec->ExceptionCode,
-                      ExceptRec->ExceptionAddress);
+                      ExceptRec->ExceptionAddress,
+                      (void *)AFSExceptionFilter);
 
         DbgPrint("**** Exception Caught in AFS Redirector ****\n");
 
index 5ad3ba0..83e22f7 100644 (file)
@@ -520,12 +520,14 @@ try_exit:
             ExDeleteResourceLite( &AFSDbgLogLock);
         }
     }
-    __except( AFSExceptionFilter( GetExceptionCode(), GetExceptionInformation()) )
+    __except( AFSExceptionFilter( __FUNCTION__, GetExceptionCode(), GetExceptionInformation()) )
     {
 
         AFSDbgLogMsg( 0,
                       0,
                       "EXCEPTION - AFSRedirFs DriverEntry\n");
+
+        AFSDumpTraceFilesFnc();
     }
 
     return ntStatus;
index 1853912..d966f25 100644 (file)
@@ -55,12 +55,14 @@ AFSInternalDevControl( IN PDEVICE_OBJECT DeviceObject,
                             ntStatus);
 
     }
-    __except( AFSExceptionFilter( GetExceptionCode(), GetExceptionInformation()) )
+    __except( AFSExceptionFilter( __FUNCTION__, GetExceptionCode(), GetExceptionInformation()) )
     {
 
         AFSDbgLogMsg( 0,
                       0,
                       "EXCEPTION - AFSInternalDevControl\n");
+
+        AFSDumpTraceFilesFnc();
     }
 
     return ntStatus;
index c4a6184..3de4fae 100644 (file)
@@ -93,13 +93,15 @@ try_exit:
 
         NOTHING;
     }
-    __except( AFSExceptionFilter( (ntStatus = GetExceptionCode()), GetExceptionInformation()))
+    __except( AFSExceptionFilter( __FUNCTION__, (ntStatus = GetExceptionCode()), GetExceptionInformation()))
     {
 
         AFSDbgLogMsg( 0,
                       0,
                       "EXCEPTION - AFSLockControl\n");
 
+        AFSDumpTraceFilesFnc();
+
         AFSCompleteRequest( Irp,
                             ntStatus);
     }
index 423f200..7d139c5 100644 (file)
@@ -60,12 +60,14 @@ AFSQueryQuota( IN PDEVICE_OBJECT DeviceObject,
                             ntStatus);
 
     }
-    __except( AFSExceptionFilter( GetExceptionCode(), GetExceptionInformation()) )
+    __except( AFSExceptionFilter( __FUNCTION__, GetExceptionCode(), GetExceptionInformation()) )
     {
 
         AFSDbgLogMsg( 0,
                       0,
                       "EXCEPTION - AFSQueryQuota\n");
+
+        AFSDumpTraceFilesFnc();
     }
 
     return ntStatus;
@@ -92,12 +94,14 @@ AFSSetQuota( IN PDEVICE_OBJECT DeviceObject,
         AFSCompleteRequest( Irp,
                             ntStatus);
     }
-    __except( AFSExceptionFilter( GetExceptionCode(), GetExceptionInformation()) )
+    __except( AFSExceptionFilter( __FUNCTION__, GetExceptionCode(), GetExceptionInformation()) )
     {
 
         AFSDbgLogMsg( 0,
                       0,
                       "EXCEPTION - AFSSetQuota\n");
+
+        AFSDumpTraceFilesFnc();
     }
 
     return ntStatus;
index 31d1e34..45ad910 100644 (file)
@@ -532,8 +532,11 @@ AFSInitializeRedirector( IN AFSRedirectorInitInfo *RedirInitInfo)
                     pDevExt->Specific.RDR.CacheBaseAddress = MmGetSystemAddressForMdlSafe( pDevExt->Specific.RDR.CacheMdl,
                                                                                            NormalPagePriority);
                 }
-                __except( AFSExceptionFilter( GetExceptionCode(), GetExceptionInformation()) )
+                __except( AFSExceptionFilter( __FUNCTION__, GetExceptionCode(), GetExceptionInformation()) )
                 {
+
+                    AFSDumpTraceFilesFnc();
+
                     IoFreeMdl( pDevExt->Specific.RDR.CacheMdl);
                     pDevExt->Specific.RDR.CacheMdl = NULL;
                 }
index 877813e..6e987b4 100644 (file)
@@ -101,9 +101,11 @@ try_exit:
 
         NOTHING;
     }
-    __except( AFSExceptionFilter( GetExceptionCode(), GetExceptionInformation()) )
+    __except( AFSExceptionFilter( __FUNCTION__, GetExceptionCode(), GetExceptionInformation()) )
     {
 
+        AFSDumpTraceFilesFnc();
+
         ntStatus = STATUS_INSUFFICIENT_RESOURCES;
     }
 
index b4a33e3..d531aa9 100644 (file)
@@ -120,12 +120,14 @@ try_exit:
 
         NOTHING;
     }
-    __except( AFSExceptionFilter( GetExceptionCode(), GetExceptionInformation()) )
+    __except( AFSExceptionFilter( __FUNCTION__, GetExceptionCode(), GetExceptionInformation()) )
     {
 
         AFSDbgLogMsg( 0,
                       0,
                       "EXCEPTION - AFSSetSecurity\n");
+
+        AFSDumpTraceFilesFnc();
     }
 
     return ntStatus;
@@ -213,12 +215,14 @@ try_exit:
 
         NOTHING;
     }
-    __except( AFSExceptionFilter( GetExceptionCode(), GetExceptionInformation()) )
+    __except( AFSExceptionFilter( __FUNCTION__, GetExceptionCode(), GetExceptionInformation()) )
     {
 
         AFSDbgLogMsg( 0,
                       0,
                       "EXCEPTION - AFSQuerySecurity\n");
+
+        AFSDumpTraceFilesFnc();
     }
 
     return ntStatus;
index 4fb66bf..5e6fd9e 100644 (file)
@@ -78,12 +78,14 @@ AFSShutdown( IN PDEVICE_OBJECT DeviceObject,
         AFSCompleteRequest( Irp,
                             ntStatus);
     }
-    __except( AFSExceptionFilter( GetExceptionCode(), GetExceptionInformation()) )
+    __except( AFSExceptionFilter( __FUNCTION__, GetExceptionCode(), GetExceptionInformation()) )
     {
 
         AFSDbgLogMsg( 0,
                       0,
                       "EXCEPTION - AFSShutdown\n");
+
+        AFSDumpTraceFilesFnc();
     }
 
     return ntStatus;
index b80c2ad..63817f3 100644 (file)
@@ -60,12 +60,14 @@ AFSSystemControl( IN PDEVICE_OBJECT DeviceObject,
                             ntStatus);
 
     }
-    __except( AFSExceptionFilter( GetExceptionCode(), GetExceptionInformation()) )
+    __except( AFSExceptionFilter( __FUNCTION__, GetExceptionCode(), GetExceptionInformation()) )
     {
 
         AFSDbgLogMsg( 0,
                       0,
                       "EXCEPTION - AFSSystemControl\n");
+
+        AFSDumpTraceFilesFnc();
     }
 
     return ntStatus;
index 9abf890..485713d 100644 (file)
@@ -97,12 +97,14 @@ try_exit:
 
         NOTHING;
     }
-    __except( AFSExceptionFilter( GetExceptionCode(), GetExceptionInformation()) )
+    __except( AFSExceptionFilter( __FUNCTION__, GetExceptionCode(), GetExceptionInformation()) )
     {
 
         AFSDbgLogMsg( 0,
                       0,
                       "EXCEPTION - AFSQueryVolumeInfo\n");
+
+        AFSDumpTraceFilesFnc();
     }
 
     return ntStatus;
@@ -129,12 +131,14 @@ AFSSetVolumeInfo( IN PDEVICE_OBJECT DeviceObject,
                             ntStatus);
 
     }
-    __except( AFSExceptionFilter( GetExceptionCode(), GetExceptionInformation()) )
+    __except( AFSExceptionFilter( __FUNCTION__, GetExceptionCode(), GetExceptionInformation()) )
     {
 
         AFSDbgLogMsg( 0,
                       0,
                       "EXCEPTION - AFSSetVolumeInfo\n");
+
+        AFSDumpTraceFilesFnc();
     }
 
     return ntStatus;
index d2cfead..3420587 100644 (file)
@@ -105,10 +105,12 @@ try_exit:
 
         NOTHING;
     }
-    __except( AFSExceptionFilter( GetExceptionCode(), GetExceptionInformation()) )
+    __except( AFSExceptionFilter( __FUNCTION__, GetExceptionCode(), GetExceptionInformation()) )
     {
 
         ntStatus = STATUS_INSUFFICIENT_RESOURCES;
+
+        AFSDumpTraceFilesFnc();
     }
 
     return ntStatus;
index 75300b5..5ae8604 100644 (file)
@@ -400,7 +400,8 @@ AFSSetQuota( IN PDEVICE_OBJECT DeviceObject,
 //
 
 ULONG
-AFSExceptionFilter( IN ULONG Code,
+AFSExceptionFilter( IN CHAR *FunctionString,
+                    IN ULONG Code,
                     IN PEXCEPTION_POINTERS ExceptPtrs);
 
 BOOLEAN
index 612e499..342c338 100644 (file)
@@ -1351,12 +1351,14 @@ try_exit:
 
         AFSCompleteRequest( Irp, ntStatus);
     }
-    __except( AFSExceptionFilter( GetExceptionCode(), GetExceptionInformation()) )
+    __except( AFSExceptionFilter( __FUNCTION__, GetExceptionCode(), GetExceptionInformation()) )
     {
 
         AFSDbgLogMsg( 0,
                       0,
                       "EXCEPTION - AFSCleanup\n");
+
+        AFSDumpTraceFilesFnc();
     }
 
     return ntStatus;
index 469ba51..62bcb21 100644 (file)
@@ -686,12 +686,14 @@ try_exit:
         AFSCompleteRequest( Irp,
                             ntStatus);
     }
-    __except( AFSExceptionFilter( GetExceptionCode(), GetExceptionInformation()) )
+    __except( AFSExceptionFilter( __FUNCTION__, GetExceptionCode(), GetExceptionInformation()) )
     {
 
         AFSDbgLogMsg( 0,
                       0,
                       "EXCEPTION - AFSClose\n");
+
+        AFSDumpTraceFilesFnc();
     }
 
     return ntStatus;
index 388495c..3bb9e5f 100644 (file)
@@ -99,7 +99,7 @@ try_exit:
 
         NOTHING;
     }
-    __except( AFSExceptionFilter( GetExceptionCode(), GetExceptionInformation()) )
+    __except( AFSExceptionFilter( __FUNCTION__, GetExceptionCode(), GetExceptionInformation()) )
     {
 
         AFSDbgLogMsg( 0,
@@ -107,6 +107,8 @@ try_exit:
                       "EXCEPTION - AFSCreate\n");
 
         ntStatus = STATUS_ACCESS_DENIED;
+
+        AFSDumpTraceFilesFnc();
     }
 
     //
index 3464552..627195e 100644 (file)
@@ -427,10 +427,12 @@ AFSDevControl( IN PDEVICE_OBJECT LibDeviceObject,
 //try_exit:
 
     }
-    __except( AFSExceptionFilter( GetExceptionCode(), GetExceptionInformation()))
+    __except( AFSExceptionFilter( __FUNCTION__, GetExceptionCode(), GetExceptionInformation()))
     {
 
         ntStatus = STATUS_UNSUCCESSFUL;
+
+        AFSDumpTraceFilesFnc();
     }
 
     Irp->IoStatus.Status = ntStatus;
index cb89958..e7346f2 100644 (file)
@@ -89,12 +89,14 @@ AFSDirControl( IN PDEVICE_OBJECT LibDeviceObject,
                 break;
         }
     }
-    __except( AFSExceptionFilter( GetExceptionCode(), GetExceptionInformation()) )
+    __except( AFSExceptionFilter( __FUNCTION__, GetExceptionCode(), GetExceptionInformation()) )
     {
 
         AFSDbgLogMsg( 0,
                       0,
                       "EXCEPTION - AFSDirControl\n");
+
+        AFSDumpTraceFilesFnc();
     }
 
     if( ntStatus != STATUS_PENDING)
index 94fa398..49ff0cc 100644 (file)
@@ -71,12 +71,14 @@ AFSQueryEA( IN PDEVICE_OBJECT LibDeviceObject,
                             ntStatus);
 
     }
-    __except( AFSExceptionFilter( GetExceptionCode(), GetExceptionInformation()) )
+    __except( AFSExceptionFilter( __FUNCTION__, GetExceptionCode(), GetExceptionInformation()) )
     {
 
         AFSDbgLogMsg( 0,
                       0,
                       "EXCEPTION - AFSQueryEA\n");
+
+        AFSDumpTraceFilesFnc();
     }
 
     return ntStatus;
@@ -115,12 +117,14 @@ AFSSetEA( IN PDEVICE_OBJECT LibDeviceObject,
                             ntStatus);
 
     }
-    __except( AFSExceptionFilter( GetExceptionCode(), GetExceptionInformation()) )
+    __except( AFSExceptionFilter( __FUNCTION__, GetExceptionCode(), GetExceptionInformation()) )
     {
 
         AFSDbgLogMsg( 0,
                       0,
                       "EXCEPTION - AFSSetEA\n");
+
+        AFSDumpTraceFilesFnc();
     }
 
     return ntStatus;
index b482378..05610d3 100644 (file)
@@ -668,12 +668,14 @@ BOOLEAN AFSDoExtentsMapRegion(IN AFSFcb *Fcb,
                 entry = newEntry;
             }
         }
-        __except( AFSExceptionFilter( GetExceptionCode(), GetExceptionInformation()) )
+        __except( AFSExceptionFilter( __FUNCTION__, GetExceptionCode(), GetExceptionInformation()) )
         {
 
             AFSDbgLogMsg( 0,
                           0,
                           "EXCEPTION - AFSDoExtentsMapRegion\n");
+
+            AFSDumpTraceFilesFnc();
         }
 
 try_exit:
@@ -3604,12 +3606,14 @@ AFSMarkDirty( IN AFSFcb *Fcb,
             ulCount++;
         }
     }
-    __except( AFSExceptionFilter( GetExceptionCode(), GetExceptionInformation()) )
+    __except( AFSExceptionFilter( __FUNCTION__, GetExceptionCode(), GetExceptionInformation()) )
     {
 
         AFSDbgLogMsg( 0,
                       0,
                       "EXCEPTION - AFSMarkDirty\n");
+
+        AFSDumpTraceFilesFnc();
     }
 
     AFSReleaseResource( &pNPFcb->Specific.File.DirtyExtentsListLock);
@@ -4382,12 +4386,14 @@ AFSSetupMD5Hash( IN AFSFcb *Fcb,
                           PsGetCurrentThread());
 
         }
-        __except( AFSExceptionFilter( GetExceptionCode(), GetExceptionInformation()) )
+        __except( AFSExceptionFilter( __FUNCTION__, GetExceptionCode(), GetExceptionInformation()) )
         {
 
             AFSDbgLogMsg( 0,
                           0,
                           "EXCEPTION - AFSSetupMD5Hash\n");
+
+            AFSDumpTraceFilesFnc();
         }
 
         AFSReleaseResource( &Fcb->NPFcb->Specific.File.ExtentsResource );
index b5768a9..6715c95 100644 (file)
@@ -77,12 +77,14 @@ AFSFSControl( IN PDEVICE_OBJECT LibDeviceObject,
                               ntStatus);
 
     }
-    __except( AFSExceptionFilter( GetExceptionCode(), GetExceptionInformation()) )
+    __except( AFSExceptionFilter( __FUNCTION__, GetExceptionCode(), GetExceptionInformation()) )
     {
 
         AFSDbgLogMsg( 0,
                       0,
                       "EXCEPTION - AFSFSControl\n");
+
+        AFSDumpTraceFilesFnc();
     }
 
     return ntStatus;
index 6311a9d..4a53c50 100644 (file)
@@ -441,13 +441,15 @@ try_exit:
             }
         }
     }
-    __except( AFSExceptionFilter( GetExceptionCode(), GetExceptionInformation()) )
+    __except( AFSExceptionFilter( __FUNCTION__, GetExceptionCode(), GetExceptionInformation()) )
     {
 
         AFSDbgLogMsg( 0,
                       0,
                       "EXCEPTION - AFSQueryFileInfo\n");
 
+        AFSDumpTraceFilesFnc();
+
         ntStatus = STATUS_UNSUCCESSFUL;
 
         if( bReleaseMain)
@@ -739,13 +741,15 @@ try_exit:
             }
         }
     }
-    __except( AFSExceptionFilter( GetExceptionCode(), GetExceptionInformation()) )
+    __except( AFSExceptionFilter( __FUNCTION__, GetExceptionCode(), GetExceptionInformation()) )
     {
 
         AFSDbgLogMsg( 0,
                       0,
                       "EXCEPTION - AFSSetFileInfo\n");
 
+        AFSDumpTraceFilesFnc();
+
         ntStatus = STATUS_UNSUCCESSFUL;
 
         if( bReleaseMain)
index 0dca9fd..e25dc98 100644 (file)
@@ -51,7 +51,8 @@
 //
 
 ULONG
-AFSExceptionFilter( IN ULONG Code,
+AFSExceptionFilter( IN CHAR *FunctionString,
+                    IN ULONG Code,
                     IN PEXCEPTION_POINTERS ExceptPtrs)
 {
 
@@ -67,9 +68,10 @@ AFSExceptionFilter( IN ULONG Code,
 
         AFSDbgLogMsg( 0,
                       0,
-                      "AFSExceptionFilter (Library) - EXR %p CXR %p Code %08lX Address %p Routine %p\n",
+                      "AFSExceptionFilter (Library) - EXR %p CXR %p Function %s Code %08lX Address %p Routine %p\n",
                       ExceptRec,
                       Context,
+                      FunctionString,
                       ExceptRec->ExceptionCode,
                       ExceptRec->ExceptionAddress,
                       (void *)AFSExceptionFilter);
@@ -403,9 +405,11 @@ AFSLockSystemBuffer( IN PIRP Irp,
                 pAddress = MmGetSystemAddressForMdlSafe( Irp->MdlAddress, NormalPagePriority );
 
             }
-            __except( AFSExceptionFilter( GetExceptionCode(), GetExceptionInformation()) )
+            __except( AFSExceptionFilter( __FUNCTION__, GetExceptionCode(), GetExceptionInformation()) )
             {
 
+                AFSDumpTraceFilesFnc();
+
                 IoFreeMdl( Irp->MdlAddress );
                 Irp->MdlAddress = NULL;
                 pAddress = NULL;
@@ -455,9 +459,11 @@ AFSLockUserBuffer( IN void *UserBuffer,
             pAddress = MmGetSystemAddressForMdlSafe( pMdl,
                                                      NormalPagePriority);
         }
-        __except( AFSExceptionFilter( GetExceptionCode(), GetExceptionInformation()) )
+        __except( AFSExceptionFilter( __FUNCTION__, GetExceptionCode(), GetExceptionInformation()) )
         {
 
+            AFSDumpTraceFilesFnc();
+
             IoFreeMdl( pMdl);
             pMdl = NULL;
             pAddress = NULL;
index 98a5941..d8f3aff 100644 (file)
@@ -286,10 +286,12 @@ try_exit:
             }
         }
     }
-    __except( AFSExceptionFilter( GetExceptionCode(), GetExceptionInformation()) )
+    __except( AFSExceptionFilter( __FUNCTION__, GetExceptionCode(), GetExceptionInformation()) )
     {
 
         AFSPrint( "EXCEPTION - AFS DriverEntry\n");
+
+        AFSDumpTraceFilesFnc();
     }
 
     return ntStatus;
index 64e5e9c..363216d 100644 (file)
@@ -55,12 +55,14 @@ AFSInternalDevControl( IN PDEVICE_OBJECT LibDeviceObject,
                             ntStatus);
 
     }
-    __except( AFSExceptionFilter( GetExceptionCode(), GetExceptionInformation()) )
+    __except( AFSExceptionFilter( __FUNCTION__, GetExceptionCode(), GetExceptionInformation()) )
     {
 
         AFSDbgLogMsg( 0,
                       0,
                       "EXCEPTION - AFSInternalDevControl\n");
+
+        AFSDumpTraceFilesFnc();
     }
 
     return ntStatus;
index e54cb00..1545967 100644 (file)
@@ -299,13 +299,15 @@ try_exit:
                                 ntStatus);
         }
     }
-    __except( AFSExceptionFilter( GetExceptionCode(), GetExceptionInformation()))
+    __except( AFSExceptionFilter( __FUNCTION__, GetExceptionCode(), GetExceptionInformation()))
     {
 
         AFSDbgLogMsg( 0,
                       0,
                       "EXCEPTION - AFSLockControl\n");
 
+        AFSDumpTraceFilesFnc();
+
         //
         // Again, there is little point in failing this request but pass back some type of failure status
         //
index ab8a0dd..7816de6 100644 (file)
@@ -60,12 +60,14 @@ AFSQueryQuota( IN PDEVICE_OBJECT LibDeviceObject,
                             ntStatus);
 
     }
-    __except( AFSExceptionFilter( GetExceptionCode(), GetExceptionInformation()) )
+    __except( AFSExceptionFilter( __FUNCTION__, GetExceptionCode(), GetExceptionInformation()) )
     {
 
         AFSDbgLogMsg( 0,
                       0,
                       "EXCEPTION - AFSQueryQuota\n");
+
+        AFSDumpTraceFilesFnc();
     }
 
     return ntStatus;
@@ -92,12 +94,14 @@ AFSSetQuota( IN PDEVICE_OBJECT DeviceObject,
         AFSCompleteRequest( Irp,
                             ntStatus);
     }
-    __except( AFSExceptionFilter( GetExceptionCode(), GetExceptionInformation()) )
+    __except( AFSExceptionFilter( __FUNCTION__, GetExceptionCode(), GetExceptionInformation()) )
     {
 
         AFSDbgLogMsg( 0,
                       0,
                       "EXCEPTION - AFSSetQuota\n");
+
+        AFSDumpTraceFilesFnc();
     }
 
     return ntStatus;
index 660e90f..e0ac614 100644 (file)
@@ -785,10 +785,12 @@ AFSRead( IN PDEVICE_OBJECT LibDeviceObject,
 
         ntStatus = AFSCommonRead( AFSRDRDeviceObject, Irp, NULL);
     }
-    __except( AFSExceptionFilter( GetExceptionCode(), GetExceptionInformation()) )
+    __except( AFSExceptionFilter( __FUNCTION__, GetExceptionCode(), GetExceptionInformation()) )
     {
 
         ntStatus = STATUS_INSUFFICIENT_RESOURCES;
+
+        AFSDumpTraceFilesFnc();
     }
 
     return ntStatus;
index 5b178b6..c15d32b 100644 (file)
@@ -59,12 +59,14 @@ AFSSetSecurity( IN PDEVICE_OBJECT LibDeviceObject,
         AFSCompleteRequest( Irp,
                             ntStatus);
     }
-    __except( AFSExceptionFilter( GetExceptionCode(), GetExceptionInformation()) )
+    __except( AFSExceptionFilter( __FUNCTION__, GetExceptionCode(), GetExceptionInformation()) )
     {
 
         AFSDbgLogMsg( 0,
                       0,
                       "EXCEPTION - AFSSetSecurity\n");
+
+        AFSDumpTraceFilesFnc();
     }
 
     return ntStatus;
@@ -144,12 +146,14 @@ try_exit:
             IoFreeMdl( pUserBufferMdl);
         }
     }
-    __except( AFSExceptionFilter( GetExceptionCode(), GetExceptionInformation()) )
+    __except( AFSExceptionFilter( __FUNCTION__, GetExceptionCode(), GetExceptionInformation()) )
     {
 
         AFSDbgLogMsg( 0,
                       0,
                       "EXCEPTION - AFSQuerySecurity\n");
+
+        AFSDumpTraceFilesFnc();
     }
 
     AFSCompleteRequest( Irp,
index 9bf6f67..230f8af 100644 (file)
@@ -62,12 +62,14 @@ AFSShutdown( IN PDEVICE_OBJECT LibDeviceObject,
         AFSCompleteRequest( Irp,
                             ntStatus);
     }
-    __except( AFSExceptionFilter( GetExceptionCode(), GetExceptionInformation()) )
+    __except( AFSExceptionFilter( __FUNCTION__, GetExceptionCode(), GetExceptionInformation()) )
     {
 
         AFSDbgLogMsg( 0,
                       0,
                       "EXCEPTION - AFSShutdown\n");
+
+        AFSDumpTraceFilesFnc();
     }
 
     return ntStatus;
index 109e065..6afcd95 100644 (file)
@@ -60,12 +60,14 @@ AFSSystemControl( IN PDEVICE_OBJECT LibDeviceObject,
                             ntStatus);
 
     }
-    __except( AFSExceptionFilter( GetExceptionCode(), GetExceptionInformation()) )
+    __except( AFSExceptionFilter( __FUNCTION__, GetExceptionCode(), GetExceptionInformation()) )
     {
 
         AFSDbgLogMsg( 0,
                       0,
                       "EXCEPTION - AFSSystemControl\n");
+
+        AFSDumpTraceFilesFnc();
     }
 
     return ntStatus;
index 33e174b..6d6343f 100644 (file)
@@ -203,12 +203,14 @@ try_exit:
                             ntStatus);
 
     }
-    __except( AFSExceptionFilter( GetExceptionCode(), GetExceptionInformation()) )
+    __except( AFSExceptionFilter( __FUNCTION__, GetExceptionCode(), GetExceptionInformation()) )
     {
 
         AFSDbgLogMsg( 0,
                       0,
                       "EXCEPTION - AFSQueryVolumeInfo\n");
+
+        AFSDumpTraceFilesFnc();
     }
 
     return ntStatus;
@@ -235,12 +237,14 @@ AFSSetVolumeInfo( IN PDEVICE_OBJECT DeviceObject,
                             ntStatus);
 
     }
-    __except( AFSExceptionFilter( GetExceptionCode(), GetExceptionInformation()) )
+    __except( AFSExceptionFilter( __FUNCTION__, GetExceptionCode(), GetExceptionInformation()) )
     {
 
         AFSDbgLogMsg( 0,
                       0,
                       "EXCEPTION - AFSSetVolumeInfo\n");
+
+        AFSDumpTraceFilesFnc();
     }
 
     return ntStatus;
index ac83818..64b9ada 100644 (file)
@@ -2249,12 +2249,14 @@ try_exit:
                           "AFSQueueFlushExtents Failed to queue request Status %08lX\n", ntStatus);
         }
     }
-    __except( AFSExceptionFilter( GetExceptionCode(), GetExceptionInformation()) )
+    __except( AFSExceptionFilter( __FUNCTION__, GetExceptionCode(), GetExceptionInformation()) )
     {
 
         AFSDbgLogMsg( 0,
                       0,
                       "EXCEPTION - AFSQueueFlushExtents\n");
+
+        AFSDumpTraceFilesFnc();
     }
 
     return ntStatus;
@@ -2333,12 +2335,14 @@ try_exit:
                           "AFSQueueAsyncRead Failed to queue request Status %08lX\n", ntStatus);
         }
     }
-    __except( AFSExceptionFilter( GetExceptionCode(), GetExceptionInformation()) )
+    __except( AFSExceptionFilter( __FUNCTION__, GetExceptionCode(), GetExceptionInformation()) )
     {
 
         AFSDbgLogMsg( 0,
                       0,
                       "EXCEPTION - AFSQueueAsyncRead\n");
+
+        AFSDumpTraceFilesFnc();
     }
 
     return ntStatus;
@@ -2417,12 +2421,14 @@ try_exit:
                           "AFSQueueAsyncWrite Failed to queue request Status %08lX\n", ntStatus);
         }
     }
-    __except( AFSExceptionFilter( GetExceptionCode(), GetExceptionInformation()) )
+    __except( AFSExceptionFilter( __FUNCTION__, GetExceptionCode(), GetExceptionInformation()) )
     {
 
         AFSDbgLogMsg( 0,
                       0,
                       "EXCEPTION - AFSQueueAsyncWrite\n");
+
+        AFSDumpTraceFilesFnc();
     }
 
     return ntStatus;
@@ -2487,12 +2493,14 @@ try_exit:
                           ntStatus);
         }
     }
-    __except( AFSExceptionFilter( GetExceptionCode(), GetExceptionInformation()) )
+    __except( AFSExceptionFilter( __FUNCTION__, GetExceptionCode(), GetExceptionInformation()) )
     {
 
         AFSDbgLogMsg( 0,
                       0,
                       "EXCEPTION - AFSQueueGlobalRootEnumeration\n");
+
+        AFSDumpTraceFilesFnc();
     }
 
     return ntStatus;
@@ -2591,12 +2599,14 @@ try_exit:
             }
         }
     }
-    __except( AFSExceptionFilter( GetExceptionCode(), GetExceptionInformation()) )
+    __except( AFSExceptionFilter( __FUNCTION__, GetExceptionCode(), GetExceptionInformation()) )
     {
 
         AFSDbgLogMsg( 0,
                       0,
                       "EXCEPTION - AFSQueueStartIos\n");
+
+        AFSDumpTraceFilesFnc();
     }
 
     return ntStatus;
@@ -2665,12 +2675,14 @@ try_exit:
                           ntStatus);
         }
     }
-    __except( AFSExceptionFilter( GetExceptionCode(), GetExceptionInformation()) )
+    __except( AFSExceptionFilter( __FUNCTION__, GetExceptionCode(), GetExceptionInformation()) )
     {
 
         AFSDbgLogMsg( 0,
                       0,
                       "EXCEPTION - AFSQueueInvalidateObject\n");
+
+        AFSDumpTraceFilesFnc();
     }
 
     return ntStatus;
index e4db03a..177c6cf 100644 (file)
@@ -81,7 +81,7 @@ AFSWrite( IN PDEVICE_OBJECT LibDeviceObject,
 
         ntStatus = AFSCommonWrite( AFSRDRDeviceObject, Irp, NULL);
     }
-    __except( AFSExceptionFilter( GetExceptionCode(), GetExceptionInformation()) )
+    __except( AFSExceptionFilter( __FUNCTION__, GetExceptionCode(), GetExceptionInformation()) )
     {
 
         ntStatus = STATUS_INSUFFICIENT_RESOURCES;
index f98494e..39cb790 100644 (file)
@@ -1043,7 +1043,8 @@ AFSSetQuota( IN PDEVICE_OBJECT DeviceObject,
 //
 
 ULONG
-AFSExceptionFilter( IN ULONG Code,
+AFSExceptionFilter( IN CHAR *FunctionString,
+                    IN ULONG Code,
                     IN PEXCEPTION_POINTERS ExceptPtrs);
 
 BOOLEAN