@@ -911,6 +911,9 @@ NTSTATUS CUsbDkControlDevice::AddRedirectionToSet(const USB_DK_DEVICE_ID &Device
911
911
return status;
912
912
}
913
913
914
+ TraceEvents (TRACE_LEVEL_INFORMATION, TRACE_CONTROLDEVICE, " %!FUNC! Adding new redirection" );
915
+ newRedir->Dump ();
916
+
914
917
if (!UsbDeviceExists (DeviceId))
915
918
{
916
919
TraceEvents (TRACE_LEVEL_ERROR, TRACE_CONTROLDEVICE, " %!FUNC! failed. Cannot redirect unknown device." );
@@ -935,11 +938,19 @@ NTSTATUS CUsbDkControlDevice::RemoveRedirect(const USB_DK_DEVICE_ID &DeviceId)
935
938
auto res = ResetUsbDevice (DeviceId);
936
939
if (NT_SUCCESS (res))
937
940
{
941
+ TraceEvents (TRACE_LEVEL_INFORMATION, TRACE_CONTROLDEVICE,
942
+ " %!FUNC! Waiting for detachment from %S:%S" ,
943
+ DeviceId.DeviceID , DeviceId.InstanceID );
944
+
938
945
if (!WaitForDetachment (DeviceId))
939
946
{
940
947
TraceEvents (TRACE_LEVEL_ERROR, TRACE_CONTROLDEVICE, " %!FUNC! Wait for redirector detachment failed." );
941
948
return STATUS_DEVICE_NOT_CONNECTED;
942
949
}
950
+
951
+ TraceEvents (TRACE_LEVEL_INFORMATION, TRACE_CONTROLDEVICE,
952
+ " %!FUNC! Detached from %S:%S" ,
953
+ DeviceId.DeviceID , DeviceId.InstanceID );
943
954
}
944
955
else if (res != STATUS_NO_SUCH_DEVICE)
945
956
{
@@ -959,7 +970,10 @@ NTSTATUS CUsbDkControlDevice::RemoveRedirect(const USB_DK_DEVICE_ID &DeviceId)
959
970
return STATUS_SUCCESS;
960
971
}
961
972
962
- TraceEvents (TRACE_LEVEL_ERROR, TRACE_CONTROLDEVICE, " %!FUNC! failed." );
973
+ TraceEvents (TRACE_LEVEL_ERROR, TRACE_CONTROLDEVICE,
974
+ " %!FUNC! failed for %S:%S" ,
975
+ DeviceId.DeviceID , DeviceId.InstanceID );
976
+
963
977
return STATUS_OBJECT_NAME_NOT_FOUND;
964
978
}
965
979
0 commit comments