From: 王凡 <wangfan1987.good@xxxxxxx> In libusb 1.0.21, UsbDk is enabled at compile time with --enable-usbdk option. In libusb 1.0.22, the backend is selected at runtime. This patch avoids a crash when spice client is compiled against libusb 1.0.22 and UsbDk is not installed. * Enabling dynamic backend selection in Windows https://github.com/libusb/libusb/commit/54884e84d024e761450287ab56aca https://gitlab.freedesktop.org/spice/spice-gtk/issues/74 Signed-off-by: Victor Toso <victortoso@xxxxxxxxxx> --- src/usb-device-manager.c | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/src/usb-device-manager.c b/src/usb-device-manager.c index 55bf67e..50fb491 100644 --- a/src/usb-device-manager.c +++ b/src/usb-device-manager.c @@ -303,6 +303,12 @@ static gboolean spice_usb_device_manager_initable_init(GInitable *initable, return FALSE; } +#ifdef G_OS_WIN32 +#if LIBUSB_API_VERSION >= 0x01000106 + libusb_set_option(priv->context, LIBUSB_OPTION_USE_USBDK); +#endif +#endif + /* Start listening for usb devices plug / unplug */ #ifdef USE_GUDEV priv->udev = g_udev_client_new(subsystems); -- 2.17.1 _______________________________________________ Spice-devel mailing list Spice-devel@xxxxxxxxxxxxxxxxxxxxx https://lists.freedesktop.org/mailman/listinfo/spice-devel