summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorPete Batard <pbatard@gmail.com>2010-12-09 11:21:26 +0000
committerPete Batard <pbatard@gmail.com>2010-12-09 11:21:26 +0000
commit5bd59aef04e9eef2b53da2af9b3770833d1546e5 (patch)
tree0d866415333a4424f42e8727773fcd338bc54c3d
parent50a23e3f38b4f6342c5dc102497c7a8b42d7b7bb (diff)
downloadlibusb-pbh315.tar.gz
fixed missing context for get_ancestor_session_id()pbh315
-rw-r--r--libusb/os/windows_usb.c6
1 files changed, 3 insertions, 3 deletions
diff --git a/libusb/os/windows_usb.c b/libusb/os/windows_usb.c
index 659bba9..3ecf0d3 100644
--- a/libusb/os/windows_usb.c
+++ b/libusb/os/windows_usb.c
@@ -411,7 +411,7 @@ err_exit:
* Returns the session ID of a device's nth level ancestor
* If there's no device at the nth level, return 0
*/
-static unsigned long get_ancestor_session_id(DWORD devinst, unsigned level)
+static unsigned long get_ancestor_session_id(struct libusb_context *ctx, DWORD devinst, unsigned level)
{
DWORD parent_devinst;
unsigned long session_id = 0;
@@ -1030,7 +1030,7 @@ static int init_device(struct libusb_device* dev, struct libusb_device* parent_d
// If that's the case, lookup the ancestors to set the bus number
if (parent_dev->bus_number == 0) {
for (i=2; ; i++) {
- tmp_dev = usbi_get_device_by_session_id(ctx, get_ancestor_session_id(devinst, i));
+ tmp_dev = usbi_get_device_by_session_id(ctx, get_ancestor_session_id(ctx, devinst, i));
if (tmp_dev == NULL) break;
if (tmp_dev->bus_number != 0) {
usbi_dbg("got bus number from ancestor #%d", i);
@@ -1429,7 +1429,7 @@ static int windows_get_device_list(struct libusb_context *ctx, struct discovered
// Go through the ancestors until we see a face we recognize
parent_dev = NULL;
for (ancestor = 1; parent_dev == NULL; ancestor++) {
- session_id = get_ancestor_session_id(dev_info_data.DevInst, ancestor);
+ session_id = get_ancestor_session_id(ctx, dev_info_data.DevInst, ancestor);
if (session_id == 0) {
break;
}