Re: usb_control_msg works in linux but not windows

Xiaofan Chen <[email protected]>
Newsgroups gmane.comp.lib.libusb.devel.windows
Message-ID <CAGjSPUDkvPvDgS31EyYsAKeLzBSnHony2jjj5Si=w7ZDxqgTrg@mail.gmail.com>
On Thu, Feb 20, 2014 at 7:23 AM, Rob Willard <[email protected]> wrote:
> Good day...
>
> We are writing some proof of concept software to ensure a new USB device
> will be usable in both Linux and Windows.
>
> The following line turns on an LED.
>
>      int t2 = usb_control_msg(handle, 0x01, 10, on   , 0, 0, 0, 10);
>
> and works just fine in Linux, however produces the following error in
> Windows:
>
>      libusb0-dll:err [control_msg] sending control message failed, win
> error: The parameter is incorrect.
>
> I am very new to USB, and have not been able to find any kind of
> reference as to why it would work on one side, but not the other... Any
> help would be most appreciated.
>

You can try to install debug version of libusb-win32 and
then run your program. Then you can post the debug
message using Debug View.

Debug version of libusb-win32:
http://sourceforge.net/projects/libusb-win32/files/libusb-win32-releases/1.2.6.0/
 File name: libusb-win32-bin-debug-1.2.6.0.zip

Microsoft DebugView
http://technet.microsoft.com/en-us/sysinternals/bb896647.aspx

Detail steps:
1) unzip libusb-win32-bin-debug-1.2.6.0.zip

2) Depending on you OS:
2a) 64bit PCs Only: copy 'bin\amd64\libusb0.sys' to
'windows\system32\drivers\libusb0.sys', disconnect your USB device and
re-boot.

2b) 32bit PCs Only: copy 'bin\x86\libusb0.sys' to
'windows\system32\drivers\libusb0.sys', disconnect your USB device and
re-boot.

3) Launch DbgView (you MUST right click and run as administrator)

4) Under the capture menu, ensure all items are checked

5) Connect your device and then run your program

6) messages should appear in DebugView. Save the
log and post it.



-- 
Xiaofan

------------------------------------------------------------------------------
Managing the Performance of Cloud-Based Applications
Take advantage of what the Cloud has to offer - Avoid Common Pitfalls.
Read the Whitepaper.
http://pubads.g.doubleclick.net/gampad/clk?id=121054471&iu=/4140/ostg.clktrk
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.