<div dir="ltr"><br><div class="gmail_extra"><br><div class="gmail_quote">On Thu, Jun 11, 2015 at 6:59 PM, Christophe Fergeau <span dir="ltr"><<a href="mailto:cfergeau@redhat.com" target="_blank">cfergeau@redhat.com</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">Hey,<br>
<br>
I think I forgot to mention this in the initial review, but GModule<br>
might probably have been useful as a wrapper for the GetProcAddress<br>
calls. As we only need to do that on Windows, GModule VS direct win32<br>
API calls do not bring us much.<br>
<br>
I'd squash the attached patch in with just some cosmetic changes,<br>
SPICE_DEBUG changed to g_warning in unexpected error cases, and<br>
a licence header more in line with the rest of the code (I picked (C)<br>
2014-2015, let me know if this should be adjusted). One question below:<br></blockquote><div><br></div><div>will fix it in v3 </div><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><span>
On Tue, Jun 09, 2015 at 03:53:01PM +0300, Kirill Moizik wrote:<br>
> +void usbdk_api_set_hide_rules(usbdk_api_wrapper *usbdk_api, HANDLE hider_handle, gchar *redirect_on_connect)<br>
> +{<br>
> +    struct usbredirfilter_rule *rules;<br>
> +    int r, count;<br>
> +<br>
> +    r = usbredirfilter_string_to_rules(redirect_on_connect, ",", "|", &rules, &count);<br>
> +    if (r) {<br>
> +        SPICE_DEBUG("auto-connect rules parsing failed with error %d", r);<br>
> +        return;<br>
> +    }<br>
> +<br>
> +    for (int i = 0; i < count; i++) {<br>
> +        USB_DK_HIDE_RULE rule;<br>
> +        rule.Hide  = (uint64_t)rules[i].allow;<br>
> +        rule.Class = (uint64_t)rules[i].device_class;<br>
> +        rule.VID   = (uint64_t)rules[i].vendor_id;<br>
> +        rule.PID   = (uint64_t)rules[i].product_id;<br>
> +        rule.BCD   = (uint64_t)rules[i].device_version_bcd;<br>
<br>
</span>Some of the int values stored in the usbredirfilter_rule can be -1, is<br>
usbdk able to cope with these values?<br></blockquote><div><br></div><div>Yes, UsbDk support -1 as "match all"  value</div><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
<span><font color="#888888"><br>
Christophe<br>
</font></span></blockquote></div>Kirill</div></div>