Windows: Fix I/O completion port thread behavior on error
authorChris Dickens <christopher.a.dickens@gmail.com>
Tue, 18 Aug 2020 16:19:03 +0000 (09:19 -0700)
committerChris Dickens <christopher.a.dickens@gmail.com>
Tue, 18 Aug 2020 16:19:03 +0000 (09:19 -0700)
commit37e8b1334e59485e1d4735f5f67b31eba37ae5c9
treec5c77139bf226ae7bf4f1d67a891f8eef61b026d
parentd42410b21c4314143f31fd7f8494dd1d4c279663
Windows: Fix I/O completion port thread behavior on error

The GetQueuedCompletionStatus() returns FALSE when the I/O operation
itself does not complete successfully. The I/O completion thread should
therefore not exit on this condition. Adjust the check to verify that an
OVERLAPPED structure was provided and use an explicit completion key
value in the exit path to disambiguate receiving a valid NULL OVERLAPPED
pointer.

Signed-off-by: Chris Dickens <christopher.a.dickens@gmail.com>
libusb/os/windows_common.c
libusb/version_nano.h