Skip to content

Commit

Permalink
RedirectorStrategy: Do not report STALL conditions on control pipe
Browse files Browse the repository at this point in the history
STALL condition on control pipe cleared automatically
by underlying infrastructure. Do not report it to client
otherwise it may decide to clear it via ResetPipe and
reset of control pipe is not supported by WDF.

Signed-off-by: Dmitry Fleytman <[email protected]>
  • Loading branch information
Dmitry Fleytman committed Jan 14, 2016
1 parent 0fbeb04 commit c573972
Showing 1 changed file with 16 additions and 4 deletions.
20 changes: 16 additions & 4 deletions UsbDk/RedirectorStrategy.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -425,15 +425,27 @@ void CUsbDkRedirectorStrategy::DoControlTransfer(CRedirectorRequest &WdfRequest,
{
auto status = Params->IoStatus.Status;
auto usbCompletionParams = Params->Parameters.Usb.Completion;
auto UsbdStatus = usbCompletionParams->UsbdStatus;
CRedirectorRequest WdfRequest(Request);

if (!NT_SUCCESS(status) || !USBD_SUCCESS(usbCompletionParams->UsbdStatus))
// Do not report STALL conditions on control pipe.
//
// STALL condition on control pipe cleared automatically
// by underlying infrastructure. Do not report it to client
// otherwise it may decide to clear it via ResetPipe and
// reset of control pipe is not supported by WDF.
if (UsbdStatus == USBD_STATUS_STALL_PID)
{
TraceTransferError(WdfRequest, status, usbCompletionParams->UsbdStatus);
status = STATUS_SUCCESS;
UsbdStatus = USBD_STATUS_INTERNAL_HC_ERROR;
}

CompleteTransferRequest(WdfRequest, status,
usbCompletionParams->UsbdStatus,
if (!NT_SUCCESS(status) || !USBD_SUCCESS(UsbdStatus))
{
TraceTransferError(WdfRequest, status, UsbdStatus);
}

CompleteTransferRequest(WdfRequest, status, UsbdStatus,
usbCompletionParams->Parameters.DeviceControlTransfer.Length);
});

Expand Down

0 comments on commit c573972

Please sign in to comment.