Zebediah Figura : wineusb.sys: Implement URB_FUNCTION_ABORT_PIPE.
Alexandre Julliard
julliard at winehq.org
Mon Apr 20 15:48:19 CDT 2020
Module: wine
Branch: master
Commit: 66bdf9f77cc6f4491b9c361cc1f4f88ec5edbfe5
URL: https://source.winehq.org/git/wine.git/?a=commit;h=66bdf9f77cc6f4491b9c361cc1f4f88ec5edbfe5
Author: Zebediah Figura <z.figura12 at gmail.com>
Date: Fri Apr 17 18:03:08 2020 -0500
wineusb.sys: Implement URB_FUNCTION_ABORT_PIPE.
Signed-off-by: Zebediah Figura <z.figura12 at gmail.com>
Signed-off-by: Alexandre Julliard <julliard at winehq.org>
---
dlls/wineusb.sys/wineusb.c | 21 +++++++++++++++++++++
1 file changed, 21 insertions(+)
diff --git a/dlls/wineusb.sys/wineusb.c b/dlls/wineusb.sys/wineusb.c
index aa4f204415..6a979b9126 100644
--- a/dlls/wineusb.sys/wineusb.c
+++ b/dlls/wineusb.sys/wineusb.c
@@ -514,6 +514,27 @@ static NTSTATUS usb_submit_urb(struct usb_device *device, IRP *irp)
switch (urb->UrbHeader.Function)
{
+ case URB_FUNCTION_ABORT_PIPE:
+ {
+ LIST_ENTRY *entry, *mark;
+
+ /* The documentation states that URB_FUNCTION_ABORT_PIPE may
+ * complete before outstanding requests complete, so we don't need
+ * to wait for them. */
+ EnterCriticalSection(&wineusb_cs);
+ mark = &device->irp_list;
+ for (entry = mark->Flink; entry != mark; entry = entry->Flink)
+ {
+ IRP *queued_irp = CONTAINING_RECORD(entry, IRP, Tail.Overlay.ListEntry);
+
+ if ((ret = libusb_cancel_transfer(queued_irp->Tail.Overlay.DriverContext[0])) < 0)
+ ERR("Failed to cancel transfer: %s\n", libusb_strerror(ret));
+ }
+ LeaveCriticalSection(&wineusb_cs);
+
+ return STATUS_SUCCESS;
+ }
+
case URB_FUNCTION_BULK_OR_INTERRUPT_TRANSFER:
{
struct _URB_BULK_OR_INTERRUPT_TRANSFER *req = &urb->UrbBulkOrInterruptTransfer;
More information about the wine-cvs
mailing list