Windows: Mark interfaces as unused when releasing
authorPete Batard <pbatard@gmail.com>
Thu, 5 Aug 2010 00:18:32 +0000 (18:18 -0600)
committerDaniel Drake <dan@reactivated.net>
Thu, 5 Aug 2010 00:18:32 +0000 (18:18 -0600)
Without this important cleanup, the autoclaim code could attempt to
reuse an unclaimed interface as if it were already claimed.

libusb/os/windows_usb.c

index 03a70fc..14c2d7b 100644 (file)
@@ -2583,6 +2583,7 @@ static int winusb_release_interface(struct libusb_device_handle *dev_handle, int
        }
 
        WinUsb_Free(winusb_handle);
+       handle_priv->interface_handle[iface].api_handle = INVALID_HANDLE_VALUE;
 
        return LIBUSB_SUCCESS;
 }