Windows: Replace AFSDbgMsgLog func with macro
authorpete scott <pscott@kerneldrivers.com>
Wed, 13 Mar 2013 13:54:00 +0000 (07:54 -0600)
committerJeffrey Altman <jaltman@your-file-system.com>
Mon, 18 Mar 2013 21:23:43 +0000 (14:23 -0700)
In order to reduce computation overhead when trace logging is not
active replace the AFSDbgMsgLog function call with a macro,
AFSDbgTrace.

Change-Id: I7bccee0ddffcd8488f81fcebbb970aa15c8dc52e
Reviewed-on: http://gerrit.openafs.org/9621
Reviewed-by: Peter Scott <pscott@kerneldrivers.com>
Tested-by: BuildBot <buildbot@rampaginggeek.com>
Reviewed-by: Jeffrey Altman <jaltman@your-file-system.com>
Tested-by: Jeffrey Altman <jaltman@your-file-system.com>

62 files changed:
src/WINNT/afsrdr/common/AFSRedirCommonDefines.h
src/WINNT/afsrdr/common/AFSRedirCommonStructs.h
src/WINNT/afsrdr/common/AFSUserIoctl.h
src/WINNT/afsrdr/kernel/fs/AFSAuthGroupSupport.cpp
src/WINNT/afsrdr/kernel/fs/AFSBTreeSupport.cpp
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/AFSData.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/AFSFastIoSupport.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/AFSLibrarySupport.cpp
src/WINNT/afsrdr/kernel/fs/AFSLockControl.cpp
src/WINNT/afsrdr/kernel/fs/AFSLogSupport.cpp
src/WINNT/afsrdr/kernel/fs/AFSNetworkProviderSupport.cpp
src/WINNT/afsrdr/kernel/fs/AFSProcessSupport.cpp
src/WINNT/afsrdr/kernel/fs/AFSQuota.cpp
src/WINNT/afsrdr/kernel/fs/AFSRDRSupport.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/fs/Include/AFSExtern.h
src/WINNT/afsrdr/kernel/lib/AFSBTreeSupport.cpp
src/WINNT/afsrdr/kernel/lib/AFSCleanup.cpp
src/WINNT/afsrdr/kernel/lib/AFSClose.cpp
src/WINNT/afsrdr/kernel/lib/AFSCommSupport.cpp
src/WINNT/afsrdr/kernel/lib/AFSCreate.cpp
src/WINNT/afsrdr/kernel/lib/AFSData.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/AFSFcbSupport.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/AFSInternalDevControl.cpp
src/WINNT/afsrdr/kernel/lib/AFSIoSupport.cpp
src/WINNT/afsrdr/kernel/lib/AFSLockControl.cpp
src/WINNT/afsrdr/kernel/lib/AFSNameSupport.cpp
src/WINNT/afsrdr/kernel/lib/AFSNetworkProviderSupport.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/AFSExtern.h

index a5b08f2..6e5ea40 100644 (file)
@@ -233,6 +233,11 @@ static inline void AFSBreakPoint() {
 
 #endif
 
+#define AFSDbgTrace(X) \
+{ \
+    PAFSDbgLogMsg pTraceFnc = AFSDebugTraceFnc; \
+    if( pTraceFnc != NULL) { pTraceFnc X;} \
+}
 //
 // Library control device name
 //
index a79b5c8..5da3ce9 100644 (file)
@@ -829,6 +829,12 @@ typedef struct _AFS_LIBRARY_INIT_CB
 
 } AFSLibraryInitCB;
 
+typedef struct _AFS_TRACE_CONFIG_CB
+{
+
+    PAFSDbgLogMsg       AFSDbgLogMsg;
+
+} AFSDebugTraceConfigCB;
 
 #endif
 
index dd5a7e3..3599899 100644 (file)
@@ -92,4 +92,6 @@
 
 #define IOCTL_AFS_AUTHGROUP_LOGON_CREATE        CTL_CODE( FILE_DEVICE_DISK_FILE_SYSTEM, 0x101A, METHOD_BUFFERED, FILE_ANY_ACCESS)
 
+#define IOCTL_AFS_CONFIG_LIBRARY_TRACE          CTL_CODE( FILE_DEVICE_DISK_FILE_SYSTEM, 0x101B, METHOD_BUFFERED, FILE_ANY_ACCESS)
+
 #endif /* _AFS_USER_IOCTL_H */
\ No newline at end of file
index a2cd557..9373571 100644 (file)
@@ -61,22 +61,22 @@ AFSRetrieveAuthGroup( IN ULONGLONG ProcessId,
         if( ulSessionId == (ULONG)-1)
         {
 
-            AFSDbgLogMsg( AFS_SUBSYSTEM_AUTHGROUP_PROCESSING,
+            AFSDbgTrace(( AFS_SUBSYSTEM_AUTHGROUP_PROCESSING,
                           AFS_TRACE_LEVEL_ERROR,
                           "%s Failed to retrieve session ID for PID %I64X\n",
                           __FUNCTION__,
-                          ProcessId);
+                          ProcessId));
 
             try_return( ntStatus = STATUS_INSUFFICIENT_RESOURCES);
         }
 
-        AFSDbgLogMsg( AFS_SUBSYSTEM_AUTHGROUP_PROCESSING,
+        AFSDbgTrace(( AFS_SUBSYSTEM_AUTHGROUP_PROCESSING,
                       AFS_TRACE_LEVEL_VERBOSE,
                       "%s Entry for Session %08lX PID %I64X TID %I64X\n",
                       __FUNCTION__,
                       ulSessionId,
                       ProcessId,
-                      ThreadId);
+                      ThreadId));
 
         ntStatus = AFSCheckThreadDacl( AuthGroup);
 
@@ -90,14 +90,14 @@ AFSRetrieveAuthGroup( IN ULONGLONG ProcessId,
             RtlStringFromGUID( *AuthGroup,
                                &uniGUIDString);
 
-            AFSDbgLogMsg( AFS_SUBSYSTEM_AUTHGROUP_PROCESSING,
+            AFSDbgTrace(( AFS_SUBSYSTEM_AUTHGROUP_PROCESSING,
                           AFS_TRACE_LEVEL_VERBOSE,
                           "%s Located AuthGroup %wZ via DACL for Session %08lX PID %I64X TID %I64X\n",
                           __FUNCTION__,
                           &uniGUIDString,
                           ulSessionId,
                           ProcessId,
-                          ThreadId);
+                          ThreadId));
 
             if( uniGUIDString.Buffer != NULL)
             {
@@ -107,11 +107,11 @@ AFSRetrieveAuthGroup( IN ULONGLONG ProcessId,
             try_return( ntStatus = STATUS_SUCCESS);
         }
 
-        AFSDbgLogMsg( AFS_SUBSYSTEM_LOCK_PROCESSING,
+        AFSDbgTrace(( AFS_SUBSYSTEM_LOCK_PROCESSING,
                       AFS_TRACE_LEVEL_VERBOSE,
                       "AFSRetrieveAuthGroup Acquiring Control ProcessTree.TreeLock lock %p SHARED %08lX\n",
                       pDeviceExt->Specific.Control.ProcessTree.TreeLock,
-                      PsGetCurrentThread());
+                      PsGetCurrentThread()));
 
         ntStatus = STATUS_SUCCESS;
 
@@ -126,13 +126,13 @@ AFSRetrieveAuthGroup( IN ULONGLONG ProcessId,
             pProcessCB == NULL)
         {
 
-            AFSDbgLogMsg( AFS_SUBSYSTEM_AUTHGROUP_PROCESSING,
+            AFSDbgTrace(( AFS_SUBSYSTEM_AUTHGROUP_PROCESSING,
                           AFS_TRACE_LEVEL_ERROR,
                           "%s Failed to locate process entry for Session %08lX PID %I64X TID %I64X\n",
                           __FUNCTION__,
                           ulSessionId,
                           ProcessId,
-                          ThreadId);
+                          ThreadId));
 
             AFSReleaseResource( pDeviceExt->Specific.Control.ProcessTree.TreeLock);
 
@@ -166,14 +166,14 @@ AFSRetrieveAuthGroup( IN ULONGLONG ProcessId,
             RtlStringFromGUID( *AuthGroup,
                                &uniGUIDString);
 
-            AFSDbgLogMsg( AFS_SUBSYSTEM_AUTHGROUP_PROCESSING,
+            AFSDbgTrace(( AFS_SUBSYSTEM_AUTHGROUP_PROCESSING,
                           AFS_TRACE_LEVEL_VERBOSE,
                           "%s Located AuthGroup %wZ in thread Session %08lX PID %I64X TID %I64X\n",
                           __FUNCTION__,
                           &uniGUIDString,
                           ulSessionId,
                           ProcessId,
-                          ThreadId);
+                          ThreadId));
 
             if( uniGUIDString.Buffer != NULL)
             {
@@ -196,14 +196,14 @@ AFSRetrieveAuthGroup( IN ULONGLONG ProcessId,
             RtlStringFromGUID( *AuthGroup,
                                &uniGUIDString);
 
-            AFSDbgLogMsg( AFS_SUBSYSTEM_AUTHGROUP_PROCESSING,
+            AFSDbgTrace(( AFS_SUBSYSTEM_AUTHGROUP_PROCESSING,
                           AFS_TRACE_LEVEL_VERBOSE,
                           "%s Located AuthGroup %wZ in process Session %08lX PID %I64X TID %I64X\n",
                           __FUNCTION__,
                           &uniGUIDString,
                           ulSessionId,
                           ProcessId,
-                          ThreadId);
+                          ThreadId));
 
             if( uniGUIDString.Buffer != NULL)
             {
@@ -217,13 +217,13 @@ AFSRetrieveAuthGroup( IN ULONGLONG ProcessId,
             AFSIsNoPAGAuthGroup( pAuthGroup))
         {
 
-            AFSDbgLogMsg( AFS_SUBSYSTEM_AUTHGROUP_PROCESSING,
+            AFSDbgTrace(( AFS_SUBSYSTEM_AUTHGROUP_PROCESSING,
                           AFS_TRACE_LEVEL_VERBOSE,
                           "%s No AuthGroup located, validating process for Session %08lX PID %I64X TID %I64X\n",
                           __FUNCTION__,
                           ulSessionId,
                           ProcessId,
-                          ThreadId);
+                          ThreadId));
 
             pAuthGroup = AFSValidateProcessEntry( PsGetCurrentProcessId(),
                                                   FALSE);
@@ -241,14 +241,14 @@ AFSRetrieveAuthGroup( IN ULONGLONG ProcessId,
                 RtlStringFromGUID( *AuthGroup,
                                    &uniGUIDString);
 
-                AFSDbgLogMsg( AFS_SUBSYSTEM_AUTHGROUP_PROCESSING,
+                AFSDbgTrace(( AFS_SUBSYSTEM_AUTHGROUP_PROCESSING,
                               AFS_TRACE_LEVEL_VERBOSE,
                               "%s Located AuthGroup %wZ after validation Session %08lX PID %I64X TID %I64X\n",
                               __FUNCTION__,
                               &uniGUIDString,
                               ulSessionId,
                               ProcessId,
-                              ThreadId);
+                              ThreadId));
 
                 if( uniGUIDString.Buffer != NULL)
                 {
@@ -257,13 +257,13 @@ AFSRetrieveAuthGroup( IN ULONGLONG ProcessId,
             }
             else
             {
-                AFSDbgLogMsg( AFS_SUBSYSTEM_AUTHGROUP_PROCESSING,
+                AFSDbgTrace(( AFS_SUBSYSTEM_AUTHGROUP_PROCESSING,
                               AFS_TRACE_LEVEL_ERROR,
                               "%s Failed to locate AuthGroup for Session %08lX PID %I64X TID %I64X\n",
                               __FUNCTION__,
                               ulSessionId,
                               ProcessId,
-                              ThreadId);
+                              ThreadId));
             }
         }
 
@@ -300,11 +300,11 @@ AFSIsLocalSystemAuthGroup( IN GUID *AuthGroup)
         RtlStringFromGUID( *AuthGroup,
                            &uniGUIDString);
 
-        AFSDbgLogMsg( AFS_SUBSYSTEM_AUTHGROUP_PROCESSING,
+        AFSDbgTrace(( AFS_SUBSYSTEM_AUTHGROUP_PROCESSING,
                       AFS_TRACE_LEVEL_VERBOSE_2,
                       "%s Checking AuthGroup %wZ\n",
                       __FUNCTION__,
-                      &uniGUIDString);
+                      &uniGUIDString));
 
         AFSAcquireShared( pDeviceExt->Specific.Control.ProcessTree.TreeLock,
                           TRUE);
@@ -318,11 +318,11 @@ AFSIsLocalSystemAuthGroup( IN GUID *AuthGroup)
         {
             bIsLocalSys = TRUE;
 
-            AFSDbgLogMsg( AFS_SUBSYSTEM_AUTHGROUP_PROCESSING,
+            AFSDbgTrace(( AFS_SUBSYSTEM_AUTHGROUP_PROCESSING,
                           AFS_TRACE_LEVEL_VERBOSE,
                           "%s AuthGroup %wZ is LOCAL SYSTEM\n",
                           __FUNCTION__,
-                          &uniGUIDString);
+                          &uniGUIDString));
         }
 
         AFSReleaseResource( pDeviceExt->Specific.Control.ProcessTree.TreeLock);
@@ -356,12 +356,12 @@ AFSIsLocalSystemSID( IN UNICODE_STRING *SIDString)
             bIsLocalSys = TRUE;
         }
 
-        AFSDbgLogMsg( AFS_SUBSYSTEM_AUTHGROUP_PROCESSING,
+        AFSDbgTrace(( AFS_SUBSYSTEM_AUTHGROUP_PROCESSING,
                       AFS_TRACE_LEVEL_VERBOSE_2,
                       "%s AuthGroup SID %wZ is %sLOCAL SYSTEM\n",
                       __FUNCTION__,
                       SIDString,
-                      bIsLocalSys ? "" : "not ");
+                      bIsLocalSys ? "" : "not "));
     }
 
     return bIsLocalSys;
@@ -391,12 +391,12 @@ AFSIsNoPAGAuthGroup( IN GUID *AuthGroup)
             bIsNoPAG = TRUE;
         }
 
-        AFSDbgLogMsg( AFS_SUBSYSTEM_AUTHGROUP_PROCESSING,
+        AFSDbgTrace(( AFS_SUBSYSTEM_AUTHGROUP_PROCESSING,
                       AFS_TRACE_LEVEL_VERBOSE_2,
                       "%s AuthGroup %wZ is %sNoPAG\n",
                       __FUNCTION__,
                       &uniGUIDString,
-                      bIsNoPAG ? "" : "not ");
+                      bIsNoPAG ? "" : "not "));
 
         if( uniGUIDString.Buffer != NULL)
         {
@@ -450,11 +450,11 @@ AFSCreateSetProcessAuthGroup( AFSAuthGroupRequestCB *CreateSetAuthGroup)
             pProcessCB == NULL)
         {
 
-            AFSDbgLogMsg( AFS_SUBSYSTEM_AUTHGROUP_PROCESSING,
+            AFSDbgTrace(( AFS_SUBSYSTEM_AUTHGROUP_PROCESSING,
                           AFS_TRACE_LEVEL_ERROR,
                           "%s Failed to locate process CB for PID %I64X\n",
                           __FUNCTION__,
-                          ullProcessID);
+                          ullProcessID));
 
             AFSReleaseResource( pDeviceExt->Specific.Control.ProcessTree.TreeLock);
             try_return( ntStatus = STATUS_UNSUCCESSFUL);
@@ -470,22 +470,22 @@ AFSCreateSetProcessAuthGroup( AFSAuthGroupRequestCB *CreateSetAuthGroup)
         if( !NT_SUCCESS( ntStatus))
         {
 
-            AFSDbgLogMsg( AFS_SUBSYSTEM_AUTHGROUP_PROCESSING,
+            AFSDbgTrace(( AFS_SUBSYSTEM_AUTHGROUP_PROCESSING,
                           AFS_TRACE_LEVEL_ERROR,
                           "%s Failed to locate caller SID for PID %I64X Status %08lX\n",
                           __FUNCTION__,
                           ullProcessID,
-                          ntStatus);
+                          ntStatus));
 
             try_return( ntStatus);
         }
 
-        AFSDbgLogMsg( AFS_SUBSYSTEM_AUTHGROUP_PROCESSING,
+        AFSDbgTrace(( AFS_SUBSYSTEM_AUTHGROUP_PROCESSING,
                       AFS_TRACE_LEVEL_VERBOSE,
                       "%s Retrieved caller SID %wZ for PID %I64X\n",
                       __FUNCTION__,
                       &uniCallerSID,
-                      ullProcessID);
+                      ullProcessID));
 
 
         if( CreateSetAuthGroup->SIDLength != 0)
@@ -496,12 +496,12 @@ AFSCreateSetProcessAuthGroup( AFSAuthGroupRequestCB *CreateSetAuthGroup)
 
             uniPassedSIDString.Buffer = CreateSetAuthGroup->SIDString;
 
-            AFSDbgLogMsg( AFS_SUBSYSTEM_AUTHGROUP_PROCESSING,
+            AFSDbgTrace(( AFS_SUBSYSTEM_AUTHGROUP_PROCESSING,
                           AFS_TRACE_LEVEL_VERBOSE,
                           "%s Validating passed SID %wZ for PID %I64X\n",
                           __FUNCTION__,
                           &uniPassedSIDString,
-                          ullProcessID);
+                          ullProcessID));
 
             if( RtlCompareUnicodeString( &uniCallerSID,
                                          &uniPassedSIDString,
@@ -511,47 +511,47 @@ AFSCreateSetProcessAuthGroup( AFSAuthGroupRequestCB *CreateSetAuthGroup)
                 if( !BooleanFlagOn( pProcessCB->Flags, AFS_PROCESS_LOCAL_SYSTEM_AUTH))
                 {
 
-                    AFSDbgLogMsg( AFS_SUBSYSTEM_AUTHGROUP_PROCESSING,
+                    AFSDbgTrace(( AFS_SUBSYSTEM_AUTHGROUP_PROCESSING,
                                   AFS_TRACE_LEVEL_ERROR,
                                   "%s Caller specified SID %wZ for PID %I64X but caller is not LOCAL SYSTEM AUTHORITY\n",
                                   __FUNCTION__,
                                   &uniPassedSIDString,
-                                  ullProcessID);
+                                  ullProcessID));
 
                     try_return( ntStatus = STATUS_ACCESS_DENIED);
                 }
 
                 uniSIDString = uniPassedSIDString;
 
-                AFSDbgLogMsg( AFS_SUBSYSTEM_AUTHGROUP_PROCESSING,
+                AFSDbgTrace(( AFS_SUBSYSTEM_AUTHGROUP_PROCESSING,
                               AFS_TRACE_LEVEL_VERBOSE,
                               "%s Using passed SID %wZ for PID %I64X\n",
                               __FUNCTION__,
                               &uniSIDString,
-                              ullProcessID);
+                              ullProcessID));
             }
             else
             {
                 uniSIDString = uniCallerSID;
 
-                AFSDbgLogMsg( AFS_SUBSYSTEM_AUTHGROUP_PROCESSING,
+                AFSDbgTrace(( AFS_SUBSYSTEM_AUTHGROUP_PROCESSING,
                               AFS_TRACE_LEVEL_VERBOSE,
                               "%s Caller and passed SID are equal SID %wZ for PID %I64X\n",
                               __FUNCTION__,
                               &uniSIDString,
-                              ullProcessID);
+                              ullProcessID));
             }
         }
         else
         {
             uniSIDString = uniCallerSID;
 
-            AFSDbgLogMsg( AFS_SUBSYSTEM_AUTHGROUP_PROCESSING,
+            AFSDbgTrace(( AFS_SUBSYSTEM_AUTHGROUP_PROCESSING,
                           AFS_TRACE_LEVEL_VERBOSE,
                           "%s No SID passed, using callers SID %wZ for PID %I64X\n",
                           __FUNCTION__,
                           &uniSIDString,
-                          ullProcessID);
+                          ullProcessID));
         }
 
         ntStatus = RtlHashUnicodeString( &uniSIDString,
@@ -562,13 +562,13 @@ AFSCreateSetProcessAuthGroup( AFSAuthGroupRequestCB *CreateSetAuthGroup)
         if( !NT_SUCCESS( ntStatus))
         {
 
-            AFSDbgLogMsg( AFS_SUBSYSTEM_AUTHGROUP_PROCESSING,
+            AFSDbgTrace(( AFS_SUBSYSTEM_AUTHGROUP_PROCESSING,
                           AFS_TRACE_LEVEL_ERROR,
                           "%s Failed to hash SID %wZ for PID %I64X Status %08lX\n",
                           __FUNCTION__,
                           &uniSIDString,
                           ullProcessID,
-                          ntStatus);
+                          ntStatus));
 
             try_return( ntStatus);
         }
@@ -578,12 +578,12 @@ AFSCreateSetProcessAuthGroup( AFSAuthGroupRequestCB *CreateSetAuthGroup)
         if( ulSessionId == (ULONG)-1)
         {
 
-            AFSDbgLogMsg( AFS_SUBSYSTEM_AUTHGROUP_PROCESSING,
+            AFSDbgTrace(( AFS_SUBSYSTEM_AUTHGROUP_PROCESSING,
                           AFS_TRACE_LEVEL_ERROR,
                           "%s Failed to retrieve SessionID PID %I64X Status %08lX\n",
                           __FUNCTION__,
                           ullProcessID,
-                          ntStatus);
+                          ntStatus));
 
             try_return( ntStatus = STATUS_INSUFFICIENT_RESOURCES);
         }
@@ -591,12 +591,12 @@ AFSCreateSetProcessAuthGroup( AFSAuthGroupRequestCB *CreateSetAuthGroup)
         if( CreateSetAuthGroup->SessionId != (ULONG)-1)
         {
 
-            AFSDbgLogMsg( AFS_SUBSYSTEM_AUTHGROUP_PROCESSING,
+            AFSDbgTrace(( AFS_SUBSYSTEM_AUTHGROUP_PROCESSING,
                           AFS_TRACE_LEVEL_VERBOSE,
                           "%s Checking passed SessionID %08lX for PID %I64X\n",
                           __FUNCTION__,
                           CreateSetAuthGroup->SessionId,
-                          ullProcessID);
+                          ullProcessID));
 
             if( ulSessionId != CreateSetAuthGroup->SessionId)
             {
@@ -604,34 +604,34 @@ AFSCreateSetProcessAuthGroup( AFSAuthGroupRequestCB *CreateSetAuthGroup)
                 if( !BooleanFlagOn( pProcessCB->Flags, AFS_PROCESS_LOCAL_SYSTEM_AUTH))
                 {
 
-                    AFSDbgLogMsg( AFS_SUBSYSTEM_AUTHGROUP_PROCESSING,
+                    AFSDbgTrace(( AFS_SUBSYSTEM_AUTHGROUP_PROCESSING,
                                   AFS_TRACE_LEVEL_ERROR,
                                   "%s Passed SessionID %08lX for PID %I64X, failed because caller is not LOCAL SYSTEM AUTHORITY\n",
                                   __FUNCTION__,
                                   CreateSetAuthGroup->SessionId,
-                                  ullProcessID);
+                                  ullProcessID));
 
                     try_return( ntStatus = STATUS_ACCESS_DENIED);
                 }
 
                 ulSessionId = CreateSetAuthGroup->SessionId;
 
-                AFSDbgLogMsg( AFS_SUBSYSTEM_AUTHGROUP_PROCESSING,
+                AFSDbgTrace(( AFS_SUBSYSTEM_AUTHGROUP_PROCESSING,
                               AFS_TRACE_LEVEL_VERBOSE,
                               "%s Using passed SessionID %08lX for PID %I64X\n",
                               __FUNCTION__,
                               ulSessionId,
-                              ullProcessID);
+                              ullProcessID));
             }
         }
         else
         {
-            AFSDbgLogMsg( AFS_SUBSYSTEM_AUTHGROUP_PROCESSING,
+            AFSDbgTrace(( AFS_SUBSYSTEM_AUTHGROUP_PROCESSING,
                           AFS_TRACE_LEVEL_VERBOSE,
                           "%s Using callers SessionID %08lX for PID %I64X\n",
                           __FUNCTION__,
                           ulSessionId,
-                          ullProcessID);
+                          ullProcessID));
         }
 
         ullTableHash = ( ((ULONGLONG)ulSessionId << 32) | ulSIDHash);
@@ -654,13 +654,13 @@ AFSCreateSetProcessAuthGroup( AFSAuthGroupRequestCB *CreateSetAuthGroup)
         if( pAuthGroup != NULL)
         {
 
-            AFSDbgLogMsg( AFS_SUBSYSTEM_AUTHGROUP_PROCESSING,
+            AFSDbgTrace(( AFS_SUBSYSTEM_AUTHGROUP_PROCESSING,
                           AFS_TRACE_LEVEL_ERROR,
                           "%s Located AuthGroup for SID %wZ SessionID %08lX for PID %I64X, failing request\n",
                           __FUNCTION__,
                           &uniSIDString,
                           ulSessionId,
-                          ullProcessID);
+                          ullProcessID));
 
             try_return( ntStatus = STATUS_INVALID_PARAMETER);
         }
@@ -690,13 +690,13 @@ AFSCreateSetProcessAuthGroup( AFSAuthGroupRequestCB *CreateSetAuthGroup)
             pLastAuthGroup->Next = pAuthGroup;
         }
 
-        AFSDbgLogMsg( AFS_SUBSYSTEM_AUTHGROUP_PROCESSING,
+        AFSDbgTrace(( AFS_SUBSYSTEM_AUTHGROUP_PROCESSING,
                       AFS_TRACE_LEVEL_VERBOSE,
                       "%s Allocated new AuthGroup for SID %wZ SessionID %08lX for PID %I64X\n",
                       __FUNCTION__,
                       &uniSIDString,
                       ulSessionId,
-                      ullProcessID);
+                      ullProcessID));
 
         if( BooleanFlagOn( CreateSetAuthGroup->Flags, AFS_PAG_FLAGS_THREAD_AUTH_GROUP))
         {
@@ -729,26 +729,26 @@ AFSCreateSetProcessAuthGroup( AFSAuthGroupRequestCB *CreateSetAuthGroup)
                 pThreadCB->ActiveAuthGroup = &pAuthGroup->AuthGroup;
             }
 
-            AFSDbgLogMsg( AFS_SUBSYSTEM_AUTHGROUP_PROCESSING,
+            AFSDbgTrace(( AFS_SUBSYSTEM_AUTHGROUP_PROCESSING,
                           AFS_TRACE_LEVEL_VERBOSE,
                           "%s Set new AuthGroup for SID %wZ SessionID %08lX for PID %I64X on thread ID %I64X\n",
                           __FUNCTION__,
                           &uniSIDString,
                           ulSessionId,
                           ullProcessID,
-                          ullThreadId);
+                          ullThreadId));
         }
         else if( BooleanFlagOn( CreateSetAuthGroup->Flags, AFS_PAG_FLAGS_SET_AS_ACTIVE))
         {
             pProcessCB->ActiveAuthGroup = &pAuthGroup->AuthGroup;
 
-            AFSDbgLogMsg( AFS_SUBSYSTEM_AUTHGROUP_PROCESSING,
+            AFSDbgTrace(( AFS_SUBSYSTEM_AUTHGROUP_PROCESSING,
                           AFS_TRACE_LEVEL_VERBOSE,
                           "%s Set new AuthGroup for SID %wZ SessionID %08lX for PID %I64X on process\n",
                           __FUNCTION__,
                           &uniSIDString,
                           ulSessionId,
-                          ullProcessID);
+                          ullProcessID));
         }
 
 try_exit:
@@ -791,11 +791,11 @@ AFSQueryProcessAuthGroupList( IN GUID *GUIDList,
     __Enter
     {
 
-        AFSDbgLogMsg( AFS_SUBSYSTEM_AUTHGROUP_PROCESSING,
+        AFSDbgTrace(( AFS_SUBSYSTEM_AUTHGROUP_PROCESSING,
                       AFS_TRACE_LEVEL_VERBOSE,
                       "%s Entry for PID %I64X\n",
                       __FUNCTION__,
-                      ullProcessID);
+                      ullProcessID));
 
         AFSAcquireShared( pDeviceExt->Specific.Control.ProcessTree.TreeLock,
                           TRUE);
@@ -808,11 +808,11 @@ AFSQueryProcessAuthGroupList( IN GUID *GUIDList,
             pProcessCB == NULL)
         {
 
-            AFSDbgLogMsg( AFS_SUBSYSTEM_AUTHGROUP_PROCESSING,
+            AFSDbgTrace(( AFS_SUBSYSTEM_AUTHGROUP_PROCESSING,
                           AFS_TRACE_LEVEL_ERROR,
                           "%s Failed to locate process entry PID %I64X\n",
                           __FUNCTION__,
-                          ullProcessID);
+                          ullProcessID));
 
             AFSReleaseResource( pDeviceExt->Specific.Control.ProcessTree.TreeLock);
             try_return( ntStatus = STATUS_UNSUCCESSFUL);
@@ -838,12 +838,12 @@ AFSQueryProcessAuthGroupList( IN GUID *GUIDList,
             GUIDList == NULL)
         {
 
-            AFSDbgLogMsg( AFS_SUBSYSTEM_AUTHGROUP_PROCESSING,
+            AFSDbgTrace(( AFS_SUBSYSTEM_AUTHGROUP_PROCESSING,
                           AFS_TRACE_LEVEL_VERBOSE,
                           "%s Buffer too small for query, required %08lX for PID %I64X\n",
                           __FUNCTION__,
                           ulRequiredLength,
-                          ullProcessID);
+                          ullProcessID));
 
             *ReturnLength = ulRequiredLength;
             try_return( ntStatus = STATUS_BUFFER_OVERFLOW);
@@ -866,12 +866,12 @@ AFSQueryProcessAuthGroupList( IN GUID *GUIDList,
             RtlStringFromGUID( pAuthGroup->AuthGroup,
                                &uniGUIDString);
 
-            AFSDbgLogMsg( AFS_SUBSYSTEM_AUTHGROUP_PROCESSING,
+            AFSDbgTrace(( AFS_SUBSYSTEM_AUTHGROUP_PROCESSING,
                           AFS_TRACE_LEVEL_VERBOSE,
                           "%s Adding AuthGroup %wZ for PID %I64X\n",
                           __FUNCTION__,
                           &uniGUIDString,
-                          ullProcessID);
+                          ullProcessID));
 
             if( uniGUIDString.Buffer != NULL)
             {
@@ -925,12 +925,12 @@ AFSSetActiveProcessAuthGroup( IN AFSAuthGroupRequestCB *ActiveAuthGroup)
         RtlStringFromGUID( ActiveAuthGroup->AuthGroup,
                            &uniGUIDString);
 
-        AFSDbgLogMsg( AFS_SUBSYSTEM_AUTHGROUP_PROCESSING,
+        AFSDbgTrace(( AFS_SUBSYSTEM_AUTHGROUP_PROCESSING,
                       AFS_TRACE_LEVEL_VERBOSE,
                       "%s Entry for ProcessID %I64X AuthGroup GUID %wZ\n",
                       __FUNCTION__,
                       ullProcessID,
-                      &uniGUIDString);
+                      &uniGUIDString));
 
         AFSAcquireShared( pDeviceExt->Specific.Control.ProcessTree.TreeLock,
                           TRUE);
@@ -943,11 +943,11 @@ AFSSetActiveProcessAuthGroup( IN AFSAuthGroupRequestCB *ActiveAuthGroup)
             pProcessCB == NULL)
         {
 
-            AFSDbgLogMsg( AFS_SUBSYSTEM_AUTHGROUP_PROCESSING,
+            AFSDbgTrace(( AFS_SUBSYSTEM_AUTHGROUP_PROCESSING,
                           AFS_TRACE_LEVEL_ERROR,
                           "%s Failed to locate process entry for ProcessID %I64X\n",
                           __FUNCTION__,
-                          ullProcessID);
+                          ullProcessID));
 
             AFSReleaseResource( pDeviceExt->Specific.Control.ProcessTree.TreeLock);
             try_return( ntStatus = STATUS_UNSUCCESSFUL);
@@ -976,12 +976,12 @@ AFSSetActiveProcessAuthGroup( IN AFSAuthGroupRequestCB *ActiveAuthGroup)
         if( pAuthGroup == NULL)
         {
 
-            AFSDbgLogMsg( AFS_SUBSYSTEM_AUTHGROUP_PROCESSING,
+            AFSDbgTrace(( AFS_SUBSYSTEM_AUTHGROUP_PROCESSING,
                           AFS_TRACE_LEVEL_VERBOSE,
                           "%s Failed to locate AuthGroup for ProcessID %I64X AuthGroup GUID %wZ\n",
                           __FUNCTION__,
                           ullProcessID,
-                          &uniGUIDString);
+                          &uniGUIDString));
 
             try_return( ntStatus = STATUS_INVALID_PARAMETER);
         }
@@ -1017,24 +1017,24 @@ AFSSetActiveProcessAuthGroup( IN AFSAuthGroupRequestCB *ActiveAuthGroup)
                 pThreadCB->ActiveAuthGroup = &pAuthGroup->AuthGroup;
             }
 
-            AFSDbgLogMsg( AFS_SUBSYSTEM_AUTHGROUP_PROCESSING,
+            AFSDbgTrace(( AFS_SUBSYSTEM_AUTHGROUP_PROCESSING,
                           AFS_TRACE_LEVEL_VERBOSE,
                           "%s Set active AuthGroup for ProcessID %I64X AuthGroup GUID %wZ on thread %I64X\n",
                           __FUNCTION__,
                           ullProcessID,
                           &uniGUIDString,
-                          ullThreadId);
+                          ullThreadId));
         }
         else
         {
             pProcessCB->ActiveAuthGroup = &pAuthGroup->AuthGroup;
 
-            AFSDbgLogMsg( AFS_SUBSYSTEM_AUTHGROUP_PROCESSING,
+            AFSDbgTrace(( AFS_SUBSYSTEM_AUTHGROUP_PROCESSING,
                           AFS_TRACE_LEVEL_VERBOSE,
                           "%s Set active AuthGroup for ProcessID %I64X AuthGroup GUID %wZ on process\n",
                           __FUNCTION__,
                           ullProcessID,
-                          &uniGUIDString);
+                          &uniGUIDString));
         }
 
 try_exit:
@@ -1072,11 +1072,11 @@ AFSResetActiveProcessAuthGroup( IN IN AFSAuthGroupRequestCB *AuthGroup)
     __Enter
     {
 
-        AFSDbgLogMsg( AFS_SUBSYSTEM_AUTHGROUP_PROCESSING,
+        AFSDbgTrace(( AFS_SUBSYSTEM_AUTHGROUP_PROCESSING,
                       AFS_TRACE_LEVEL_VERBOSE,
                       "%s Entry for ProcessID %I64X\n",
                       __FUNCTION__,
-                      ullProcessID);
+                      ullProcessID));
 
         AFSAcquireShared( pDeviceExt->Specific.Control.ProcessTree.TreeLock,
                           TRUE);
@@ -1089,11 +1089,11 @@ AFSResetActiveProcessAuthGroup( IN IN AFSAuthGroupRequestCB *AuthGroup)
             pProcessCB == NULL)
         {
 
-            AFSDbgLogMsg( AFS_SUBSYSTEM_AUTHGROUP_PROCESSING,
+            AFSDbgTrace(( AFS_SUBSYSTEM_AUTHGROUP_PROCESSING,
                           AFS_TRACE_LEVEL_ERROR,
                           "%s Failed to locate AuthGroup for ProcessID %I64X\n",
                           __FUNCTION__,
-                          ullProcessID);
+                          ullProcessID));
 
             AFSReleaseResource( pDeviceExt->Specific.Control.ProcessTree.TreeLock);
             try_return( ntStatus = STATUS_UNSUCCESSFUL);
@@ -1121,12 +1121,12 @@ AFSResetActiveProcessAuthGroup( IN IN AFSAuthGroupRequestCB *AuthGroup)
                 pThreadCB = pThreadCB->Next;
             }
 
-            AFSDbgLogMsg( AFS_SUBSYSTEM_AUTHGROUP_PROCESSING,
+            AFSDbgTrace(( AFS_SUBSYSTEM_AUTHGROUP_PROCESSING,
                           AFS_TRACE_LEVEL_VERBOSE,
                           "%s Reset AuthGroup list on thread %I64X for ProcessID %I64X\n",
                           __FUNCTION__,
                           ullThreadId,
-                          ullProcessID);
+                          ullProcessID));
         }
         else
         {
@@ -1140,11 +1140,11 @@ AFSResetActiveProcessAuthGroup( IN IN AFSAuthGroupRequestCB *AuthGroup)
                 pThreadCB = pThreadCB->Next;
             }
 
-            AFSDbgLogMsg( AFS_SUBSYSTEM_AUTHGROUP_PROCESSING,
+            AFSDbgTrace(( AFS_SUBSYSTEM_AUTHGROUP_PROCESSING,
                           AFS_TRACE_LEVEL_VERBOSE,
                           "%s Reset AuthGroup list on process for ProcessID %I64X\n",
                           __FUNCTION__,
-                          ullProcessID);
+                          ullProcessID));
         }
 
         AFSReleaseResource( &pProcessCB->Lock);
@@ -1190,25 +1190,25 @@ AFSCreateAuthGroupForSIDorLogonSession( IN AFSAuthGroupRequestCB *AuthGroupReque
     __Enter
     {
 
-        AFSDbgLogMsg( AFS_SUBSYSTEM_AUTHGROUP_PROCESSING,
+        AFSDbgTrace(( AFS_SUBSYSTEM_AUTHGROUP_PROCESSING,
                       AFS_TRACE_LEVEL_VERBOSE,
                       "%s Entry for ProcessID %I64X ThreadID %I64X\n",
                       __FUNCTION__,
                       ullProcessID,
-                      ullThreadId);
+                      ullThreadId));
 
         ntStatus = AFSGetCallerSID( &uniCallerSID, &bImpersonation);
 
         if( !NT_SUCCESS( ntStatus))
         {
 
-            AFSDbgLogMsg( AFS_SUBSYSTEM_AUTHGROUP_PROCESSING,
+            AFSDbgTrace(( AFS_SUBSYSTEM_AUTHGROUP_PROCESSING,
                           AFS_TRACE_LEVEL_ERROR,
                           "%s Failed to retrieve callers SID for ProcessID %I64X ThreadID %I64X Status %08lX\n",
                           __FUNCTION__,
                           ullProcessID,
                           ullThreadId,
-                          ntStatus);
+                          ntStatus));
 
             try_return( ntStatus);
         }
@@ -1219,11 +1219,11 @@ AFSCreateAuthGroupForSIDorLogonSession( IN AFSAuthGroupRequestCB *AuthGroupReque
             bLocalSystem == FALSE)
         {
 
-            AFSDbgLogMsg( AFS_SUBSYSTEM_AUTHGROUP_PROCESSING,
+            AFSDbgTrace(( AFS_SUBSYSTEM_AUTHGROUP_PROCESSING,
                           AFS_TRACE_LEVEL_ERROR,
                           "%s caller is %wZ and LOCAL SYSTEM AUTHORITY required\n",
                           __FUNCTION__,
-                          uniCallerSID);
+                          uniCallerSID));
 
             try_return( ntStatus = STATUS_ACCESS_DENIED);
         }
@@ -1234,10 +1234,10 @@ AFSCreateAuthGroupForSIDorLogonSession( IN AFSAuthGroupRequestCB *AuthGroupReque
                AuthGroupRequestCB->SessionId == (ULONG)-1))
         {
 
-            AFSDbgLogMsg( AFS_SUBSYSTEM_AUTHGROUP_PROCESSING,
+            AFSDbgTrace(( AFS_SUBSYSTEM_AUTHGROUP_PROCESSING,
                           AFS_TRACE_LEVEL_ERROR,
                           "%s SID and SessionId are mandatory\n",
-                          __FUNCTION__);
+                          __FUNCTION__));
 
             try_return( ntStatus = STATUS_INVALID_PARAMETER);
         }
@@ -1248,22 +1248,22 @@ AFSCreateAuthGroupForSIDorLogonSession( IN AFSAuthGroupRequestCB *AuthGroupReque
                AuthGroupRequestCB->SessionId != (ULONG)-1))
         {
 
-            AFSDbgLogMsg( AFS_SUBSYSTEM_AUTHGROUP_PROCESSING,
+            AFSDbgTrace(( AFS_SUBSYSTEM_AUTHGROUP_PROCESSING,
                           AFS_TRACE_LEVEL_ERROR,
                           "%s SID and SessionId must not be specified\n",
-                          __FUNCTION__);
+                          __FUNCTION__));
 
             try_return( ntStatus = STATUS_INVALID_PARAMETER);
         }
 
 
-        AFSDbgLogMsg( AFS_SUBSYSTEM_AUTHGROUP_PROCESSING,
+        AFSDbgTrace(( AFS_SUBSYSTEM_AUTHGROUP_PROCESSING,
                       AFS_TRACE_LEVEL_VERBOSE,
                       "%s Retrieved callers SID %wZ for ProcessID %I64X ThreadID %I64X\n",
                       __FUNCTION__,
                       &uniCallerSID,
                       ullProcessID,
-                      ullThreadId);
+                      ullThreadId));
 
         if( AuthGroupRequestCB != NULL &&
             AuthGroupRequestCB->SIDLength != 0)
@@ -1274,13 +1274,13 @@ AFSCreateAuthGroupForSIDorLogonSession( IN AFSAuthGroupRequestCB *AuthGroupReque
 
             uniPassedSIDString.Buffer = AuthGroupRequestCB->SIDString;
 
-            AFSDbgLogMsg( AFS_SUBSYSTEM_AUTHGROUP_PROCESSING,
+            AFSDbgTrace(( AFS_SUBSYSTEM_AUTHGROUP_PROCESSING,
                           AFS_TRACE_LEVEL_VERBOSE,
                           "%s Checking passed SID %wZ for ProcessID %I64X ThreadID %I64X\n",
                           __FUNCTION__,
                           &uniPassedSIDString,
                           ullProcessID,
-                          ullThreadId);
+                          ullThreadId));
 
             if( RtlCompareUnicodeString( &uniCallerSID,
                                          &uniPassedSIDString,
@@ -1290,51 +1290,51 @@ AFSCreateAuthGroupForSIDorLogonSession( IN AFSAuthGroupRequestCB *AuthGroupReque
                 if( !bLocalSystem)
                 {
 
-                    AFSDbgLogMsg( AFS_SUBSYSTEM_AUTHGROUP_PROCESSING,
+                    AFSDbgTrace(( AFS_SUBSYSTEM_AUTHGROUP_PROCESSING,
                                   AFS_TRACE_LEVEL_ERROR,
                                   "%s Not using passed SID %wZ for ProcessID %I64X ThreadID %I64X caller is not LOCAL SYSTEM AUTHORITY\n",
                                   __FUNCTION__,
                                   &uniPassedSIDString,
                                   ullProcessID,
-                                  ullThreadId);
+                                  ullThreadId));
 
                     try_return( ntStatus = STATUS_ACCESS_DENIED);
                 }
 
                 uniSIDString = uniPassedSIDString;
 
-                AFSDbgLogMsg( AFS_SUBSYSTEM_AUTHGROUP_PROCESSING,
+                AFSDbgTrace(( AFS_SUBSYSTEM_AUTHGROUP_PROCESSING,
                               AFS_TRACE_LEVEL_VERBOSE,
                               "%s Using passed SID %wZ for ProcessID %I64X ThreadID %I64X\n",
                               __FUNCTION__,
                               &uniSIDString,
                               ullProcessID,
-                              ullThreadId);
+                              ullThreadId));
             }
             else
             {
                 uniSIDString = uniCallerSID;
 
-                AFSDbgLogMsg( AFS_SUBSYSTEM_AUTHGROUP_PROCESSING,
+                AFSDbgTrace(( AFS_SUBSYSTEM_AUTHGROUP_PROCESSING,
                               AFS_TRACE_LEVEL_VERBOSE,
                               "%s Both SIDs are equal, using callers SID %wZ for ProcessID %I64X ThreadID %I64X\n",
                               __FUNCTION__,
                               &uniSIDString,
                               ullProcessID,
-                              ullThreadId);
+                              ullThreadId));
             }
         }
         else
         {
             uniSIDString = uniCallerSID;
 
-            AFSDbgLogMsg( AFS_SUBSYSTEM_AUTHGROUP_PROCESSING,
+            AFSDbgTrace(( AFS_SUBSYSTEM_AUTHGROUP_PROCESSING,
                           AFS_TRACE_LEVEL_VERBOSE,
                           "%s Using callers SID %wZ for ProcessID %I64X ThreadID %I64X\n",
                           __FUNCTION__,
                           &uniSIDString,
                           ullProcessID,
-                          ullThreadId);
+                          ullThreadId));
         }
 
         ntStatus = RtlHashUnicodeString( &uniSIDString,
@@ -1345,14 +1345,14 @@ AFSCreateAuthGroupForSIDorLogonSession( IN AFSAuthGroupRequestCB *AuthGroupReque
         if( !NT_SUCCESS( ntStatus))
         {
 
-            AFSDbgLogMsg( AFS_SUBSYSTEM_AUTHGROUP_PROCESSING,
+            AFSDbgTrace(( AFS_SUBSYSTEM_AUTHGROUP_PROCESSING,
                           AFS_TRACE_LEVEL_ERROR,
                           "%s Failed to hash SID %wZ for ProcessID %I64X ThreadID %I64X Status %08lX\n",
                           __FUNCTION__,
                           &uniSIDString,
                           ullProcessID,
                           ullThreadId,
-                          ntStatus);
+                          ntStatus));
 
             try_return( ntStatus);
         }
@@ -1362,12 +1362,12 @@ AFSCreateAuthGroupForSIDorLogonSession( IN AFSAuthGroupRequestCB *AuthGroupReque
         if( ulSessionId == (ULONG)-1)
         {
 
-            AFSDbgLogMsg( AFS_SUBSYSTEM_AUTHGROUP_PROCESSING,
+            AFSDbgTrace(( AFS_SUBSYSTEM_AUTHGROUP_PROCESSING,
                           AFS_TRACE_LEVEL_ERROR,
                           "%s Failed to retrieve session ID for ProcessID %I64X ThreadID %I64X\n",
                           __FUNCTION__,
                           ullProcessID,
-                          ullThreadId);
+                          ullThreadId));
 
             try_return( ntStatus = STATUS_INSUFFICIENT_RESOURCES);
         }
@@ -1377,38 +1377,38 @@ AFSCreateAuthGroupForSIDorLogonSession( IN AFSAuthGroupRequestCB *AuthGroupReque
             AuthGroupRequestCB->SessionId != (ULONG)-1)
         {
 
-            AFSDbgLogMsg( AFS_SUBSYSTEM_AUTHGROUP_PROCESSING,
+            AFSDbgTrace(( AFS_SUBSYSTEM_AUTHGROUP_PROCESSING,
                           AFS_TRACE_LEVEL_VERBOSE,
                           "%s Checking passed SessionID %08lX for ProcessID %I64X ThreadID %I64X\n",
                           __FUNCTION__,
                           AuthGroupRequestCB->SessionId,
                           ullProcessID,
-                          ullThreadId);
+                          ullThreadId));
 
             if( ulSessionId != AuthGroupRequestCB->SessionId)
             {
 
                 ulSessionId = AuthGroupRequestCB->SessionId;
 
-                AFSDbgLogMsg( AFS_SUBSYSTEM_AUTHGROUP_PROCESSING,
+                AFSDbgTrace(( AFS_SUBSYSTEM_AUTHGROUP_PROCESSING,
                               AFS_TRACE_LEVEL_VERBOSE,
                               "%s Using passed SessionID %08lX for ProcessID %I64X ThreadID %I64X\n",
                               __FUNCTION__,
                               AuthGroupRequestCB->SessionId,
                               ullProcessID,
-                              ullThreadId);
+                              ullThreadId));
             }
         }
         else
         {
 
-            AFSDbgLogMsg( AFS_SUBSYSTEM_AUTHGROUP_PROCESSING,
+            AFSDbgTrace(( AFS_SUBSYSTEM_AUTHGROUP_PROCESSING,
                           AFS_TRACE_LEVEL_VERBOSE,
                           "%s Using callers SessionID %08lX for ProcessID %I64X ThreadID %I64X\n",
                           __FUNCTION__,
                           ulSessionId,
                           ullProcessID,
-                          ullThreadId);
+                          ullThreadId));
         }
 
         ullTableHash = ( ((ULONGLONG)ulSessionId << 32) | ulSIDHash);
@@ -1424,25 +1424,25 @@ AFSCreateAuthGroupForSIDorLogonSession( IN AFSAuthGroupRequestCB *AuthGroupReque
             pSIDEntryCB != NULL)
         {
 
-            AFSDbgLogMsg( AFS_SUBSYSTEM_AUTHGROUP_PROCESSING,
+            AFSDbgTrace(( AFS_SUBSYSTEM_AUTHGROUP_PROCESSING,
                           AFS_TRACE_LEVEL_VERBOSE,
                           "%s Located SID entry for SID %wZ SessionID %08lX ProcessID %I64X ThreadID %I64X, updating GUID\n",
                           __FUNCTION__,
                           &uniSIDString,
                           ulSessionId,
                           ullProcessID,
-                          ullThreadId);
+                          ullThreadId));
 
             uniGUID.Buffer = NULL;
 
             RtlStringFromGUID( pSIDEntryCB->AuthGroup,
                                &uniGUID);
 
-            AFSDbgLogMsg( AFS_SUBSYSTEM_AUTHGROUP_PROCESSING,
+            AFSDbgTrace(( AFS_SUBSYSTEM_AUTHGROUP_PROCESSING,
                           AFS_TRACE_LEVEL_VERBOSE,
                           "%s Updating existing AuthGroup GUID %wZ\n",
                           __FUNCTION__,
-                          &uniGUID);
+                          &uniGUID));
 
             if( uniGUID.Buffer != NULL)
             {
@@ -1456,11 +1456,11 @@ AFSCreateAuthGroupForSIDorLogonSession( IN AFSAuthGroupRequestCB *AuthGroupReque
             RtlStringFromGUID( pSIDEntryCB->AuthGroup,
                                &uniGUID);
 
-            AFSDbgLogMsg( AFS_SUBSYSTEM_AUTHGROUP_PROCESSING,
+            AFSDbgTrace(( AFS_SUBSYSTEM_AUTHGROUP_PROCESSING,
                           AFS_TRACE_LEVEL_VERBOSE,
                           "%s Updated existing AuthGroup GUID %wZ\n",
                           __FUNCTION__,
-                          &uniGUID);
+                          &uniGUID));
 
             if( uniGUID.Buffer != NULL)
             {
@@ -1505,13 +1505,13 @@ AFSCreateAuthGroupForSIDorLogonSession( IN AFSAuthGroupRequestCB *AuthGroupReque
         RtlStringFromGUID( pSIDEntryCB->AuthGroup,
                            &uniGUID);
 
-        AFSDbgLogMsg( AFS_SUBSYSTEM_AUTHGROUP_PROCESSING,
+        AFSDbgTrace(( AFS_SUBSYSTEM_AUTHGROUP_PROCESSING,
                       AFS_TRACE_LEVEL_VERBOSE,
                       "%s Created new AuthGroup GUID %wZ SID %wZ Session %08lX\n",
                       __FUNCTION__,
                       &uniGUID,
                       &uniSIDString,
-                      ulSessionId);
+                      ulSessionId));
 
         if( uniGUID.Buffer != NULL)
         {
@@ -1555,45 +1555,45 @@ AFSQueryAuthGroup( IN AFSAuthGroupRequestCB *AuthGroup,
     __Enter
     {
 
-        AFSDbgLogMsg( AFS_SUBSYSTEM_AUTHGROUP_PROCESSING,
+        AFSDbgTrace(( AFS_SUBSYSTEM_AUTHGROUP_PROCESSING,
                       AFS_TRACE_LEVEL_VERBOSE,
                       "%s Entry for ProcessID %I64X\n",
                       __FUNCTION__,
-                      ullProcessID);
+                      ullProcessID));
 
         if( AuthGroup == NULL ||
             AuthGroup->SIDLength == 0)
         {
 
-            AFSDbgLogMsg( AFS_SUBSYSTEM_AUTHGROUP_PROCESSING,
+            AFSDbgTrace(( AFS_SUBSYSTEM_AUTHGROUP_PROCESSING,
                           AFS_TRACE_LEVEL_VERBOSE,
                           "%s No SID specified, retrieving callers SID for ProcessID %I64X\n",
                           __FUNCTION__,
-                          ullProcessID);
+                          ullProcessID));
 
             ntStatus = AFSGetCallerSID( &uniSIDString, &bImpersonation);
 
             if( !NT_SUCCESS( ntStatus))
             {
 
-                AFSDbgLogMsg( AFS_SUBSYSTEM_AUTHGROUP_PROCESSING,
+                AFSDbgTrace(( AFS_SUBSYSTEM_AUTHGROUP_PROCESSING,
                               AFS_TRACE_LEVEL_ERROR,
                               "%s Failed to retrieve callers SID for ProcessID %I64X Status %08lX\n",
                               __FUNCTION__,
                               ullProcessID,
-                              ntStatus);
+                              ntStatus));
 
                 try_return( ntStatus);
             }
 
             bReleaseSID = TRUE;
 
-            AFSDbgLogMsg( AFS_SUBSYSTEM_AUTHGROUP_PROCESSING,
+            AFSDbgTrace(( AFS_SUBSYSTEM_AUTHGROUP_PROCESSING,
                           AFS_TRACE_LEVEL_VERBOSE,
                           "%s Retrieved callers SID %wZ for ProcessID %I64X\n",
                           __FUNCTION__,
                           &uniSIDString,
-                          ullProcessID);
+                          ullProcessID));
         }
         else
         {
@@ -1603,12 +1603,12 @@ AFSQueryAuthGroup( IN AFSAuthGroupRequestCB *AuthGroup,
 
             uniSIDString.Buffer = AuthGroup->SIDString;
 
-            AFSDbgLogMsg( AFS_SUBSYSTEM_AUTHGROUP_PROCESSING,
+            AFSDbgTrace(( AFS_SUBSYSTEM_AUTHGROUP_PROCESSING,
                           AFS_TRACE_LEVEL_VERBOSE,
                           "%s Using passed SID %wZ for ProcessID %I64X\n",
                           __FUNCTION__,
                           &uniSIDString,
-                          ullProcessID);
+                          ullProcessID));
         }
 
         ntStatus = RtlHashUnicodeString( &uniSIDString,
@@ -1619,13 +1619,13 @@ AFSQueryAuthGroup( IN AFSAuthGroupRequestCB *AuthGroup,
         if( !NT_SUCCESS( ntStatus))
         {
 
-            AFSDbgLogMsg( AFS_SUBSYSTEM_AUTHGROUP_PROCESSING,
+            AFSDbgTrace(( AFS_SUBSYSTEM_AUTHGROUP_PROCESSING,
                           AFS_TRACE_LEVEL_ERROR,
                           "%s Failed to hash SID %wZ for ProcessID %I64X Status %08lX\n",
                           __FUNCTION__,
                           &uniSIDString,
                           ullProcessID,
-                          ntStatus);
+                          ntStatus));
 
             try_return( ntStatus);
         }
@@ -1634,43 +1634,43 @@ AFSQueryAuthGroup( IN AFSAuthGroupRequestCB *AuthGroup,
             AuthGroup->SessionId == -1)
         {
 
-            AFSDbgLogMsg( AFS_SUBSYSTEM_AUTHGROUP_PROCESSING,
+            AFSDbgTrace(( AFS_SUBSYSTEM_AUTHGROUP_PROCESSING,
                           AFS_TRACE_LEVEL_VERBOSE,
                           "%s No SessionID specified, retrieving callers for ProcessID %I64X\n",
                           __FUNCTION__,
-                          ullProcessID);
+                          ullProcessID));
 
             ulSessionId = AFSGetSessionId( (HANDLE)ullProcessID, &bImpersonation);
 
             if( ulSessionId == (ULONG)-1)
             {
 
-                AFSDbgLogMsg( AFS_SUBSYSTEM_AUTHGROUP_PROCESSING,
+                AFSDbgTrace(( AFS_SUBSYSTEM_AUTHGROUP_PROCESSING,
                               AFS_TRACE_LEVEL_ERROR,
                               "%s Failed to retrieve callers Session ID for ProcessID %I64X\n",
                               __FUNCTION__,
-                              ullProcessID);
+                              ullProcessID));
 
                 try_return( ntStatus = STATUS_INSUFFICIENT_RESOURCES);
             }
 
-            AFSDbgLogMsg( AFS_SUBSYSTEM_AUTHGROUP_PROCESSING,
+            AFSDbgTrace(( AFS_SUBSYSTEM_AUTHGROUP_PROCESSING,
                           AFS_TRACE_LEVEL_VERBOSE,
                           "%s Retrieved callers SessionID %08lX for ProcessID %I64X\n",
                           __FUNCTION__,
                           ulSessionId,
-                          ullProcessID);
+                          ullProcessID));
         }
         else
         {
             ulSessionId = AuthGroup->SessionId;
 
-            AFSDbgLogMsg( AFS_SUBSYSTEM_AUTHGROUP_PROCESSING,
+            AFSDbgTrace(( AFS_SUBSYSTEM_AUTHGROUP_PROCESSING,
                           AFS_TRACE_LEVEL_VERBOSE,
                           "%s Using passed SessionID %08lX for ProcessID %I64X\n",
                           __FUNCTION__,
                           ulSessionId,
-                          ullProcessID);
+                          ullProcessID));
         }
 
         ullTableHash = ( ((ULONGLONG)ulSessionId << 32) | ulSIDHash);
@@ -1685,13 +1685,13 @@ AFSQueryAuthGroup( IN AFSAuthGroupRequestCB *AuthGroup,
         if( pSIDEntryCB == NULL)
         {
 
-            AFSDbgLogMsg( AFS_SUBSYSTEM_AUTHGROUP_PROCESSING,
+            AFSDbgTrace(( AFS_SUBSYSTEM_AUTHGROUP_PROCESSING,
                           AFS_TRACE_LEVEL_ERROR,
                           "%s Failed to locate SID entry for SID %wZ SessionID %08lX ProcessID %I64X\n",
                           __FUNCTION__,
                           &uniSIDString,
                           ulSessionId,
-                          ullProcessID);
+                          ullProcessID));
 
             AFSReleaseResource( pDeviceExt->Specific.Control.AuthGroupTree.TreeLock);
             try_return( ntStatus = STATUS_NOT_FOUND);
@@ -1708,12 +1708,12 @@ AFSQueryAuthGroup( IN AFSAuthGroupRequestCB *AuthGroup,
         RtlStringFromGUID( pSIDEntryCB->AuthGroup,
                            &uniGUID);
 
-        AFSDbgLogMsg( AFS_SUBSYSTEM_AUTHGROUP_PROCESSING,
+        AFSDbgTrace(( AFS_SUBSYSTEM_AUTHGROUP_PROCESSING,
                       AFS_TRACE_LEVEL_VERBOSE,
                       "%s Retrieved AuthGroup GUID %wZ for ProcessID %I64X\n",
                       __FUNCTION__,
                       &uniGUID,
-                      ullProcessID);
+                      ullProcessID));
 
         if( uniGUID.Buffer != NULL)
         {
index 64b3bac..ddcfd91 100644 (file)
@@ -174,9 +174,9 @@ AFSInsertHashEntry( IN AFSBTreeEntry *TopNode,
         if( pCurrentEntry == NULL)
         {
 
-            AFSDbgLogMsg( AFS_SUBSYSTEM_FILE_PROCESSING,
+            AFSDbgTrace(( AFS_SUBSYSTEM_FILE_PROCESSING,
                           AFS_TRACE_LEVEL_WARNING,
-                          "AFSInsertHashEntry Invalid root node\n");
+                          "AFSInsertHashEntry Invalid root node\n"));
 
             try_return( ntStatus = STATUS_UNSUCCESSFUL);
         }
@@ -245,10 +245,10 @@ AFSInsertHashEntry( IN AFSBTreeEntry *TopNode,
             else
             {
 
-                AFSDbgLogMsg( AFS_SUBSYSTEM_FILE_PROCESSING,
+                AFSDbgTrace(( AFS_SUBSYSTEM_FILE_PROCESSING,
                               AFS_TRACE_LEVEL_WARNING,
                               "AFSInsertHashEntry Attempt to re-insert a CRC %I64X\n",
-                              FileIDEntry->HashIndex);
+                              FileIDEntry->HashIndex));
 
                 ASSERT( FALSE);
 
index 8ead4b5..19e8925 100644 (file)
@@ -110,9 +110,9 @@ try_exit:
     __except( AFSExceptionFilter( __FUNCTION__, GetExceptionCode(), GetExceptionInformation()) )
     {
 
-        AFSDbgLogMsg( 0,
+        AFSDbgTrace(( 0,
                       0,
-                      "EXCEPTION - AFSCleanup\n");
+                      "EXCEPTION - AFSCleanup\n"));
 
         AFSDumpTraceFilesFnc();
     }
index 609adb7..5d273a3 100644 (file)
@@ -79,9 +79,9 @@ try_exit:
     __except( AFSExceptionFilter( __FUNCTION__, GetExceptionCode(), GetExceptionInformation()) )
     {
 
-        AFSDbgLogMsg( 0,
+        AFSDbgTrace(( 0,
                       0,
-                      "EXCEPTION - AFSClose\n");
+                      "EXCEPTION - AFSClose\n"));
 
         AFSDumpTraceFilesFnc();
     }
index b6ab8e6..c67cabe 100644 (file)
@@ -108,11 +108,11 @@ AFSProcessRequest( IN ULONG RequestType,
         // Grab the pool resource and check the state
         //
 
-        AFSDbgLogMsg( AFS_SUBSYSTEM_LOCK_PROCESSING,
+        AFSDbgTrace(( AFS_SUBSYSTEM_LOCK_PROCESSING,
                       AFS_TRACE_LEVEL_VERBOSE,
                       "AFSProcessRequest Acquiring IrpPoolLock lock %p EXCL %08lX\n",
                       &pCommSrvc->IrpPoolLock,
-                      PsGetCurrentThread());
+                      PsGetCurrentThread()));
 
         AFSAcquireExcl( &pCommSrvc->IrpPoolLock,
                         TRUE);
@@ -265,10 +265,10 @@ AFSProcessRequest( IN ULONG RequestType,
 
         if( AFSIsNoPAGAuthGroup( &pPoolEntry->AuthGroup))
         {
-            AFSDbgLogMsg( 0,
+            AFSDbgTrace(( 0,
                           0,
                           "AFSProcessRequest NoPAG Auth Group %08lX\n",
-                          PsGetCurrentThread());
+                          PsGetCurrentThread()));
         }
 
         //
@@ -468,6 +468,7 @@ AFSCheckIoctlPermissions( IN ULONG ControlCode)
         //
 
         case IOCTL_AFS_INITIALIZE_LIBRARY_DEVICE:
+        case IOCTL_AFS_CONFIG_LIBRARY_TRACE:
 
             //
             // Only the kernel can issue this
@@ -986,20 +987,20 @@ AFSInitIrpPool()
         // locks. We also do this in the tear down of the pool
         //
 
-        AFSDbgLogMsg( AFS_SUBSYSTEM_LOCK_PROCESSING,
+        AFSDbgTrace(( AFS_SUBSYSTEM_LOCK_PROCESSING,
                       AFS_TRACE_LEVEL_VERBOSE,
                       "AFSInitIrpPool Acquiring IrpPoolLock lock %p EXCL %08lX\n",
                       &pCommSrvc->IrpPoolLock,
-                      PsGetCurrentThread());
+                      PsGetCurrentThread()));
 
         AFSAcquireExcl( &pCommSrvc->IrpPoolLock,
                           TRUE);
 
-        AFSDbgLogMsg( AFS_SUBSYSTEM_LOCK_PROCESSING,
+        AFSDbgTrace(( AFS_SUBSYSTEM_LOCK_PROCESSING,
                       AFS_TRACE_LEVEL_VERBOSE,
                       "AFSInitIrpPool Acquiring ResultPoolLock lock %p EXCL %08lX\n",
                       &pCommSrvc->ResultPoolLock,
-                      PsGetCurrentThread());
+                      PsGetCurrentThread()));
 
         AFSAcquireExcl( &pCommSrvc->ResultPoolLock,
                           TRUE);
@@ -1075,20 +1076,20 @@ AFSCleanupIrpPool()
         // Irp pool then the result pool lock
         //
 
-        AFSDbgLogMsg( AFS_SUBSYSTEM_LOCK_PROCESSING,
+        AFSDbgTrace(( AFS_SUBSYSTEM_LOCK_PROCESSING,
                       AFS_TRACE_LEVEL_VERBOSE,
                       "AFSCleanupIrpPool Acquiring IrpPoolLock lock %p EXCL %08lX\n",
                       &pCommSrvc->IrpPoolLock,
-                      PsGetCurrentThread());
+                      PsGetCurrentThread()));
 
         AFSAcquireExcl( &pCommSrvc->IrpPoolLock,
                         TRUE);
 
-        AFSDbgLogMsg( AFS_SUBSYSTEM_LOCK_PROCESSING,
+        AFSDbgTrace(( AFS_SUBSYSTEM_LOCK_PROCESSING,
                       AFS_TRACE_LEVEL_VERBOSE,
                       "AFSCleanupIrpPool Acquiring ResultPoolLock lock %p EXCL %08lX\n",
                       &pCommSrvc->ResultPoolLock,
-                      PsGetCurrentThread());
+                      PsGetCurrentThread()));
 
         AFSAcquireExcl( &pCommSrvc->ResultPoolLock,
                         TRUE);
@@ -1234,11 +1235,11 @@ AFSInsertRequest( IN AFSCommSrvcCB *CommSrvc,
     __Enter
     {
 
-        AFSDbgLogMsg( AFS_SUBSYSTEM_LOCK_PROCESSING,
+        AFSDbgTrace(( AFS_SUBSYSTEM_LOCK_PROCESSING,
                       AFS_TRACE_LEVEL_VERBOSE,
                       "AFSInsertRequest Acquiring IrpPoolLock lock %p EXCL %08lX\n",
                       &CommSrvc->IrpPoolLock,
-                      PsGetCurrentThread());
+                      PsGetCurrentThread()));
 
         AFSAcquireExcl( &CommSrvc->IrpPoolLock,
                         TRUE);
@@ -1309,11 +1310,11 @@ AFSProcessIrpRequest( IN PIRP Irp)
 
         pRequest = (AFSCommRequest *)Irp->AssociatedIrp.SystemBuffer;
 
-        AFSDbgLogMsg( AFS_SUBSYSTEM_LOCK_PROCESSING,
+        AFSDbgTrace(( AFS_SUBSYSTEM_LOCK_PROCESSING,
                       AFS_TRACE_LEVEL_VERBOSE,
                       "AFSProcessIrpRequest Acquiring IrpPoolLock lock %p EXCL %08lX\n",
                       &pCommSrvc->IrpPoolLock,
-                      PsGetCurrentThread());
+                      PsGetCurrentThread()));
 
         AFSAcquireExcl( &pCommSrvc->IrpPoolLock,
                         TRUE);
@@ -1402,11 +1403,11 @@ AFSProcessIrpRequest( IN PIRP Irp)
             // Grab the lock on the request pool
             //
 
-            AFSDbgLogMsg( AFS_SUBSYSTEM_LOCK_PROCESSING,
+            AFSDbgTrace(( AFS_SUBSYSTEM_LOCK_PROCESSING,
                           AFS_TRACE_LEVEL_VERBOSE,
                           "AFSProcessIrpRequest Acquiring IrpPoolLock (WAIT) lock %p EXCL %08lX\n",
                           &pCommSrvc->IrpPoolLock,
-                          PsGetCurrentThread());
+                          PsGetCurrentThread()));
 
             AFSAcquireExcl( &pCommSrvc->IrpPoolLock,
                             TRUE);
@@ -1622,11 +1623,11 @@ AFSProcessIrpRequest( IN PIRP Irp)
                     pEntry->fLink = NULL;
                     pEntry->bLink = NULL;
 
-                    AFSDbgLogMsg( AFS_SUBSYSTEM_LOCK_PROCESSING,
+                    AFSDbgTrace(( AFS_SUBSYSTEM_LOCK_PROCESSING,
                                   AFS_TRACE_LEVEL_VERBOSE,
                                   "AFSProcessIrpRequest Acquiring ResultPoolLock lock %p EXCL %08lX\n",
                                   &pCommSrvc->ResultPoolLock,
-                                  PsGetCurrentThread());
+                                  PsGetCurrentThread()));
 
                     AFSAcquireExcl( &pCommSrvc->ResultPoolLock,
                                     TRUE);
@@ -1702,11 +1703,11 @@ AFSProcessIrpResult( IN PIRP Irp)
         // Go look for our entry
         //
 
-        AFSDbgLogMsg( AFS_SUBSYSTEM_LOCK_PROCESSING,
+        AFSDbgTrace(( AFS_SUBSYSTEM_LOCK_PROCESSING,
                       AFS_TRACE_LEVEL_VERBOSE,
                       "AFSProcessIrpResult Acquiring ResultPoolLock lock %p EXCL %08lX\n",
                       &pCommSrvc->ResultPoolLock,
-                      PsGetCurrentThread());
+                      PsGetCurrentThread()));
 
         AFSAcquireExcl( &pCommSrvc->ResultPoolLock,
                           TRUE);
index aebbc70..9eafa43 100644 (file)
@@ -80,9 +80,9 @@ try_exit:
     __except( AFSExceptionFilter( __FUNCTION__, GetExceptionCode(), GetExceptionInformation()) )
     {
 
-        AFSDbgLogMsg( 0,
+        AFSDbgTrace(( 0,
                       0,
-                      "EXCEPTION - AFSCreate\n");
+                      "EXCEPTION - AFSCreate\n"));
 
         ntStatus = STATUS_ACCESS_DENIED;
 
@@ -129,21 +129,21 @@ AFSCommonCreate( IN PDEVICE_OBJECT DeviceObject,
             RtlStringFromGUID( *pAuthGroup,
                                &uniGUIDString);
 
-            AFSDbgLogMsg( AFS_SUBSYSTEM_AUTHGROUP_PROCESSING,
+            AFSDbgTrace(( AFS_SUBSYSTEM_AUTHGROUP_PROCESSING,
                           AFS_TRACE_LEVEL_VERBOSE,
                           "%s (%p) Located AuthGroup %wZ after validation\n",
                           __FUNCTION__,
                           Irp,
-                          &uniGUIDString);
+                          &uniGUIDString));
 
         }
         else
         {
-            AFSDbgLogMsg( AFS_SUBSYSTEM_AUTHGROUP_PROCESSING,
+            AFSDbgTrace(( AFS_SUBSYSTEM_AUTHGROUP_PROCESSING,
                           AFS_TRACE_LEVEL_VERBOSE,
                           "%s (%p) Failed to locate AuthGroup\n",
                           __FUNCTION__,
-                          Irp);
+                          Irp));
         }
 
         //
@@ -154,10 +154,10 @@ AFSCommonCreate( IN PDEVICE_OBJECT DeviceObject,
             pFileObject->FileName.Buffer == NULL)
         {
 
-            AFSDbgLogMsg( AFS_SUBSYSTEM_FILE_PROCESSING,
+            AFSDbgTrace(( AFS_SUBSYSTEM_FILE_PROCESSING,
                           AFS_TRACE_LEVEL_VERBOSE,
                           "AFSCommonCreate (%p) Processing volume open request\n",
-                          Irp);
+                          Irp));
 
             ntStatus = AFSOpenRedirector( Irp);
 
@@ -200,14 +200,14 @@ AFSCommonCreate( IN PDEVICE_OBJECT DeviceObject,
 try_exit:
 
         if ( pFileObject) {
-            AFSDbgLogMsg( AFS_SUBSYSTEM_AUTHGROUP_PROCESSING,
+            AFSDbgTrace(( AFS_SUBSYSTEM_AUTHGROUP_PROCESSING,
                           AFS_TRACE_LEVEL_VERBOSE,
                           "%s (%p) File \"%wZ\" AuthGroup '%wZ' ntStatus %08lX\n",
                           __FUNCTION__,
                           Irp,
                           &pFileObject->FileName,
                           &uniGUIDString,
-                          ntStatus);
+                          ntStatus));
         }
 
         if( uniGUIDString.Buffer != NULL)
index f1cc27a..73c418a 100644 (file)
@@ -122,4 +122,6 @@ GUID                AFSNoPAGAuthGroup;
 
 PAFSSetInformationToken AFSSetInformationToken = NULL;
 
+PAFSDbgLogMsg       AFSDebugTraceFnc = NULL;
+
 }
index 3c764d9..af38a7c 100644 (file)
@@ -81,9 +81,9 @@ try_exit:
     __except( AFSExceptionFilter( __FUNCTION__, GetExceptionCode(), GetExceptionInformation()) )
     {
 
-        AFSDbgLogMsg( 0,
+        AFSDbgTrace(( 0,
                       0,
-                      "EXCEPTION - AFSDevControl\n");
+                      "EXCEPTION - AFSDevControl\n"));
 
         AFSDumpTraceFilesFnc();
     }
index c47da01..362863b 100644 (file)
@@ -108,9 +108,9 @@ try_exit:
     __except( AFSExceptionFilter( __FUNCTION__, GetExceptionCode(), GetExceptionInformation()) )
     {
 
-        AFSDbgLogMsg( 0,
+        AFSDbgTrace(( 0,
                       0,
-                      "EXCEPTION - AFSDirControl\n");
+                      "EXCEPTION - AFSDirControl\n"));
 
         AFSDumpTraceFilesFnc();
     }
index 4c5a377..99a1185 100644 (file)
@@ -106,9 +106,9 @@ try_exit:
     __except( AFSExceptionFilter( __FUNCTION__, GetExceptionCode(), GetExceptionInformation()) )
     {
 
-        AFSDbgLogMsg( 0,
+        AFSDbgTrace(( 0,
                       0,
-                      "EXCEPTION - AFSQueryEA\n");
+                      "EXCEPTION - AFSQueryEA\n"));
 
         AFSDumpTraceFilesFnc();
     }
@@ -184,9 +184,9 @@ try_exit:
     __except( AFSExceptionFilter( __FUNCTION__, GetExceptionCode(), GetExceptionInformation()) )
     {
 
-        AFSDbgLogMsg( 0,
+        AFSDbgTrace(( 0,
                       0,
-                      "EXCEPTION - AFSSetEA\n");
+                      "EXCEPTION - AFSSetEA\n"));
 
         AFSDumpTraceFilesFnc();
     }
index f00eec0..0745ba8 100644 (file)
@@ -99,9 +99,9 @@ try_exit:
     __except( AFSExceptionFilter( __FUNCTION__, GetExceptionCode(), GetExceptionInformation()) )
     {
 
-        AFSDbgLogMsg( 0,
+        AFSDbgTrace(( 0,
                       0,
-                      "EXCEPTION - AFSFSControl\n");
+                      "EXCEPTION - AFSFSControl\n"));
 
         AFSDumpTraceFilesFnc();
     }
index 926da9d..366a009 100644 (file)
@@ -262,11 +262,11 @@ AFSFastIoAcquireFile( IN struct _FILE_OBJECT *FileObject)
 
     AFSFcb *pFcb = (AFSFcb *)FileObject->FsContext;
 
-    AFSDbgLogMsg( AFS_SUBSYSTEM_LOCK_PROCESSING,
+    AFSDbgTrace(( AFS_SUBSYSTEM_LOCK_PROCESSING,
                   AFS_TRACE_LEVEL_VERBOSE,
                   "AFSFastIoAcquireFile Acquiring Fcb SectionObject lock %p EXCL %08lX\n",
                   &pFcb->NPFcb->SectionObjectResource,
-                  PsGetCurrentThread());
+                  PsGetCurrentThread()));
 
     AFSAcquireExcl( &pFcb->NPFcb->SectionObjectResource,
                     TRUE);
@@ -283,11 +283,11 @@ AFSFastIoReleaseFile( IN struct _FILE_OBJECT *FileObject)
     if( ExIsResourceAcquiredExclusiveLite( &pFcb->NPFcb->SectionObjectResource))
     {
 
-        AFSDbgLogMsg( AFS_SUBSYSTEM_LOCK_PROCESSING,
+        AFSDbgTrace(( AFS_SUBSYSTEM_LOCK_PROCESSING,
                       AFS_TRACE_LEVEL_VERBOSE,
                       "AFSFastIoReleaseFile Releasing Fcb SectionObject lock %p EXCL %08lX\n",
                       &pFcb->NPFcb->SectionObjectResource,
-                      PsGetCurrentThread());
+                      PsGetCurrentThread()));
 
         AFSReleaseResource( &pFcb->NPFcb->SectionObjectResource);
     }
@@ -416,11 +416,11 @@ AFSFastIoAcquireForModWrite( IN struct _FILE_OBJECT *FileObject,
                             BooleanFlagOn( FileObject->Flags, FO_SYNCHRONOUS_IO)))
         {
 
-            AFSDbgLogMsg( AFS_SUBSYSTEM_LOCK_PROCESSING,
+            AFSDbgTrace(( AFS_SUBSYSTEM_LOCK_PROCESSING,
                           AFS_TRACE_LEVEL_VERBOSE,
                           "AFSFastIoAcquireForModWrite Acquired Fcb SectionObject lock %p EXCL %08lX\n",
                           &pFcb->NPFcb->SectionObjectResource,
-                          PsGetCurrentThread());
+                          PsGetCurrentThread()));
 
             ntStatus = STATUS_SUCCESS;
 
@@ -441,11 +441,11 @@ AFSFastIoReleaseForModWrite( IN struct _FILE_OBJECT *FileObject,
 
     NTSTATUS ntStatus = STATUS_SUCCESS;
 
-    AFSDbgLogMsg( AFS_SUBSYSTEM_LOCK_PROCESSING,
+    AFSDbgTrace(( AFS_SUBSYSTEM_LOCK_PROCESSING,
                   AFS_TRACE_LEVEL_VERBOSE,
                   "AFSFastIoReleaseForModWrite Releasing lock %p EXCL %08lX\n",
                   ResourceToRelease,
-                  PsGetCurrentThread());
+                  PsGetCurrentThread()));
 
     AFSReleaseResource( ResourceToRelease);
 
@@ -461,11 +461,11 @@ AFSFastIoAcquireForCCFlush( IN struct _FILE_OBJECT *FileObject,
     NTSTATUS ntStatus = STATUS_FILE_LOCK_CONFLICT;
     AFSFcb *pFcb = (AFSFcb *)FileObject->FsContext;
 
-    AFSDbgLogMsg( AFS_SUBSYSTEM_LOCK_PROCESSING,
+    AFSDbgTrace(( AFS_SUBSYSTEM_LOCK_PROCESSING,
                   AFS_TRACE_LEVEL_VERBOSE,
                   "AFSFastIoAcquireForCCFlush Acquiring Fcb PagingIo lock %p SHARED %08lX\n",
                   &pFcb->NPFcb->PagingResource,
-                  PsGetCurrentThread());
+                  PsGetCurrentThread()));
 
     AFSAcquireShared( &pFcb->NPFcb->PagingResource,
                       TRUE);
@@ -473,11 +473,11 @@ AFSFastIoAcquireForCCFlush( IN struct _FILE_OBJECT *FileObject,
     if( !ExIsResourceAcquiredSharedLite( &pFcb->NPFcb->SectionObjectResource))
     {
 
-        AFSDbgLogMsg( AFS_SUBSYSTEM_LOCK_PROCESSING,
+        AFSDbgTrace(( AFS_SUBSYSTEM_LOCK_PROCESSING,
                       AFS_TRACE_LEVEL_VERBOSE,
                       "AFSFastIoAcquireForCCFlush Acquiring Fcb SectionObject lock %p EXCL %08lX\n",
                       &pFcb->NPFcb->SectionObjectResource,
-                      PsGetCurrentThread());
+                      PsGetCurrentThread()));
 
         AFSAcquireExcl( &pFcb->NPFcb->SectionObjectResource,
                         TRUE);
@@ -485,11 +485,11 @@ AFSFastIoAcquireForCCFlush( IN struct _FILE_OBJECT *FileObject,
     else
     {
 
-        AFSDbgLogMsg( AFS_SUBSYSTEM_LOCK_PROCESSING,
+        AFSDbgTrace(( AFS_SUBSYSTEM_LOCK_PROCESSING,
                       AFS_TRACE_LEVEL_VERBOSE,
                       "AFSFastIoAcquireForCCFlush Acquiring Fcb SectionObject lock %p SHARED %08lX\n",
                       &pFcb->NPFcb->SectionObjectResource,
-                      PsGetCurrentThread());
+                      PsGetCurrentThread()));
 
         AFSAcquireShared( &pFcb->NPFcb->SectionObjectResource,
                           TRUE);
@@ -533,9 +533,9 @@ AFSFastIoReleaseForCCFlush( IN struct _FILE_OBJECT *FileObject,
     else
     {
 
-        AFSDbgLogMsg( AFS_SUBSYSTEM_FILE_PROCESSING,
+        AFSDbgTrace(( AFS_SUBSYSTEM_FILE_PROCESSING,
                       AFS_TRACE_LEVEL_ERROR,
-                      "AFSFastIoReleaseForCCFlush Called for non-acquired paging resource Fcb\n");
+                      "AFSFastIoReleaseForCCFlush Called for non-acquired paging resource Fcb\n"));
     }
 
     if( ExIsResourceAcquiredExclusiveLite( &pFcb->NPFcb->SectionObjectResource) ||
@@ -547,9 +547,9 @@ AFSFastIoReleaseForCCFlush( IN struct _FILE_OBJECT *FileObject,
     else
     {
 
-        AFSDbgLogMsg( AFS_SUBSYSTEM_FILE_PROCESSING,
+        AFSDbgTrace(( AFS_SUBSYSTEM_FILE_PROCESSING,
                       AFS_TRACE_LEVEL_ERROR,
-                      "AFSFastIoReleaseForCCFlush Called for non-acquired SectionObject resource Fcb\n");
+                      "AFSFastIoReleaseForCCFlush Called for non-acquired SectionObject resource Fcb\n"));
     }
 
     return ntStatus;
index bc87426..888a4eb 100644 (file)
@@ -127,9 +127,9 @@ try_exit:
     __except( AFSExceptionFilter( __FUNCTION__, GetExceptionCode(), GetExceptionInformation()) )
     {
 
-        AFSDbgLogMsg( 0,
+        AFSDbgTrace(( 0,
                       0,
-                      "EXCEPTION - AFSQueryFileInfo\n");
+                      "EXCEPTION - AFSQueryFileInfo\n"));
 
         ntStatus = STATUS_UNSUCCESSFUL;
 
@@ -229,9 +229,9 @@ try_exit:
     __except( AFSExceptionFilter( __FUNCTION__, GetExceptionCode(), GetExceptionInformation()) )
     {
 
-        AFSDbgLogMsg( 0,
+        AFSDbgTrace(( 0,
                       0,
-                      "EXCEPTION - AFSSetFileInfo\n");
+                      "EXCEPTION - AFSSetFileInfo\n"));
 
         ntStatus = STATUS_UNSUCCESSFUL;
 
index 5433480..4d42de3 100644 (file)
@@ -67,7 +67,7 @@ AFSExceptionFilter( IN CHAR *FunctionString,
 
         Context = ExceptPtrs->ContextRecord;
 
-        AFSDbgLogMsg( 0,
+        AFSDbgTrace(( 0,
                       0,
                       "AFSExceptionFilter (Framework) - EXR %p CXR %p Function %s Code %08lX Address %p Routine %p\n",
                       ExceptRec,
@@ -75,7 +75,7 @@ AFSExceptionFilter( IN CHAR *FunctionString,
                       FunctionString,
                       ExceptRec->ExceptionCode,
                       ExceptRec->ExceptionAddress,
-                      (void *)AFSExceptionFilter);
+                      (void *)AFSExceptionFilter));
 
         DbgPrint("**** Exception Caught in AFS Redirector ****\n");
 
@@ -217,11 +217,11 @@ AFSReleaseResource( IN PERESOURCE Resource)
     if( Resource != &AFSDbgLogLock)
     {
 
-        AFSDbgLogMsg( AFS_SUBSYSTEM_LOCK_PROCESSING,
+        AFSDbgTrace(( AFS_SUBSYSTEM_LOCK_PROCESSING,
                       AFS_TRACE_LEVEL_VERBOSE,
                       "AFSReleaseResource Releasing lock %p Thread %08lX\n",
                       Resource,
-                      PsGetCurrentThread());
+                      PsGetCurrentThread()));
     }
 
     ExReleaseResourceLite( Resource);
@@ -235,11 +235,11 @@ void
 AFSConvertToShared( IN PERESOURCE Resource)
 {
 
-    AFSDbgLogMsg( AFS_SUBSYSTEM_LOCK_PROCESSING,
+    AFSDbgTrace(( AFS_SUBSYSTEM_LOCK_PROCESSING,
                   AFS_TRACE_LEVEL_VERBOSE,
                   "AFSConvertToShared Converting lock %p Thread %08lX\n",
                   Resource,
-                  PsGetCurrentThread());
+                  PsGetCurrentThread()));
 
     ExConvertExclusiveToSharedLite( Resource);
 
@@ -1150,11 +1150,11 @@ AFSSetSysNameInformation( IN AFSSysNameNotificationCB *SysNameInfo,
         // Process the request
         //
 
-        AFSDbgLogMsg( AFS_SUBSYSTEM_LOCK_PROCESSING,
+        AFSDbgTrace(( AFS_SUBSYSTEM_LOCK_PROCESSING,
                       AFS_TRACE_LEVEL_VERBOSE,
                       "AFSSetSysNameInformation Acquiring SysName lock %p EXCL %08lX\n",
                       pSysNameLock,
-                      PsGetCurrentThread());
+                      PsGetCurrentThread()));
 
         AFSAcquireExcl( pSysNameLock,
                         TRUE);
@@ -1335,10 +1335,10 @@ AFSSendDeviceIoControl( IN DEVICE_OBJECT *TargetDeviceObject,
         // Set the completion routine.
         //
 
-        AFSDbgLogMsg( AFS_SUBSYSTEM_IO_PROCESSING,
+        AFSDbgTrace(( AFS_SUBSYSTEM_IO_PROCESSING,
                       AFS_TRACE_LEVEL_VERBOSE,
                       "Setting AFSIrpComplete as IoCompletion Routine Irp %p\n",
-                      pIrp);
+                      pIrp));
 
         IoSetCompletionRoutine( pIrp,
                                 AFSIrpComplete,
@@ -1465,13 +1465,13 @@ AFSExAllocatePoolWithTag( IN POOL_TYPE  PoolType,
             if ( bTimeout || pControlDevExt == NULL)
             {
 
-                AFSDbgLogMsg( 0,
+                AFSDbgTrace(( 0,
                               0,
                               "AFSExAllocatePoolWithTag failure Type %08lX Size %08lX Tag %08lX %08lX\n",
                               PoolType,
                               NumberOfBytes,
                               Tag,
-                              PsGetCurrentThread());
+                              PsGetCurrentThread()));
 
                 switch ( Tag ) {
 
@@ -1563,12 +1563,12 @@ AFSShutdownRedirector()
     __Enter
     {
 
-        AFSDbgLogMsg( AFS_SUBSYSTEM_FILE_PROCESSING,
+        AFSDbgTrace(( AFS_SUBSYSTEM_FILE_PROCESSING,
                       AFS_TRACE_LEVEL_VERBOSE,
                       "%s Shutting down redirector Extent count %08lX Request count %08lX\n",
                       __FUNCTION__,
                       pControlDevExt->Specific.Control.ExtentCount,
-                      pControlDevExt->Specific.Control.OutstandingServiceRequestCount);
+                      pControlDevExt->Specific.Control.OutstandingServiceRequestCount));
 
         //
         // Set the shutdown flag so the worker is more agressive in tearing down extents
@@ -1591,10 +1591,10 @@ AFSShutdownRedirector()
         if( ntStatus == STATUS_TIMEOUT)
         {
 
-            AFSDbgLogMsg( AFS_SUBSYSTEM_FILE_PROCESSING,
+            AFSDbgTrace(( AFS_SUBSYSTEM_FILE_PROCESSING,
                           AFS_TRACE_LEVEL_WARNING,
                           "AFSShutdownRedirector Failed to complete all service requests Remaining count %08lX\n",
-                          pControlDevExt->Specific.Control.OutstandingServiceRequestCount);
+                          pControlDevExt->Specific.Control.OutstandingServiceRequestCount));
 
             try_return( ntStatus = STATUS_UNSUCCESSFUL);
         }
@@ -1616,10 +1616,10 @@ AFSShutdownRedirector()
         if( ntStatus == STATUS_TIMEOUT)
         {
 
-            AFSDbgLogMsg( AFS_SUBSYSTEM_FILE_PROCESSING,
+            AFSDbgTrace(( AFS_SUBSYSTEM_FILE_PROCESSING,
                           AFS_TRACE_LEVEL_WARNING,
                           "AFSShutdownRedirector Failed to purge all extents Remaining count %08lX\n",
-                          pControlDevExt->Specific.Control.ExtentCount);
+                          pControlDevExt->Specific.Control.ExtentCount));
 
             try_return( ntStatus = STATUS_UNSUCCESSFUL);
         }
@@ -1634,13 +1634,13 @@ AFSShutdownRedirector()
 
 try_exit:
 
-        AFSDbgLogMsg( AFS_SUBSYSTEM_FILE_PROCESSING,
+        AFSDbgTrace(( AFS_SUBSYSTEM_FILE_PROCESSING,
                       AFS_TRACE_LEVEL_VERBOSE,
                       "%s Completed shut down of redirector Extent count %08lX Request count %08lX Status %08lX\n",
                       __FUNCTION__,
                       pControlDevExt->Specific.Control.ExtentCount,
                       pControlDevExt->Specific.Control.OutstandingServiceRequestCount,
-                      ntStatus);
+                      ntStatus));
     }
 
     return ntStatus;
@@ -1663,48 +1663,48 @@ AFSAcquireFcbForLazyWrite( IN PVOID Fcb,
     // Try and acquire the Fcb resource
     //
 
-    AFSDbgLogMsg( AFS_SUBSYSTEM_IO_PROCESSING,
+    AFSDbgTrace(( AFS_SUBSYSTEM_IO_PROCESSING,
                   AFS_TRACE_LEVEL_VERBOSE,
                   "AFSAcquireFcbForLazyWrite Acquiring Fcb %p\n",
-                  Fcb);
+                  Fcb));
 
     //
     // Try and grab the paging
     //
 
-    AFSDbgLogMsg( AFS_SUBSYSTEM_LOCK_PROCESSING,
+    AFSDbgTrace(( AFS_SUBSYSTEM_LOCK_PROCESSING,
                   AFS_TRACE_LEVEL_VERBOSE,
                   "AFSAcquireFcbForLazyWrite Attempt to acquire Fcb PagingIo lock %p SHARED %08lX\n",
                   &pFcb->NPFcb->PagingResource,
-                  PsGetCurrentThread());
+                  PsGetCurrentThread()));
 
     if( AFSAcquireShared( &pFcb->NPFcb->PagingResource,
                           Wait))
     {
 
-        AFSDbgLogMsg( AFS_SUBSYSTEM_LOCK_PROCESSING,
+        AFSDbgTrace(( AFS_SUBSYSTEM_LOCK_PROCESSING,
                       AFS_TRACE_LEVEL_VERBOSE,
                       "AFSAcquireFcbForLazyWrite Acquired Fcb PagingIo lock %p SHARED %08lX\n",
                       &pFcb->NPFcb->PagingResource,
-                      PsGetCurrentThread());
+                      PsGetCurrentThread()));
 
         bReleasePaging = TRUE;
 
-        AFSDbgLogMsg( AFS_SUBSYSTEM_LOCK_PROCESSING,
+        AFSDbgTrace(( AFS_SUBSYSTEM_LOCK_PROCESSING,
                       AFS_TRACE_LEVEL_VERBOSE,
                       "AFSAcquireFcbForLazyWrite Attempt to acquire Fcb SectionObject lock %p SHARED %08lX\n",
                       &pFcb->NPFcb->SectionObjectResource,
-                      PsGetCurrentThread());
+                      PsGetCurrentThread()));
 
         if( AFSAcquireShared( &pFcb->NPFcb->SectionObjectResource,
                               Wait))
         {
 
-            AFSDbgLogMsg( AFS_SUBSYSTEM_LOCK_PROCESSING,
+            AFSDbgTrace(( AFS_SUBSYSTEM_LOCK_PROCESSING,
                           AFS_TRACE_LEVEL_VERBOSE,
                           "AFSAcquireFcbForLazyWrite Acquired Fcb SectionObject lock %p SHARED %08lX\n",
                           &pFcb->NPFcb->SectionObjectResource,
-                          PsGetCurrentThread());
+                          PsGetCurrentThread()));
 
             bReleaseSectionObject = TRUE;
 
@@ -1743,10 +1743,10 @@ AFSReleaseFcbFromLazyWrite( IN PVOID Fcb)
 
     AFSFcb *pFcb = (AFSFcb *)Fcb;
 
-    AFSDbgLogMsg( AFS_SUBSYSTEM_IO_PROCESSING,
+    AFSDbgTrace(( AFS_SUBSYSTEM_IO_PROCESSING,
                   AFS_TRACE_LEVEL_VERBOSE,
                   "AFSReleaseFcbFromLazyWrite Releasing Fcb %p\n",
-                  Fcb);
+                  Fcb));
 
     IoSetTopLevelIrp( NULL);
 
@@ -1765,21 +1765,21 @@ AFSAcquireFcbForReadAhead( IN PVOID Fcb,
     BOOLEAN bStatus = FALSE;
     AFSFcb *pFcb = (AFSFcb *)Fcb;
 
-    AFSDbgLogMsg( AFS_SUBSYSTEM_LOCK_PROCESSING,
+    AFSDbgTrace(( AFS_SUBSYSTEM_LOCK_PROCESSING,
                   AFS_TRACE_LEVEL_VERBOSE,
                   "AFSAcquireFcbForReadAhead Attempt to acquire Fcb SectionObject lock %p SHARED %08lX\n",
                   &pFcb->NPFcb->SectionObjectResource,
-                  PsGetCurrentThread());
+                  PsGetCurrentThread()));
 
     if( AFSAcquireShared( &pFcb->NPFcb->SectionObjectResource,
                           Wait))
     {
 
-        AFSDbgLogMsg( AFS_SUBSYSTEM_LOCK_PROCESSING,
+        AFSDbgTrace(( AFS_SUBSYSTEM_LOCK_PROCESSING,
                       AFS_TRACE_LEVEL_VERBOSE,
                       "AFSAcquireFcbForReadAhead Acquired Fcb SectionObject lock %p SHARED %08lX\n",
                       &pFcb->NPFcb->SectionObjectResource,
-                      PsGetCurrentThread());
+                      PsGetCurrentThread()));
 
         bStatus = TRUE;
 
@@ -1831,9 +1831,9 @@ AFSGetCallerSID( OUT UNICODE_STRING *SIDString, OUT BOOLEAN *pbImpersonation)
             if( hToken == NULL)
             {
 
-                AFSDbgLogMsg( AFS_SUBSYSTEM_FILE_PROCESSING,
+                AFSDbgTrace(( AFS_SUBSYSTEM_FILE_PROCESSING,
                               AFS_TRACE_LEVEL_ERROR,
-                              "AFSGetCallerSID Failed to retrieve impersonation or primary token\n");
+                              "AFSGetCallerSID Failed to retrieve impersonation or primary token\n"));
 
                 try_return( ntStatus);
             }
@@ -1848,9 +1848,10 @@ AFSGetCallerSID( OUT UNICODE_STRING *SIDString, OUT BOOLEAN *pbImpersonation)
         if( !NT_SUCCESS( ntStatus))
         {
 
-            AFSDbgLogMsg( AFS_SUBSYSTEM_FILE_PROCESSING,
+            AFSDbgTrace(( AFS_SUBSYSTEM_FILE_PROCESSING,
                           AFS_TRACE_LEVEL_ERROR,
-                          "AFSGetCallerSID Failed to retrieve information Status %08lX\n", ntStatus);
+                          "AFSGetCallerSID Failed to retrieve information Status %08lX\n",
+                          ntStatus));
 
             try_return( ntStatus);
         }
@@ -1866,19 +1867,20 @@ AFSGetCallerSID( OUT UNICODE_STRING *SIDString, OUT BOOLEAN *pbImpersonation)
         if( !NT_SUCCESS( ntStatus))
         {
 
-            AFSDbgLogMsg( AFS_SUBSYSTEM_FILE_PROCESSING,
+            AFSDbgTrace(( AFS_SUBSYSTEM_FILE_PROCESSING,
                           AFS_TRACE_LEVEL_ERROR,
-                          "AFSGetCallerSID Failed to convert sid to string Status %08lX\n", ntStatus);
+                          "AFSGetCallerSID Failed to convert sid to string Status %08lX\n",
+                          ntStatus));
 
             try_return( ntStatus);
         }
 
         *SIDString = uniSIDString;
 
-        AFSDbgLogMsg( AFS_SUBSYSTEM_FILE_PROCESSING | AFS_SUBSYSTEM_AUTHGROUP_PROCESSING,
+        AFSDbgTrace(( AFS_SUBSYSTEM_FILE_PROCESSING | AFS_SUBSYSTEM_AUTHGROUP_PROCESSING,
                       AFS_TRACE_LEVEL_VERBOSE_2,
                       "AFSGetCallerSID Successfully retrieved SID %wZ\n",
-                      SIDString);
+                      SIDString));
 
         if ( bPrimaryToken == FALSE &&
              pbImpersonation)
@@ -1938,9 +1940,9 @@ AFSGetSessionId( IN HANDLE ProcessId, OUT BOOLEAN *pbImpersonation)
             if( hToken == NULL)
             {
 
-                AFSDbgLogMsg( AFS_SUBSYSTEM_FILE_PROCESSING,
+                AFSDbgTrace(( AFS_SUBSYSTEM_FILE_PROCESSING,
                               AFS_TRACE_LEVEL_ERROR,
-                              "AFSGetSessionId Failed to retrieve impersonation or primary token\n");
+                              "AFSGetSessionId Failed to retrieve impersonation or primary token\n"));
 
                 try_return( ntStatus);
             }
@@ -1956,18 +1958,18 @@ AFSGetSessionId( IN HANDLE ProcessId, OUT BOOLEAN *pbImpersonation)
         {
             ulSessionId = (ULONG)-1;
 
-            AFSDbgLogMsg( AFS_SUBSYSTEM_FILE_PROCESSING,
+            AFSDbgTrace(( AFS_SUBSYSTEM_FILE_PROCESSING,
                           AFS_TRACE_LEVEL_ERROR,
                           "AFSGetSessionId Failed to retrieve session id Status %08lX\n",
-                          ntStatus);
+                          ntStatus));
 
             try_return( ntStatus);
         }
 
-        AFSDbgLogMsg( AFS_SUBSYSTEM_FILE_PROCESSING | AFS_SUBSYSTEM_AUTHGROUP_PROCESSING,
+        AFSDbgTrace(( AFS_SUBSYSTEM_FILE_PROCESSING | AFS_SUBSYSTEM_AUTHGROUP_PROCESSING,
                       AFS_TRACE_LEVEL_VERBOSE_2,
                       "AFSGetSessionId found %08lX\n",
-                      ulSessionId);
+                      ulSessionId));
 
         if ( bPrimaryToken == FALSE &&
              pbImpersonation)
index 2281d80..5d8774f 100644 (file)
@@ -541,9 +541,9 @@ try_exit:
     __except( AFSExceptionFilter( __FUNCTION__, GetExceptionCode(), GetExceptionInformation()) )
     {
 
-        AFSDbgLogMsg( 0,
+        AFSDbgTrace(( 0,
                       0,
-                      "EXCEPTION - AFSRedirFs DriverEntry\n");
+                      "EXCEPTION - AFSRedirFs DriverEntry\n"));
 
         AFSDumpTraceFilesFnc();
     }
index 371f660..e1707c6 100644 (file)
@@ -59,9 +59,9 @@ AFSInternalDevControl( IN PDEVICE_OBJECT DeviceObject,
     __except( AFSExceptionFilter( __FUNCTION__, GetExceptionCode(), GetExceptionInformation()) )
     {
 
-        AFSDbgLogMsg( 0,
+        AFSDbgTrace(( 0,
                       0,
-                      "EXCEPTION - AFSInternalDevControl\n");
+                      "EXCEPTION - AFSInternalDevControl\n"));
 
         AFSDumpTraceFilesFnc();
     }
index 5de9bc9..6bde1b4 100644 (file)
@@ -59,10 +59,10 @@ AFSLoadLibrary( IN ULONG Flags,
         // other requests coming through
         //
 
-        AFSDbgLogMsg( AFS_SUBSYSTEM_LOAD_LIBRARY,
+        AFSDbgTrace(( AFS_SUBSYSTEM_LOAD_LIBRARY,
                       AFS_TRACE_LEVEL_VERBOSE,
                       "%s Start load library\n",
-                      __FUNCTION__);
+                      __FUNCTION__));
 
         ntStatus = KeWaitForSingleObject( &pDevExt->Specific.Control.LoadLibraryEvent,
                                           Executive,
@@ -73,10 +73,10 @@ AFSLoadLibrary( IN ULONG Flags,
         if( !NT_SUCCESS( ntStatus))
         {
 
-            AFSDbgLogMsg( AFS_SUBSYSTEM_LOAD_LIBRARY | AFS_SUBSYSTEM_INIT_PROCESSING,
+            AFSDbgTrace(( AFS_SUBSYSTEM_LOAD_LIBRARY | AFS_SUBSYSTEM_INIT_PROCESSING,
                           AFS_TRACE_LEVEL_ERROR,
                           "AFSLoadLibrary Wait for LoadLibraryEvent failure %08lX\n",
-                          ntStatus);
+                          ntStatus));
 
             try_return( ntStatus);
         }
@@ -88,10 +88,10 @@ AFSLoadLibrary( IN ULONG Flags,
         if( BooleanFlagOn( pDevExt->Specific.Control.LibraryState, AFS_LIBRARY_LOADED))
         {
 
-            AFSDbgLogMsg( AFS_SUBSYSTEM_LOAD_LIBRARY | AFS_SUBSYSTEM_INIT_PROCESSING,
+            AFSDbgTrace(( AFS_SUBSYSTEM_LOAD_LIBRARY | AFS_SUBSYSTEM_INIT_PROCESSING,
                           AFS_TRACE_LEVEL_VERBOSE,
                           "%s Library already loaded\n",
-                          __FUNCTION__);
+                          __FUNCTION__));
 
             try_return( ntStatus = STATUS_DEVICE_NOT_READY);
         }
@@ -103,9 +103,9 @@ AFSLoadLibrary( IN ULONG Flags,
         if( pDevExt->Specific.Control.LibraryServicePath.Buffer == NULL)
         {
 
-            AFSDbgLogMsg( AFS_SUBSYSTEM_LOAD_LIBRARY | AFS_SUBSYSTEM_INIT_PROCESSING,
+            AFSDbgTrace(( AFS_SUBSYSTEM_LOAD_LIBRARY | AFS_SUBSYSTEM_INIT_PROCESSING,
                           AFS_TRACE_LEVEL_ERROR,
-                          "AFSLoadLibrary AFS_GENERIC_MEMORY_25_TAG allocation error\n");
+                          "AFSLoadLibrary AFS_GENERIC_MEMORY_25_TAG allocation error\n"));
 
             try_return( ntStatus = STATUS_INSUFFICIENT_RESOURCES);
         }
@@ -129,11 +129,11 @@ AFSLoadLibrary( IN ULONG Flags,
         if( !NT_SUCCESS( ntStatus))
         {
 
-            AFSDbgLogMsg( AFS_SUBSYSTEM_LOAD_LIBRARY | AFS_SUBSYSTEM_INIT_PROCESSING,
+            AFSDbgTrace(( AFS_SUBSYSTEM_LOAD_LIBRARY | AFS_SUBSYSTEM_INIT_PROCESSING,
                           AFS_TRACE_LEVEL_ERROR,
                           "%s Failed to load library Status %08lX\n",
                           __FUNCTION__,
-                          ntStatus);
+                          ntStatus));
 
             try_return( ntStatus);
         }
@@ -152,10 +152,10 @@ AFSLoadLibrary( IN ULONG Flags,
 
         if( !NT_SUCCESS( ntStatus))
         {
-            AFSDbgLogMsg( AFS_SUBSYSTEM_LOAD_LIBRARY | AFS_SUBSYSTEM_INIT_PROCESSING,
+            AFSDbgTrace(( AFS_SUBSYSTEM_LOAD_LIBRARY | AFS_SUBSYSTEM_INIT_PROCESSING,
                           AFS_TRACE_LEVEL_ERROR,
                           "AFSLoadLibrary IoGetDeviceObjectPointer failure %08lX\n",
-                          ntStatus);
+                          ntStatus));
 
             try_return( ntStatus);
         }
@@ -186,10 +186,10 @@ AFSLoadLibrary( IN ULONG Flags,
 
         ClearFlag( pDevExt->Specific.Control.LibraryState, AFS_LIBRARY_QUEUE_CANCELLED);
 
-        AFSDbgLogMsg( AFS_SUBSYSTEM_LOAD_LIBRARY | AFS_SUBSYSTEM_INIT_PROCESSING,
+        AFSDbgTrace(( AFS_SUBSYSTEM_LOAD_LIBRARY | AFS_SUBSYSTEM_INIT_PROCESSING,
                       AFS_TRACE_LEVEL_VERBOSE,
                       "%s Completed load library, processing queued requests\n",
-                      __FUNCTION__);
+                      __FUNCTION__));
 
         AFSReleaseResource( &pDevExt->Specific.Control.LibraryStateLock);
 
@@ -201,11 +201,11 @@ AFSLoadLibrary( IN ULONG Flags,
 
 try_exit:
 
-        AFSDbgLogMsg( AFS_SUBSYSTEM_LOAD_LIBRARY | AFS_SUBSYSTEM_INIT_PROCESSING,
+        AFSDbgTrace(( AFS_SUBSYSTEM_LOAD_LIBRARY | AFS_SUBSYSTEM_INIT_PROCESSING,
                       AFS_TRACE_LEVEL_VERBOSE,
                       "%s Library load complete Status %08lX\n",
                       __FUNCTION__,
-                      ntStatus);
+                      ntStatus));
 
         if( !NT_SUCCESS( ntStatus))
         {
@@ -247,10 +247,10 @@ AFSUnloadLibrary( IN BOOLEAN CancelQueue)
         // other requests coming through
         //
 
-        AFSDbgLogMsg( AFS_SUBSYSTEM_LOAD_LIBRARY,
+        AFSDbgTrace(( AFS_SUBSYSTEM_LOAD_LIBRARY,
                       AFS_TRACE_LEVEL_VERBOSE,
                       "%s Start unload library\n",
-                      __FUNCTION__);
+                      __FUNCTION__));
 
         ntStatus = KeWaitForSingleObject( &pDevExt->Specific.Control.LoadLibraryEvent,
                                           Executive,
@@ -313,11 +313,11 @@ AFSUnloadLibrary( IN BOOLEAN CancelQueue)
                 ntStatus != STATUS_SUCCESS)
             {
 
-                AFSDbgLogMsg( AFS_SUBSYSTEM_LOAD_LIBRARY,
+                AFSDbgTrace(( AFS_SUBSYSTEM_LOAD_LIBRARY,
                               AFS_TRACE_LEVEL_VERBOSE,
                               "%s Failed request event Status %08lX\n",
                               __FUNCTION__,
-                              ntStatus);
+                              ntStatus));
 
                 SetFlag( pDevExt->Specific.Control.LibraryState, AFS_LIBRARY_LOADED);
 
@@ -328,19 +328,19 @@ AFSUnloadLibrary( IN BOOLEAN CancelQueue)
                 try_return( ntStatus);
             }
 
-            AFSDbgLogMsg( AFS_SUBSYSTEM_LOAD_LIBRARY,
+            AFSDbgTrace(( AFS_SUBSYSTEM_LOAD_LIBRARY,
                           AFS_TRACE_LEVEL_VERBOSE,
                           "%s Wait for inflight requests to complete %08lX\n",
                           __FUNCTION__,
-                          pDevExt->Specific.Control.InflightLibraryRequests);
+                          pDevExt->Specific.Control.InflightLibraryRequests));
         }
 
         AFSReleaseResource( &pDevExt->Specific.Control.LibraryStateLock);
 
-        AFSDbgLogMsg( AFS_SUBSYSTEM_LOAD_LIBRARY,
+        AFSDbgTrace(( AFS_SUBSYSTEM_LOAD_LIBRARY,
                       AFS_TRACE_LEVEL_VERBOSE,
                       "%s Processing queued results\n",
-                      __FUNCTION__);
+                      __FUNCTION__));
 
         AFSProcessQueuedResults( TRUE);
 
@@ -369,11 +369,11 @@ AFSUnloadLibrary( IN BOOLEAN CancelQueue)
 
 try_exit:
 
-        AFSDbgLogMsg( AFS_SUBSYSTEM_LOAD_LIBRARY,
+        AFSDbgTrace(( AFS_SUBSYSTEM_LOAD_LIBRARY,
                       AFS_TRACE_LEVEL_VERBOSE,
                       "%s Library unload complete Status %08lX\n",
                       __FUNCTION__,
-                      ntStatus);
+                      ntStatus));
 
         KeSetEvent( &pDevExt->Specific.Control.LoadLibraryEvent,
                     0,
@@ -398,13 +398,13 @@ AFSCheckLibraryState( IN PIRP Irp)
         AFSAcquireShared( &pDevExt->Specific.Control.LibraryStateLock,
                           TRUE);
 
-        AFSDbgLogMsg( AFS_SUBSYSTEM_LOAD_LIBRARY,
+        AFSDbgTrace(( AFS_SUBSYSTEM_LOAD_LIBRARY,
                       AFS_TRACE_LEVEL_VERBOSE,
                       "%s Entry State %08lX Irp %p Function %08lX\n",
                       __FUNCTION__,
                       pRDRDevExt->DeviceFlags,
                       Irp,
-                      pIrpSp->MajorFunction);
+                      pIrpSp->MajorFunction));
 
         if( BooleanFlagOn( pRDRDevExt->DeviceFlags, AFS_DEVICE_FLAG_REDIRECTOR_SHUTDOWN))
         {
@@ -418,31 +418,31 @@ AFSCheckLibraryState( IN PIRP Irp)
             if( Irp != NULL)
             {
 
-                AFSDbgLogMsg( AFS_SUBSYSTEM_LOAD_LIBRARY,
+                AFSDbgTrace(( AFS_SUBSYSTEM_LOAD_LIBRARY,
                               AFS_TRACE_LEVEL_VERBOSE,
                               "%s Queuing request %p\n",
                               __FUNCTION__,
-                              Irp);
+                              Irp));
 
                 ntStatus = AFSQueueLibraryRequest( Irp);
 
-                AFSDbgLogMsg( AFS_SUBSYSTEM_LOAD_LIBRARY,
+                AFSDbgTrace(( AFS_SUBSYSTEM_LOAD_LIBRARY,
                               AFS_TRACE_LEVEL_VERBOSE,
                               "%s Queued request %p Status %08lX\n",
                               __FUNCTION__,
                               Irp,
-                              ntStatus);
+                              ntStatus));
             }
             else
             {
 
                 ntStatus = STATUS_TOO_LATE;
 
-                AFSDbgLogMsg( AFS_SUBSYSTEM_LOAD_LIBRARY,
+                AFSDbgTrace(( AFS_SUBSYSTEM_LOAD_LIBRARY,
                               AFS_TRACE_LEVEL_VERBOSE,
                               "%s Failing request %p\n",
                               __FUNCTION__,
-                              Irp);
+                              Irp));
             }
 
             try_return( ntStatus);
@@ -455,13 +455,13 @@ AFSCheckLibraryState( IN PIRP Irp)
 
 try_exit:
 
-        AFSDbgLogMsg( AFS_SUBSYSTEM_LOAD_LIBRARY,
+        AFSDbgTrace(( AFS_SUBSYSTEM_LOAD_LIBRARY,
                       AFS_TRACE_LEVEL_VERBOSE,
                       "%s Completed Irp %p Status %08lX Inflight Count %08lX\n",
                       __FUNCTION__,
                       Irp,
                       ntStatus,
-                      pDevExt->Specific.Control.InflightLibraryRequests);
+                      pDevExt->Specific.Control.InflightLibraryRequests));
 
         AFSReleaseResource( &pDevExt->Specific.Control.LibraryStateLock);
     }
@@ -478,11 +478,11 @@ AFSClearLibraryRequest()
 
     __Enter
     {
-        AFSDbgLogMsg( AFS_SUBSYSTEM_LOAD_LIBRARY,
+        AFSDbgTrace(( AFS_SUBSYSTEM_LOAD_LIBRARY,
                       AFS_TRACE_LEVEL_VERBOSE,
                       "%s Inflight Count %08lX\n",
                       __FUNCTION__,
-                      pDevExt->Specific.Control.InflightLibraryRequests);
+                      pDevExt->Specific.Control.InflightLibraryRequests));
 
         if( InterlockedDecrement( &pDevExt->Specific.Control.InflightLibraryRequests) == 0)
         {
@@ -513,12 +513,12 @@ AFSQueueLibraryRequest( IN PIRP Irp)
         AFSAcquireExcl( &pDevExt->Specific.Control.LibraryQueueLock,
                         TRUE);
 
-        AFSDbgLogMsg( AFS_SUBSYSTEM_LOAD_LIBRARY,
+        AFSDbgTrace(( AFS_SUBSYSTEM_LOAD_LIBRARY,
                       AFS_TRACE_LEVEL_VERBOSE,
                       "%s Entry for Irp %p Function %08lX\n",
                       __FUNCTION__,
                       Irp,
-                      pIrpSp->MajorFunction);
+                      pIrpSp->MajorFunction));
 
         //
         // Has the load processing timed out and we are no longer
@@ -529,11 +529,11 @@ AFSQueueLibraryRequest( IN PIRP Irp)
             BooleanFlagOn( pRDRDevExt->DeviceFlags, AFS_DEVICE_FLAG_REDIRECTOR_SHUTDOWN))
         {
 
-            AFSDbgLogMsg( AFS_SUBSYSTEM_LOAD_LIBRARY,
+            AFSDbgTrace(( AFS_SUBSYSTEM_LOAD_LIBRARY,
                           AFS_TRACE_LEVEL_ERROR,
                           "%s Library not loaded for Irp %p\n",
                           __FUNCTION__,
-                          Irp);
+                          Irp));
 
             try_return( ntStatus = STATUS_DEVICE_NOT_READY);
         }
@@ -569,12 +569,12 @@ AFSQueueLibraryRequest( IN PIRP Irp)
 
 try_exit:
 
-        AFSDbgLogMsg( AFS_SUBSYSTEM_LOAD_LIBRARY,
+        AFSDbgTrace(( AFS_SUBSYSTEM_LOAD_LIBRARY,
                       AFS_TRACE_LEVEL_VERBOSE,
                       "%s Completed for Irp %p Status %08lX\n",
                       __FUNCTION__,
                       Irp,
-                      ntStatus);
+                      ntStatus));
 
         AFSReleaseResource( &pDevExt->Specific.Control.LibraryQueueLock);
     }
@@ -593,10 +593,10 @@ AFSProcessQueuedResults( IN BOOLEAN CancelRequest)
     __Enter
     {
 
-        AFSDbgLogMsg( AFS_SUBSYSTEM_LOAD_LIBRARY,
+        AFSDbgTrace(( AFS_SUBSYSTEM_LOAD_LIBRARY,
                       AFS_TRACE_LEVEL_VERBOSE,
                       "%s Entry\n",
-                      __FUNCTION__);
+                      __FUNCTION__));
 
         //
         // Loop through the queue either resubmitting requests or cancelling them
@@ -633,11 +633,11 @@ AFSProcessQueuedResults( IN BOOLEAN CancelRequest)
 
                 pRequest->Irp->IoStatus.Status = STATUS_CANCELLED;
 
-                AFSDbgLogMsg( AFS_SUBSYSTEM_LOAD_LIBRARY,
+                AFSDbgTrace(( AFS_SUBSYSTEM_LOAD_LIBRARY,
                               AFS_TRACE_LEVEL_VERBOSE,
                               "%s Cancelling request Irp %p\n",
                               __FUNCTION__,
-                              pRequest->Irp);
+                              pRequest->Irp));
 
                 IoCompleteRequest( pRequest->Irp,
                                    IO_NO_INCREMENT);
@@ -645,11 +645,11 @@ AFSProcessQueuedResults( IN BOOLEAN CancelRequest)
             else
             {
 
-                AFSDbgLogMsg( AFS_SUBSYSTEM_LOAD_LIBRARY,
+                AFSDbgTrace(( AFS_SUBSYSTEM_LOAD_LIBRARY,
                               AFS_TRACE_LEVEL_VERBOSE,
                               "%s Resubmitting request Irp %p\n",
                               __FUNCTION__,
-                              pRequest->Irp);
+                              pRequest->Irp));
 
                 AFSSubmitLibraryRequest( pRequest->Irp);
             }
@@ -657,10 +657,10 @@ AFSProcessQueuedResults( IN BOOLEAN CancelRequest)
             ExFreePool( pRequest);
         }
 
-        AFSDbgLogMsg( AFS_SUBSYSTEM_LOAD_LIBRARY,
+        AFSDbgTrace(( AFS_SUBSYSTEM_LOAD_LIBRARY,
                       AFS_TRACE_LEVEL_VERBOSE,
                       "%s Completed\n",
-                      __FUNCTION__);
+                      __FUNCTION__));
     }
 
     return ntStatus;
@@ -676,12 +676,12 @@ AFSSubmitLibraryRequest( IN PIRP Irp)
     __Enter
     {
 
-        AFSDbgLogMsg( AFS_SUBSYSTEM_LOAD_LIBRARY,
+        AFSDbgTrace(( AFS_SUBSYSTEM_LOAD_LIBRARY,
                       AFS_TRACE_LEVEL_VERBOSE,
                       "%s Submitting Irp %p Function %08lX\n",
                       __FUNCTION__,
                       Irp,
-                      pIrpSp->MajorFunction);
+                      pIrpSp->MajorFunction));
 
         switch( pIrpSp->MajorFunction)
         {
@@ -916,10 +916,57 @@ AFSInitializeLibrary( IN AFSFileID *GlobalRootFid,
         if ( !NT_SUCCESS( ntStatus))
         {
 
-            AFSDbgLogMsg( AFS_SUBSYSTEM_INIT_PROCESSING,
+            AFSDbgTrace(( AFS_SUBSYSTEM_INIT_PROCESSING,
                           AFS_TRACE_LEVEL_ERROR,
                           "AFSInitializeLibrary AFSSendDeviceIoControl failure %08lX\n",
-                          ntStatus);
+                          ntStatus));
+        }
+    }
+
+    return ntStatus;
+}
+
+NTSTATUS
+AFSConfigLibraryDebug()
+{
+
+    NTSTATUS ntStatus = STATUS_SUCCESS;
+    AFSDebugTraceConfigCB stConfigLib;
+    AFSDeviceExt       *pDevExt;
+
+    __Enter
+    {
+
+        if ( AFSDeviceObject != NULL &&
+             AFSDeviceObject->DeviceExtension != NULL)
+        {
+
+            pDevExt = (AFSDeviceExt *)AFSDeviceObject->DeviceExtension;
+
+            if ( pDevExt->Specific.Control.LibraryDeviceObject != NULL)
+            {
+                RtlZeroMemory( &stConfigLib,
+                               sizeof( AFSDebugTraceConfigCB));
+
+                stConfigLib.AFSDbgLogMsg = AFSDebugTraceFnc;
+
+                ntStatus = AFSSendDeviceIoControl( pDevExt->Specific.Control.LibraryDeviceObject,
+                                                   IOCTL_AFS_CONFIG_LIBRARY_TRACE,
+                                                   &stConfigLib,
+                                                   sizeof( AFSDebugTraceConfigCB),
+                                                   NULL,
+                                                   0,
+                                                   NULL);
+
+                if ( !NT_SUCCESS( ntStatus))
+                {
+
+                    AFSDbgTrace(( AFS_SUBSYSTEM_INIT_PROCESSING,
+                                  AFS_TRACE_LEVEL_ERROR,
+                                  "AFSInitializeLibrary AFSSendDeviceIoControl failure %08lX\n",
+                                  ntStatus));
+                }
+            }
         }
     }
 
index 3de4fae..8fdea4d 100644 (file)
@@ -96,9 +96,9 @@ try_exit:
     __except( AFSExceptionFilter( __FUNCTION__, (ntStatus = GetExceptionCode()), GetExceptionInformation()))
     {
 
-        AFSDbgLogMsg( 0,
+        AFSDbgTrace(( 0,
                       0,
-                      "EXCEPTION - AFSLockControl\n");
+                      "EXCEPTION - AFSLockControl\n"));
 
         AFSDumpTraceFilesFnc();
 
index 549b57f..69517f5 100644 (file)
@@ -207,6 +207,10 @@ AFSInitializeDbgLog()
             AFSDbgLogRemainingLength = AFSDbgBufferLength;
 
             ntStatus = STATUS_SUCCESS;
+
+            InterlockedCompareExchangePointer( (PVOID *)&AFSDebugTraceFnc,
+                                               (void *)AFSDbgLogMsg,
+                                               NULL);
         }
     }
 
@@ -387,12 +391,24 @@ AFSConfigureTrace( IN AFSTraceConfigCB *TraceInfo)
                     try_return( ntStatus = STATUS_INSUFFICIENT_RESOURCES);
                 }
 
+                InterlockedCompareExchangePointer( (PVOID *)&AFSDebugTraceFnc,
+                                                   (void *)AFSDbgLogMsg,
+                                                   NULL);
+
                 AFSDbgCurrentBuffer = AFSDbgBuffer;
 
                 AFSDbgLogRemainingLength = AFSDbgBufferLength;
 
                 AFSTagInitialLogEntry();
             }
+            else
+            {
+                InterlockedCompareExchangePointer( (PVOID *)&AFSDebugTraceFnc,
+                                                   NULL,
+                                                   (void *)AFSDbgLogMsg);
+            }
+
+            AFSConfigLibraryDebug();
         }
 
 try_exit:
@@ -484,7 +500,7 @@ AFSTagInitialLogEntry()
     RtlTimeToTimeFields( &liLocalTime,
                          &timeFields);
 
-    AFSDbgLogMsg( 0,
+    AFSDbgTrace(( 0,
                   0,
                   "AFS Log Initialized %d-%d-%d %d:%d Level %d Subsystems %08lX\n",
                   timeFields.Month,
@@ -493,7 +509,7 @@ AFSTagInitialLogEntry()
                   timeFields.Hour,
                   timeFields.Minute,
                   AFSTraceLevel,
-                  AFSTraceComponent);
+                  AFSTraceComponent));
 
     return;
 }
index ad654df..623b432 100644 (file)
@@ -52,22 +52,22 @@ AFSAddConnectionEx( IN UNICODE_STRING *RemoteName,
     __Enter
     {
 
-        AFSDbgLogMsg( AFS_SUBSYSTEM_LOCK_PROCESSING,
+        AFSDbgTrace(( AFS_SUBSYSTEM_LOCK_PROCESSING,
                       AFS_TRACE_LEVEL_VERBOSE,
                       "AFSAddConnectionEx Acquiring AFSProviderListLock lock %p EXCL %08lX\n",
                       &pRDRDevExt->Specific.RDR.ProviderListLock,
-                      PsGetCurrentThread());
+                      PsGetCurrentThread()));
 
         AFSAcquireExcl( &pRDRDevExt->Specific.RDR.ProviderListLock,
                         TRUE);
 
 
-        AFSDbgLogMsg( AFS_SUBSYSTEM_NETWORK_PROVIDER,
+        AFSDbgTrace(( AFS_SUBSYSTEM_NETWORK_PROVIDER,
                       AFS_TRACE_LEVEL_VERBOSE,
                       "AFSAddConnectionEx remote name %wZ display type %08lX flags %08lX\n",
                       RemoteName,
                       DisplayType,
-                      Flags);
+                      Flags));
 
         //
         // If this is a server, start in the enum list, otherwise
@@ -134,9 +134,10 @@ AFSAddConnectionEx( IN UNICODE_STRING *RemoteName,
             uniRemoteName.Length -= sizeof( WCHAR);
         }
 
-        AFSDbgLogMsg( AFS_SUBSYSTEM_NETWORK_PROVIDER,
+        AFSDbgTrace(( AFS_SUBSYSTEM_NETWORK_PROVIDER,
                       AFS_TRACE_LEVEL_VERBOSE,
-                      "AFSAddConnectionEx Inserting remote name %wZ\n", &uniRemoteName);
+                      "AFSAddConnectionEx Inserting remote name %wZ\n",
+                      &uniRemoteName));
 
         //
         // Allocate a new node and add it to our list
index 9ff88e5..3ff9bcf 100644 (file)
@@ -103,21 +103,21 @@ AFSProcessCreate( IN HANDLE ParentId,
     __Enter
     {
 
-        AFSDbgLogMsg( AFS_SUBSYSTEM_LOCK_PROCESSING,
+        AFSDbgTrace(( AFS_SUBSYSTEM_LOCK_PROCESSING,
                       AFS_TRACE_LEVEL_VERBOSE,
                       "AFSProcessCreate Acquiring Control ProcessTree.TreeLock lock %p EXCL %08lX\n",
                       pDeviceExt->Specific.Control.ProcessTree.TreeLock,
-                      PsGetCurrentThread());
+                      PsGetCurrentThread()));
 
         AFSAcquireExcl( pDeviceExt->Specific.Control.ProcessTree.TreeLock,
                         TRUE);
 
-        AFSDbgLogMsg( AFS_SUBSYSTEM_PROCESS_PROCESSING,
+        AFSDbgTrace(( AFS_SUBSYSTEM_PROCESS_PROCESSING,
                       AFS_TRACE_LEVEL_VERBOSE,
                       "AFSProcessCreate Parent %08lX Process %08lX %08lX\n",
                       ParentId,
                       ProcessId,
-                      PsGetCurrentThread());
+                      PsGetCurrentThread()));
 
         pProcessCB = AFSInitializeProcessCB( (ULONGLONG)ParentId,
                                              (ULONGLONG)ProcessId);
@@ -139,12 +139,12 @@ AFSProcessCreate( IN HANDLE ParentId,
         else
         {
 
-            AFSDbgLogMsg( AFS_SUBSYSTEM_PROCESS_PROCESSING,
+            AFSDbgTrace(( AFS_SUBSYSTEM_PROCESS_PROCESSING,
                           AFS_TRACE_LEVEL_ERROR,
                           "AFSProcessCreate Initialization failure for Parent %08lX Process %08lX %08lX\n",
                           ParentId,
                           ProcessId,
-                          PsGetCurrentThread());
+                          PsGetCurrentThread()));
         }
 
         AFSReleaseResource( pDeviceExt->Specific.Control.ProcessTree.TreeLock);
@@ -166,11 +166,11 @@ AFSProcessDestroy( IN HANDLE ProcessId)
     __Enter
     {
 
-        AFSDbgLogMsg( AFS_SUBSYSTEM_LOCK_PROCESSING,
+        AFSDbgTrace(( AFS_SUBSYSTEM_LOCK_PROCESSING,
                       AFS_TRACE_LEVEL_VERBOSE,
                       "AFSProcessDestroy Acquiring Control ProcessTree.TreeLock lock %p EXCL %08lX\n",
                       pDeviceExt->Specific.Control.ProcessTree.TreeLock,
-                      PsGetCurrentThreadId());
+                      PsGetCurrentThreadId()));
 
         AFSAcquireExcl( pDeviceExt->Specific.Control.ProcessTree.TreeLock,
                         TRUE);
@@ -178,11 +178,11 @@ AFSProcessDestroy( IN HANDLE ProcessId)
         // It's a remove so pull the entry
         //
 
-        AFSDbgLogMsg( AFS_SUBSYSTEM_PROCESS_PROCESSING,
+        AFSDbgTrace(( AFS_SUBSYSTEM_PROCESS_PROCESSING,
                       AFS_TRACE_LEVEL_VERBOSE,
                       "AFSProcessDestroy Process %08lX %08lX\n",
                       ProcessId,
-                      PsGetCurrentThread());
+                      PsGetCurrentThread()));
 
         ntStatus = AFSLocateHashEntry( pDeviceExt->Specific.Control.ProcessTree.TreeHead,
                                        (ULONGLONG)ProcessId,
@@ -225,12 +225,12 @@ AFSProcessDestroy( IN HANDLE ProcessId)
         }
         else
         {
-            AFSDbgLogMsg( AFS_SUBSYSTEM_PROCESS_PROCESSING,
+            AFSDbgTrace(( AFS_SUBSYSTEM_PROCESS_PROCESSING,
                           AFS_TRACE_LEVEL_WARNING,
                           "AFSProcessDestroy Process %08lX not found in ProcessTree Status %08lX %08lX\n",
                           ProcessId,
                           ntStatus,
-                          PsGetCurrentThread());
+                          PsGetCurrentThread()));
         }
 
         AFSReleaseResource( pDeviceExt->Specific.Control.ProcessTree.TreeLock);
@@ -274,21 +274,21 @@ AFSValidateProcessEntry( IN HANDLE  ProcessId,
         if ( !bProcessTreeLocked)
         {
 
-            AFSDbgLogMsg( AFS_SUBSYSTEM_LOCK_PROCESSING,
+            AFSDbgTrace(( AFS_SUBSYSTEM_LOCK_PROCESSING,
                           AFS_TRACE_LEVEL_VERBOSE,
                           "AFSValidateProcessEntry Acquiring Control ProcessTree.TreeLock lock %p SHARED %08lX\n",
                           pDeviceExt->Specific.Control.ProcessTree.TreeLock,
-                          PsGetCurrentThread());
+                          PsGetCurrentThread()));
 
             AFSAcquireShared( pDeviceExt->Specific.Control.ProcessTree.TreeLock,
                               TRUE);
         }
 
-        AFSDbgLogMsg( AFS_SUBSYSTEM_AUTHGROUP_PROCESSING,
+        AFSDbgTrace(( AFS_SUBSYSTEM_AUTHGROUP_PROCESSING,
                       AFS_TRACE_LEVEL_VERBOSE,
                       "%s Entry for ProcessID %I64X\n",
                       __FUNCTION__,
-                      ullProcessID);
+                      ullProcessID));
 
         ntStatus = AFSLocateHashEntry( pDeviceExt->Specific.Control.ProcessTree.TreeHead,
                                        ullProcessID,
@@ -325,11 +325,11 @@ AFSValidateProcessEntry( IN HANDLE  ProcessId,
                 pProcessCB == NULL)
             {
 
-                AFSDbgLogMsg( AFS_SUBSYSTEM_AUTHGROUP_PROCESSING,
+                AFSDbgTrace(( AFS_SUBSYSTEM_AUTHGROUP_PROCESSING,
                               AFS_TRACE_LEVEL_ERROR,
                               "%s Failed to locate process entry for ProcessID %I64X\n",
                               __FUNCTION__,
-                              ullProcessID);
+                              ullProcessID));
 
                 try_return( ntStatus = STATUS_UNSUCCESSFUL);
             }
@@ -348,11 +348,11 @@ AFSValidateProcessEntry( IN HANDLE  ProcessId,
         if( pProcessCB->ParentProcessId != 0)
         {
 
-            AFSDbgLogMsg( AFS_SUBSYSTEM_AUTHGROUP_PROCESSING,
+            AFSDbgTrace(( AFS_SUBSYSTEM_AUTHGROUP_PROCESSING,
                           AFS_TRACE_LEVEL_VERBOSE,
                           "%s Locating process entry for Parent ProcessID %I64X\n",
                           __FUNCTION__,
-                          pProcessCB->ParentProcessId);
+                          pProcessCB->ParentProcessId));
 
             ntStatus = AFSLocateHashEntry( pDeviceExt->Specific.Control.ProcessTree.TreeHead,
                                            (ULONGLONG)pProcessCB->ParentProcessId,
@@ -364,21 +364,21 @@ AFSValidateProcessEntry( IN HANDLE  ProcessId,
                 AFSAcquireExcl( &pParentProcessCB->Lock,
                                 TRUE);
 
-                AFSDbgLogMsg( AFS_SUBSYSTEM_AUTHGROUP_PROCESSING,
+                AFSDbgTrace(( AFS_SUBSYSTEM_AUTHGROUP_PROCESSING,
                               AFS_TRACE_LEVEL_VERBOSE,
                               "%s Located process entry for Parent ProcessID %I64X\n",
                               __FUNCTION__,
-                              pProcessCB->ParentProcessId);
+                              pProcessCB->ParentProcessId));
             }
         }
         else
         {
 
-            AFSDbgLogMsg( AFS_SUBSYSTEM_AUTHGROUP_PROCESSING,
+            AFSDbgTrace(( AFS_SUBSYSTEM_AUTHGROUP_PROCESSING,
                           AFS_TRACE_LEVEL_VERBOSE,
                           "%s No parent ID for ProcessID %I64X\n",
                           __FUNCTION__,
-                          ullProcessID);
+                          ullProcessID));
         }
 
         AFSAcquireExcl( &pProcessCB->Lock,
@@ -411,11 +411,11 @@ AFSValidateProcessEntry( IN HANDLE  ProcessId,
         if( !NT_SUCCESS( ntStatus))
         {
 
-            AFSDbgLogMsg( AFS_SUBSYSTEM_AUTHGROUP_PROCESSING,
+            AFSDbgTrace(( AFS_SUBSYSTEM_AUTHGROUP_PROCESSING,
                           AFS_TRACE_LEVEL_ERROR,
                           "%s Failed to locate callers SID for ProcessID %I64X\n",
                           __FUNCTION__,
-                          ullProcessID);
+                          ullProcessID));
 
             try_return( ntStatus);
         }
@@ -425,22 +425,22 @@ AFSValidateProcessEntry( IN HANDLE  ProcessId,
         if( ulSessionId == (ULONG)-1)
         {
 
-            AFSDbgLogMsg( AFS_SUBSYSTEM_AUTHGROUP_PROCESSING,
+            AFSDbgTrace(( AFS_SUBSYSTEM_AUTHGROUP_PROCESSING,
                           AFS_TRACE_LEVEL_ERROR,
                           "%s Failed to retrieve session ID for ProcessID %I64X\n",
                           __FUNCTION__,
-                          ullProcessID);
+                          ullProcessID));
 
             try_return( ntStatus = STATUS_INSUFFICIENT_RESOURCES);
         }
 
-        AFSDbgLogMsg( AFS_SUBSYSTEM_AUTHGROUP_PROCESSING,
+        AFSDbgTrace(( AFS_SUBSYSTEM_AUTHGROUP_PROCESSING,
                       AFS_TRACE_LEVEL_VERBOSE,
                       "%s Retrieved callers SID %wZ for ProcessID %I64X Session %08lX\n",
                       __FUNCTION__,
                       &uniSIDString,
                       ullProcessID,
-                      ulSessionId);
+                      ulSessionId));
 
         //
         // If there is an Auth Group for the current process,
@@ -460,14 +460,14 @@ AFSValidateProcessEntry( IN HANDLE  ProcessId,
                 RtlStringFromGUID( *pAuthGroup,
                                    &uniGUID);
 
-                AFSDbgLogMsg( AFS_SUBSYSTEM_AUTHGROUP_PROCESSING,
+                AFSDbgTrace(( AFS_SUBSYSTEM_AUTHGROUP_PROCESSING,
                               AFS_TRACE_LEVEL_VERBOSE,
                               "%s Located valid AuthGroup GUID %wZ for SID %wZ ProcessID %I64X Session %08lX\n",
                               __FUNCTION__,
                               &uniGUID,
                               &uniSIDString,
                               ullProcessID,
-                              ulSessionId);
+                              ulSessionId));
 
                 if( uniGUID.Buffer != NULL)
                 {
@@ -512,14 +512,14 @@ AFSValidateProcessEntry( IN HANDLE  ProcessId,
                     RtlStringFromGUID( *(pProcessCB->ActiveAuthGroup),
                                        &uniGUID);
 
-                    AFSDbgLogMsg( AFS_SUBSYSTEM_AUTHGROUP_PROCESSING,
+                    AFSDbgTrace(( AFS_SUBSYSTEM_AUTHGROUP_PROCESSING,
                                   AFS_TRACE_LEVEL_VERBOSE,
                                   "%s PID %I64X Session %08lX inherited Active AuthGroup %wZ from thread %I64X\n",
                                   __FUNCTION__,
                                   ullProcessID,
                                   ulSessionId,
                                   &uniGUID,
-                                  pParentThreadCB->ThreadId);
+                                  pParentThreadCB->ThreadId));
 
                     if( uniGUID.Buffer != NULL)
                     {
@@ -541,14 +541,14 @@ AFSValidateProcessEntry( IN HANDLE  ProcessId,
                     RtlStringFromGUID( *(pProcessCB->ActiveAuthGroup),
                                        &uniGUID);
 
-                    AFSDbgLogMsg( AFS_SUBSYSTEM_AUTHGROUP_PROCESSING,
+                    AFSDbgTrace(( AFS_SUBSYSTEM_AUTHGROUP_PROCESSING,
                                   AFS_TRACE_LEVEL_VERBOSE,
                                   "%s PID %I64X Session %08lX inherited Active AuthGroup %wZ from parent PID %I64X\n",
                                   __FUNCTION__,
                                   ullProcessID,
                                   ulSessionId,
                                   &uniGUID,
-                                  pParentProcessCB->TreeEntry.HashIndex);
+                                  pParentProcessCB->TreeEntry.HashIndex));
 
                     if( uniGUID.Buffer != NULL)
                     {
@@ -570,14 +570,14 @@ AFSValidateProcessEntry( IN HANDLE  ProcessId,
                     RtlStringFromGUID( *(pProcessCB->ActiveAuthGroup),
                                        &uniGUID);
 
-                    AFSDbgLogMsg( AFS_SUBSYSTEM_AUTHGROUP_PROCESSING,
+                    AFSDbgTrace(( AFS_SUBSYSTEM_AUTHGROUP_PROCESSING,
                                   AFS_TRACE_LEVEL_VERBOSE,
                                   "%s Returning(1) Active AuthGroup %wZ for SID %wZ PID %I64X Session %08lX\n",
                                   __FUNCTION__,
                                   &uniGUID,
                                   &uniSIDString,
                                   ullProcessID,
-                                  ulSessionId);
+                                  ulSessionId));
 
                     if( uniGUID.Buffer != NULL)
                     {
@@ -601,14 +601,14 @@ AFSValidateProcessEntry( IN HANDLE  ProcessId,
         if( !NT_SUCCESS( ntStatus))
         {
 
-            AFSDbgLogMsg( AFS_SUBSYSTEM_AUTHGROUP_PROCESSING,
+            AFSDbgTrace(( AFS_SUBSYSTEM_AUTHGROUP_PROCESSING,
                           AFS_TRACE_LEVEL_ERROR,
                           "%s Failed to hash SID %wZ for PID %I64X Session %08lX Status %08lX\n",
                           __FUNCTION__,
                           &uniSIDString,
                           ullProcessID,
                           ulSessionId,
-                          ntStatus);
+                          ntStatus));
 
             try_return( ntStatus);
         }
@@ -663,14 +663,14 @@ AFSValidateProcessEntry( IN HANDLE  ProcessId,
                 RtlStringFromGUID( pSIDEntryCB->AuthGroup,
                                    &uniGUID);
 
-                AFSDbgLogMsg( AFS_SUBSYSTEM_AUTHGROUP_PROCESSING,
+                AFSDbgTrace(( AFS_SUBSYSTEM_AUTHGROUP_PROCESSING,
                               AFS_TRACE_LEVEL_VERBOSE,
                               "%s  SID %wZ PID %I64X Session %08lX generated NEW AG %wZ\n",
                               __FUNCTION__,
                               &uniSIDString,
                               ullProcessID,
                               ulSessionId,
-                              &uniGUID);
+                              &uniGUID));
 
                 if( uniGUID.Buffer != NULL)
                 {
@@ -705,14 +705,14 @@ AFSValidateProcessEntry( IN HANDLE  ProcessId,
         RtlStringFromGUID( pSIDEntryCB->AuthGroup,
                            &uniGUID);
 
-        AFSDbgLogMsg( AFS_SUBSYSTEM_AUTHGROUP_PROCESSING,
+        AFSDbgTrace(( AFS_SUBSYSTEM_AUTHGROUP_PROCESSING,
                       AFS_TRACE_LEVEL_VERBOSE,
                       "%s SID %wZ PID %I64X Session %08lX assigned AG %wZ\n",
                       __FUNCTION__,
                       &uniSIDString,
                       ullProcessID,
                       ulSessionId,
-                      &uniGUID);
+                      &uniGUID));
 
         if( uniGUID.Buffer != NULL)
         {
@@ -728,12 +728,12 @@ AFSValidateProcessEntry( IN HANDLE  ProcessId,
         {
             SetFlag( pProcessCB->Flags, AFS_PROCESS_LOCAL_SYSTEM_AUTH);
 
-            AFSDbgLogMsg( AFS_SUBSYSTEM_AUTHGROUP_PROCESSING,
+            AFSDbgTrace(( AFS_SUBSYSTEM_AUTHGROUP_PROCESSING,
                           AFS_TRACE_LEVEL_VERBOSE,
                           "%s Setting PID %I64X Session %08lX with LOCAL SYSTEM AUTHORITY\n",
                           __FUNCTION__,
                           ullProcessID,
-                          ulSessionId);
+                          ulSessionId));
         }
 
         //
@@ -747,14 +747,14 @@ AFSValidateProcessEntry( IN HANDLE  ProcessId,
         RtlStringFromGUID( *(pProcessCB->ActiveAuthGroup),
                            &uniGUID);
 
-        AFSDbgLogMsg( AFS_SUBSYSTEM_AUTHGROUP_PROCESSING,
+        AFSDbgTrace(( AFS_SUBSYSTEM_AUTHGROUP_PROCESSING,
                       AFS_TRACE_LEVEL_VERBOSE,
                       "%s Returning(2) Active AuthGroup %wZ for SID %wZ PID %I64X Session %08lX\n",
                       __FUNCTION__,
                       &uniGUID,
                       &uniSIDString,
                       ullProcessID,
-                      ulSessionId);
+                      ulSessionId));
 
         if( uniGUID.Buffer != NULL)
         {
@@ -817,11 +817,11 @@ AFSIs64BitProcess( IN ULONGLONG ProcessId)
     __Enter
     {
 
-        AFSDbgLogMsg( AFS_SUBSYSTEM_LOCK_PROCESSING,
+        AFSDbgTrace(( AFS_SUBSYSTEM_LOCK_PROCESSING,
                       AFS_TRACE_LEVEL_VERBOSE,
                       "AFSIs64BitProcess Acquiring Control ProcessTree.TreeLock lock %p SHARED %08lX\n",
                       pDeviceExt->Specific.Control.ProcessTree.TreeLock,
-                      PsGetCurrentThread());
+                      PsGetCurrentThread()));
 
         AFSAcquireShared( pDeviceExt->Specific.Control.ProcessTree.TreeLock,
                           TRUE);
index 50c3333..1414a14 100644 (file)
@@ -52,10 +52,10 @@ AFSQueryQuota( IN PDEVICE_OBJECT DeviceObject,
     __try
     {
 
-        AFSDbgLogMsg( AFS_SUBSYSTEM_FILE_PROCESSING,
+        AFSDbgTrace(( AFS_SUBSYSTEM_FILE_PROCESSING,
                       AFS_TRACE_LEVEL_ERROR,
                       "AFSQueryQuota Entry for FO %p\n",
-                      pIrpSp->FileObject);
+                      pIrpSp->FileObject));
 
         AFSCompleteRequest( Irp,
                             ntStatus);
@@ -64,9 +64,9 @@ AFSQueryQuota( IN PDEVICE_OBJECT DeviceObject,
     __except( AFSExceptionFilter( __FUNCTION__, GetExceptionCode(), GetExceptionInformation()) )
     {
 
-        AFSDbgLogMsg( 0,
+        AFSDbgTrace(( 0,
                       0,
-                      "EXCEPTION - AFSQueryQuota\n");
+                      "EXCEPTION - AFSQueryQuota\n"));
 
         AFSDumpTraceFilesFnc();
     }
@@ -88,10 +88,10 @@ AFSSetQuota( IN PDEVICE_OBJECT DeviceObject,
     __try
     {
 
-        AFSDbgLogMsg( AFS_SUBSYSTEM_FILE_PROCESSING,
+        AFSDbgTrace(( AFS_SUBSYSTEM_FILE_PROCESSING,
                       AFS_TRACE_LEVEL_ERROR,
                       "AFSSetQuota Entry for FO %p\n",
-                      pIrpSp->FileObject);
+                      pIrpSp->FileObject));
 
         AFSCompleteRequest( Irp,
                             ntStatus);
@@ -99,9 +99,9 @@ AFSSetQuota( IN PDEVICE_OBJECT DeviceObject,
     __except( AFSExceptionFilter( __FUNCTION__, GetExceptionCode(), GetExceptionInformation()) )
     {
 
-        AFSDbgLogMsg( 0,
+        AFSDbgTrace(( 0,
                       0,
-                      "EXCEPTION - AFSSetQuota\n");
+                      "EXCEPTION - AFSSetQuota\n"));
 
         AFSDumpTraceFilesFnc();
     }
index 05372eb..8a6ef42 100644 (file)
@@ -71,10 +71,10 @@ AFSInitRDRDevice()
         if( !NT_SUCCESS( ntStatus))
         {
 
-            AFSDbgLogMsg( AFS_SUBSYSTEM_INIT_PROCESSING,
+            AFSDbgTrace(( AFS_SUBSYSTEM_INIT_PROCESSING,
                           AFS_TRACE_LEVEL_ERROR,
                           "AFSInitRDRDevice IoCreateDevice failure %08lX\n",
-                          ntStatus);
+                          ntStatus));
 
             try_return( ntStatus);
         }
@@ -117,10 +117,10 @@ AFSInitRDRDevice()
         if ( !NT_SUCCESS(ntStatus))
         {
 
-            AFSDbgLogMsg( AFS_SUBSYSTEM_INIT_PROCESSING,
+            AFSDbgTrace(( AFS_SUBSYSTEM_INIT_PROCESSING,
                           AFS_TRACE_LEVEL_ERROR,
                           "AFSInitRDRDevice AFSInitRdrFcb failure %08lX\n",
-                          ntStatus);
+                          ntStatus));
 
             try_return( ntStatus);
         }
@@ -151,10 +151,10 @@ AFSInitRDRDevice()
                                                     0);
             if ( !NT_SUCCESS( ntStatus))
             {
-                AFSDbgLogMsg( AFS_SUBSYSTEM_INIT_PROCESSING,
+                AFSDbgTrace(( AFS_SUBSYSTEM_INIT_PROCESSING,
                               AFS_TRACE_LEVEL_ERROR,
                               "AFSInitRDRDevice FsRtlRegisterUncProvider failure %08lX\n",
-                              ntStatus);
+                              ntStatus));
             }
         }
         else
@@ -171,10 +171,10 @@ AFSInitRDRDevice()
             }
             else
             {
-                AFSDbgLogMsg( AFS_SUBSYSTEM_INIT_PROCESSING,
+                AFSDbgTrace(( AFS_SUBSYSTEM_INIT_PROCESSING,
                               AFS_TRACE_LEVEL_ERROR,
                               "AFSInitRDRDevice FsRtlRegisterUncProvider failure %08lX\n",
-                              ntStatus);
+                              ntStatus));
             }
         }
 
@@ -372,10 +372,10 @@ AFSInitializeRedirector( IN AFSRedirectorInitInfo *RedirInitInfo)
         if( !NT_SUCCESS( ntStatus))
         {
 
-            AFSDbgLogMsg( AFS_SUBSYSTEM_INIT_PROCESSING,
+            AFSDbgTrace(( AFS_SUBSYSTEM_INIT_PROCESSING,
                           AFS_TRACE_LEVEL_ERROR,
                           "AFSInitializeRedirector AFSLoadLibrary failure %08lX\n",
-                          ntStatus);
+                          ntStatus));
 
             try_return( ntStatus);
         }
@@ -404,9 +404,9 @@ AFSInitializeRedirector( IN AFSRedirectorInitInfo *RedirInitInfo)
         if( AFSDumpFileLocation.Buffer == NULL)
         {
 
-            AFSDbgLogMsg( AFS_SUBSYSTEM_INIT_PROCESSING,
+            AFSDbgTrace(( AFS_SUBSYSTEM_INIT_PROCESSING,
                           AFS_TRACE_LEVEL_ERROR,
-                          "AFSInitializeRedirector AFS_GENERIC_MEMORY_23_TAG allocation error\n");
+                          "AFSInitializeRedirector AFS_GENERIC_MEMORY_23_TAG allocation error\n"));
 
             try_return( ntStatus = STATUS_INSUFFICIENT_RESOURCES);
         }
@@ -584,10 +584,10 @@ AFSInitializeRedirector( IN AFSRedirectorInitInfo *RedirInitInfo)
                 RedirInitInfo->CacheFileNameLength == 0)
             {
 
-                AFSDbgLogMsg( AFS_SUBSYSTEM_INIT_PROCESSING,
+                AFSDbgTrace(( AFS_SUBSYSTEM_INIT_PROCESSING,
                               AFS_TRACE_LEVEL_ERROR,
                               "AFSInitializeRedirector Unable to initialize cache file %08lX\n",
-                              ntStatus);
+                              ntStatus));
 
                 try_return( ntStatus);
             }
@@ -598,9 +598,9 @@ AFSInitializeRedirector( IN AFSRedirectorInitInfo *RedirInitInfo)
                 if( RedirInitInfo->CacheFileNameLength == 0)
                 {
 
-                    AFSDbgLogMsg( AFS_SUBSYSTEM_INIT_PROCESSING,
+                    AFSDbgTrace(( AFS_SUBSYSTEM_INIT_PROCESSING,
                                   AFS_TRACE_LEVEL_ERROR,
-                                  "AFSInitializeRedirector CacheMdl == NULL\n");
+                                  "AFSInitializeRedirector CacheMdl == NULL\n"));
 
                     try_return( ntStatus = STATUS_INVALID_PARAMETER);
                 }
@@ -619,9 +619,9 @@ AFSInitializeRedirector( IN AFSRedirectorInitInfo *RedirInitInfo)
                 if( pDevExt->Specific.RDR.CacheFile.Buffer == NULL)
                 {
 
-                    AFSDbgLogMsg( AFS_SUBSYSTEM_INIT_PROCESSING,
+                    AFSDbgTrace(( AFS_SUBSYSTEM_INIT_PROCESSING,
                                   AFS_TRACE_LEVEL_ERROR,
-                                  "AFSInitializeRedirector AFS_GENERIC_MEMORY_24_TAG allocation failure\n");
+                                  "AFSInitializeRedirector AFS_GENERIC_MEMORY_24_TAG allocation failure\n"));
 
                     try_return( ntStatus = STATUS_INSUFFICIENT_RESOURCES);
                 }
@@ -654,10 +654,10 @@ AFSInitializeRedirector( IN AFSRedirectorInitInfo *RedirInitInfo)
                 if( !NT_SUCCESS( ntStatus))
                 {
 
-                    AFSDbgLogMsg( AFS_SUBSYSTEM_INIT_PROCESSING,
+                    AFSDbgTrace(( AFS_SUBSYSTEM_INIT_PROCESSING,
                                   AFS_TRACE_LEVEL_ERROR,
                                   "AFSInitializeRedirector ZwOpenFile failure %08lX\n",
-                                  ntStatus);
+                                  ntStatus));
 
                     try_return( ntStatus);
                 }
@@ -676,10 +676,10 @@ AFSInitializeRedirector( IN AFSRedirectorInitInfo *RedirInitInfo)
                 if( !NT_SUCCESS( ntStatus))
                 {
 
-                    AFSDbgLogMsg( AFS_SUBSYSTEM_INIT_PROCESSING,
+                    AFSDbgTrace(( AFS_SUBSYSTEM_INIT_PROCESSING,
                                   AFS_TRACE_LEVEL_ERROR,
                                   "AFSInitializeRedirector ObReferenceObjectByHandle failure %08lX\n",
-                                  ntStatus);
+                                  ntStatus));
 
                     try_return( ntStatus);
                 }
@@ -699,10 +699,10 @@ AFSInitializeRedirector( IN AFSRedirectorInitInfo *RedirInitInfo)
 
         if ( !NT_SUCCESS( ntStatus))
         {
-            AFSDbgLogMsg( AFS_SUBSYSTEM_INIT_PROCESSING,
+            AFSDbgTrace(( AFS_SUBSYSTEM_INIT_PROCESSING,
                           AFS_TRACE_LEVEL_ERROR,
                           "AFSInitializeRedirector AFSInitializeLibrary failure %08lX\n",
-                          ntStatus);
+                          ntStatus));
         }
 
 try_exit:
@@ -885,9 +885,9 @@ AFSInitRdrFcb( OUT AFSFcb **RdrFcb)
         if( pFcb == NULL)
         {
 
-            AFSDbgLogMsg( AFS_SUBSYSTEM_FILE_PROCESSING,
+            AFSDbgTrace(( AFS_SUBSYSTEM_FILE_PROCESSING,
                           AFS_TRACE_LEVEL_ERROR,
-                          "AFSInitRdrFcb Failed to allocate the root fcb\n");
+                          "AFSInitRdrFcb Failed to allocate the root fcb\n"));
 
             try_return( ntStatus = STATUS_INSUFFICIENT_RESOURCES);
         }
@@ -905,9 +905,9 @@ AFSInitRdrFcb( OUT AFSFcb **RdrFcb)
         if( pNPFcb == NULL)
         {
 
-            AFSDbgLogMsg( AFS_SUBSYSTEM_FILE_PROCESSING,
+            AFSDbgTrace(( AFS_SUBSYSTEM_FILE_PROCESSING,
                           AFS_TRACE_LEVEL_ERROR,
-                          "AFSInitRdrFcb Failed to allocate the non-paged fcb\n");
+                          "AFSInitRdrFcb Failed to allocate the non-paged fcb\n"));
 
             try_return( ntStatus = STATUS_INSUFFICIENT_RESOURCES);
         }
@@ -929,11 +929,11 @@ AFSInitRdrFcb( OUT AFSFcb **RdrFcb)
 
         ExInitializeResourceLite( &pNPFcb->Resource);
 
-        AFSDbgLogMsg( AFS_SUBSYSTEM_LOCK_PROCESSING,
+        AFSDbgTrace(( AFS_SUBSYSTEM_LOCK_PROCESSING,
                       AFS_TRACE_LEVEL_VERBOSE,
                       "AFSInitRootFcb Acquiring Fcb lock %p EXCL %08lX\n",
                       &pNPFcb->Resource,
-                      PsGetCurrentThread());
+                      PsGetCurrentThread()));
 
         ExInitializeResourceLite( &pNPFcb->PagingResource);
 
index 2c477fb..b946348 100644 (file)
@@ -53,10 +53,10 @@ AFSSetSecurity( IN PDEVICE_OBJECT DeviceObject,
     __try
     {
 
-        AFSDbgLogMsg( AFS_SUBSYSTEM_FILE_PROCESSING,
+        AFSDbgTrace(( AFS_SUBSYSTEM_FILE_PROCESSING,
                       AFS_TRACE_LEVEL_VERBOSE,
                       "AFSSetSecurity Entry for FO %p\n",
-                      pIrpSp->FileObject);
+                      pIrpSp->FileObject));
 
         if( DeviceObject == AFSDeviceObject)
         {
@@ -123,9 +123,9 @@ try_exit:
     __except( AFSExceptionFilter( __FUNCTION__, GetExceptionCode(), GetExceptionInformation()) )
     {
 
-        AFSDbgLogMsg( 0,
+        AFSDbgTrace(( 0,
                       0,
-                      "EXCEPTION - AFSSetSecurity\n");
+                      "EXCEPTION - AFSSetSecurity\n"));
 
         AFSDumpTraceFilesFnc();
     }
@@ -148,10 +148,10 @@ AFSQuerySecurity( IN PDEVICE_OBJECT DeviceObject,
     __try
     {
 
-        AFSDbgLogMsg( AFS_SUBSYSTEM_FILE_PROCESSING,
+        AFSDbgTrace(( AFS_SUBSYSTEM_FILE_PROCESSING,
                       AFS_TRACE_LEVEL_VERBOSE,
                       "AFSQuerySecurity Entry for FO %p\n",
-                      pIrpSp->FileObject);
+                      pIrpSp->FileObject));
 
         if( DeviceObject == AFSDeviceObject)
         {
@@ -218,9 +218,9 @@ try_exit:
     __except( AFSExceptionFilter( __FUNCTION__, GetExceptionCode(), GetExceptionInformation()) )
     {
 
-        AFSDbgLogMsg( 0,
+        AFSDbgTrace(( 0,
                       0,
-                      "EXCEPTION - AFSQuerySecurity\n");
+                      "EXCEPTION - AFSQuerySecurity\n"));
 
         AFSDumpTraceFilesFnc();
     }
index 073aed1..e5940cc 100644 (file)
@@ -82,9 +82,9 @@ AFSShutdown( IN PDEVICE_OBJECT DeviceObject,
     __except( AFSExceptionFilter( __FUNCTION__, GetExceptionCode(), GetExceptionInformation()) )
     {
 
-        AFSDbgLogMsg( 0,
+        AFSDbgTrace(( 0,
                       0,
-                      "EXCEPTION - AFSShutdown\n");
+                      "EXCEPTION - AFSShutdown\n"));
 
         AFSDumpTraceFilesFnc();
     }
index 83627f6..740a606 100644 (file)
@@ -52,10 +52,10 @@ AFSSystemControl( IN PDEVICE_OBJECT DeviceObject,
     __try
     {
 
-        AFSDbgLogMsg( AFS_SUBSYSTEM_FILE_PROCESSING,
+        AFSDbgTrace(( AFS_SUBSYSTEM_FILE_PROCESSING,
                       AFS_TRACE_LEVEL_WARNING,
                       "AFSSystemControl Entry for FO %p\n",
-                      pIrpSp->FileObject);
+                      pIrpSp->FileObject));
 
         AFSCompleteRequest( Irp,
                             ntStatus);
@@ -64,9 +64,9 @@ AFSSystemControl( IN PDEVICE_OBJECT DeviceObject,
     __except( AFSExceptionFilter( __FUNCTION__, GetExceptionCode(), GetExceptionInformation()) )
     {
 
-        AFSDbgLogMsg( 0,
+        AFSDbgTrace(( 0,
                       0,
-                      "EXCEPTION - AFSSystemControl\n");
+                      "EXCEPTION - AFSSystemControl\n"));
 
         AFSDumpTraceFilesFnc();
     }
index 49646ca..07ac857 100644 (file)
@@ -99,9 +99,9 @@ try_exit:
     __except( AFSExceptionFilter( __FUNCTION__, GetExceptionCode(), GetExceptionInformation()) )
     {
 
-        AFSDbgLogMsg( 0,
+        AFSDbgTrace(( 0,
                       0,
-                      "EXCEPTION - AFSQueryVolumeInfo\n");
+                      "EXCEPTION - AFSQueryVolumeInfo\n"));
 
         AFSDumpTraceFilesFnc();
     }
@@ -123,9 +123,10 @@ AFSSetVolumeInfo( IN PDEVICE_OBJECT DeviceObject,
     __try
     {
 
-        AFSDbgLogMsg( AFS_SUBSYSTEM_FILE_PROCESSING,
+        AFSDbgTrace(( AFS_SUBSYSTEM_FILE_PROCESSING,
                       AFS_TRACE_LEVEL_WARNING,
-                      "AFSSetVolumeInfo Entry for FO %p\n", pIrpSp->FileObject);
+                      "AFSSetVolumeInfo Entry for FO %p\n",
+                      pIrpSp->FileObject));
 
         AFSCompleteRequest( Irp,
                             ntStatus);
@@ -134,9 +135,9 @@ AFSSetVolumeInfo( IN PDEVICE_OBJECT DeviceObject,
     __except( AFSExceptionFilter( __FUNCTION__, GetExceptionCode(), GetExceptionInformation()) )
     {
 
-        AFSDbgLogMsg( 0,
+        AFSDbgTrace(( 0,
                       0,
-                      "EXCEPTION - AFSSetVolumeInfo\n");
+                      "EXCEPTION - AFSSetVolumeInfo\n"));
 
         AFSDumpTraceFilesFnc();
     }
index 1ada012..aa0ca1c 100644 (file)
@@ -130,10 +130,10 @@ AFSWrite( IN PDEVICE_OBJECT DeviceObject,
 
         IoCopyCurrentIrpStackLocationToNext( Irp);
 
-        AFSDbgLogMsg( AFS_SUBSYSTEM_IO_PROCESSING,
+        AFSDbgTrace(( AFS_SUBSYSTEM_IO_PROCESSING,
                       AFS_TRACE_LEVEL_VERBOSE,
                       "Setting AFSWriteComplete as IoCompletion Routine Irp %p\n",
-                      Irp);
+                      Irp));
 
         IoSetCompletionRoutine( Irp, AFSWriteComplete, NULL, TRUE, TRUE, TRUE);
 
@@ -188,11 +188,11 @@ AFSWriteComplete( IN PDEVICE_OBJECT DeviceObject,
         IoMarkIrpPending(Irp);
     }
 
-    AFSDbgLogMsg( AFS_SUBSYSTEM_IO_PROCESSING,
+    AFSDbgTrace(( AFS_SUBSYSTEM_IO_PROCESSING,
                   AFS_TRACE_LEVEL_VERBOSE,
                   "AFSWriteComplete Irp %p%s\n",
                   Irp,
-                  bPending ? " PENDING" : "");
+                  bPending ? " PENDING" : ""));
 
     return STATUS_CONTINUE_COMPLETION;
 }
index ca79a13..432fd2c 100644 (file)
@@ -743,6 +743,9 @@ NTSTATUS
 AFSInitializeLibrary( IN AFSFileID *GlobalRootFid,
                       IN BOOLEAN QueueRootEnumeration);
 
+NTSTATUS
+AFSConfigLibraryDebug( void);
+
 //
 // AFSRDRSupport.cpp Prototypes
 //
index 524c851..67edae8 100644 (file)
@@ -105,6 +105,8 @@ extern void               *AFSDumpBuffer;
 
 extern ULONG               AFSDumpBufferLength;
 
+extern PAFSDbgLogMsg       AFSDebugTraceFnc;
+
 }
 
 #endif /* _AFS_EXTERN_H */
index 45afde0..03689f4 100644 (file)
@@ -294,9 +294,9 @@ AFSInsertCaseSensitiveDirEntry( IN AFSDirectoryCB *RootNode,
         if( pCurrentEntry == NULL)
         {
 
-            AFSDbgLogMsg( AFS_SUBSYSTEM_FILE_PROCESSING,
+            AFSDbgTrace(( AFS_SUBSYSTEM_FILE_PROCESSING,
                           AFS_TRACE_LEVEL_WARNING,
-                          "AFSInsertCaseSensitiveDirEntry Invalid root node\n");
+                          "AFSInsertCaseSensitiveDirEntry Invalid root node\n"));
 
             try_return( ntStatus = STATUS_UNSUCCESSFUL);
         }
@@ -365,11 +365,11 @@ AFSInsertCaseSensitiveDirEntry( IN AFSDirectoryCB *RootNode,
             else
             {
 
-                AFSDbgLogMsg( AFS_SUBSYSTEM_FILE_PROCESSING,
+                AFSDbgTrace(( AFS_SUBSYSTEM_FILE_PROCESSING,
                               AFS_TRACE_LEVEL_VERBOSE,
                               "AFSInsertCaseSensitiveDirEntry Collision with DE %p for %wZ\n",
                               pCurrentEntry,
-                              &pCurrentEntry->NameInformation.FileName);
+                              &pCurrentEntry->NameInformation.FileName));
 
                 ntStatus = STATUS_UNSUCCESSFUL;
 
@@ -405,9 +405,9 @@ AFSInsertCaseInsensitiveDirEntry( IN AFSDirectoryCB *RootNode,
         if( pCurrentEntry == NULL)
         {
 
-            AFSDbgLogMsg( AFS_SUBSYSTEM_FILE_PROCESSING,
+            AFSDbgTrace(( AFS_SUBSYSTEM_FILE_PROCESSING,
                           AFS_TRACE_LEVEL_WARNING,
-                          "AFSInsertCaseInsensitiveDirEntry Invalid root node\n");
+                          "AFSInsertCaseInsensitiveDirEntry Invalid root node\n"));
 
             try_return( ntStatus = STATUS_UNSUCCESSFUL);
         }
@@ -1009,9 +1009,9 @@ AFSInsertShortNameDirEntry( IN AFSDirectoryCB *RootNode,
         if( pCurrentEntry == NULL)
         {
 
-            AFSDbgLogMsg( AFS_SUBSYSTEM_FILE_PROCESSING,
+            AFSDbgTrace(( AFS_SUBSYSTEM_FILE_PROCESSING,
                           AFS_TRACE_LEVEL_WARNING,
-                          "AFSInsertShortNameDirEntry Invalid root node\n");
+                          "AFSInsertShortNameDirEntry Invalid root node\n"));
 
             try_return( ntStatus = STATUS_UNSUCCESSFUL);
         }
@@ -1082,12 +1082,12 @@ AFSInsertShortNameDirEntry( IN AFSDirectoryCB *RootNode,
 
                 ntStatus = STATUS_UNSUCCESSFUL;
 
-                AFSDbgLogMsg( AFS_SUBSYSTEM_FILE_PROCESSING,
+                AFSDbgTrace(( AFS_SUBSYSTEM_FILE_PROCESSING,
                               AFS_TRACE_LEVEL_VERBOSE,
                               "AFSInsertShortNameDirEntry Collision with DE %p for shortname %S and %wZ\n",
                               pCurrentEntry,
                               pCurrentEntry->NameInformation.ShortName,
-                              &pCurrentEntry->NameInformation.FileName);
+                              &pCurrentEntry->NameInformation.FileName));
 
                 break;
             }
@@ -1384,9 +1384,9 @@ AFSInsertHashEntry( IN AFSBTreeEntry *TopNode,
         if( pCurrentEntry == NULL)
         {
 
-            AFSDbgLogMsg( AFS_SUBSYSTEM_FILE_PROCESSING,
+            AFSDbgTrace(( AFS_SUBSYSTEM_FILE_PROCESSING,
                           AFS_TRACE_LEVEL_WARNING,
-                          "AFSInsertHashEntry Invalid root node\n");
+                          "AFSInsertHashEntry Invalid root node\n"));
 
             try_return( ntStatus = STATUS_UNSUCCESSFUL);
         }
@@ -1455,10 +1455,10 @@ AFSInsertHashEntry( IN AFSBTreeEntry *TopNode,
             else
             {
 
-                AFSDbgLogMsg( AFS_SUBSYSTEM_FILE_PROCESSING,
+                AFSDbgTrace(( AFS_SUBSYSTEM_FILE_PROCESSING,
                               AFS_TRACE_LEVEL_WARNING,
                               "AFSInsertHashEntry Attempt to re-insert a CRC %I64X\n",
-                              FileIDEntry->HashIndex);
+                              FileIDEntry->HashIndex));
 
                 ntStatus = STATUS_UNSUCCESSFUL;
 
index df613ca..6f2bcf1 100644 (file)
@@ -152,11 +152,11 @@ AFSCleanup( IN PDEVICE_OBJECT LibDeviceObject,
             case AFS_ROOT_ALL:
             {
 
-                AFSDbgLogMsg( AFS_SUBSYSTEM_LOCK_PROCESSING,
+                AFSDbgTrace(( AFS_SUBSYSTEM_LOCK_PROCESSING,
                               AFS_TRACE_LEVEL_VERBOSE,
                               "AFSCleanup Acquiring GlobalRoot lock %p EXCL %08lX\n",
                               &pFcb->NPFcb->Resource,
-                              PsGetCurrentThread());
+                              PsGetCurrentThread()));
 
                 AFSAcquireExcl( &pFcb->NPFcb->Resource,
                                   TRUE);
@@ -169,11 +169,11 @@ AFSCleanup( IN PDEVICE_OBJECT LibDeviceObject,
 
                 lCount = InterlockedDecrement( &pFcb->OpenHandleCount);
 
-                AFSDbgLogMsg( AFS_SUBSYSTEM_FCB_REF_COUNTING,
+                AFSDbgTrace(( AFS_SUBSYSTEM_FCB_REF_COUNTING,
                               AFS_TRACE_LEVEL_VERBOSE,
                               "AFSCleanup (RootAll) Decrement handle count on Fcb %p Cnt %d\n",
                               pFcb,
-                              lCount);
+                              lCount));
 
                 AFSReleaseResource( &pFcb->NPFcb->Resource);
 
@@ -183,11 +183,11 @@ AFSCleanup( IN PDEVICE_OBJECT LibDeviceObject,
             case AFS_IOCTL_FCB:
             {
 
-                AFSDbgLogMsg( AFS_SUBSYSTEM_LOCK_PROCESSING,
+                AFSDbgTrace(( AFS_SUBSYSTEM_LOCK_PROCESSING,
                               AFS_TRACE_LEVEL_VERBOSE,
                               "AFSCleanup Acquiring PIOCtl lock %p EXCL %08lX\n",
                               &pFcb->NPFcb->Resource,
-                              PsGetCurrentThread());
+                              PsGetCurrentThread()));
 
                 AFSAcquireExcl( &pFcb->NPFcb->Resource,
                                   TRUE);
@@ -204,22 +204,22 @@ AFSCleanup( IN PDEVICE_OBJECT LibDeviceObject,
 
                     lCount = InterlockedDecrement( &pParentObjectInfo->Specific.Directory.ChildOpenHandleCount);
 
-                    AFSDbgLogMsg( AFS_SUBSYSTEM_OBJECT_REF_COUNTING,
+                    AFSDbgTrace(( AFS_SUBSYSTEM_OBJECT_REF_COUNTING,
                                   AFS_TRACE_LEVEL_VERBOSE,
                                   "AFSCleanup (IOCtl) Decrement child open handle count on Parent object %p Cnt %d\n",
                                   pParentObjectInfo,
-                                  lCount);
+                                  lCount));
                 }
 
                 AFSReleaseResource( &pFcb->NPFcb->Resource);
 
                 lCount = InterlockedDecrement( &pFcb->OpenHandleCount);
 
-                AFSDbgLogMsg( AFS_SUBSYSTEM_FCB_REF_COUNTING,
+                AFSDbgTrace(( AFS_SUBSYSTEM_FCB_REF_COUNTING,
                               AFS_TRACE_LEVEL_VERBOSE,
                               "AFSCleanup (IOCtl) Decrement handle count on Fcb %p Cnt %d\n",
                               pFcb,
-                              lCount);
+                              lCount));
 
                 break;
             }
@@ -235,11 +235,11 @@ AFSCleanup( IN PDEVICE_OBJECT LibDeviceObject,
                 // We may be performing some cleanup on the Fcb so grab it exclusive to ensure no collisions
                 //
 
-                AFSDbgLogMsg( AFS_SUBSYSTEM_LOCK_PROCESSING,
+                AFSDbgTrace(( AFS_SUBSYSTEM_LOCK_PROCESSING,
                               AFS_TRACE_LEVEL_VERBOSE,
                               "AFSCleanup Acquiring Fcb SectionObject lock %p EXCL %08lX\n",
                               &pFcb->NPFcb->SectionObjectResource,
-                              PsGetCurrentThread());
+                              PsGetCurrentThread()));
 
                 AFSAcquireExcl( &pFcb->NPFcb->SectionObjectResource,
                                 TRUE);
@@ -263,7 +263,7 @@ AFSCleanup( IN PDEVICE_OBJECT LibDeviceObject,
                         if( !NT_SUCCESS( stIoSB.Status))
                         {
 
-                            AFSDbgLogMsg( AFS_SUBSYSTEM_IO_PROCESSING,
+                            AFSDbgTrace(( AFS_SUBSYSTEM_IO_PROCESSING,
                                           AFS_TRACE_LEVEL_ERROR,
                                           "AFSCleanup CcFlushCache failure %wZ FID %08lX-%08lX-%08lX-%08lX Status 0x%08lX Bytes 0x%08lX\n",
                                           &pCcb->FullFileName,
@@ -272,7 +272,7 @@ AFSCleanup( IN PDEVICE_OBJECT LibDeviceObject,
                                           pObjectInfo->FileId.Vnode,
                                           pObjectInfo->FileId.Unique,
                                           stIoSB.Status,
-                                          stIoSB.Information);
+                                          stIoSB.Information));
 
                             ntStatus = stIoSB.Status;
                         }
@@ -288,13 +288,13 @@ AFSCleanup( IN PDEVICE_OBJECT LibDeviceObject,
                                                        FALSE))
                             {
 
-                                AFSDbgLogMsg( AFS_SUBSYSTEM_IO_PROCESSING,
+                                AFSDbgTrace(( AFS_SUBSYSTEM_IO_PROCESSING,
                                               AFS_TRACE_LEVEL_WARNING,
                                               "AFSCleanup CcPurgeCacheSection failure FID %08lX-%08lX-%08lX-%08lX\n",
                                               pObjectInfo->FileId.Cell,
                                               pObjectInfo->FileId.Volume,
                                               pObjectInfo->FileId.Vnode,
-                                              pObjectInfo->FileId.Unique);
+                                              pObjectInfo->FileId.Unique));
 
                                 SetFlag( pObjectInfo->Fcb->Flags, AFS_FCB_FLAG_PURGE_ON_CLOSE);
                             }
@@ -309,14 +309,14 @@ AFSCleanup( IN PDEVICE_OBJECT LibDeviceObject,
 
                         ntStatus = GetExceptionCode();
 
-                        AFSDbgLogMsg( 0,
+                        AFSDbgTrace(( 0,
                                       0,
                                       "EXCEPTION - AFSCleanup Cc FID %08lX-%08lX-%08lX-%08lX Status 0x%08lX\n",
                                       pObjectInfo->FileId.Cell,
                                       pObjectInfo->FileId.Volume,
                                       pObjectInfo->FileId.Vnode,
                                       pObjectInfo->FileId.Unique,
-                                      ntStatus);
+                                      ntStatus));
 
                         SetFlag( pObjectInfo->Fcb->Flags, AFS_FCB_FLAG_PURGE_ON_CLOSE);
                     }
@@ -326,30 +326,30 @@ AFSCleanup( IN PDEVICE_OBJECT LibDeviceObject,
                 // Uninitialize the cache map. This call is unconditional.
                 //
 
-                AFSDbgLogMsg( AFS_SUBSYSTEM_IO_PROCESSING,
+                AFSDbgTrace(( AFS_SUBSYSTEM_IO_PROCESSING,
                               AFS_TRACE_LEVEL_VERBOSE,
                               "AFSCleanup Tearing down cache map for Fcb %p FileObject %p\n",
                               pFcb,
-                              pFileObject);
+                              pFileObject));
 
                 CcUninitializeCacheMap( pFileObject,
                                         NULL,
                                         NULL);
 
 
-                AFSDbgLogMsg( AFS_SUBSYSTEM_LOCK_PROCESSING,
+                AFSDbgTrace(( AFS_SUBSYSTEM_LOCK_PROCESSING,
                               AFS_TRACE_LEVEL_VERBOSE,
                               "AFSCleanup Releasing Fcb SectionObject lock %p EXCL %08lX\n",
                               &pFcb->NPFcb->SectionObjectResource,
-                              PsGetCurrentThread());
+                              PsGetCurrentThread()));
 
                 AFSReleaseResource( &pFcb->NPFcb->SectionObjectResource);
 
-                AFSDbgLogMsg( AFS_SUBSYSTEM_LOCK_PROCESSING,
+                AFSDbgTrace(( AFS_SUBSYSTEM_LOCK_PROCESSING,
                               AFS_TRACE_LEVEL_VERBOSE,
                               "AFSCleanup Acquiring Fcb lock %p EXCL %08lX\n",
                               &pFcb->NPFcb->Resource,
-                              PsGetCurrentThread());
+                              PsGetCurrentThread()));
 
                 AFSAcquireExcl( &pFcb->NPFcb->Resource,
                                 TRUE);
@@ -469,11 +469,11 @@ AFSCleanup( IN PDEVICE_OBJECT LibDeviceObject,
                         ntStatus != STATUS_OBJECT_NAME_NOT_FOUND)
                     {
 
-                        AFSDbgLogMsg( AFS_SUBSYSTEM_FILE_PROCESSING,
+                        AFSDbgTrace(( AFS_SUBSYSTEM_FILE_PROCESSING,
                                       AFS_TRACE_LEVEL_ERROR,
                                       "AFSCleanup Failed to notify service of deleted file %wZ Status %08lX\n",
                                       &pCcb->FullFileName,
-                                      ntStatus);
+                                      ntStatus));
 
                         ntStatus = STATUS_SUCCESS;
 
@@ -491,11 +491,11 @@ AFSCleanup( IN PDEVICE_OBJECT LibDeviceObject,
                             // Stop anything possibly in process
                             //
 
-                            AFSDbgLogMsg( AFS_SUBSYSTEM_LOCK_PROCESSING,
+                            AFSDbgTrace(( AFS_SUBSYSTEM_LOCK_PROCESSING,
                                           AFS_TRACE_LEVEL_VERBOSE,
                                           "AFSCleanup Acquiring Fcb extents lock %p EXCL %08lX\n",
                                           &pFcb->NPFcb->Specific.File.ExtentsResource,
-                                          PsGetCurrentThread());
+                                          PsGetCurrentThread()));
 
                             AFSAcquireExcl( &pFcb->NPFcb->Specific.File.ExtentsResource,
                                             TRUE);
@@ -512,20 +512,20 @@ AFSCleanup( IN PDEVICE_OBJECT LibDeviceObject,
 
                             AFSDeleteFcbExtents( pFcb);
 
-                            AFSDbgLogMsg( AFS_SUBSYSTEM_LOCK_PROCESSING,
+                            AFSDbgTrace(( AFS_SUBSYSTEM_LOCK_PROCESSING,
                                           AFS_TRACE_LEVEL_VERBOSE,
                                           "AFSCleanup Releasing Fcb extents lock %p EXCL %08lX\n",
                                           &pFcb->NPFcb->Specific.File.ExtentsResource,
-                                          PsGetCurrentThread());
+                                          PsGetCurrentThread()));
 
                             AFSReleaseResource( &pFcb->NPFcb->Specific.File.ExtentsResource);
                         }
 
-                        AFSDbgLogMsg( AFS_SUBSYSTEM_FILE_PROCESSING,
+                        AFSDbgTrace(( AFS_SUBSYSTEM_FILE_PROCESSING,
                                       AFS_TRACE_LEVEL_VERBOSE,
                                       "AFSCleanup Setting DELETE flag in file %wZ Dir Entry %p\n",
                                       &pCcb->FullFileName,
-                                      pCcb->DirectoryCB);
+                                      pCcb->DirectoryCB));
 
                         SetFlag( pCcb->DirectoryCB->Flags, AFS_DIR_ENTRY_DELETED);
 
@@ -560,11 +560,11 @@ AFSCleanup( IN PDEVICE_OBJECT LibDeviceObject,
                             if( !BooleanFlagOn( pCcb->DirectoryCB->Flags, AFS_DIR_ENTRY_NOT_IN_PARENT_TREE))
                             {
 
-                                AFSDbgLogMsg( AFS_SUBSYSTEM_FILE_PROCESSING,
+                                AFSDbgTrace(( AFS_SUBSYSTEM_FILE_PROCESSING,
                                               AFS_TRACE_LEVEL_VERBOSE,
                                               "AFSCleanup DE %p for %wZ removing entry\n",
                                               pCcb->DirectoryCB,
-                                              &pCcb->DirectoryCB->NameInformation.FileName);
+                                              &pCcb->DirectoryCB->NameInformation.FileName));
 
                                 AFSRemoveNameEntry( pParentObjectInfo,
                                                     pCcb->DirectoryCB);
@@ -572,11 +572,11 @@ AFSCleanup( IN PDEVICE_OBJECT LibDeviceObject,
                             else
                             {
 
-                                AFSDbgLogMsg( AFS_SUBSYSTEM_FILE_PROCESSING,
+                                AFSDbgTrace(( AFS_SUBSYSTEM_FILE_PROCESSING,
                                               AFS_TRACE_LEVEL_VERBOSE,
                                               "AFSCleanup DE %p for %wZ NOT removing entry due to flag set\n",
                                               pCcb->DirectoryCB,
-                                              &pCcb->DirectoryCB->NameInformation.FileName);
+                                              &pCcb->DirectoryCB->NameInformation.FileName));
                             }
 
                             AFSReleaseResource( pParentObjectInfo->Specific.Directory.DirectoryNodeHdr.TreeLock);
@@ -591,11 +591,11 @@ AFSCleanup( IN PDEVICE_OBJECT LibDeviceObject,
                             if( !BooleanFlagOn( pCcb->DirectoryCB->Flags, AFS_DIR_ENTRY_NOT_IN_PARENT_TREE))
                             {
 
-                                AFSDbgLogMsg( AFS_SUBSYSTEM_FILE_PROCESSING,
+                                AFSDbgTrace(( AFS_SUBSYSTEM_FILE_PROCESSING,
                                               AFS_TRACE_LEVEL_VERBOSE,
                                               "AFSCleanup DE %p for %wZ NOT removing entry due to pParentObjectInfo == NULL\n",
                                               pCcb->DirectoryCB,
-                                              &pCcb->DirectoryCB->NameInformation.FileName);
+                                              &pCcb->DirectoryCB->NameInformation.FileName));
                             }
                         }
                     }
@@ -745,21 +745,21 @@ AFSCleanup( IN PDEVICE_OBJECT LibDeviceObject,
 
                     lCount = InterlockedDecrement( &pParentObjectInfo->Specific.Directory.ChildOpenHandleCount);
 
-                    AFSDbgLogMsg( AFS_SUBSYSTEM_OBJECT_REF_COUNTING,
+                    AFSDbgTrace(( AFS_SUBSYSTEM_OBJECT_REF_COUNTING,
                                   AFS_TRACE_LEVEL_VERBOSE,
                                   "AFSCleanup (File) Decrement child open handle count on Parent object %p Cnt %d\n",
                                   pParentObjectInfo,
-                                  lCount);
+                                  lCount));
                 }
 
 
                 lCount = InterlockedDecrement( &pFcb->OpenHandleCount);
 
-                AFSDbgLogMsg( AFS_SUBSYSTEM_FCB_REF_COUNTING,
+                AFSDbgTrace(( AFS_SUBSYSTEM_FCB_REF_COUNTING,
                               AFS_TRACE_LEVEL_VERBOSE,
                               "AFSCleanup (File) Decrement handle count on Fcb %p Cnt %d\n",
                               pFcb,
-                              lCount);
+                              lCount));
 
                 if( BooleanFlagOn( pFcb->Flags, AFS_FCB_FLAG_PURGE_ON_CLOSE))
                 {
@@ -770,11 +770,11 @@ AFSCleanup( IN PDEVICE_OBJECT LibDeviceObject,
                     lCount = AFSObjectInfoIncrement( pObjectInfo,
                                                      AFS_OBJECT_REFERENCE_INVALIDATION);
 
-                    AFSDbgLogMsg( AFS_SUBSYSTEM_OBJECT_REF_COUNTING,
+                    AFSDbgTrace(( AFS_SUBSYSTEM_OBJECT_REF_COUNTING,
                                   AFS_TRACE_LEVEL_VERBOSE,
                                   "AFSCleanup Setting Purge on Close Increment count on object %p Cnt %d\n",
                                   pObjectInfo,
-                                  lCount);
+                                  lCount));
 
                     ClearFlag( pFcb->Flags, AFS_FCB_FLAG_PURGE_ON_CLOSE);
 
@@ -817,11 +817,11 @@ AFSCleanup( IN PDEVICE_OBJECT LibDeviceObject,
                 // We may be performing some cleanup on the Fcb so grab it exclusive to ensure no collisions
                 //
 
-                AFSDbgLogMsg( AFS_SUBSYSTEM_LOCK_PROCESSING,
+                AFSDbgTrace(( AFS_SUBSYSTEM_LOCK_PROCESSING,
                               AFS_TRACE_LEVEL_VERBOSE,
                               "AFSCleanup Acquiring Dcb lock %p EXCL %08lX\n",
                               &pFcb->NPFcb->Resource,
-                              PsGetCurrentThread());
+                              PsGetCurrentThread()));
 
                 AFSAcquireExcl( &pFcb->NPFcb->Resource,
                                   TRUE);
@@ -912,11 +912,11 @@ AFSCleanup( IN PDEVICE_OBJECT LibDeviceObject,
                         ntStatus != STATUS_OBJECT_NAME_NOT_FOUND)
                     {
 
-                        AFSDbgLogMsg( AFS_SUBSYSTEM_FILE_PROCESSING,
+                        AFSDbgTrace(( AFS_SUBSYSTEM_FILE_PROCESSING,
                                       AFS_TRACE_LEVEL_ERROR,
                                       "AFSCleanup Failed to notify service of deleted directory %wZ Status %08lX\n",
                                       &pCcb->FullFileName,
-                                      ntStatus);
+                                      ntStatus));
 
                         ntStatus = STATUS_SUCCESS;
 
@@ -927,11 +927,11 @@ AFSCleanup( IN PDEVICE_OBJECT LibDeviceObject,
 
                         ntStatus = STATUS_SUCCESS;
 
-                        AFSDbgLogMsg( AFS_SUBSYSTEM_FILE_PROCESSING,
+                        AFSDbgTrace(( AFS_SUBSYSTEM_FILE_PROCESSING,
                                       AFS_TRACE_LEVEL_VERBOSE,
                                       "AFSCleanup Setting DELETE flag in directory %wZ Dir Entry %p\n",
                                       &pCcb->FullFileName,
-                                      pCcb->DirectoryCB);
+                                      pCcb->DirectoryCB));
 
                         SetFlag( pCcb->DirectoryCB->Flags, AFS_DIR_ENTRY_DELETED);
 
@@ -972,11 +972,11 @@ AFSCleanup( IN PDEVICE_OBJECT LibDeviceObject,
                             else
                             {
 
-                                AFSDbgLogMsg( AFS_SUBSYSTEM_FILE_PROCESSING,
+                                AFSDbgTrace(( AFS_SUBSYSTEM_FILE_PROCESSING,
                                               AFS_TRACE_LEVEL_VERBOSE,
                                               "AFSCleanup DE %p for %wZ NOT removing entry due to flag set\n",
                                               pCcb->DirectoryCB,
-                                              &pCcb->DirectoryCB->NameInformation.FileName);
+                                              &pCcb->DirectoryCB->NameInformation.FileName));
                             }
 
                             AFSReleaseResource( pParentObjectInfo->Specific.Directory.DirectoryNodeHdr.TreeLock);
@@ -991,11 +991,11 @@ AFSCleanup( IN PDEVICE_OBJECT LibDeviceObject,
                             if( !BooleanFlagOn( pCcb->DirectoryCB->Flags, AFS_DIR_ENTRY_NOT_IN_PARENT_TREE))
                             {
 
-                                AFSDbgLogMsg( AFS_SUBSYSTEM_FILE_PROCESSING,
+                                AFSDbgTrace(( AFS_SUBSYSTEM_FILE_PROCESSING,
                                               AFS_TRACE_LEVEL_VERBOSE,
                                               "AFSCleanup DE %p for %wZ NOT removing entry due to pParentObjectInfo == NULL\n",
                                               pCcb->DirectoryCB,
-                                              &pCcb->DirectoryCB->NameInformation.FileName);
+                                              &pCcb->DirectoryCB->NameInformation.FileName));
                             }
                         }
                     }
@@ -1105,20 +1105,20 @@ AFSCleanup( IN PDEVICE_OBJECT LibDeviceObject,
 
                     lCount = InterlockedDecrement( &pParentObjectInfo->Specific.Directory.ChildOpenHandleCount);
 
-                    AFSDbgLogMsg( AFS_SUBSYSTEM_OBJECT_REF_COUNTING,
+                    AFSDbgTrace(( AFS_SUBSYSTEM_OBJECT_REF_COUNTING,
                                   AFS_TRACE_LEVEL_VERBOSE,
                                   "AFSCleanup (Dir) Decrement child open handle count on Parent object %p Cnt %d\n",
                                   pParentObjectInfo,
-                                  lCount);
+                                  lCount));
                 }
 
                 lCount = InterlockedDecrement( &pFcb->OpenHandleCount);
 
-                AFSDbgLogMsg( AFS_SUBSYSTEM_FCB_REF_COUNTING,
+                AFSDbgTrace(( AFS_SUBSYSTEM_FCB_REF_COUNTING,
                               AFS_TRACE_LEVEL_VERBOSE,
                               "AFSCleanup (Dir) Decrement handle count on Fcb %p Cnt %d\n",
                               pFcb,
-                              lCount);
+                              lCount));
 
                 AFSReleaseResource( &pFcb->NPFcb->Resource);
 
@@ -1135,11 +1135,11 @@ AFSCleanup( IN PDEVICE_OBJECT LibDeviceObject,
                 // We may be performing some cleanup on the Fcb so grab it exclusive to ensure no collisions
                 //
 
-                AFSDbgLogMsg( AFS_SUBSYSTEM_LOCK_PROCESSING,
+                AFSDbgTrace(( AFS_SUBSYSTEM_LOCK_PROCESSING,
                               AFS_TRACE_LEVEL_VERBOSE,
                               "AFSCleanup (MP/SL) Acquiring Dcb lock %p EXCL %08lX\n",
                               &pFcb->NPFcb->Resource,
-                              PsGetCurrentThread());
+                              PsGetCurrentThread()));
 
                 AFSAcquireExcl( &pFcb->NPFcb->Resource,
                                   TRUE);
@@ -1230,11 +1230,11 @@ AFSCleanup( IN PDEVICE_OBJECT LibDeviceObject,
                         ntStatus != STATUS_OBJECT_NAME_NOT_FOUND)
                     {
 
-                        AFSDbgLogMsg( AFS_SUBSYSTEM_FILE_PROCESSING,
+                        AFSDbgTrace(( AFS_SUBSYSTEM_FILE_PROCESSING,
                                       AFS_TRACE_LEVEL_ERROR,
                                       "AFSCleanup Failed to notify service of deleted MP/SL %wZ Status %08lX\n",
                                       &pCcb->FullFileName,
-                                      ntStatus);
+                                      ntStatus));
 
                         ntStatus = STATUS_SUCCESS;
 
@@ -1245,11 +1245,11 @@ AFSCleanup( IN PDEVICE_OBJECT LibDeviceObject,
 
                         ntStatus = STATUS_SUCCESS;
 
-                        AFSDbgLogMsg( AFS_SUBSYSTEM_FILE_PROCESSING,
+                        AFSDbgTrace(( AFS_SUBSYSTEM_FILE_PROCESSING,
                                       AFS_TRACE_LEVEL_VERBOSE,
                                       "AFSCleanup Setting DELETE flag in MP/SL %wZ Dir Entry %p\n",
                                       &pCcb->FullFileName,
-                                      pCcb->DirectoryCB);
+                                      pCcb->DirectoryCB));
 
                         SetFlag( pCcb->DirectoryCB->Flags, AFS_DIR_ENTRY_DELETED);
 
@@ -1289,11 +1289,11 @@ AFSCleanup( IN PDEVICE_OBJECT LibDeviceObject,
                             else
                             {
 
-                                AFSDbgLogMsg( AFS_SUBSYSTEM_FILE_PROCESSING,
+                                AFSDbgTrace(( AFS_SUBSYSTEM_FILE_PROCESSING,
                                               AFS_TRACE_LEVEL_VERBOSE,
                                               "AFSCleanup DE %p for %wZ NOT removing entry due to flag set\n",
                                               pCcb->DirectoryCB,
-                                              &pCcb->DirectoryCB->NameInformation.FileName);
+                                              &pCcb->DirectoryCB->NameInformation.FileName));
                             }
 
                             AFSReleaseResource( pParentObjectInfo->Specific.Directory.DirectoryNodeHdr.TreeLock);
@@ -1309,11 +1309,11 @@ AFSCleanup( IN PDEVICE_OBJECT LibDeviceObject,
                             if( !BooleanFlagOn( pCcb->DirectoryCB->Flags, AFS_DIR_ENTRY_NOT_IN_PARENT_TREE))
                             {
 
-                                AFSDbgLogMsg( AFS_SUBSYSTEM_FILE_PROCESSING,
+                                AFSDbgTrace(( AFS_SUBSYSTEM_FILE_PROCESSING,
                                               AFS_TRACE_LEVEL_VERBOSE,
                                               "AFSCleanup DE %p for %wZ NOT removing entry due to pParentObjectInfo == NULL\n",
                                               pCcb->DirectoryCB,
-                                              &pCcb->DirectoryCB->NameInformation.FileName);
+                                              &pCcb->DirectoryCB->NameInformation.FileName));
                             }
                         }
                     }
@@ -1415,20 +1415,20 @@ AFSCleanup( IN PDEVICE_OBJECT LibDeviceObject,
 
                     lCount = InterlockedDecrement( &pParentObjectInfo->Specific.Directory.ChildOpenHandleCount);
 
-                    AFSDbgLogMsg( AFS_SUBSYSTEM_OBJECT_REF_COUNTING,
+                    AFSDbgTrace(( AFS_SUBSYSTEM_OBJECT_REF_COUNTING,
                                   AFS_TRACE_LEVEL_VERBOSE,
                                   "AFSCleanup (MP/SL) Decrement child open handle count on Parent object %p Cnt %d\n",
                                   pParentObjectInfo,
-                                  lCount);
+                                  lCount));
                 }
 
                 lCount = InterlockedDecrement( &pFcb->OpenHandleCount);
 
-                AFSDbgLogMsg( AFS_SUBSYSTEM_FCB_REF_COUNTING,
+                AFSDbgTrace(( AFS_SUBSYSTEM_FCB_REF_COUNTING,
                               AFS_TRACE_LEVEL_VERBOSE,
                               "AFSCleanup (MP/SL) Decrement handle count on Fcb %p Cnt %d\n",
                               pFcb,
-                              lCount);
+                              lCount));
 
                 AFSReleaseResource( &pFcb->NPFcb->Resource);
 
@@ -1438,11 +1438,11 @@ AFSCleanup( IN PDEVICE_OBJECT LibDeviceObject,
             case AFS_SPECIAL_SHARE_FCB:
             {
 
-                AFSDbgLogMsg( AFS_SUBSYSTEM_LOCK_PROCESSING,
+                AFSDbgTrace(( AFS_SUBSYSTEM_LOCK_PROCESSING,
                               AFS_TRACE_LEVEL_VERBOSE,
                               "AFSCleanup Acquiring SPECIAL SHARE lock %p EXCL %08lX\n",
                               &pFcb->NPFcb->Resource,
-                              PsGetCurrentThread());
+                              PsGetCurrentThread()));
 
                 AFSAcquireExcl( &pFcb->NPFcb->Resource,
                                 TRUE);
@@ -1459,20 +1459,20 @@ AFSCleanup( IN PDEVICE_OBJECT LibDeviceObject,
 
                     lCount = InterlockedDecrement( &pParentObjectInfo->Specific.Directory.ChildOpenHandleCount);
 
-                    AFSDbgLogMsg( AFS_SUBSYSTEM_OBJECT_REF_COUNTING,
+                    AFSDbgTrace(( AFS_SUBSYSTEM_OBJECT_REF_COUNTING,
                                   AFS_TRACE_LEVEL_VERBOSE,
                                   "AFSCleanup (Share) Decrement child open handle count on Parent object %p Cnt %d\n",
                                   pParentObjectInfo,
-                                  lCount);
+                                  lCount));
                 }
 
                 lCount = InterlockedDecrement( &pFcb->OpenHandleCount);
 
-                AFSDbgLogMsg( AFS_SUBSYSTEM_FCB_REF_COUNTING,
+                AFSDbgTrace(( AFS_SUBSYSTEM_FCB_REF_COUNTING,
                               AFS_TRACE_LEVEL_VERBOSE,
                               "AFSCleanup (Share) Decrement handle count on Fcb %p Cnt %d\n",
                               pFcb,
-                              lCount);
+                              lCount));
 
                 AFSReleaseResource( &pFcb->NPFcb->Resource);
 
@@ -1481,10 +1481,10 @@ AFSCleanup( IN PDEVICE_OBJECT LibDeviceObject,
 
             default:
 
-                AFSDbgLogMsg( AFS_SUBSYSTEM_FILE_PROCESSING,
+                AFSDbgTrace(( AFS_SUBSYSTEM_FILE_PROCESSING,
                               AFS_TRACE_LEVEL_ERROR,
                               "AFSCleanup Processing unknown node type %d\n",
-                              pFcb->Header.NodeTypeCode);
+                              pFcb->Header.NodeTypeCode));
 
                 break;
         }
@@ -1523,9 +1523,9 @@ try_exit:
     __except( AFSExceptionFilter( __FUNCTION__, GetExceptionCode(), GetExceptionInformation()) )
     {
 
-        AFSDbgLogMsg( 0,
+        AFSDbgTrace(( 0,
                       0,
-                      "EXCEPTION - AFSCleanup\n");
+                      "EXCEPTION - AFSCleanup\n"));
 
         AFSDumpTraceFilesFnc();
     }
index e18459c..1dd061f 100644 (file)
@@ -104,11 +104,11 @@ AFSClose( IN PDEVICE_OBJECT LibDeviceObject,
                 AFSPIOCtlOpenCloseRequestCB stPIOCtlClose;
                 AFSFileID stParentFileId;
 
-                AFSDbgLogMsg( AFS_SUBSYSTEM_LOCK_PROCESSING,
+                AFSDbgTrace(( AFS_SUBSYSTEM_LOCK_PROCESSING,
                               AFS_TRACE_LEVEL_VERBOSE,
                               "AFSClose Acquiring GlobalRoot lock %p EXCL %08lX\n",
                               &pFcb->NPFcb->Resource,
-                              PsGetCurrentThread());
+                              PsGetCurrentThread()));
 
                 AFSAcquireExcl( &pFcb->NPFcb->Resource,
                                   TRUE);
@@ -171,22 +171,22 @@ AFSClose( IN PDEVICE_OBJECT LibDeviceObject,
 
                     InterlockedDecrement( &pParentObjectInfo->Specific.Directory.ChildOpenReferenceCount);
 
-                    AFSDbgLogMsg( AFS_SUBSYSTEM_OBJECT_REF_COUNTING,
+                    AFSDbgTrace(( AFS_SUBSYSTEM_OBJECT_REF_COUNTING,
                                   AFS_TRACE_LEVEL_VERBOSE,
                                   "AFSClose (IOCtl) Decrement child open ref count on Parent object %p Cnt %d\n",
                                   pParentObjectInfo,
-                                  pParentObjectInfo->Specific.Directory.ChildOpenReferenceCount);
+                                  pParentObjectInfo->Specific.Directory.ChildOpenReferenceCount));
                 }
 
                 AFSReleaseResource( &pFcb->NPFcb->Resource);
 
                 lCount = InterlockedDecrement( &pFcb->OpenReferenceCount);
 
-                AFSDbgLogMsg( AFS_SUBSYSTEM_FCB_REF_COUNTING,
+                AFSDbgTrace(( AFS_SUBSYSTEM_FCB_REF_COUNTING,
                               AFS_TRACE_LEVEL_VERBOSE,
                               "AFSClose (IOCtl) Decrement count on Fcb %p Cnt %d\n",
                               pFcb,
-                              lCount);
+                              lCount));
 
                 ASSERT( lCount >= 0);
 
@@ -196,11 +196,11 @@ AFSClose( IN PDEVICE_OBJECT LibDeviceObject,
             case AFS_ROOT_ALL:
             {
 
-                AFSDbgLogMsg( AFS_SUBSYSTEM_LOCK_PROCESSING,
+                AFSDbgTrace(( AFS_SUBSYSTEM_LOCK_PROCESSING,
                               AFS_TRACE_LEVEL_VERBOSE,
                               "AFSClose Acquiring Special Root ALL lock %p EXCL %08lX\n",
                               &pFcb->NPFcb->Resource,
-                              PsGetCurrentThread());
+                              PsGetCurrentThread()));
 
                 AFSAcquireExcl( &pFcb->NPFcb->Resource,
                                 TRUE);
@@ -218,11 +218,11 @@ AFSClose( IN PDEVICE_OBJECT LibDeviceObject,
 
                 lCount = InterlockedDecrement( &pFcb->OpenReferenceCount);
 
-                AFSDbgLogMsg( AFS_SUBSYSTEM_FCB_REF_COUNTING,
+                AFSDbgTrace(( AFS_SUBSYSTEM_FCB_REF_COUNTING,
                               AFS_TRACE_LEVEL_VERBOSE,
                               "AFSClose (RootAll) Decrement count on Fcb %p Cnt %d\n",
                               pFcb,
-                              lCount);
+                              lCount));
 
                 ASSERT( lCount >= 0);
 
@@ -248,11 +248,11 @@ AFSClose( IN PDEVICE_OBJECT LibDeviceObject,
                 // We may be performing some cleanup on the Fcb so grab it exclusive to ensure no collisions
                 //
 
-                AFSDbgLogMsg( AFS_SUBSYSTEM_LOCK_PROCESSING,
+                AFSDbgTrace(( AFS_SUBSYSTEM_LOCK_PROCESSING,
                               AFS_TRACE_LEVEL_VERBOSE,
                               "AFSClose Acquiring Dcb lock %p EXCL %08lX\n",
                               &pFcb->NPFcb->Resource,
-                              PsGetCurrentThread());
+                              PsGetCurrentThread()));
 
                 AFSAcquireExcl( &pFcb->NPFcb->Resource,
                                 TRUE);
@@ -352,11 +352,11 @@ AFSClose( IN PDEVICE_OBJECT LibDeviceObject,
                         // Stop anything possibly in process
                         //
 
-                        AFSDbgLogMsg( AFS_SUBSYSTEM_LOCK_PROCESSING,
+                        AFSDbgTrace(( AFS_SUBSYSTEM_LOCK_PROCESSING,
                                       AFS_TRACE_LEVEL_VERBOSE,
                                       "AFSClose Acquiring Fcb extents lock %p EXCL %08lX\n",
                                       &pFcb->NPFcb->Specific.File.ExtentsResource,
-                                      PsGetCurrentThread());
+                                      PsGetCurrentThread()));
 
                         AFSAcquireExcl( &pObjectInfo->Fcb->NPFcb->Specific.File.ExtentsResource,
                                         TRUE);
@@ -367,11 +367,11 @@ AFSClose( IN PDEVICE_OBJECT LibDeviceObject,
                                     0,
                                     FALSE);
 
-                        AFSDbgLogMsg( AFS_SUBSYSTEM_LOCK_PROCESSING,
+                        AFSDbgTrace(( AFS_SUBSYSTEM_LOCK_PROCESSING,
                                       AFS_TRACE_LEVEL_VERBOSE,
                                       "AFSClose Releasing Fcb extents lock %p EXCL %08lX\n",
                                       &pFcb->NPFcb->Specific.File.ExtentsResource,
-                                      PsGetCurrentThread());
+                                      PsGetCurrentThread()));
 
                         AFSReleaseResource( &pObjectInfo->Fcb->NPFcb->Specific.File.ExtentsResource);
                     }
@@ -388,13 +388,13 @@ AFSClose( IN PDEVICE_OBJECT LibDeviceObject,
 
                         lCount = InterlockedDecrement( &pDirCB->DirOpenReferenceCount);
 
-                        AFSDbgLogMsg( AFS_SUBSYSTEM_DIRENTRY_REF_COUNTING,
+                        AFSDbgTrace(( AFS_SUBSYSTEM_DIRENTRY_REF_COUNTING,
                                       AFS_TRACE_LEVEL_VERBOSE,
                                       "AFSClose (Other) Decrement count on %wZ DE %p Ccb %p Cnt %d\n",
                                       &pDirCB->NameInformation.FileName,
                                       pDirCB,
                                       pCcb,
-                                      lCount);
+                                      lCount));
 
                         ASSERT( lCount >= 0);
 
@@ -402,7 +402,7 @@ AFSClose( IN PDEVICE_OBJECT LibDeviceObject,
                             pDirCB->NameArrayReferenceCount <= 0)
                         {
 
-                            AFSDbgLogMsg( AFS_SUBSYSTEM_CLEANUP_PROCESSING,
+                            AFSDbgTrace(( AFS_SUBSYSTEM_CLEANUP_PROCESSING,
                                           AFS_TRACE_LEVEL_VERBOSE,
                                           "AFSClose Deleting dir entry %p (%p) for %wZ  FID %08lX-%08lX-%08lX-%08lX\n",
                                           pDirCB,
@@ -411,7 +411,7 @@ AFSClose( IN PDEVICE_OBJECT LibDeviceObject,
                                           pObjectInfo->FileId.Cell,
                                           pObjectInfo->FileId.Volume,
                                           pObjectInfo->FileId.Vnode,
-                                          pObjectInfo->FileId.Unique);
+                                          pObjectInfo->FileId.Unique));
 
                             //
                             // Remove and delete the directory entry from the parent list
@@ -429,10 +429,10 @@ AFSClose( IN PDEVICE_OBJECT LibDeviceObject,
                                 if( BooleanFlagOn( pObjectInfo->Flags, AFS_OBJECT_INSERTED_HASH_TREE))
                                 {
 
-                                    AFSDbgLogMsg( AFS_SUBSYSTEM_CLEANUP_PROCESSING,
+                                    AFSDbgTrace(( AFS_SUBSYSTEM_CLEANUP_PROCESSING,
                                                   AFS_TRACE_LEVEL_VERBOSE,
                                                   "AFSClose Removing object %p from volume tree\n",
-                                                  pObjectInfo);
+                                                  pObjectInfo));
 
                                     AFSRemoveHashEntry( &pObjectInfo->VolumeCB->ObjectInfoTree.TreeHead,
                                                         &pObjectInfo->TreeEntry);
@@ -454,13 +454,13 @@ AFSClose( IN PDEVICE_OBJECT LibDeviceObject,
 
                     lCount = InterlockedDecrement( &pDirCB->DirOpenReferenceCount);
 
-                    AFSDbgLogMsg( AFS_SUBSYSTEM_DIRENTRY_REF_COUNTING,
+                    AFSDbgTrace(( AFS_SUBSYSTEM_DIRENTRY_REF_COUNTING,
                                   AFS_TRACE_LEVEL_VERBOSE,
                                   "AFSClose (Other2) Decrement count on %wZ DE %p Ccb %p Cnt %d\n",
                                   &pDirCB->NameInformation.FileName,
                                   pDirCB,
                                   pCcb,
-                                  lCount);
+                                  lCount));
 
                     ASSERT( lCount >= 0);
                 }
@@ -476,11 +476,11 @@ AFSClose( IN PDEVICE_OBJECT LibDeviceObject,
 
                     InterlockedDecrement( &pParentObjectInfo->Specific.Directory.ChildOpenReferenceCount);
 
-                    AFSDbgLogMsg( AFS_SUBSYSTEM_OBJECT_REF_COUNTING,
+                    AFSDbgTrace(( AFS_SUBSYSTEM_OBJECT_REF_COUNTING,
                                   AFS_TRACE_LEVEL_VERBOSE,
                                   "AFSClose Decrement child open ref count on Parent object %p Cnt %d\n",
                                   pParentObjectInfo,
-                                  pParentObjectInfo->Specific.Directory.ChildOpenReferenceCount);
+                                  pParentObjectInfo->Specific.Directory.ChildOpenReferenceCount));
                 }
 
                 //
@@ -489,11 +489,11 @@ AFSClose( IN PDEVICE_OBJECT LibDeviceObject,
 
                 lCount = InterlockedDecrement( &pFcb->OpenReferenceCount);
 
-                AFSDbgLogMsg( AFS_SUBSYSTEM_FCB_REF_COUNTING,
+                AFSDbgTrace(( AFS_SUBSYSTEM_FCB_REF_COUNTING,
                               AFS_TRACE_LEVEL_VERBOSE,
                               "AFSClose Decrement count on Fcb %p Cnt %d\n",
                               pFcb,
-                              lCount);
+                              lCount));
 
                 ASSERT( lCount >= 0);
 
@@ -518,11 +518,11 @@ AFSClose( IN PDEVICE_OBJECT LibDeviceObject,
                                                            &pObjectInfo->ParentFileId);
                 }
 
-                AFSDbgLogMsg( AFS_SUBSYSTEM_LOCK_PROCESSING,
+                AFSDbgTrace(( AFS_SUBSYSTEM_LOCK_PROCESSING,
                               AFS_TRACE_LEVEL_VERBOSE,
                               "AFSClose Acquiring Special Share lock %p EXCL %08lX\n",
                               &pFcb->NPFcb->Resource,
-                              PsGetCurrentThread());
+                              PsGetCurrentThread()));
 
                 AFSAcquireExcl( &pFcb->NPFcb->Resource,
                                 TRUE);
@@ -569,22 +569,22 @@ AFSClose( IN PDEVICE_OBJECT LibDeviceObject,
 
                     lCount = InterlockedDecrement( &pParentObjectInfo->Specific.Directory.ChildOpenReferenceCount);
 
-                    AFSDbgLogMsg( AFS_SUBSYSTEM_OBJECT_REF_COUNTING,
+                    AFSDbgTrace(( AFS_SUBSYSTEM_OBJECT_REF_COUNTING,
                                   AFS_TRACE_LEVEL_VERBOSE,
                                   "AFSClose (Share) Decrement child open ref count on Parent object %p Cnt %d\n",
                                   pParentObjectInfo,
-                                  lCount);
+                                  lCount));
                 }
 
                 AFSReleaseResource( &pFcb->NPFcb->Resource);
 
                 lCount = InterlockedDecrement( &pFcb->OpenReferenceCount);
 
-                AFSDbgLogMsg( AFS_SUBSYSTEM_FCB_REF_COUNTING,
+                AFSDbgTrace(( AFS_SUBSYSTEM_FCB_REF_COUNTING,
                               AFS_TRACE_LEVEL_VERBOSE,
                               "AFSClose (Share) Decrement count on Fcb %p Cnt %d\n",
                               pFcb,
-                              lCount);
+                              lCount));
 
                 ASSERT( lCount >= 0);
 
@@ -593,10 +593,10 @@ AFSClose( IN PDEVICE_OBJECT LibDeviceObject,
 
             default:
 
-                AFSDbgLogMsg( AFS_SUBSYSTEM_FILE_PROCESSING,
+                AFSDbgTrace(( AFS_SUBSYSTEM_FILE_PROCESSING,
                               AFS_TRACE_LEVEL_ERROR,
                               "AFSClose Processing unknown node type %d\n",
-                              pFcb->Header.NodeTypeCode);
+                              pFcb->Header.NodeTypeCode));
 
                 break;
         }
@@ -613,9 +613,9 @@ try_exit:
     __except( AFSExceptionFilter( __FUNCTION__, GetExceptionCode(), GetExceptionInformation()) )
     {
 
-        AFSDbgLogMsg( 0,
+        AFSDbgTrace(( 0,
                       0,
-                      "EXCEPTION - AFSClose\n");
+                      "EXCEPTION - AFSClose\n"));
 
         AFSDumpTraceFilesFnc();
     }
index e37fe17..85285dc 100644 (file)
@@ -77,14 +77,14 @@ AFSEnumerateDirectory( IN GUID *AuthGroup,
                                &uniGUID);
         }
 
-        AFSDbgLogMsg( AFS_SUBSYSTEM_FILE_PROCESSING,
+        AFSDbgTrace(( AFS_SUBSYSTEM_FILE_PROCESSING,
                       AFS_TRACE_LEVEL_VERBOSE,
                       "AFSEnumerateDirectory Enumerating FID %08lX-%08lX-%08lX-%08lX AuthGroup %wZ\n",
                       ObjectInfoCB->FileId.Cell,
                       ObjectInfoCB->FileId.Volume,
                       ObjectInfoCB->FileId.Vnode,
                       ObjectInfoCB->FileId.Unique,
-                      &uniGUID);
+                      &uniGUID));
 
         if( AuthGroup != NULL)
         {
@@ -175,7 +175,7 @@ AFSEnumerateDirectory( IN GUID *AuthGroup,
                     AFSAcquireExcl( ObjectInfoCB->Specific.Directory.DirectoryNodeHdr.TreeLock,
                                     TRUE);
 
-                    AFSDbgLogMsg( AFS_SUBSYSTEM_FILE_PROCESSING,
+                    AFSDbgTrace(( AFS_SUBSYSTEM_FILE_PROCESSING,
                                   AFS_TRACE_LEVEL_VERBOSE,
                                   "AFSEnumerateDirectory Directory Complete FID %08lX-%08lX-%08lX-%08lX Snapshot-DV %08lX:%08lX Current-DV %08lX:%08lX Status %08lX\n",
                                   ObjectInfoCB->FileId.Cell,
@@ -186,7 +186,7 @@ AFSEnumerateDirectory( IN GUID *AuthGroup,
                                   pDirEnumResponse->SnapshotDataVersion.LowPart,
                                   pDirEnumResponse->CurrentDataVersion.HighPart,
                                   pDirEnumResponse->CurrentDataVersion.LowPart,
-                                  ntStatus);
+                                  ntStatus));
 
                     ObjectInfoCB->DataVersion = pDirEnumResponse->SnapshotDataVersion;
 
@@ -197,13 +197,13 @@ AFSEnumerateDirectory( IN GUID *AuthGroup,
 
                         ObjectInfoCB->DataVersion.QuadPart = (ULONGLONG)-1;
 
-                        AFSDbgLogMsg( AFS_SUBSYSTEM_FILE_PROCESSING,
+                        AFSDbgTrace(( AFS_SUBSYSTEM_FILE_PROCESSING,
                                       AFS_TRACE_LEVEL_VERBOSE,
                                       "AFSEnumerateDirectory Force Verify due to DV change during enumeration FID %08lX-%08lX-%08lX-%08lX\n",
                                       ObjectInfoCB->FileId.Cell,
                                       ObjectInfoCB->FileId.Volume,
                                       ObjectInfoCB->FileId.Vnode,
-                                      ObjectInfoCB->FileId.Unique);
+                                      ObjectInfoCB->FileId.Unique));
                     }
 
                     AFSReleaseResource( ObjectInfoCB->Specific.Directory.DirectoryNodeHdr.TreeLock);
@@ -211,7 +211,7 @@ AFSEnumerateDirectory( IN GUID *AuthGroup,
                 else
                 {
 
-                    AFSDbgLogMsg( AFS_SUBSYSTEM_FILE_PROCESSING,
+                    AFSDbgTrace(( AFS_SUBSYSTEM_FILE_PROCESSING,
                                   AFS_TRACE_LEVEL_VERBOSE,
                                   "AFSEnumerateDirectory Failed to enumerate directory FID %08lX-%08lX-%08lX-%08lX AuthGroup %wZ Status %08lX\n",
                                   ObjectInfoCB->FileId.Cell,
@@ -219,7 +219,7 @@ AFSEnumerateDirectory( IN GUID *AuthGroup,
                                   ObjectInfoCB->FileId.Vnode,
                                   ObjectInfoCB->FileId.Unique,
                                   &uniGUID,
-                                  ntStatus);
+                                  ntStatus));
                 }
 
                 break;
@@ -229,7 +229,7 @@ AFSEnumerateDirectory( IN GUID *AuthGroup,
 
             pCurrentDirEntry = (AFSDirEnumEntry *)pDirEnumResponse->Entry;
 
-            AFSDbgLogMsg( AFS_SUBSYSTEM_FILE_PROCESSING,
+            AFSDbgTrace(( AFS_SUBSYSTEM_FILE_PROCESSING,
                           AFS_TRACE_LEVEL_VERBOSE,
                           "AFSEnumerateDirectory Enumerating FID %08lX-%08lX-%08lX-%08lX Snapshot-DV %08lX:%08lX Current-DV %08lX:%08lX\n",
                           ObjectInfoCB->FileId.Cell,
@@ -239,7 +239,7 @@ AFSEnumerateDirectory( IN GUID *AuthGroup,
                           pDirEnumResponse->SnapshotDataVersion.HighPart,
                           pDirEnumResponse->SnapshotDataVersion.LowPart,
                           pDirEnumResponse->CurrentDataVersion.HighPart,
-                          pDirEnumResponse->CurrentDataVersion.LowPart);
+                          pDirEnumResponse->CurrentDataVersion.LowPart));
 
             //
             // Remove the leading header from the processed length
@@ -320,11 +320,11 @@ AFSEnumerateDirectory( IN GUID *AuthGroup,
                             lCount = AFSObjectInfoIncrement( pObjectInfo,
                                                              AFS_OBJECT_REFERENCE_INVALIDATION);
 
-                            AFSDbgLogMsg( AFS_SUBSYSTEM_OBJECT_REF_COUNTING,
+                            AFSDbgTrace(( AFS_SUBSYSTEM_OBJECT_REF_COUNTING,
                                           AFS_TRACE_LEVEL_VERBOSE,
                                           "AFSEnumerateDirectory calling AFSPerformObjectInvalidate Increment count on object %p Cnt %d\n",
                                           pObjectInfo,
-                                          lCount);
+                                          lCount));
 
                             AFSPerformObjectInvalidate( pObjectInfo,
                                                         AFS_INVALIDATE_DATA_VERSION);
@@ -349,7 +349,7 @@ AFSEnumerateDirectory( IN GUID *AuthGroup,
                             pDirNode->NameArrayReferenceCount <= 0)
                         {
 
-                            AFSDbgLogMsg( AFS_SUBSYSTEM_FILE_PROCESSING,
+                            AFSDbgTrace(( AFS_SUBSYSTEM_FILE_PROCESSING,
                                           AFS_TRACE_LEVEL_VERBOSE,
                                           "AFSEnumerateDirectory Different FIDs - Deleting DE %p for %wZ Old FID %08lX-%08lX-%08lX-%08lX New FID %08lX-%08lX-%08lX-%08lX\n",
                                           pDirNode,
@@ -361,7 +361,7 @@ AFSEnumerateDirectory( IN GUID *AuthGroup,
                                           pCurrentDirEntry->FileId.Cell,
                                           pCurrentDirEntry->FileId.Volume,
                                           pCurrentDirEntry->FileId.Vnode,
-                                          pCurrentDirEntry->FileId.Unique);
+                                          pCurrentDirEntry->FileId.Unique));
 
                             AFSDeleteDirEntry( ObjectInfoCB,
                                                pDirNode);
@@ -371,7 +371,7 @@ AFSEnumerateDirectory( IN GUID *AuthGroup,
 
                             SetFlag( pDirNode->Flags, AFS_DIR_ENTRY_DELETED);
 
-                            AFSDbgLogMsg( AFS_SUBSYSTEM_FILE_PROCESSING,
+                            AFSDbgTrace(( AFS_SUBSYSTEM_FILE_PROCESSING,
                                           AFS_TRACE_LEVEL_VERBOSE,
                                           "AFSEnumerateDirectory Different FIDs - Removing DE %p for %wZ Old FID %08lX-%08lX-%08lX-%08lX New FID %08lX-%08lX-%08lX-%08lX\n",
                                           pDirNode,
@@ -383,7 +383,7 @@ AFSEnumerateDirectory( IN GUID *AuthGroup,
                                           pCurrentDirEntry->FileId.Cell,
                                           pCurrentDirEntry->FileId.Volume,
                                           pCurrentDirEntry->FileId.Vnode,
-                                          pCurrentDirEntry->FileId.Unique);
+                                          pCurrentDirEntry->FileId.Unique));
 
                             AFSRemoveNameEntry( ObjectInfoCB,
                                                 pDirNode);
@@ -413,14 +413,14 @@ AFSEnumerateDirectory( IN GUID *AuthGroup,
                 if( pDirNode->ObjectInformation->FileType == AFS_FILE_TYPE_DIRECTORY)
                 {
 
-                    AFSDbgLogMsg( AFS_SUBSYSTEM_FILE_PROCESSING,
+                    AFSDbgTrace(( AFS_SUBSYSTEM_FILE_PROCESSING,
                                   AFS_TRACE_LEVEL_VERBOSE,
                                   "AFSEnumerateDirectory Setting VERIFY on entry %wZ for FID %08lX-%08lX-%08lX-%08lX\n",
                                   &uniDirName,
                                   pDirNode->ObjectInformation->FileId.Cell,
                                   pDirNode->ObjectInformation->FileId.Volume,
                                   pDirNode->ObjectInformation->FileId.Vnode,
-                                  pDirNode->ObjectInformation->FileId.Unique);
+                                  pDirNode->ObjectInformation->FileId.Unique));
 
                     AFSAcquireExcl( pDirNode->ObjectInformation->Specific.Directory.DirectoryNodeHdr.TreeLock,
                                     TRUE);
@@ -472,7 +472,7 @@ AFSEnumerateDirectory( IN GUID *AuthGroup,
                         pDirNode->Type.Data.ShortNameTreeEntry.HashIndex = AFSGenerateCRC( &uniShortName,
                                                                                            TRUE);
 
-                        AFSDbgLogMsg( AFS_SUBSYSTEM_FILE_PROCESSING,
+                        AFSDbgTrace(( AFS_SUBSYSTEM_FILE_PROCESSING,
                                       AFS_TRACE_LEVEL_VERBOSE,
                                       "AFSEnumerateDirectory Initialized short name %wZ for DE %p for %wZ FID %08lX-%08lX-%08lX-%08lX\n",
                                       &uniShortName,
@@ -481,7 +481,7 @@ AFSEnumerateDirectory( IN GUID *AuthGroup,
                                       pCurrentDirEntry->FileId.Cell,
                                       pCurrentDirEntry->FileId.Volume,
                                       pCurrentDirEntry->FileId.Vnode,
-                                      pCurrentDirEntry->FileId.Unique);
+                                      pCurrentDirEntry->FileId.Unique));
                     }
                     else
                     {
@@ -510,20 +510,20 @@ AFSEnumerateDirectory( IN GUID *AuthGroup,
 
                     ObjectInfoCB->Specific.Directory.DirectoryNodeHdr.CaseSensitiveTreeHead = pDirNode;
 
-                    AFSDbgLogMsg( AFS_SUBSYSTEM_FILE_PROCESSING,
+                    AFSDbgTrace(( AFS_SUBSYSTEM_FILE_PROCESSING,
                                   AFS_TRACE_LEVEL_VERBOSE,
                                   "AFSEnumerateDirectory Insert DE %p to head of case sensitive tree for %wZ\n",
                                   pDirNode,
-                                  &pDirNode->NameInformation.FileName);
+                                  &pDirNode->NameInformation.FileName));
                 }
                 else
                 {
 
-                    AFSDbgLogMsg( AFS_SUBSYSTEM_FILE_PROCESSING,
+                    AFSDbgTrace(( AFS_SUBSYSTEM_FILE_PROCESSING,
                                   AFS_TRACE_LEVEL_VERBOSE,
                                   "AFSEnumerateDirectory Insert DE %p to case sensitive tree for %wZ\n",
                                   pDirNode,
-                                  &pDirNode->NameInformation.FileName);
+                                  &pDirNode->NameInformation.FileName));
 
                     if( !NT_SUCCESS( AFSInsertCaseSensitiveDirEntry( ObjectInfoCB->Specific.Directory.DirectoryNodeHdr.CaseSensitiveTreeHead,
                                                                      pDirNode)))
@@ -556,11 +556,11 @@ AFSEnumerateDirectory( IN GUID *AuthGroup,
                 if( ObjectInfoCB->Specific.Directory.DirectoryNodeHdr.CaseInsensitiveTreeHead == NULL)
                 {
 
-                    AFSDbgLogMsg( AFS_SUBSYSTEM_FILE_PROCESSING,
+                    AFSDbgTrace(( AFS_SUBSYSTEM_FILE_PROCESSING,
                                   AFS_TRACE_LEVEL_VERBOSE,
                                   "AFSEnumerateDirectory Insert DE %p to head of case insensitive tree for %wZ\n",
                                   pDirNode,
-                                  &pDirNode->NameInformation.FileName);
+                                  &pDirNode->NameInformation.FileName));
 
                     ObjectInfoCB->Specific.Directory.DirectoryNodeHdr.CaseInsensitiveTreeHead = pDirNode;
 
@@ -569,11 +569,11 @@ AFSEnumerateDirectory( IN GUID *AuthGroup,
                 else
                 {
 
-                    AFSDbgLogMsg( AFS_SUBSYSTEM_FILE_PROCESSING,
+                    AFSDbgTrace(( AFS_SUBSYSTEM_FILE_PROCESSING,
                                   AFS_TRACE_LEVEL_VERBOSE,
                                   "AFSEnumerateDirectory Insert DE %p to case insensitive tree for %wZ\n",
                                   pDirNode,
-                                  &pDirNode->NameInformation.FileName);
+                                  &pDirNode->NameInformation.FileName));
 
                     AFSInsertCaseInsensitiveDirEntry( ObjectInfoCB->Specific.Directory.DirectoryNodeHdr.CaseInsensitiveTreeHead,
                                                       pDirNode);
@@ -598,7 +598,7 @@ AFSEnumerateDirectory( IN GUID *AuthGroup,
 
                 InterlockedIncrement( &ObjectInfoCB->Specific.Directory.DirectoryNodeCount);
 
-                AFSDbgLogMsg( AFS_SUBSYSTEM_DIR_NODE_COUNT,
+                AFSDbgTrace(( AFS_SUBSYSTEM_DIR_NODE_COUNT,
                               AFS_TRACE_LEVEL_VERBOSE,
                               "AFSEnumerateDirectory Adding entry %wZ Inc Count %d to parent FID %08lX-%08lX-%08lX-%08lX\n",
                               &pDirNode->NameInformation.FileName,
@@ -606,7 +606,7 @@ AFSEnumerateDirectory( IN GUID *AuthGroup,
                               ObjectInfoCB->FileId.Cell,
                               ObjectInfoCB->FileId.Volume,
                               ObjectInfoCB->FileId.Vnode,
-                              ObjectInfoCB->FileId.Unique);
+                              ObjectInfoCB->FileId.Unique));
 
                 if( pDirNode->Type.Data.ShortNameTreeEntry.HashIndex != 0)
                 {
@@ -618,11 +618,11 @@ AFSEnumerateDirectory( IN GUID *AuthGroup,
                     if( ObjectInfoCB->Specific.Directory.ShortNameTree == NULL)
                     {
 
-                        AFSDbgLogMsg( AFS_SUBSYSTEM_FILE_PROCESSING,
+                        AFSDbgTrace(( AFS_SUBSYSTEM_FILE_PROCESSING,
                                       AFS_TRACE_LEVEL_VERBOSE,
                                       "AFSEnumerateDirectory Insert DE %p to head of shortname tree for %wZ\n",
                                       pDirNode,
-                                      &pDirNode->NameInformation.FileName);
+                                      &pDirNode->NameInformation.FileName));
 
                         ObjectInfoCB->Specific.Directory.ShortNameTree = pDirNode;
 
@@ -636,11 +636,11 @@ AFSEnumerateDirectory( IN GUID *AuthGroup,
                         {
                             SetFlag( pDirNode->Flags, AFS_DIR_ENTRY_INSERTED_SHORT_NAME);
 
-                            AFSDbgLogMsg( AFS_SUBSYSTEM_FILE_PROCESSING,
+                            AFSDbgTrace(( AFS_SUBSYSTEM_FILE_PROCESSING,
                                           AFS_TRACE_LEVEL_VERBOSE,
                                           "AFSEnumerateDirectory Insert DE %p to shortname tree for %wZ\n",
                                           pDirNode,
-                                          &pDirNode->NameInformation.FileName);
+                                          &pDirNode->NameInformation.FileName));
                         }
                     }
                 }
@@ -670,10 +670,10 @@ AFSEnumerateDirectory( IN GUID *AuthGroup,
 
             pDirQueryCB->EnumHandle = pDirEnumResponse->EnumHandle;
 
-            AFSDbgLogMsg( AFS_SUBSYSTEM_FILE_PROCESSING,
+            AFSDbgTrace(( AFS_SUBSYSTEM_FILE_PROCESSING,
                           AFS_TRACE_LEVEL_VERBOSE,
                           "AFSEnumerateDirectory EnumHandle %08lX\n",
-                          pDirQueryCB->EnumHandle);
+                          pDirQueryCB->EnumHandle));
         }
 
 try_exit:
@@ -701,14 +701,14 @@ try_exit:
             // content in the event it is re-enumerated
             //
 
-            AFSDbgLogMsg( AFS_SUBSYSTEM_FILE_PROCESSING,
+            AFSDbgTrace(( AFS_SUBSYSTEM_FILE_PROCESSING,
                           AFS_TRACE_LEVEL_ERROR,
                           "AFSEnumerateDirectory Resetting content for FID %08lX-%08lX-%08lX-%08lX Status %08lX\n",
                           ObjectInfoCB->FileId.Cell,
                           ObjectInfoCB->FileId.Volume,
                           ObjectInfoCB->FileId.Vnode,
                           ObjectInfoCB->FileId.Unique,
-                          ntStatus);
+                          ntStatus));
 
             AFSResetDirectoryContent( ObjectInfoCB);
         }
@@ -759,10 +759,10 @@ AFSEnumerateDirectoryNoResponse( IN GUID *AuthGroup,
             else
             {
 
-                AFSDbgLogMsg( AFS_SUBSYSTEM_FILE_PROCESSING,
+                AFSDbgTrace(( AFS_SUBSYSTEM_FILE_PROCESSING,
                               AFS_TRACE_LEVEL_ERROR,
                               "AFSEnumerateDirectoryNoResponse Failed to enumerate directory Status %08lX\n",
-                              ntStatus);
+                              ntStatus));
             }
         }
     }
@@ -807,14 +807,14 @@ AFSVerifyDirectoryContent( IN AFSObjectInfoCB *ObjectInfoCB,
                                &uniGUID);
         }
 
-        AFSDbgLogMsg( AFS_SUBSYSTEM_FILE_PROCESSING,
+        AFSDbgTrace(( AFS_SUBSYSTEM_FILE_PROCESSING,
                       AFS_TRACE_LEVEL_VERBOSE,
                       "AFSVerifyDirectoryContent Verifying content for FID %08lX-%08lX-%08lX-%08lX AuthGroup %wZ\n",
                       ObjectInfoCB->FileId.Cell,
                       ObjectInfoCB->FileId.Volume,
                       ObjectInfoCB->FileId.Vnode,
                       ObjectInfoCB->FileId.Unique,
-                      &uniGUID);
+                      &uniGUID));
 
         if( AuthGroup != NULL)
         {
@@ -897,7 +897,7 @@ AFSVerifyDirectoryContent( IN AFSObjectInfoCB *ObjectInfoCB,
                     AFSAcquireExcl( ObjectInfoCB->Specific.Directory.DirectoryNodeHdr.TreeLock,
                                     TRUE);
 
-                    AFSDbgLogMsg( AFS_SUBSYSTEM_FILE_PROCESSING,
+                    AFSDbgTrace(( AFS_SUBSYSTEM_FILE_PROCESSING,
                                   AFS_TRACE_LEVEL_VERBOSE,
                                   "AFSVerifyDirectoryContent Directory Complete FID %08lX-%08lX-%08lX-%08lX Snapshot-DV %08lX:%08lX Current-DV %08lX:%08lX Status %08lX\n",
                                   ObjectInfoCB->FileId.Cell,
@@ -908,7 +908,7 @@ AFSVerifyDirectoryContent( IN AFSObjectInfoCB *ObjectInfoCB,
                                   pDirEnumResponse->SnapshotDataVersion.LowPart,
                                   pDirEnumResponse->CurrentDataVersion.HighPart,
                                   pDirEnumResponse->CurrentDataVersion.LowPart,
-                                  ntStatus);
+                                  ntStatus));
 
                     ntStatus = STATUS_SUCCESS;
 
@@ -919,13 +919,13 @@ AFSVerifyDirectoryContent( IN AFSObjectInfoCB *ObjectInfoCB,
 
                         ObjectInfoCB->DataVersion.QuadPart = (ULONGLONG)-1;
 
-                        AFSDbgLogMsg( AFS_SUBSYSTEM_FILE_PROCESSING,
+                        AFSDbgTrace(( AFS_SUBSYSTEM_FILE_PROCESSING,
                                       AFS_TRACE_LEVEL_VERBOSE,
                                       "AFSVerifyDirectoryContent Force Verify due to DV change during enumeration FID %08lX-%08lX-%08lX-%08lX\n",
                                       ObjectInfoCB->FileId.Cell,
                                       ObjectInfoCB->FileId.Volume,
                                       ObjectInfoCB->FileId.Vnode,
-                                      ObjectInfoCB->FileId.Unique);
+                                      ObjectInfoCB->FileId.Unique));
                     }
                     else
                     {
@@ -938,7 +938,7 @@ AFSVerifyDirectoryContent( IN AFSObjectInfoCB *ObjectInfoCB,
                 else
                 {
 
-                    AFSDbgLogMsg( AFS_SUBSYSTEM_FILE_PROCESSING,
+                    AFSDbgTrace(( AFS_SUBSYSTEM_FILE_PROCESSING,
                                   AFS_TRACE_LEVEL_ERROR,
                                   "AFSVerifyDirectoryContent Failed to enumerate directory FID %08lX-%08lX-%08lX-%08lX AuthGroup %wZ Status %08lX\n",
                                   ObjectInfoCB->FileId.Cell,
@@ -946,7 +946,7 @@ AFSVerifyDirectoryContent( IN AFSObjectInfoCB *ObjectInfoCB,
                                   ObjectInfoCB->FileId.Vnode,
                                   ObjectInfoCB->FileId.Unique,
                                   &uniGUID,
-                                  ntStatus);
+                                  ntStatus));
                 }
 
                 break;
@@ -956,7 +956,7 @@ AFSVerifyDirectoryContent( IN AFSObjectInfoCB *ObjectInfoCB,
 
             pCurrentDirEntry = (AFSDirEnumEntry *)pDirEnumResponse->Entry;
 
-            AFSDbgLogMsg( AFS_SUBSYSTEM_FILE_PROCESSING,
+            AFSDbgTrace(( AFS_SUBSYSTEM_FILE_PROCESSING,
                           AFS_TRACE_LEVEL_VERBOSE,
                           "AFSVerifyDirectoryContent EnumResponse FID %08lX-%08lX-%08lX-%08lX Snapshot-DV %08lX:%08lX Current-DV %08lX:%08lX\n",
                           ObjectInfoCB->FileId.Cell,
@@ -966,7 +966,7 @@ AFSVerifyDirectoryContent( IN AFSObjectInfoCB *ObjectInfoCB,
                           pDirEnumResponse->SnapshotDataVersion.HighPart,
                           pDirEnumResponse->SnapshotDataVersion.LowPart,
                           pDirEnumResponse->CurrentDataVersion.HighPart,
-                          pDirEnumResponse->CurrentDataVersion.LowPart);
+                          pDirEnumResponse->CurrentDataVersion.LowPart));
 
             //
             // Remove the leading header from the processed length
@@ -1042,7 +1042,7 @@ AFSVerifyDirectoryContent( IN AFSObjectInfoCB *ObjectInfoCB,
                         if( pCurrentDirEntry->ShortNameLength > 0 &&
                             pDirNode->NameInformation.ShortNameLength > 0)
                         {
-                            AFSDbgLogMsg( AFS_SUBSYSTEM_FILE_PROCESSING,
+                            AFSDbgTrace(( AFS_SUBSYSTEM_FILE_PROCESSING,
                                           AFS_TRACE_LEVEL_VERBOSE,
                                           "AFSVerifyDirectoryContent Verified entry %wZ (%wZ) parent FID %08lX-%08lX-%08lX-%08lX old short name %S New short name %S\n",
                                           &uniDirName,
@@ -1052,13 +1052,13 @@ AFSVerifyDirectoryContent( IN AFSObjectInfoCB *ObjectInfoCB,
                                           ObjectInfoCB->FileId.Vnode,
                                           ObjectInfoCB->FileId.Unique,
                                           pDirNode->NameInformation.ShortName,
-                                          pCurrentDirEntry->ShortName);
+                                          pCurrentDirEntry->ShortName));
                         }
                         else if( pCurrentDirEntry->ShortNameLength == 0 &&
                                  pDirNode->NameInformation.ShortNameLength > 0)
                         {
 
-                            AFSDbgLogMsg( AFS_SUBSYSTEM_FILE_PROCESSING,
+                            AFSDbgTrace(( AFS_SUBSYSTEM_FILE_PROCESSING,
                                           AFS_TRACE_LEVEL_VERBOSE,
                                           "AFSVerifyDirectoryContent Verified entry %wZ (%wZ) parent FID %08lX-%08lX-%08lX-%08lX old short name %S New short name NULL\n",
                                           &uniDirName,
@@ -1067,12 +1067,12 @@ AFSVerifyDirectoryContent( IN AFSObjectInfoCB *ObjectInfoCB,
                                           ObjectInfoCB->FileId.Volume,
                                           ObjectInfoCB->FileId.Vnode,
                                           ObjectInfoCB->FileId.Unique,
-                                          pDirNode->NameInformation.ShortName);
+                                          pDirNode->NameInformation.ShortName));
                         }
                         else if( pCurrentDirEntry->ShortNameLength > 0 &&
                                  pDirNode->NameInformation.ShortNameLength == 0)
                         {
-                            AFSDbgLogMsg( AFS_SUBSYSTEM_FILE_PROCESSING,
+                            AFSDbgTrace(( AFS_SUBSYSTEM_FILE_PROCESSING,
                                           AFS_TRACE_LEVEL_VERBOSE,
                                           "AFSVerifyDirectoryContent Verified entry %wZ (%wZ) parent FID %08lX-%08lX-%08lX-%08lX old short name NULL New short name %S\n",
                                           &uniDirName,
@@ -1081,11 +1081,11 @@ AFSVerifyDirectoryContent( IN AFSObjectInfoCB *ObjectInfoCB,
                                           ObjectInfoCB->FileId.Volume,
                                           ObjectInfoCB->FileId.Vnode,
                                           ObjectInfoCB->FileId.Unique,
-                                          pCurrentDirEntry->ShortName);
+                                          pCurrentDirEntry->ShortName));
                         }
                         else
                         {
-                            AFSDbgLogMsg( AFS_SUBSYSTEM_FILE_PROCESSING,
+                            AFSDbgTrace(( AFS_SUBSYSTEM_FILE_PROCESSING,
                                           AFS_TRACE_LEVEL_VERBOSE,
                                           "AFSVerifyDirectoryContent Verified entry %wZ (%wZ) parent FID %08lX-%08lX-%08lX-%08lX old short name NULL New short name NULL\n",
                                           &uniDirName,
@@ -1093,7 +1093,7 @@ AFSVerifyDirectoryContent( IN AFSObjectInfoCB *ObjectInfoCB,
                                           ObjectInfoCB->FileId.Cell,
                                           ObjectInfoCB->FileId.Volume,
                                           ObjectInfoCB->FileId.Vnode,
-                                          ObjectInfoCB->FileId.Unique);
+                                          ObjectInfoCB->FileId.Unique));
                         }
 
                         //
@@ -1116,11 +1116,11 @@ AFSVerifyDirectoryContent( IN AFSObjectInfoCB *ObjectInfoCB,
                             lCount = AFSObjectInfoIncrement( pObjectInfo,
                                                              AFS_OBJECT_REFERENCE_INVALIDATION);
 
-                            AFSDbgLogMsg( AFS_SUBSYSTEM_OBJECT_REF_COUNTING,
+                            AFSDbgTrace(( AFS_SUBSYSTEM_OBJECT_REF_COUNTING,
                                           AFS_TRACE_LEVEL_VERBOSE,
                                           "AFSVerifyDirectoryContent calling AFSQueueInvalidateObject Increment count on object %p Cnt %d\n",
                                           pObjectInfo,
-                                          lCount);
+                                          lCount));
 
                             if ( !NT_SUCCESS( AFSQueueInvalidateObject( pObjectInfo,
                                                                         AFS_INVALIDATE_DATA_VERSION)))
@@ -1129,11 +1129,11 @@ AFSVerifyDirectoryContent( IN AFSObjectInfoCB *ObjectInfoCB,
                                 lCount = AFSObjectInfoDecrement( pObjectInfo,
                                                                  AFS_OBJECT_REFERENCE_INVALIDATION);
 
-                                AFSDbgLogMsg( AFS_SUBSYSTEM_OBJECT_REF_COUNTING,
+                                AFSDbgTrace(( AFS_SUBSYSTEM_OBJECT_REF_COUNTING,
                                               AFS_TRACE_LEVEL_VERBOSE,
                                               "AFSVerifyDirectoryContent AFSQueueInvalidateObject failed Decrement count on object %p Cnt %d\n",
                                               pObjectInfo,
-                                              lCount);
+                                              lCount));
                             }
                         }
                         else
@@ -1168,7 +1168,7 @@ AFSVerifyDirectoryContent( IN AFSObjectInfoCB *ObjectInfoCB,
                     // File name matches but FileID does not.
                     //
 
-                    AFSDbgLogMsg( AFS_SUBSYSTEM_FILE_PROCESSING,
+                    AFSDbgTrace(( AFS_SUBSYSTEM_FILE_PROCESSING,
                                   AFS_TRACE_LEVEL_VERBOSE,
                                   "AFSVerifyDirectoryContent Processing dir entry %p %wZ with different FID, same name in parent FID %08lX-%08lX-%08lX-%08lX\n",
                                   pDirNode,
@@ -1176,7 +1176,7 @@ AFSVerifyDirectoryContent( IN AFSObjectInfoCB *ObjectInfoCB,
                                   ObjectInfoCB->FileId.Cell,
                                   ObjectInfoCB->FileId.Volume,
                                   ObjectInfoCB->FileId.Vnode,
-                                  ObjectInfoCB->FileId.Unique);
+                                  ObjectInfoCB->FileId.Unique));
 
                     //
                     // Need to tear down this entry and rebuild it below
@@ -1186,7 +1186,7 @@ AFSVerifyDirectoryContent( IN AFSObjectInfoCB *ObjectInfoCB,
                         pDirNode->NameArrayReferenceCount <= 0)
                     {
 
-                        AFSDbgLogMsg( AFS_SUBSYSTEM_FILE_PROCESSING,
+                        AFSDbgTrace(( AFS_SUBSYSTEM_FILE_PROCESSING,
                                       AFS_TRACE_LEVEL_VERBOSE,
                                       "AFSVerifyDirectoryContent Different FIDs - Deleting DE %p for %wZ Old FID %08lX-%08lX-%08lX-%08lX New FID %08lX-%08lX-%08lX-%08lX\n",
                                       pDirNode,
@@ -1198,7 +1198,7 @@ AFSVerifyDirectoryContent( IN AFSObjectInfoCB *ObjectInfoCB,
                                       pCurrentDirEntry->FileId.Cell,
                                       pCurrentDirEntry->FileId.Volume,
                                       pCurrentDirEntry->FileId.Vnode,
-                                      pCurrentDirEntry->FileId.Unique);
+                                      pCurrentDirEntry->FileId.Unique));
 
                         AFSDeleteDirEntry( ObjectInfoCB,
                                            pDirNode);
@@ -1208,7 +1208,7 @@ AFSVerifyDirectoryContent( IN AFSObjectInfoCB *ObjectInfoCB,
 
                         SetFlag( pDirNode->Flags, AFS_DIR_ENTRY_DELETED);
 
-                        AFSDbgLogMsg( AFS_SUBSYSTEM_FILE_PROCESSING,
+                        AFSDbgTrace(( AFS_SUBSYSTEM_FILE_PROCESSING,
                                       AFS_TRACE_LEVEL_WARNING,
                                       "AFSVerifyDirectoryContent Different FIDs - removing DE %p for %wZ Old FID %08lX-%08lX-%08lX-%08lX New FID %08lX-%08lX-%08lX-%08lX\n",
                                       pDirNode,
@@ -1220,7 +1220,7 @@ AFSVerifyDirectoryContent( IN AFSObjectInfoCB *ObjectInfoCB,
                                       pCurrentDirEntry->FileId.Cell,
                                       pCurrentDirEntry->FileId.Volume,
                                       pCurrentDirEntry->FileId.Vnode,
-                                      pCurrentDirEntry->FileId.Unique);
+                                      pCurrentDirEntry->FileId.Unique));
 
                         AFSRemoveNameEntry( ObjectInfoCB,
                                             pDirNode);
@@ -1229,14 +1229,14 @@ AFSVerifyDirectoryContent( IN AFSObjectInfoCB *ObjectInfoCB,
                 else
                 {
 
-                    AFSDbgLogMsg( AFS_SUBSYSTEM_FILE_PROCESSING,
+                    AFSDbgTrace(( AFS_SUBSYSTEM_FILE_PROCESSING,
                                   AFS_TRACE_LEVEL_VERBOSE,
                                   "AFSVerifyDirectoryContent New entry %wZ for parent FID %08lX-%08lX-%08lX-%08lX\n",
                                   &uniDirName,
                                   ObjectInfoCB->FileId.Cell,
                                   ObjectInfoCB->FileId.Volume,
                                   ObjectInfoCB->FileId.Vnode,
-                                  ObjectInfoCB->FileId.Unique);
+                                  ObjectInfoCB->FileId.Unique));
                 }
 
                 pDirNode = AFSInitDirEntry( ObjectInfoCB,
@@ -1259,14 +1259,14 @@ AFSVerifyDirectoryContent( IN AFSObjectInfoCB *ObjectInfoCB,
                 if( pDirNode->ObjectInformation->FileType == AFS_FILE_TYPE_DIRECTORY)
                 {
 
-                    AFSDbgLogMsg( AFS_SUBSYSTEM_FILE_PROCESSING,
+                    AFSDbgTrace(( AFS_SUBSYSTEM_FILE_PROCESSING,
                                   AFS_TRACE_LEVEL_VERBOSE,
                                   "AFSVerifyDirectoryContent Setting VERIFY on entry %wZ for FID %08lX-%08lX-%08lX-%08lX\n",
                                   &uniDirName,
                                   pDirNode->ObjectInformation->FileId.Cell,
                                   pDirNode->ObjectInformation->FileId.Volume,
                                   pDirNode->ObjectInformation->FileId.Vnode,
-                                  pDirNode->ObjectInformation->FileId.Unique);
+                                  pDirNode->ObjectInformation->FileId.Unique));
 
                     AFSAcquireExcl( pDirNode->ObjectInformation->Specific.Directory.DirectoryNodeHdr.TreeLock,
                                     TRUE);
@@ -1310,7 +1310,7 @@ AFSVerifyDirectoryContent( IN AFSObjectInfoCB *ObjectInfoCB,
                         pDirNode->Type.Data.ShortNameTreeEntry.HashIndex = AFSGenerateCRC( &uniShortName,
                                                                                            TRUE);
 
-                        AFSDbgLogMsg( AFS_SUBSYSTEM_FILE_PROCESSING,
+                        AFSDbgTrace(( AFS_SUBSYSTEM_FILE_PROCESSING,
                                       AFS_TRACE_LEVEL_VERBOSE,
                                       "AFSVerifyDirectoryContent Initialized short name %wZ for DE %p for %wZ FID %08lX-%08lX-%08lX-%08lX\n",
                                       &uniShortName,
@@ -1319,7 +1319,7 @@ AFSVerifyDirectoryContent( IN AFSObjectInfoCB *ObjectInfoCB,
                                       pCurrentDirEntry->FileId.Cell,
                                       pCurrentDirEntry->FileId.Volume,
                                       pCurrentDirEntry->FileId.Vnode,
-                                      pCurrentDirEntry->FileId.Unique);
+                                      pCurrentDirEntry->FileId.Unique));
                     }
                     else
                     {
@@ -1350,11 +1350,11 @@ AFSVerifyDirectoryContent( IN AFSObjectInfoCB *ObjectInfoCB,
 
                     ObjectInfoCB->Specific.Directory.DirectoryNodeHdr.CaseSensitiveTreeHead = pDirNode;
 
-                    AFSDbgLogMsg( AFS_SUBSYSTEM_FILE_PROCESSING,
+                    AFSDbgTrace(( AFS_SUBSYSTEM_FILE_PROCESSING,
                                   AFS_TRACE_LEVEL_VERBOSE,
                                   "AFSVerifyDirectoryContent Insert DE %p to head of case sensitive tree for %wZ\n",
                                   pDirNode,
-                                  &pDirNode->NameInformation.FileName);
+                                  &pDirNode->NameInformation.FileName));
                 }
                 else
                 {
@@ -1362,11 +1362,11 @@ AFSVerifyDirectoryContent( IN AFSObjectInfoCB *ObjectInfoCB,
                     if( !NT_SUCCESS( AFSInsertCaseSensitiveDirEntry( ObjectInfoCB->Specific.Directory.DirectoryNodeHdr.CaseSensitiveTreeHead,
                                                                      pDirNode)))
                     {
-                        AFSDbgLogMsg( AFS_SUBSYSTEM_FILE_PROCESSING,
+                        AFSDbgTrace(( AFS_SUBSYSTEM_FILE_PROCESSING,
                                       AFS_TRACE_LEVEL_VERBOSE,
                                       "AFSVerifyDirectoryContent Failed to insert DE %p to case sensitive tree for %wZ\n",
                                       pDirNode,
-                                      &pDirNode->NameInformation.FileName);
+                                      &pDirNode->NameInformation.FileName));
 
                         //
                         // Delete this dir entry and continue on
@@ -1390,11 +1390,11 @@ AFSVerifyDirectoryContent( IN AFSObjectInfoCB *ObjectInfoCB,
                     }
                     else
                     {
-                        AFSDbgLogMsg( AFS_SUBSYSTEM_FILE_PROCESSING,
+                        AFSDbgTrace(( AFS_SUBSYSTEM_FILE_PROCESSING,
                                       AFS_TRACE_LEVEL_VERBOSE,
                                       "AFSVerifyDirectoryContent Insert DE %p to case sensitive tree for %wZ\n",
                                       pDirNode,
-                                      &pDirNode->NameInformation.FileName);
+                                      &pDirNode->NameInformation.FileName));
                     }
                 }
 
@@ -1407,11 +1407,11 @@ AFSVerifyDirectoryContent( IN AFSObjectInfoCB *ObjectInfoCB,
 
                     SetFlag( pDirNode->Flags, AFS_DIR_ENTRY_CASE_INSENSTIVE_LIST_HEAD);
 
-                    AFSDbgLogMsg( AFS_SUBSYSTEM_FILE_PROCESSING,
+                    AFSDbgTrace(( AFS_SUBSYSTEM_FILE_PROCESSING,
                                   AFS_TRACE_LEVEL_VERBOSE,
                                   "AFSVerifyDirectoryContent Insert DE %p to head of case insensitive tree for %wZ\n",
                                   pDirNode,
-                                  &pDirNode->NameInformation.FileName);
+                                  &pDirNode->NameInformation.FileName));
                 }
                 else
                 {
@@ -1419,11 +1419,11 @@ AFSVerifyDirectoryContent( IN AFSObjectInfoCB *ObjectInfoCB,
                     AFSInsertCaseInsensitiveDirEntry( ObjectInfoCB->Specific.Directory.DirectoryNodeHdr.CaseInsensitiveTreeHead,
                                                       pDirNode);
 
-                    AFSDbgLogMsg( AFS_SUBSYSTEM_FILE_PROCESSING,
+                    AFSDbgTrace(( AFS_SUBSYSTEM_FILE_PROCESSING,
                                   AFS_TRACE_LEVEL_VERBOSE,
                                   "AFSVerifyDirectoryContent Insert DE %p to case insensitive tree for %wZ\n",
                                   pDirNode,
-                                  &pDirNode->NameInformation.FileName);
+                                  &pDirNode->NameInformation.FileName));
                 }
 
                 if( ObjectInfoCB->Specific.Directory.DirectoryNodeListHead == NULL)
@@ -1445,7 +1445,7 @@ AFSVerifyDirectoryContent( IN AFSObjectInfoCB *ObjectInfoCB,
 
                 InterlockedIncrement( &ObjectInfoCB->Specific.Directory.DirectoryNodeCount);
 
-                AFSDbgLogMsg( AFS_SUBSYSTEM_DIR_NODE_COUNT,
+                AFSDbgTrace(( AFS_SUBSYSTEM_DIR_NODE_COUNT,
                               AFS_TRACE_LEVEL_VERBOSE,
                               "AFSVerifyDirectoryContent Adding entry %wZ Inc Count %d to parent FID %08lX-%08lX-%08lX-%08lX\n",
                               &pDirNode->NameInformation.FileName,
@@ -1453,7 +1453,7 @@ AFSVerifyDirectoryContent( IN AFSObjectInfoCB *ObjectInfoCB,
                               ObjectInfoCB->FileId.Cell,
                               ObjectInfoCB->FileId.Volume,
                               ObjectInfoCB->FileId.Vnode,
-                              ObjectInfoCB->FileId.Unique);
+                              ObjectInfoCB->FileId.Unique));
 
                 if( pDirNode->Type.Data.ShortNameTreeEntry.HashIndex != 0)
                 {
@@ -1467,11 +1467,11 @@ AFSVerifyDirectoryContent( IN AFSObjectInfoCB *ObjectInfoCB,
 
                         ObjectInfoCB->Specific.Directory.ShortNameTree = pDirNode;
 
-                        AFSDbgLogMsg( AFS_SUBSYSTEM_FILE_PROCESSING,
+                        AFSDbgTrace(( AFS_SUBSYSTEM_FILE_PROCESSING,
                                       AFS_TRACE_LEVEL_VERBOSE,
                                       "AFSVerifyDirectoryContent Insert DE %p to head of shortname tree for %wZ\n",
                                       pDirNode,
-                                      &pDirNode->NameInformation.FileName);
+                                      &pDirNode->NameInformation.FileName));
 
                         SetFlag( pDirNode->Flags, AFS_DIR_ENTRY_INSERTED_SHORT_NAME);
                     }
@@ -1481,22 +1481,22 @@ AFSVerifyDirectoryContent( IN AFSObjectInfoCB *ObjectInfoCB,
                         if( !NT_SUCCESS( AFSInsertShortNameDirEntry( ObjectInfoCB->Specific.Directory.ShortNameTree,
                                                                      pDirNode)))
                         {
-                            AFSDbgLogMsg( AFS_SUBSYSTEM_FILE_PROCESSING,
+                            AFSDbgTrace(( AFS_SUBSYSTEM_FILE_PROCESSING,
                                           AFS_TRACE_LEVEL_VERBOSE,
                                           "AFSVerifyDirectoryContent Failed to insert DE %p (%08lX) to shortname tree for %wZ\n",
                                           pDirNode,
                                           pDirNode->Type.Data.ShortNameTreeEntry.HashIndex,
-                                          &pDirNode->NameInformation.FileName);
+                                          &pDirNode->NameInformation.FileName));
                         }
                         else
                         {
                             SetFlag( pDirNode->Flags, AFS_DIR_ENTRY_INSERTED_SHORT_NAME);
 
-                            AFSDbgLogMsg( AFS_SUBSYSTEM_FILE_PROCESSING,
+                            AFSDbgTrace(( AFS_SUBSYSTEM_FILE_PROCESSING,
                                           AFS_TRACE_LEVEL_VERBOSE,
                                           "AFSVerifyDirectoryContent Insert DE %p to shortname tree for %wZ\n",
                                           pDirNode,
-                                          &pDirNode->NameInformation.FileName);
+                                          &pDirNode->NameInformation.FileName));
                         }
                     }
                 }
@@ -1650,7 +1650,7 @@ AFSNotifyFileCreate( IN GUID            *AuthGroup,
         if( ParentObjectInfo->DataVersion.QuadPart != pResultCB->ParentDataVersion.QuadPart - 1)
         {
 
-            AFSDbgLogMsg( AFS_SUBSYSTEM_FILE_PROCESSING,
+            AFSDbgTrace(( AFS_SUBSYSTEM_FILE_PROCESSING,
                           AFS_TRACE_LEVEL_WARNING,
                           "AFSNotifyFileCreate Raced with an invalidate call and a re-enumeration for entry %wZ ParentFID %08lX-%08lX-%08lX-%08lX Version (%08lX:%08lX != %08lX:%08lX - 1)\n",
                           FileName,
@@ -1661,7 +1661,7 @@ AFSNotifyFileCreate( IN GUID            *AuthGroup,
                           ParentObjectInfo->DataVersion.HighPart,
                           ParentObjectInfo->DataVersion.LowPart,
                           pResultCB->ParentDataVersion.HighPart,
-                          pResultCB->ParentDataVersion.LowPart);
+                          pResultCB->ParentDataVersion.LowPart));
 
             //
             // We raced so go and lookup the directory entry in the parent
@@ -1677,11 +1677,11 @@ AFSNotifyFileCreate( IN GUID            *AuthGroup,
             if( pDirNode != NULL)
             {
 
-                AFSDbgLogMsg( AFS_SUBSYSTEM_FILE_PROCESSING,
+                AFSDbgTrace(( AFS_SUBSYSTEM_FILE_PROCESSING,
                               AFS_TRACE_LEVEL_VERBOSE,
                               "AFSNotifyFileCreate Located dir entry %p for file %wZ\n",
                               pDirNode,
-                              FileName);
+                              FileName));
 
                 if ( AFSIsEqualFID( &pDirNode->ObjectInformation->FileId,
                                     &pResultCB->DirEnum.FileId))
@@ -1699,7 +1699,7 @@ AFSNotifyFileCreate( IN GUID            *AuthGroup,
                     // same as the one that was created for us by the file server.
                     //
 
-                    AFSDbgLogMsg( AFS_SUBSYSTEM_FILE_PROCESSING,
+                    AFSDbgTrace(( AFS_SUBSYSTEM_FILE_PROCESSING,
                                   AFS_TRACE_LEVEL_ERROR,
                                   "AFSNotifyFileCreate Found matching name entry %wZ DE %p FID %08lX-%08lX-%08lX-%08lX != FID %08lX-%08lX-%08lX-%08lX\n",
                                   FileName,
@@ -1711,13 +1711,13 @@ AFSNotifyFileCreate( IN GUID            *AuthGroup,
                                   pResultCB->DirEnum.FileId.Cell,
                                   pResultCB->DirEnum.FileId.Volume,