Hi John,

On 2012.07.16 06:28, John Chen wrote:
> I am using libusb-1.0.9, under windows 7, I already installed windows
> device driver and can see the information from Device Manager, I am also
> able to get serial # from one of our legacy app (written with windows
> API) , using libusb and libusbX, it failed at
> libusb_get_string_descriptor_ascii, as you can see from the debug
> output, libusbx generate a huge# of error messages after calling
> libusb_get_string_descriptor_ascii

OK. I suspect this is not linked to the code you use, but do you mind 
trying xusb against your device with: xusb -d 8086:1138 (8086:1138 is 
the VID:PID of your device, right)?.

xusb will query the serial number from your device, and you can find a 
precompiled version of xusb in the latest Windows binary archive from 
https://sourceforge.net/projects/libusbx/files/releases/1.0.12/Windows/

By the way, and this may be important to understand your issue, 
8086:1138 is not listed at http://www.linux-usb.org/usb.ids, but lsusb 
-v indicates that it's another In-Target Probe (ITP), like 1138. Is it a 
custom device?

> The Debug Out is as following:
(...)
> [ 0.304561] [0000181c] libusbx: debug [windows_get_device_list] unlisted
> ancestor for '\\.\HID#HPQ0006&COL01#3&1F5EAFA&0&0000' (non USB HID, newly
> d, etc.) - ignoring
> [ 0.306061] [0000181c] libusbx: debug [windows_get_device_list] unlisted
> ancestor for '\\.\HID#HPQ0006&COL02#3&1F5EAFA&0&0001' (non USB HID, newly
> d, etc.) - ignoring

Non USB HID devices, as appear here, should be OK, and your problem is 
WinUSB, so I don't expect these messages to be relevant.

> [ 0.348070] [0000181c] libusbx: debug [libusb_open] open 6.1
> *Before call libusb_get_string_descriptor_ascii*
> [ 0.350070] [0000181c] libusbx: debug [libusb_claim_interface] interface 0
> [ 0.352070] [0000181c] libusbx: error [winusb_claim_interface] could not
> access interface 0: [1] Incorrect function.
> [ 0.352571] [0000181c] libusbx: error [winusb_claim_interface] could not
> claim interface 0: [1] Incorrect function.

This is what we need to concentrate on, as it is the source of the 
error. Basically, the error tells us that the call to 
WinUsb_Initialize() failed, which of course means that any later WinUSB 
calls are also likely to fail.

There's not much that should make WinUsb_initialize() failed apart from:
- hassing a bad file handle, i.e. one that isn't for a WinUSB device. 
"incorrect function" is pretty much what I would expect in this case
- having a WinUSB driver installation that isn't installed correctly.

Before we look at the first option, and if you haven't done so already, 
can you try reinstalling the WinUSB driver for your device. If needed 
you can use Zadig to do so, the latest version of which which can be 
picked up at: https://sourceforge.net/projects/libwdi/files/zadig/

If that doesn't fix it, I'll try to provide debug version of xusb (which 
I expect to have the same issue) that display the path used to create 
the file handle, so that we find out if there's anything obvious there.

Regards,

/Pete



------------------------------------------------------------------------------
Live Security Virtual Conference
Exclusive live event will cover all the ways today's security and 
threat landscape has changed and how IT managers can respond. Discussions 
will include endpoint security, mobile security and the latest in malware 
threats. http://www.accelacomm.com/jaw/sfrnl04242012/114/50122263/
_______________________________________________
libusbx-devel mailing list
libusbx-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/libusbx-devel

Reply via email to