Re: libusb_claim_interface failed on Windows7

Xiaofan Chen <[email protected]> Thu, 18 Aug 2016 20:22:04 +0800
Newsgroups gmane.comp.lib.libusb.devel.windows
Message-ID <CAGjSPUAGdP+xX5ukEOFwv4o7L7BZSFpd1hWWYL6pQcd=GZHTRQ@mail.gmail.com>
On Thu, Aug 18, 2016 at 9:54 AM, popear <[email protected]> wrote:
> Thanks for your reply.
> I'll paste the error message directly:)
>
> I installed the WinUSB driver with Zadg, and xusb works well without any
> error.
> But I got my program crashed after the libusb_claim_interface(dev_handle, 2)
> return -12, which is LIBUSB_ERROR_NOT_SUPPORTED.
> My code is like this:
> libusb_init(NULL);
> libusb_get_device_list(NULL, devs);
> while ((dev = devs[i++]) != NULL )
> {
>     mydev = libusb_get_device_address(dev);//OK
>     if (XX != mydev)
>     {
>         continue;
>     }
>     dev_handle = libusb_open_device_with_vid_pid(NULL, myvid, mypid);//OK
>     libusb_get_configuration(dev_handle, &config);//OK
>     libusb_calim_interface(dev_handle, myinterface);//return -12 and
> crashed.
> }
> ...
>
> It's the right interface which claimed while using libusb-compat-0.1.
> Is there any error in my code? Thanks.


Please post the descriptor of your device. How do you install
WinUSB driver? This seems to be a problem with driver installation.


BTW, I do not think you use libusb-compat-0.1, rather you
were using libusb-win32, and how did you install the driver
there? Are you using the filter driver mode or device driver mode?

-- 
Xiaofan

------------------------------------------------------------------------------