Windows: WinUSB: Guard against erroneous reporting of devices
authorChris Dickens <christopher.a.dickens@gmail.com>
Mon, 12 Mar 2018 17:28:40 +0000 (10:28 -0700)
committerChris Dickens <christopher.a.dickens@gmail.com>
Mon, 12 Mar 2018 17:28:40 +0000 (10:28 -0700)
commitd236b63e81d2e92fc86181a4d147dbde38a8ac31
tree17213c15a175c449170f376b96200e0b4d8a3797
parent76b0677b14beda38ca4e553dec7818bf79152b48
Windows: WinUSB: Guard against erroneous reporting of devices

During enumeration, obtaining the port number via SPDRP_ADDRESS might
return a bogus value for some third-party HCD drivers. If this occurs,
we might end up reporting the device as having the VID/PID from the last
successful enumeration. Guard against this particular situation by
clearing the USB_NODE_CONNECTION_INFORMATION_EX structure before issuing
the DeviceIoControl() call.

References #403

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