diff options
author | Pete Batard <pbatard@gmail.com> | 2010-02-01 19:25:17 +0000 |
---|---|---|
committer | Pete Batard <pbatard@gmail.com> | 2010-02-01 19:25:17 +0000 |
commit | 8a35c05b5a7666248acf21d79318bd151a3831d5 (patch) | |
tree | 8055a9539a35514b7e0a6bee9fcd1d993bdba762 /libusb/os/windows_usb.c | |
parent | 3e258645f41db07ef0b2f5998206e6a7f46f503e (diff) | |
download | libusb-8a35c05b5a7666248acf21d79318bd151a3831d5.tar.gz |
r130: fixed *size in HidD_GetPhysicalDescriptor and fixed various /W4 warnings for MSVC (windows files)
Diffstat (limited to 'libusb/os/windows_usb.c')
-rw-r--r-- | libusb/os/windows_usb.c | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/libusb/os/windows_usb.c b/libusb/os/windows_usb.c index 7719d01..860097d 100644 --- a/libusb/os/windows_usb.c +++ b/libusb/os/windows_usb.c @@ -754,6 +754,7 @@ static int usb_enumerate_hub(struct libusb_context *ctx, struct discovered_devs if ((i > nb_ports) || (r != LIBUSB_SUCCESS)) break; + memset(&conn_info, 0, sizeof(conn_info)); // For non HCDs, check if the node on this port is a hub or a regular device if (!is_hcd) { size = sizeof(USB_NODE_CONNECTION_INFORMATION); @@ -1071,6 +1072,7 @@ enum libusb_hid_report_type { found = false; for (i = 0; i<USB_MAXINTERFACES; i++) { + memset(&child_devinst, 0, sizeof(DEVINST)); // prevents /W4 warning if (i == 0) { r = CM_Get_Child(&child_devinst, devinst, 0); } else { @@ -1960,10 +1962,8 @@ static int windows_clock_gettime(int clk_id, struct timespec *tp) return LIBUSB_ERROR_OTHER; } } - default: - return LIBUSB_ERROR_INVALID_PARAM; } - return LIBUSB_ERROR_OTHER; + return LIBUSB_ERROR_INVALID_PARAM; } @@ -2921,7 +2921,7 @@ static int _hid_get_descriptor(struct hid_device_priv* dev, HANDLE hid_handle, i return LIBUSB_ERROR_INVALID_PARAM; case LIBUSB_DT_PHYSICAL: usbi_dbg("LIBUSB_DT_PHYSICAL"); - if (HidD_GetPhysicalDescriptor(hid_handle, data, (ULONG)size)) + if (HidD_GetPhysicalDescriptor(hid_handle, data, (ULONG)*size)) return LIBUSB_COMPLETED; return LIBUSB_ERROR_OTHER; } |