Skip to content

Commit bb931ea

Browse files
author
Dmitry Fleytman
committed
ControlDevice: Add more traces for redirection set modifications
Signed-off-by: Dmitry Fleytman <[email protected]>
1 parent 4ae3867 commit bb931ea

File tree

1 file changed

+15
-1
lines changed

1 file changed

+15
-1
lines changed

UsbDk/ControlDevice.cpp

Lines changed: 15 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -911,6 +911,9 @@ NTSTATUS CUsbDkControlDevice::AddRedirectionToSet(const USB_DK_DEVICE_ID &Device
911911
return status;
912912
}
913913

914+
TraceEvents(TRACE_LEVEL_INFORMATION, TRACE_CONTROLDEVICE, "%!FUNC! Adding new redirection");
915+
newRedir->Dump();
916+
914917
if (!UsbDeviceExists(DeviceId))
915918
{
916919
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)
935938
auto res = ResetUsbDevice(DeviceId);
936939
if (NT_SUCCESS(res))
937940
{
941+
TraceEvents(TRACE_LEVEL_INFORMATION, TRACE_CONTROLDEVICE,
942+
"%!FUNC! Waiting for detachment from %S:%S",
943+
DeviceId.DeviceID, DeviceId.InstanceID);
944+
938945
if (!WaitForDetachment(DeviceId))
939946
{
940947
TraceEvents(TRACE_LEVEL_ERROR, TRACE_CONTROLDEVICE, "%!FUNC! Wait for redirector detachment failed.");
941948
return STATUS_DEVICE_NOT_CONNECTED;
942949
}
950+
951+
TraceEvents(TRACE_LEVEL_INFORMATION, TRACE_CONTROLDEVICE,
952+
"%!FUNC! Detached from %S:%S",
953+
DeviceId.DeviceID, DeviceId.InstanceID);
943954
}
944955
else if (res != STATUS_NO_SUCH_DEVICE)
945956
{
@@ -959,7 +970,10 @@ NTSTATUS CUsbDkControlDevice::RemoveRedirect(const USB_DK_DEVICE_ID &DeviceId)
959970
return STATUS_SUCCESS;
960971
}
961972

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+
963977
return STATUS_OBJECT_NAME_NOT_FOUND;
964978
}
965979

0 commit comments

Comments
 (0)