This PR adresses a 2s delay in the status endpoint when run on Windows under ESXi. It essentially does what PR#19 did for libusb but for WinUsb. It now also has a couple of bug fixes that were discovered while implementing & testing.
The delay happens in the 'drain pipe' WinUsb_ReadPipe call, which takes 2s to execute when running under ESXi, despite having set the timeout pipe policy to 10 ms. It Doesn't do that on a physical Windows machine. This is not a big deal now since we only reopen the device on errors.
This PR adresses a 2s delay in the status endpoint when run on Windows under ESXi. It essentially does what PR#19 did for libusb but for WinUsb. It now also has a couple of bug fixes that were discovered while implementing & testing.
The delay happens in the 'drain pipe' WinUsb_ReadPipe call, which takes 2s to execute when running under ESXi, despite having set the timeout pipe policy to 10 ms. It Doesn't do that on a physical Windows machine. This is not a big deal now since we only reopen the device on errors.