summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorPete Batard <pbatard@gmail.com>2010-10-27 19:31:27 +0100
committerPete Batard <pbatard@gmail.com>2010-10-27 19:31:27 +0100
commit844d7db566dc6fb75143554ddc8dcc308cc9da35 (patch)
tree7b4af3e202a640ef5ce3cb0e3da3cab432e0340c
parent53fec87339c29b44f2582f175aba383e9d78543e (diff)
downloadlibusb-844d7db566dc6fb75143554ddc8dcc308cc9da35.tar.gz
minor enumeration bugfixes and improvementspbr318
* dev_interface_details is not available on GEN pass but some warning messages attempt to reference that pointer * skip device if interface path cannot be sanitized * check the return value of init_device() and bail out on error
-rw-r--r--configure.ac2
-rw-r--r--libusb/libusb_version.h2
-rw-r--r--libusb/os/windows_usb.c14
3 files changed, 10 insertions, 8 deletions
diff --git a/configure.ac b/configure.ac
index 24c2625..fdd9435 100644
--- a/configure.ac
+++ b/configure.ac
@@ -1,7 +1,7 @@
m4_define(LIBUSB_MAJOR, [1])
m4_define(LIBUSB_MINOR, [0])
m4_define(LIBUSB_MICRO, [8])
-m4_define(LIBUSB_NANO, [10317])
+m4_define(LIBUSB_NANO, [10318])
AC_INIT([libusb], LIBUSB_MAJOR.LIBUSB_MINOR.LIBUSB_MICRO, [libusb-devel@lists.sourceforge.net], [libusb], [http://www.libusb.org/])
diff --git a/libusb/libusb_version.h b/libusb/libusb_version.h
index 357be45..9114048 100644
--- a/libusb/libusb_version.h
+++ b/libusb/libusb_version.h
@@ -24,6 +24,6 @@
#define LIBUSB_VERSION_MAJOR 1
#define LIBUSB_VERSION_MINOR 0
#define LIBUSB_VERSION_MICRO 8
-#define LIBUSB_VERSION_NANO 10317
+#define LIBUSB_VERSION_NANO 10318
#endif
diff --git a/libusb/os/windows_usb.c b/libusb/os/windows_usb.c
index e9ad2a6..d75bc95 100644
--- a/libusb/os/windows_usb.c
+++ b/libusb/os/windows_usb.c
@@ -1342,13 +1342,15 @@ static int windows_get_device_list(struct libusb_context *ctx, struct discovered
// Read the Device ID path. This is what we'll use as UID
// Note that if the device is plugged in a different port or hub, the Device ID changes
if (CM_Get_Device_IDA(dev_info_data.DevInst, path, sizeof(path), 0) != CR_SUCCESS) {
- usbi_warn(ctx, "could not read the device id path for device '%s', skipping",
- dev_interface_details->DevicePath);
+ usbi_warn(ctx, "could not read the device id path for devinst %X, skipping",
+ dev_info_data.DevInst);
continue;
}
dev_id_path = sanitize_path(path);
if (dev_id_path == NULL) {
- usbi_warn(ctx, "could not sanitize device id path for '%s'", dev_interface_details->DevicePath);
+ usbi_warn(ctx, "could not sanitize device id path for devinst %X, skipping",
+ dev_info_data.DevInst);
+ continue;
}
// The SPDRP_ADDRESS for USB devices is the device port number on the hub
@@ -1357,8 +1359,8 @@ static int windows_get_device_list(struct libusb_context *ctx, struct discovered
if ( (!pSetupDiGetDeviceRegistryPropertyA(dev_info, &dev_info_data, SPDRP_ADDRESS,
&reg_type, (BYTE*)&port_nr, 4, &size))
|| (size != 4) ) {
- usbi_warn(ctx, "could not retrieve port number for device %s, skipping: %s",
- dev_interface_details->DevicePath, windows_error_str(0));
+ usbi_warn(ctx, "could not retrieve port number for device '%s', skipping: %s",
+ dev_id_path, windows_error_str(0));
continue;
}
}
@@ -1548,7 +1550,7 @@ static int windows_get_device_list(struct libusb_context *ctx, struct discovered
break;
// fall through, as we must initialize hubs before generic devices
case GEN_PASS:
- init_device(dev, parent_dev, (uint8_t)port_nr, dev_id_path);
+ r = init_device(dev, parent_dev, (uint8_t)port_nr, dev_id_path);
break;
default: // HID_PASS and later
if (parent_priv->apib == &usb_api_backend[USB_API_HID]) {