From cfd1a93591300c8378fd971059158b9a2b5dca41 Mon Sep 17 00:00:00 2001 From: Tormod Volden Date: Sat, 30 Oct 2021 11:58:05 +0200 Subject: [PATCH] (untested) Signal overlapped from caller in LUsb0_ControlTransfer This is an attempt to deal with libusb 1.0.24 or later which always uses asynchronous control transfers. It will pass an OVERLAPPED structure and use this afterwards to check that the transfer has finished. It will still be forced into a synchronous transfer here, but by signalling the finished transfer the caller will not be reporting timeouts for actual finished transfers. Signed-off-by: Tormod Volden --- libusbK/src/lusbk_bknd_libusb0.c | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/libusbK/src/lusbk_bknd_libusb0.c b/libusbK/src/lusbk_bknd_libusb0.c index 57333bdf..6bac2a45 100644 --- a/libusbK/src/lusbk_bknd_libusb0.c +++ b/libusbK/src/lusbk_bknd_libusb0.c @@ -50,8 +50,6 @@ KUSB_EXP BOOL KUSB_API LUsb0_ControlTransfer( int ret; PKUSB_HANDLE_INTERNAL handle; - UNUSED(Overlapped); - Pub_To_Priv_UsbK(InterfaceHandle, handle, return FALSE); ErrorSetAction(!PoolHandle_Inc_UsbK(handle), ERROR_RESOURCE_NOT_AVAILABLE, return FALSE, "->PoolHandle_Inc_UsbK"); @@ -73,6 +71,9 @@ KUSB_EXP BOOL KUSB_API LUsb0_ControlTransfer( PoolHandle_Dec_UsbK(handle); + if (Overlapped && Overlapped.hEvent) + return SetEvent(Overlapped.hEvent); + return success; } @@ -310,4 +311,4 @@ int _usb_io_sync(HANDLE dev, unsigned int code, void *out, int out_size, CloseHandle(ol.hEvent); return FALSE; -} \ No newline at end of file +}