Skip to content

Commit

Permalink
ControlDevice: Fix removal of redirection on hub unplug
Browse files Browse the repository at this point in the history
On unplug of USB hub that contains a redirected
device, removal of redirection is started when redirected
device PDO is still present in UsbDk device lists.

In this case UsbDk will try to send reset IOCTL to this device
and system will return STATUS_NO_SUCH_DEVICE error code.

This commit changes behavior of redirection removal
logic in a way that it will not interrupt removal
process when such an error is returned by reset.

Signed-off-by: Dmitry Fleytman <[email protected]>
  • Loading branch information
Dmitry Fleytman committed Sep 1, 2016
1 parent e68f982 commit bf79d6e
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions UsbDk/ControlDevice.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -373,7 +373,7 @@ NTSTATUS CUsbDkControlDevice::ResetUsbDevice(const USB_DK_DEVICE_ID &DeviceID)
PDEVICE_OBJECT PDO = GetPDOByDeviceID(DeviceID);
if (PDO == nullptr)
{
return STATUS_NOT_FOUND;
return STATUS_NO_SUCH_DEVICE;
}

CWdmUsbDeviceAccess pdoAccess(PDO);
Expand Down Expand Up @@ -941,7 +941,7 @@ NTSTATUS CUsbDkControlDevice::RemoveRedirect(const USB_DK_DEVICE_ID &DeviceId)
return STATUS_DEVICE_NOT_CONNECTED;
}
}
else if (res != STATUS_NOT_FOUND)
else if (res != STATUS_NO_SUCH_DEVICE)
{
TraceEvents(TRACE_LEVEL_ERROR, TRACE_CONTROLDEVICE, "%!FUNC! Usb device reset failed.");
return res;
Expand Down

0 comments on commit bf79d6e

Please sign in to comment.