[Spice-devel] [PATCH v6 10/10] win-usbredir: Use UsbDk backend when available

Dmitry Fleytman dmitry at daynix.com
Thu Oct 29 08:26:45 PDT 2015


Signed-off-by: Dmitry Fleytman <dmitry at daynix.com>
---
 src/usb-device-manager.c | 5 ++++-
 1 file changed, 4 insertions(+), 1 deletion(-)

diff --git a/src/usb-device-manager.c b/src/usb-device-manager.c
index 53820b4..f4e48eb 100644
--- a/src/usb-device-manager.c
+++ b/src/usb-device-manager.c
@@ -231,7 +231,8 @@ static void spice_usb_device_manager_init(SpiceUsbDeviceManager *self)
     self->priv = priv;
 
 #if defined(G_OS_WIN32) && defined(USE_USBREDIR)
-    priv->use_usbclerk = TRUE;
+    priv->use_usbclerk = !usbdk_is_driver_installed() ||
+                         !usbdk_api_load(&priv->usbdk_api);
 #endif
     priv->channels = g_ptr_array_new();
 #ifdef USE_USBREDIR
@@ -381,6 +382,8 @@ static void spice_usb_device_manager_finalize(GObject *gobject)
     if (!priv->use_usbclerk) {
         if(priv->auto_connect)
             _usbdk_autoredir_disable(self);
+
+        usbdk_api_unload(priv->usbdk_api);
     }
 #endif
     /* Chain up to the parent class */
-- 
2.4.3



More information about the Spice-devel mailing list