Discussion:
[libusb] [PATCH v2] Align error code handling with WinUsb
Sameeh Jubran
2017-05-14 09:14:25 UTC
Permalink
WinUsb uses ERROR_GEN_FAILURE instead of ERROR_FUNCTION_FAILED,
this diffrence was observed while using Libusb's xusb example
application while alternating backends.

Signed-off-by: Sameeh Jubran <***@daynix.com>
---
libusb/os/windows_usbdk.c | 6 +-----
1 file changed, 1 insertion(+), 5 deletions(-)

diff --git a/libusb/os/windows_usbdk.c b/libusb/os/windows_usbdk.c
index 7cc5793..aba4e13 100644
--- a/libusb/os/windows_usbdk.c
+++ b/libusb/os/windows_usbdk.c
@@ -796,16 +796,12 @@ static DWORD usbdk_translate_usbd_status(USBD_STATUS UsbdStatus)
return NO_ERROR;

switch (UsbdStatus) {
- case USBD_STATUS_STALL_PID:
- case USBD_STATUS_ENDPOINT_HALTED:
- case USBD_STATUS_BAD_START_FRAME:
- return ERROR_GEN_FAILURE;
case USBD_STATUS_TIMEOUT:
return ERROR_SEM_TIMEOUT;
case USBD_STATUS_CANCELED:
return ERROR_OPERATION_ABORTED;
default:
- return ERROR_FUNCTION_FAILED;
+ return ERROR_GEN_FAILURE;
}
}
--
2.7.0.windows.1
Dmitry Fleytman
2017-05-14 12:32:41 UTC
Permalink
Reviewed-by: Dmitry Fleytman <***@daynix.com>

Adding to my queue.
Post by Sameeh Jubran
WinUsb uses ERROR_GEN_FAILURE instead of ERROR_FUNCTION_FAILED,
this diffrence was observed while using Libusb's xusb example
application while alternating backends.
---
libusb/os/windows_usbdk.c | 6 +-----
1 file changed, 1 insertion(+), 5 deletions(-)
diff --git a/libusb/os/windows_usbdk.c b/libusb/os/windows_usbdk.c
index 7cc5793..aba4e13 100644
--- a/libusb/os/windows_usbdk.c
+++ b/libusb/os/windows_usbdk.c
@@ -796,16 +796,12 @@ static DWORD usbdk_translate_usbd_status(USBD_STATUS UsbdStatus)
return NO_ERROR;
switch (UsbdStatus) {
- return ERROR_GEN_FAILURE;
return ERROR_SEM_TIMEOUT;
return ERROR_OPERATION_ABORTED;
- return ERROR_FUNCTION_FAILED;
+ return ERROR_GEN_FAILURE;
}
}
--
2.7.0.windows.1
------------------------------------------------------------------------------
Check out the vibrant tech community on one of the world's most
engaging tech sites, Slashdot.org! http://sdm.link/slashdot
_______________________________________________
libusb-devel mailing list
https://lists.sourceforge.net/lists/listinfo/libusb-devel
Loading...