Ok, this's not a patch, for I don't think it's good enough to be applied to upstream. For windows client, it's really not friendly for usbredir: 1. We need usbclerk service to let it redirect automatically --> not stably currently 2. The display of redir-list is ALL "USB DEVICE" --> make users confused maybe 3. Filtering by class doesn't work at all --> usually need to filter input devices, etc.
The reason for all the above is that libusb supports windows poorly. So here's the solution for problem 2 & 3, this's a vs2010 project built with libwdi <http://sourceforge.net/projects/libwdi/>, the output is usbutils.dll, and I put the project in github <https://github.com/int64Ago/UsbUtils4Spice> After building libwdi, add LIBWDI_DIR=path\to\libwdi in environment settings, then build usbutils project In gtk/usbutil.c or gtk/usb-device-manager.c ... do something like this(just an example): #define MAX_LEN_ 256 typedef struct{ char desc[MAX_LEN_]; int pid; int vid; int clas; }UsbInfo; //... UsbInfo usbInfo[20]; typedef int (*fpFun)(UsbInfo[]); HMODULE hDllLib = LoadLibraryA("usbutils.dll"); fpFun getUsbList = (fpFun)GetProcAddress(hDllLib,"getUsbList"); int num = getUsbList(usbInfo); for(int i = 0; i < num; ++i){ if(usbInfo[i].pid == pid && usbInfo[i].vid == vid) return g_strdup_printf("%s [%02X:%04X:%04X]", usbInfo[i].desc, usbInfo[i].clas, usbInfo[i].vid, usbInfo[i].pid); //... And at last, here's the effect: http://int64ago.qiniudn.com/o_190vus62h3lh1pr81kf0be6v4b9.png -- QSBDT0RFUiBGUk9NIFJJRVNUIE9GIENUU0VV
_______________________________________________ Spice-devel mailing list Spice-devel@lists.freedesktop.org http://lists.freedesktop.org/mailman/listinfo/spice-devel