[Spice-devel] [PATCH v2 1/2] UsbDk: Add UsbDk wrapper

Kirill Moizik kirill at daynix.com
Sun Jun 14 00:48:37 PDT 2015


On Thu, Jun 11, 2015 at 6:59 PM, Christophe Fergeau <cfergeau at redhat.com>
wrote:

> Hey,
>
> 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
>
Kirill
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.freedesktop.org/archives/spice-devel/attachments/20150614/24d03372/attachment.html>


More information about the Spice-devel mailing list