Modify the IOCTL_AFS_CONFIG_LIBRARY_TRACE DeviceIoControl message
to pass an AFSDebugTraceConfigCB which is used to toggle the value
of the Library's AFSDebugTraceFnc pointer. When the trace log is
enabled, the AFSDbgLogMsg parameter is non-NULL and when the log is
disabled, the parameter is NULL.
Change-Id: I71b951f244b760487f2ece94409cefaa7a73ea31
Reviewed-on: http://gerrit.openafs.org/9748
Tested-by: BuildBot <buildbot@rampaginggeek.com>
Reviewed-by: Rod Widdowson <rdw@steadingsoftware.com>
Reviewed-by: Peter Scott <pscott@kerneldrivers.com>
Reviewed-by: Jeffrey Altman <jaltman@your-file-system.com>
if ( pDevExt->Specific.Control.LibraryDeviceObject != NULL)
{
+
RtlZeroMemory( &stConfigLib,
sizeof( AFSDebugTraceConfigCB));
- stConfigLib.AFSDbgLogMsg = AFSDebugTraceFnc;
+ if ( BooleanFlagOn( AFSDebugFlags, AFS_DBG_TRACE_TO_DEBUGGER) ||
+ AFSDbgBufferLength > 0)
+ {
+
+ stConfigLib.AFSDbgLogMsg = AFSDebugTraceFnc;
+ }
+ else
+ {
+
+ stConfigLib.AFSDbgLogMsg = NULL;
+ }
ntStatus = AFSSendDeviceIoControl( pDevExt->Specific.Control.LibraryDeviceObject,
IOCTL_AFS_CONFIG_LIBRARY_TRACE,
case IOCTL_AFS_CONFIG_LIBRARY_TRACE:
{
+ AFSDebugTraceConfigCB *pConfigLib;
+
+ if ( pIrpSp->Parameters.DeviceIoControl.InputBufferLength != sizeof( AFSDebugTraceConfigCB))
+ {
+
+ ntStatus = STATUS_INVALID_PARAMETER;
+
+ break;
+ }
+
+ pConfigLib = (AFSDebugTraceConfigCB *)Irp->AssociatedIrp.SystemBuffer;
InterlockedCompareExchangePointer( (PVOID *)&AFSDebugTraceFnc,
- NULL,
- (void *)AFSDbgLogMsg);
+ pConfigLib->AFSDbgLogMsg,
+ (void *)pConfigLib->AFSDbgLogMsg);
break;
}