Windows: Allow synchronous control transfers (for libusb0)
authorTormod Volden <debian.tormod@gmail.com>
Thu, 28 Oct 2021 12:48:55 +0000 (14:48 +0200)
committerTormod Volden <debian.tormod@gmail.com>
Tue, 9 Nov 2021 08:19:59 +0000 (09:19 +0100)
commit5b408d108407043a8736dd36f2c1e1ee9f52394e
tree9556df86aa0136b2394ac99f2c243912e63094b2
parent7b342030d293019696ff536a95105c654167461a
Windows: Allow synchronous control transfers (for libusb0)

Some of the changes in commit 9c28ad2 rely on all transfers having (or
appearing to have) asynchronous completion.

However, the libusb0.sys backend of libusbk.dll performs all control
transfers synchronously and ignores any "overlapped" structure handed to
it. Our asynchronous handling will in this case be pending and
eventually time out although the USB request itself was successful.

Therefore restore the possibility of synchronous completion of control
transfers, by forcing the completion handling on a successful return
from request submission. This brings the code closer to how it was
established in commit ce95f65.

Fixes #94

Tested-by: Xiaofan Chen <xiaofanc@gmail.com>
Signed-off-by: Tormod Volden <debian.tormod@gmail.com>
libusb/os/windows_winusb.c
libusb/version_nano.h