summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDmitry Fleytman <dfleytma@redhat.com>2016-01-14 10:48:31 +0200
committerDmitry Fleytman <dfleytma@redhat.com>2016-01-14 11:30:59 +0200
commitc573972ff10aa1da8f2a58ec220d22a2f3678712 (patch)
tree93402d6a838a0df896b0da586279de417c0f063e
parent0fbeb04527b0ea138f0970e8eebd442a968b23b4 (diff)
RedirectorStrategy: Do not report STALL conditions on control pipev1.00-11
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 <dfleytma@redhat.com>
-rw-r--r--UsbDk/RedirectorStrategy.cpp20
1 files changed, 16 insertions, 4 deletions
diff --git a/UsbDk/RedirectorStrategy.cpp b/UsbDk/RedirectorStrategy.cpp
index 7530114..e7ac844 100644
--- a/UsbDk/RedirectorStrategy.cpp
+++ b/UsbDk/RedirectorStrategy.cpp
@@ -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);
});