From 30a6cb9dbf27eb83198a43d131b746ae76b84c01 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Benjamin=20H=C3=B6glinger?= Date: Mon, 30 Oct 2017 19:53:48 +0100 Subject: [PATCH] De-duplicated code --- usbpdo.c | 23 ++++------------------- 1 file changed, 4 insertions(+), 19 deletions(-) diff --git a/usbpdo.c b/usbpdo.c index 04c962d..4a230b6 100644 --- a/usbpdo.c +++ b/usbpdo.c @@ -682,24 +682,6 @@ NTSTATUS UsbPdo_AbortPipe(WDFDEVICE Device) switch (pdoData->TargetType) { - case Xbox360Wired: - { - PXUSB_DEVICE_DATA xusb = XusbGetData(Device); - - // Check context - if (xusb == NULL) - { - KdPrint((DRIVERNAME "No XUSB context found on device %p\n", Device)); - - return STATUS_UNSUCCESSFUL; - } - - // Higher driver shutting down, emptying PDOs queues - WdfIoQueuePurge(pdoData->PendingUsbInRequests, NULL, NULL); - WdfIoQueuePurge(pdoData->PendingNotificationRequests, NULL, NULL); - - break; - } case DualShock4Wired: { PDS4_DEVICE_DATA ds4 = Ds4GetData(Device); @@ -714,7 +696,6 @@ NTSTATUS UsbPdo_AbortPipe(WDFDEVICE Device) // Higher driver shutting down, emptying PDOs queues WdfTimerStop(ds4->PendingUsbInRequestsTimer, TRUE); - WdfIoQueuePurge(pdoData->PendingUsbInRequests, NULL, NULL); break; } @@ -722,6 +703,10 @@ NTSTATUS UsbPdo_AbortPipe(WDFDEVICE Device) break; } + // Higher driver shutting down, emptying PDOs queues + WdfIoQueuePurge(pdoData->PendingUsbInRequests, NULL, NULL); + WdfIoQueuePurge(pdoData->PendingNotificationRequests, NULL, NULL); + return STATUS_SUCCESS; }