diff options
author | Pete Batard <pbatard@gmail.com> | 2010-12-04 23:48:36 +0000 |
---|---|---|
committer | Pete Batard <pbatard@gmail.com> | 2010-12-04 23:48:36 +0000 |
commit | 7093b1f58526700043a85f818eb4f38ac3cc87a0 (patch) | |
tree | 90b135d3d35e5dfc6b2a38c171ed3894671a8156 | |
parent | db73bf698ee55a992f6ac930f16ab4e5b46d0326 (diff) | |
download | libusb-7093b1f58526700043a85f818eb4f38ac3cc87a0.tar.gz |
fixed assertion failure on non USB HID
* typical ancestors: 'ROOT\HIDCLASS\0000' -> 'HTREE\ROOT\0' -> NULL
resulted in session_id 0 being returned
* single case for non USB HID, newly inserted or unexpected unlisted
is now being used, for performance reasons, as we'll still hear
about any implementation bugs from people not being able to access
an ignored device anyway (i.e. no need to be too forceful)
-rw-r--r-- | libusb/os/windows_usb.c | 6 |
1 files changed, 1 insertions, 5 deletions
diff --git a/libusb/os/windows_usb.c b/libusb/os/windows_usb.c index 0650f54..9223afb 100644 --- a/libusb/os/windows_usb.c +++ b/libusb/os/windows_usb.c @@ -1457,16 +1457,12 @@ static int windows_get_device_list(struct libusb_context *ctx, struct discovered for (ancestor = 1; parent_dev == NULL; ancestor++) { session_id = get_ancestor_session_id(dev_info_data.DevInst, ancestor); if (session_id == 0) { - usbi_err(ctx, "program assertion failed: orphan device '%s'", dev_id_path); - r = LIBUSB_ERROR_NO_DEVICE; break; } parent_dev = usbi_get_device_by_session_id(ctx, session_id); } if (parent_dev == NULL) { - if (session_id != 0) { - usbi_dbg("unlisted ancestor for '%s' (newly connected device, non USB HID, etc.) - ignoring", dev_id_path); - } + usbi_dbg("unlisted ancestor for '%s' (non USB HID, newly connected, etc.) - ignoring", dev_id_path); continue; } parent_priv = __device_priv(parent_dev); |