On Thu, Jun 11, 2015 at 6:59 PM, Christophe Fergeau <cfergeau@xxxxxxxxxx> wrote:
KirillHey,
I think I forgot to mention this in the initial review, but GModule
might probably have been useful as a wrapper for the GetProcAddress
calls. As we only need to do that on Windows, GModule VS direct win32
API calls do not bring us much.
I'd squash the attached patch in with just some cosmetic changes,
SPICE_DEBUG changed to g_warning in unexpected error cases, and
a licence header more in line with the rest of the code (I picked (C)
2014-2015, let me know if this should be adjusted). One question below:
will fix it in v3
On Tue, Jun 09, 2015 at 03:53:01PM +0300, Kirill Moizik wrote:
> +void usbdk_api_set_hide_rules(usbdk_api_wrapper *usbdk_api, HANDLE hider_handle, gchar *redirect_on_connect)
> +{
> + struct usbredirfilter_rule *rules;
> + int r, count;
> +
> + r = usbredirfilter_string_to_rules(redirect_on_connect, ",", "|", &rules, &count);
> + if (r) {
> + SPICE_DEBUG("auto-connect rules parsing failed with error %d", r);
> + return;
> + }
> +
> + for (int i = 0; i < count; i++) {
> + USB_DK_HIDE_RULE rule;
> + rule.Hide = (uint64_t)rules[i].allow;
> + rule.Class = (uint64_t)rules[i].device_class;
> + rule.VID = (uint64_t)rules[i].vendor_id;
> + rule.PID = (uint64_t)rules[i].product_id;
> + rule.BCD = (uint64_t)rules[i].device_version_bcd;
Some of the int values stored in the usbredirfilter_rule can be -1, is
usbdk able to cope with these values?
Yes, UsbDk support -1 as "match all" value
Christophe
_______________________________________________ Spice-devel mailing list Spice-devel@xxxxxxxxxxxxxxxxxxxxx http://lists.freedesktop.org/mailman/listinfo/spice-devel