Jeff Sadowski | 1 May 2008 19:20
Picon

how to connect to my device?

In linux I was able to read what libusb was doing from dmesg.
I'm guessing in windows I will be able to do this through the Event Viewer?
In linux my one device gave a message like so in dmesg

usb 1-1: USB disconnect, address 2
ldusb 1-1:1.0: LD USB Device #0 now disconnected
usb 1-1: new low speed USB device using uhci_hcd and address 3
usb 1-1: configuration #1 chosen from 1 choice
ldusb 1-1:1.0: Interrupt out endpoint not found (using control endpoint instead)
ldusb 1-1:1.0: LD USB Device #0 now attached to major 180 minor 176

and I created a node like so

mknod /dev/gotemp c,u 180 176

What is the equivalent in windows?

-------------------------------------------------------------------------
This SF.net email is sponsored by the 2008 JavaOne(SM) Conference 
Don't miss this year's exciting event. There's still time to save $100. 
Use priority code J8TL2D2. 
http://ad.doubleclick.net/clk;198757673;13503038;p?http://java.sun.com/javaone
shalky | 2 May 2008 07:45
Picon
Favicon

Re turn 0xFFFFFFEA when call usb_bulk_read


I used Borland C++ builder 6 to write a piece of code to communicate with a
usb device. Everything about initialization is ok, and sending data to
endpoint 1 is no problem. After that, when receiving data from endpoint 1,
the function usb_bulk_read returns 0xFFFFFFEA. what does it mean ? How to
fix it ? Thanks.
--

-- 
View this message in context: http://www.nabble.com/Return-0xFFFFFFEA-when-call-usb_bulk_read-tp16996696p16996696.html
Sent from the LibUSB Dev - Win32 mailing list archive at Nabble.com.

-------------------------------------------------------------------------
This SF.net email is sponsored by the 2008 JavaOne(SM) Conference 
Don't miss this year's exciting event. There's still time to save $100. 
Use priority code J8TL2D2. 
http://ad.doubleclick.net/clk;198757673;13503038;p?http://java.sun.com/javaone
shalky | 2 May 2008 14:25
Picon
Favicon

Re: Re turn 0xFFFFFFEA when call usb_bulk_read


The problem has been fixed. I made a stupid mistake: the endpoint 0x81 was
replaced with 81.
--

-- 
View this message in context: http://www.nabble.com/Return-0xFFFFFFEA-when-call-usb_bulk_read-tp16996696p17018014.html
Sent from the LibUSB Dev - Win32 mailing list archive at Nabble.com.

-------------------------------------------------------------------------
This SF.net email is sponsored by the 2008 JavaOne(SM) Conference 
Don't miss this year's exciting event. There's still time to save $100. 
Use priority code J8TL2D2. 
http://ad.doubleclick.net/clk;198757673;13503038;p?http://java.sun.com/javaone
Taimoor Mirza | 5 May 2008 06:58
Picon
Favicon

Re: Problem with DeviceIoControl

Stephen,
 
I tried to compile this windows.c with other files of libusb and I am getting following errors:
 
1>Compiling...
1>windows.c
1>.\windows.c(56) : error C2065: 'VERSION_MAJOR' : undeclared identifier
1>.\windows.c(56) : error C2099: initializer is not a constant
1>.\windows.c(57) : error C2065: 'VERSION_MINOR' : undeclared identifier
1>.\windows.c(57) : error C2099: initializer is not a constant
1>.\windows.c(58) : error C2065: 'VERSION_MICRO' : undeclared identifier
1>.\windows.c(58) : error C2099: initializer is not a constant
1>.\windows.c(59) : error C2065: 'VERSION_NANO' : undeclared identifier
1>.\windows.c(59) : error C2099: initializer is not a constant
1>.\windows.c(64) : error C2143: syntax error : missing ')' before '*'
1>.\windows.c(64) : error C2143: syntax error : missing '{' before '*'
1>.\windows.c(64) : error C2059: syntax error : 'type'
1>.\windows.c(66) : error C2059: syntax error : ')'
1>.\windows.c(67) : error C2143: syntax error : missing ')' before '*'
1>.\windows.c(67) : error C2143: syntax error : missing '{' before '*'
1>.\windows.c(67) : error C2059: syntax error : 'type'
1>.\windows.c(69) : error C2059: syntax error : ')'
1>.\windows.c(73) : error C2143: syntax error : missing ')' before '*'
1>.\windows.c(73) : error C2143: syntax error : missing '{' before '*'
1>.\windows.c(73) : error C2059: syntax error : 'type'
1>.\windows.c(73) : error C2059: syntax error : ')'
1>.\windows.c(121) : error C2143: syntax error : missing ')' before '*'
1>.\windows.c(121) : error C2143: syntax error : missing '{' before '*'
1>.\windows.c(121) : error C2059: syntax error : ')'
1>.\windows.c(122) : error C2054: expected '(' to follow 'dev'
1>.\windows.c(184) : error C2143: syntax error : missing ')' before '*'
1>.\windows.c(184) : error C2143: syntax error : missing '{' before '*'
1>.\windows.c(184) : error C2059: syntax error : ')'
1>.\windows.c(185) : error C2054: expected '(' to follow 'dev'
1>.\windows.c(202) : error C2143: syntax error : missing ')' before '*'
1>.\windows.c(202) : error C2143: syntax error : missing '{' before '*'
1>.\windows.c(202) : error C2059: syntax error : 'type'
1>.\windows.c(202) : error C2059: syntax error : ')'
1>.\windows.c(242) : error C2143: syntax error : missing ')' before '*'
1>.\windows.c(242) : error C2143: syntax error : missing '{' before '*'
1>.\windows.c(242) : error C2059: syntax error : 'type'
1>.\windows.c(242) : error C2059: syntax error : ')'
1>.\windows.c(281) : error C2143: syntax error : missing ')' before '*'
1>.\windows.c(281) : error C2143: syntax error : missing '{' before '*'
1>.\windows.c(281) : error C2059: syntax error : 'type'
1>.\windows.c(281) : error C2059: syntax error : ')'
1>.\windows.c(316) : error C2143: syntax error : missing ')' before '*'
1>.\windows.c(316) : error C2143: syntax error : missing '{' before '*'
1>.\windows.c(316) : error C2059: syntax error : 'type'
1>.\windows.c(316) : error C2059: syntax error : ')'
1>.\windows.c(359) : error C2143: syntax error : missing ')' before '*'
1>.\windows.c(359) : error C2143: syntax error : missing '{' before '*'
1>.\windows.c(359) : error C2059: syntax error : 'type'
1>.\windows.c(361) : error C2059: syntax error : ')'
1>.\windows.c(483) : error C2065: 'ETIMEDOUT' : undeclared identifier
1>.\windows.c(550) : error C2143: syntax error : missing ')' before '*'
1>.\windows.c(550) : error C2143: syntax error : missing '{' before '*'
1>.\windows.c(550) : error C2059: syntax error : 'type'
1>.\windows.c(552) : error C2059: syntax error : ')'
1>.\windows.c(596) : error C2143: syntax error : missing ')' before '*'
1>.\windows.c(596) : error C2143: syntax error : missing '{' before '*'
1>.\windows.c(596) : error C2059: syntax error : 'type'
1>.\windows.c(597) : error C2059: syntax error : ')'
1>.\windows.c(603) : error C2143: syntax error : missing ')' before '*'
1>.\windows.c(603) : error C2143: syntax error : missing '{' before '*'
1>.\windows.c(603) : error C2059: syntax error : 'type'
1>.\windows.c(604) : error C2059: syntax error : ')'
1>.\windows.c(610) : error C2143: syntax error : missing ')' before '*'
1>.\windows.c(610) : error C2143: syntax error : missing '{' before '*'
1>.\windows.c(610) : error C2059: syntax error : 'type'
1>.\windows.c(611) : error C2059: syntax error : ')'
1>.\windows.c(617) : error C2143: syntax error : missing ')' before '*'
1>.\windows.c(617) : error C2143: syntax error : missing '{' before '*'
1>.\windows.c(617) : error C2059: syntax error : 'type'
1>.\windows.c(618) : error C2059: syntax error : ')'
1>.\windows.c(624) : error C2143: syntax error : missing ')' before '*'
1>.\windows.c(624) : error C2143: syntax error : missing '{' before '*'
1>.\windows.c(624) : error C2059: syntax error : 'type'
1>.\windows.c(625) : error C2059: syntax error : ')'
1>.\windows.c(635) : error C2143: syntax error : missing ')' before '*'
1>.\windows.c(635) : error C2143: syntax error : missing '{' before '*'
1>.\windows.c(635) : error C2059: syntax error : 'type'
1>.\windows.c(635) : error C2059: syntax error : ')'
1>.\windows.c(645) : error C2143: syntax error : missing ')' before '*'
1>.\windows.c(645) : error C2143: syntax error : missing '{' before '*'
1>.\windows.c(645) : error C2059: syntax error : 'type'
1>.\windows.c(646) : error C2059: syntax error : ')'
1>.\windows.c(656) : error C2143: syntax error : missing ')' before '*'
1>.\windows.c(656) : error C2143: syntax error : missing '{' before '*'
1>.\windows.c(656) : error C2059: syntax error : 'type'
1>.\windows.c(657) : error C2059: syntax error : ')'
 
Where is this VERSION_MAJOR and other macros are declared? Any idea?
 
-Taimoor


> Date: Wed, 30 Apr 2008 08:42:21 +0200
> From: ste.meyer1 <at> googlemail.com
> To: libusb-win32-devel <at> lists.sourceforge.net
> Subject: Re: [Libusb-win32-devel] Problem with DeviceIoControl
>
> Please try the latest windows.c from the SVN
> (http://libusb-win32.svn.sourceforge.net/viewvc/libusb-win32/trunk/libusb/src/)
>
> There had been some changes since the last release.
>
> Stephan
>
>
>
> On 4/30/08, Taimoor Mirza <mooni_mirza <at> hotmail.com> wrote:
> > Well actually the problem that I am getting is the one I mentioned in last
> > paragraph of my email i.e. I am actually trying to communicate with a
> > printer device using libusb.lib and driver dll. I installed driver
> > successfully and my testlibusb-win.exe is running fine.
> >
> > But the problem is that in my application when call usb_control_msg to send
> > class specific request to get device ID of my printer device it returns -5.
> >
> > Parameters I am passing to this call are
> > bmRequestType = 0xa1
> > bRequest = 0x00 // Class specific request to get device Id
> >
> > Now I don't know why is it happening.I've used usb analyzer to check whether
> > printer device is rejecting this request or something else. What I've found
> > out is that usb_control_msg does not send this request to usb bus.
> >
> > I then thought to debug it myself........for that I took the source code of
> > libusb and built my own library and dll....just to debug. But doing so I
> > found out that I am getting error in DeviceIoControl method in
> > usb_os_find_devices of windows.c.
> >
> > I hope you've got my point..........
> >
> > > Date: Tue, 29 Apr 2008 15:05:30 +0200
> > > From: ste.meyer1 <at> googlemail.com
> > > To: libusb-win32-devel <at> lists.sourceforge.net
> > > Subject: Re: [Libusb-win32-devel] Problem with DeviceIoControl
> >
> > >
> > > What is LIBUSB_IOCTL_GET_DEVICE_INFO?
> > > Why aren't you using the DLL that comes with the driver?
> > >
> > >
> > > On 4/29/08, Taimoor Mirza <mooni_mirza <at> hotmail.com> wrote:
> > > > Hi all,
> > > >
> > > > I am trying to run my application for printer device. I've installed
> > device
> > > > driver for this device but I am getting a problem in my
> > usb_os_find_devices
> > > > method in windows.c . In this method my CreateFile runs successfully and
> > > > returned me handle of device.
> > > >
> > > > But after that when DeviceIoControl method is called it fails. I've
> > checked
> > > > the error message using GetLastError and it is returning 87 means
> > > > INVALID_PARAMETER. Below is code of usb_os_find_devices method
> > > >
> > > >
> > > >
> > > > handle = CreateFile(dev->filename, 0, 0, NULL, OPEN_EXISTING,
> > > > FILE_ATTRIBUTE_NORMAL, NULL);
> > > >
> > > > if(handle == INVALID_HANDLE_VALUE)
> > > > {
> > > > free(dev);
> > > > stat = GetLastError();
> > > > continue;
> > > > }
> > > >
> > > > if(!DeviceIoControl(handle, LIBUSB_IOCTL_GET_DEVICE_INFO,
> > > > &req, sizeof(libusb_request),
> > > > &req, sizeof(libusb_request),
> > > > &ret, NULL))
> > > > {
> > > > USB_MESSAGE_STR(LIBUSB_DEBUG_ERR, "usb_os_find_devices:
> > > > getting "
> > > > "device info failed");
> > > > CloseHandle(handle);
> > > > stat = GetLastError();
> > > >
> > > > ...................
> > > >
> > > > Any clue? One more thing is that if I use libusb library then it does
> > not
> > > > give this problem. But in that case when I call usb_control_msg to send
> > > > class specific request to get device ID of my printer device it returns
> > -5.
> > > > Parameters I am passing to this call are
> > > > bmRequestType = 0xa1
> > > > bRequest = 0x00 // Class specific request to get device Id
> > > >
> > > > -mooni
> > > >
> > > >
> > > >
> > > > ________________________________
> > > > Discover the new Windows Vista Learn more!
> > > >
> > -------------------------------------------------------------------------
> > > > This SF.net email is sponsored by the 2008 JavaOne(SM) Conference
> > > > Don't miss this year's exciting event. There's still time to save $100.
> > > > Use priority code J8TL2D2.
> > > >
> > http://ad.doubleclick.net/clk;198757673;13503038;p?http://java.sun.com/javaone
> > > > _______________________________________________
> > > > Libusb-win32-devel mailing list
> > > > Libusb-win32-devel <at> lists.sourceforge.net
> > > >
> > https://lists.sourceforge.net/lists/listinfo/libusb-win32-devel
> > > >
> > > >
> > >
> > >
> > -------------------------------------------------------------------------
> > > This SF.net email is sponsored by the 2008 JavaOne(SM) Conference
> > > Don't miss this year's exciting event. There's still time to save $100.
> > > Use priority code J8TL2D2.
> > >
> > http://ad.doubleclick.net/clk;198757673;13503038;p?http://java.sun.com/javaone
> > > _______________________________________________
> > > Libusb-win32-devel mailing list
> > > Libusb-win32-devel <at> lists.sourceforge.net
> > >
> > https://lists.sourceforge.net/lists/listinfo/libusb-win32-devel
> >
> >
> > ________________________________
> > Get news, entertainment and everything you care about at Live.com. Check it
> > out!
> > -------------------------------------------------------------------------
> > This SF.net email is sponsored by the 2008 JavaOne(SM) Conference
> > Don't miss this year's exciting event. There's still time to save $100.
> > Use priority code J8TL2D2.
> > http://ad.doubleclick.net/clk;198757673;13503038;p?http://java.sun.com/javaone
> > _______________________________________________
> > Libusb-win32-devel mailing list
> > Libusb-win32-devel <at> lists.sourceforge.net
> > https://lists.sourceforge.net/lists/listinfo/libusb-win32-devel
> >
> >
>
> -------------------------------------------------------------------------
> This SF.net email is sponsored by the 2008 JavaOne(SM) Conference
> Don't miss this year's exciting event. There's still time to save $100.
> Use priority code J8TL2D2.
> http://ad.doubleclick.net/clk;198757673;13503038;p?http://java.sun.com/javaone
> _______________________________________________
> Libusb-win32-devel mailing list
> Libusb-win32-devel <at> lists.sourceforge.net
> https://lists.sourceforge.net/lists/listinfo/libusb-win32-devel


Invite your mail contacts to join your friends list with Windows Live Spaces. It's easy! Try it!
-------------------------------------------------------------------------
This SF.net email is sponsored by the 2008 JavaOne(SM) Conference 
Don't miss this year's exciting event. There's still time to save $100. 
Use priority code J8TL2D2. 
http://ad.doubleclick.net/clk;198757673;13503038;p?http://java.sun.com/javaone
_______________________________________________
Libusb-win32-devel mailing list
Libusb-win32-devel <at> lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/libusb-win32-devel
Stephan Meyer | 5 May 2008 08:27

Re: Problem with DeviceIoControl

These constants are defined in the Makefile. Just pass these constants
as command line arguments to your compiler if you're not using GCC.

Stephan

On 5/5/08, Taimoor Mirza <mooni_mirza <at> hotmail.com> wrote:
> Stephen,
>
> I tried to compile this windows.c with other files of libusb and I am
> getting following errors:
>
> 1>Compiling...
> 1>windows.c
> 1>.\windows.c(56) : error C2065: 'VERSION_MAJOR' : undeclared identifier
> 1>.\windows.c(56) : error C2099: initializer is not a constant
> 1>.\windows.c(57) : error C2065: 'VERSION_MINOR' : undeclared identifier
> 1>.\windows.c(57) : error C2099: initializer is not a constant
> 1>.\windows.c(58) : error C2065: 'VERSION_MICRO' : undeclared identifier
> 1>.\windows.c(58) : error C2099: initializer is not a constant
> 1>.\windows.c(59) : error C2065: 'VERSION_NANO' : undeclared identifier
> 1>.\windows.c(59) : error C2099: initializer is not a constant
> 1>.\windows.c(64) : error C2143: syntax error : missing ')' before '*'
> 1>.\windows.c(64) : error C2143: syntax error : missing '{' before '*'
> 1>.\windows.c(64) : error C2059: syntax error : 'type'
> 1>.\windows.c(66) : error C2059: syntax error : ')'
> 1>.\windows.c(67) : error C2143: syntax error : missing ')' before '*'
> 1>.\windows.c(67) : error C2143: syntax error : missing '{' before '*'
> 1>.\windows.c(67) : error C2059: syntax error : 'type'
> 1>.\windows.c(69) : error C2059: syntax error : ')'
> 1>.\windows.c(73) : error C2143: syntax error : missing ')' before '*'
> 1>.\windows.c(73) : error C2143: syntax error : missing '{' before '*'
> 1>.\windows.c(73) : error C2059: syntax error : 'type'
> 1>.\windows.c(73) : error C2059: syntax error : ')'
> 1>.\windows.c(121) : error C2143: syntax error : missing ')' before '*'
> 1>.\windows.c(121) : error C2143: syntax error : missing '{' before '*'
> 1>.\windows.c(121) : error C2059: syntax error : ')'
> 1>.\windows.c(122) : error C2054: expected '(' to follow 'dev'
> 1>.\windows.c(184) : error C2143: syntax error : missing ')' before '*'
> 1>.\windows.c(184) : error C2143: syntax error : missing '{' before '*'
> 1>.\windows.c(184) : error C2059: syntax error : ')'
> 1>.\windows.c(185) : error C2054: expected '(' to follow 'dev'
> 1>.\windows.c(202) : error C2143: syntax error : missing ')' before '*'
> 1>.\windows.c(202) : error C2143: syntax error : missing '{' before '*'
> 1>.\windows.c(202) : error C2059: syntax error : 'type'
> 1>.\windows.c(202) : error C2059: syntax error : ')'
> 1>.\windows.c(242) : error C2143: syntax error : missing ')' before '*'
> 1>.\windows.c(242) : error C2143: syntax error : missing '{' before '*'
> 1>.\windows.c(242) : error C2059: syntax error : 'type'
> 1>.\windows.c(242) : error C2059: syntax error : ')'
> 1>.\windows.c(281) : error C2143: syntax error : missing ')' before '*'
> 1>.\windows.c(281) : error C2143: syntax error : missing '{' before '*'
> 1>.\windows.c(281) : error C2059: syntax error : 'type'
> 1>.\windows.c(281) : error C2059: syntax error : ')'
> 1>.\windows.c(316) : error C2143: syntax error : missing ')' before '*'
> 1>.\windows.c(316) : error C2143: syntax error : missing '{' before '*'
> 1>.\windows.c(316) : error C2059: syntax error : 'type'
> 1>.\windows.c(316) : error C2059: syntax error : ')'
> 1>.\windows.c(359) : error C2143: syntax error : missing ')' before '*'
> 1>.\windows.c(359) : error C2143: syntax error : missing '{' before '*'
> 1>.\windows.c(359) : error C2059: syntax error : 'type'
> 1>.\windows.c(361) : error C2059: syntax error : ')'
> 1>.\windows.c(483) : error C2065: 'ETIMEDOUT' : undeclared identifier
> 1>.\windows.c(550) : error C2143: syntax error : missing ')' before '*'
> 1>.\windows.c(550) : error C2143: syntax error : missing '{' before '*'
> 1>.\windows.c(550) : error C2059: syntax error : 'type'
> 1>.\windows.c(552) : error C2059: syntax error : ')'
> 1>.\windows.c(596) : error C2143: syntax error : missing ')' before '*'
> 1>.\windows.c(596) : error C2143: syntax error : missing '{' before '*'
> 1>.\windows.c(596) : error C2059: syntax error : 'type'
> 1>.\windows.c(597) : error C2059: syntax error : ')'
> 1>.\windows.c(603) : error C2143: syntax error : missing ')' before '*'
> 1>.\windows.c(603) : error C2143: syntax error : missing '{' before '*'
> 1>.\windows.c(603) : error C2059: syntax error : 'type'
> 1>.\windows.c(604) : error C2059: syntax error : ')'
> 1>.\windows.c(610) : error C2143: syntax error : missing ')' before '*'
> 1>.\windows.c(610) : error C2143: syntax error : missing '{' before '*'
> 1>.\windows.c(610) : error C2059: syntax error : 'type'
> 1>.\windows.c(611) : error C2059: syntax error : ')'
> 1>.\windows.c(617) : error C2143: syntax error : missing ')' before '*'
> 1>.\windows.c(617) : error C2143: syntax error : missing '{' before '*'
> 1>.\windows.c(617) : error C2059: syntax error : 'type'
> 1>.\windows.c(618) : error C2059: syntax error : ')'
> 1>.\windows.c(624) : error C2143: syntax error : missing ')' before '*'
> 1>.\windows.c(624) : error C2143: syntax error : missing '{' before '*'
> 1>.\windows.c(624) : error C2059: syntax error : 'type'
> 1>.\windows.c(625) : error C2059: syntax error : ')'
> 1>.\windows.c(635) : error C2143: syntax error : missing ')' before '*'
> 1>.\windows.c(635) : error C2143: syntax error : missing '{' before '*'
> 1>.\windows.c(635) : error C2059: syntax error : 'type'
> 1>.\windows.c(635) : error C2059: syntax error : ')'
> 1>.\windows.c(645) : error C2143: syntax error : missing ')' before '*'
> 1>.\windows.c(645) : error C2143: syntax error : missing '{' before '*'
> 1>.\windows.c(645) : error C2059: syntax error : 'type'
> 1>.\windows.c(646) : error C2059: syntax error : ')'
> 1>.\windows.c(656) : error C2143: syntax error : missing ')' before '*'
> 1>.\windows.c(656) : error C2143: syntax error : missing '{' before '*'
> 1>.\windows.c(656) : error C2059: syntax error : 'type'
> 1>.\windows.c(657) : error C2059: syntax error : ')'
>
> Where is this VERSION_MAJOR and other macros are declared? Any idea?
>
> -Taimoor
>
>
> > Date: Wed, 30 Apr 2008 08:42:21 +0200
>
> > From: ste.meyer1 <at> googlemail.com
> > To: libusb-win32-devel <at> lists.sourceforge.net
> > Subject: Re: [Libusb-win32-devel] Problem with DeviceIoControl
> >
> > Please try the latest windows.c from the SVN
> >
> (http://libusb-win32.svn.sourceforge.net/viewvc/libusb-win32/trunk/libusb/src/)
> >
> > There had been some changes since the last release.
> >
> > Stephan
> >
> >
> >
> > On 4/30/08, Taimoor Mirza <mooni_mirza <at> hotmail.com> wrote:
> > > Well actually the problem that I am getting is the one I mentioned in
> last
> > > paragraph of my email i.e. I am actually trying to communicate with a
> > > printer device using libusb.lib and driver dll. I installed driver
> > > successfully and my testlibusb-win.exe is running fine.
> > >
> > > But the problem is that in my application when call usb_control_msg to
> send
> > > class specific request to get device ID of my printer device it returns
> -5.
> > >
> > > Parameters I am passing to this call are
> > > bmRequestType = 0xa1
> > > bRequest = 0x00 // Class specific request to get device Id
> > >
> > > Now I don't know why is it happening.I've used usb analyzer to check
> whether
> > > printer device is rejecting this request or something else. What I've
> found
> > > out is that usb_control_msg does not send this request to usb bus.
> > >
> > > I then thought to debug it myself........for that I took the source code
> of
> > > libusb and built my own library and dll....just to debug. But doing so I
> > > found out that I am getting error in DeviceIoControl method in
> > > usb_os_find_devices of windows.c.
> > >
> > > I hope you've got my point..........
> > >
> > > > Date: Tue, 29 Apr 2008 15:05:30 +0200
> > > > From: ste.meyer1 <at> googlemail.com
> > > > To: libusb-win32-devel <at> lists.sourceforge.net
> > > > Subject: Re: [Libusb-win32-devel] Problem with DeviceIoControl
> > >
> > > >
> > > > What is LIBUSB_IOCTL_GET_DEVICE_INFO?
> > > > Why aren't you using the DLL that comes with the driver?
> > > >
> > > >
> > > > On 4/29/08, Taimoor Mirza <mooni_mirza <at> hotmail.com> wrote:
> > > > > Hi all,
> > > > >
> > > > > I am trying to run my application for printer device. I've installed
> > > device
> > > > > driver for this device but I am getting a problem in my
> > > usb_os_find_devices
> > > > > method in windows.c . In this method my CreateFile runs successfully
> and
> > > > > returned me handle of device.
> > > > >
> > > > > But after that when DeviceIoControl method is called it fails. I've
> > > checked
> > > > > the error message using GetLastError and it is returning 87 means
> > > > > INVALID_PARAMETER. Below is code of usb_os_find_devices method
> > > > >
> > > > >
> > > > >
> > > > > handle = CreateFile(dev->filename, 0, 0, NULL, OPEN_EXISTING,
> > > > > FILE_ATTRIBUTE_NORMAL, NULL);
> > > > >
> > > > > if(handle == INVALID_HANDLE_VALUE)
> > > > > {
> > > > > free(dev);
> > > > > stat = GetLastError();
> > > > > continue;
> > > > > }
> > > > >
> > > > > if(!DeviceIoControl(handle, LIBUSB_IOCTL_GET_DEVICE_INFO,
> > > > > &req, sizeof(libusb_request),
> > > > > &req, sizeof(libusb_request),
> > > > > &ret, NULL))
> > > > > {
> > > > > USB_MESSAGE_STR(LIBUSB_DEBUG_ERR,
> "usb_os_find_devices:
> > > > > getting "
> > > > > "device info failed");
> > > > > CloseHandle(handle);
> > > > > stat = GetLastError();
> > > > >
> > > > > ...................
> > > > >
> > > > > Any clue? One more thing is that if I use libusb library then it
> does
> > > not
> > > > > give this problem. But in that case when I call usb_control_msg to
> send
> > > > > class specific request to get device ID of my printer device it
> returns
> > > -5.
> > > > > Parameters I am passing to this call are
> > > > > bmRequestType = 0xa1
> > > > > bRequest = 0x00 // Class specific request to get device Id
> > > > >
> > > > > -mooni
> > > > >
> > > > >
> > > > >
> > > > > ________________________________
> > > > > Discover the new Windows Vista Learn more!
> > > > >
> > >
> -------------------------------------------------------------------------
> > > > > This SF.net email is sponsored by the 2008 JavaOne(SM) Conference
> > > > > Don't miss this year's exciting event. There's still time to save
> $100.
> > > > > Use priority code J8TL2D2.
> > > > >
> > >
> http://ad.doubleclick.net/clk;198757673;13503038;p?http://java.sun.com/javaone
> > > > > _______________________________________________
> > > > > Libusb-win32-devel mailing list
> > > > > Libusb-win32-devel <at> lists.sourceforge.net
> > > > >
> > >
> https://lists.sourceforge.net/lists/listinfo/libusb-win32-devel
> > > > >
> > > > >
> > > >
> > > >
> > >
> -------------------------------------------------------------------------
> > > > This SF.net email is sponsored by the 2008 JavaOne(SM) Conference
> > > > Don't miss this year's exciting event. There's still time to save
> $100.
> > > > Use priority code J8TL2D2.
> > > >
> > >
> http://ad.doubleclick.net/clk;198757673;13503038;p?http://java.sun.com/javaone
> > > > _______________________________________________
> > > > Libusb-win32-devel mailing list
> > > > Libusb-win32-devel <at> lists.sourceforge.net
> > > >
> > >
> https://lists.sourceforge.net/lists/listinfo/libusb-win32-devel
> > >
> > >
> > > ________________________________
> > > Get news, entertainment and everything you care about at Live.com. Check
> it
> > > out!
> > >
> -------------------------------------------------------------------------
> > > This SF.net email is sponsored by the 2008 JavaOne(SM) Conference
> > > Don't miss this year's exciting event. There's still time to save $100.
> > > Use priority code J8TL2D2.
> > >
> http://ad.doubleclick.net/clk;198757673;13503038;p?http://java.sun.com/javaone
> > > _______________________________________________
> > > Libusb-win32-devel mailing list
> > > Libusb-win32-devel <at> lists.sourceforge.net
> > >
> https://lists.sourceforge.net/lists/listinfo/libusb-win32-devel
> > >
> > >
> >
> >
> -------------------------------------------------------------------------
> > This SF.net email is sponsored by the 2008 JavaOne(SM) Conference
> > Don't miss this year's exciting event. There's still time to save $100.
> > Use priority code J8TL2D2.
> >
> http://ad.doubleclick.net/clk;198757673;13503038;p?http://java.sun.com/javaone
> > _______________________________________________
> > Libusb-win32-devel mailing list
> > Libusb-win32-devel <at> lists.sourceforge.net
> >
> https://lists.sourceforge.net/lists/listinfo/libusb-win32-devel
>
>
> ________________________________
> Invite your mail contacts to join your friends list with Windows Live
> Spaces. It's easy! Try it!
> -------------------------------------------------------------------------
> This SF.net email is sponsored by the 2008 JavaOne(SM) Conference
> Don't miss this year's exciting event. There's still time to save $100.
> Use priority code J8TL2D2.
> http://ad.doubleclick.net/clk;198757673;13503038;p?http://java.sun.com/javaone
> _______________________________________________
> Libusb-win32-devel mailing list
> Libusb-win32-devel <at> lists.sourceforge.net
> https://lists.sourceforge.net/lists/listinfo/libusb-win32-devel
>
>

-------------------------------------------------------------------------
This SF.net email is sponsored by the 2008 JavaOne(SM) Conference 
Don't miss this year's exciting event. There's still time to save $100. 
Use priority code J8TL2D2. 
http://ad.doubleclick.net/clk;198757673;13503038;p?http://java.sun.com/javaone
Taimoor Mirza | 6 May 2008 08:29
Picon
Favicon

Re: Problem with DeviceIoControl


Thanks Stephan,
 
I've debugged it using latest LIBUSB source code. It is actually failing in DeviceIoControl function which is returning error code 998 means ERROR_NOACCESS. Below are my findings:
 
usb_control_msg calls _usb_io_sync with following parameters
dev->impl_info : 0x00000df4 // this is fine
code:               0x00222034              // It also looks fine
out:                 0x041efd4c
out_size:           0x00000018
in :                   0x034efd00
in_size:             0x000003fc
read:                0x00000000
 
This _usb_io_sync then calls DeviceIoControl with following parameters:
dev:         0x00000df4
code:        0x00222034
out:          0x041efd4c
out_size:   0x00000018
in:            0x034efd00
in_size:      0x000003fc
NULL,
ol:         every thing is NULL in it.......looks fine
 
it fails and GetLastError returns 998............any idea Y is it failing........one thing very interesting is that what we are passing in out parameter is actually in parameter for DeviceIoControl.......you can see it here ...........you can see 3rd and 4th parameters
> Date: Mon, 5 May 2008 08:27:34 +0200
> From: ste.meyer1 <at> googlemail.com
> To: libusb-win32-devel <at> lists.sourceforge.net
> Subject: Re: [Libusb-win32-devel] Problem with DeviceIoControl
>
> These constants are defined in the Makefile. Just pass these constants
> as command line arguments to your compiler if you're not using GCC.
>
> Stephan
>
>
> On 5/5/08, Taimoor Mirza <mooni_mirza <at> hotmail.com> wrote:
> > Stephen,
> >
> > I tried to compile this windows.c with other files of libusb and I am
> > getting following errors:
> >
> > 1>Compiling...
> > 1>windows.c
> > 1>.\windows.c(56) : error C2065: 'VERSION_MAJOR' : undeclared identifier
> > 1>.\windows.c(56) : error C2099: initializer is not a constant
> > 1>.\windows.c(57) : error C2065: 'VERSION_MINOR' : undeclared identifier
> > 1>.\windows.c(57) : error C2099: initializer is not a constant
> > 1>.\windows.c(58) : error C2065: 'VERSION_MICRO' : undeclared identifier
> > 1>.\windows.c(58) : error C2099: initializer is not a constant
> > 1>.\windows.c(59) : error C2065: 'VERSION_NANO' : undeclared identifier
> > 1>.\windows.c(59) : error C2099: initializer is not a constant
> > 1>.\windows.c(64) : error C2143: syntax error : missing ')' before '*'
> > 1>.\windows.c(64) : error C2143: syntax error : missing '{' before '*'
> > 1>.\windows.c(64) : error C2059: syntax error : 'type'
> > 1>.\windows.c(66) : error C2059: syntax error : ')'
> > 1>.\windows.c(67) : error C2143: syntax error : missing ')' before '*'
> > 1>.\windows.c(67) : error C2143: syntax error : missing '{' before '*'
> > 1>.\windows.c(67) : error C2059: syntax error : 'type'
> > 1>.\windows.c(69) : error C2059: syntax error : ')'
> > 1>.\windows.c(73) : error C2143: syntax error : missing ')' before '*'
> > 1>.\windows.c(73) : error C2143: syntax error : missing '{' before '*'
> > 1>.\windows.c(73) : error C2059: syntax error : 'type'
> > 1>.\windows.c(73) : error C2059: syntax error : ')'
> > 1>.\windows.c(121) : error C2143: syntax error : missing ')' before '*'
> > 1>.\windows.c(121) : error C2143: syntax error : missing '{' before '*'
> > 1>.\windows.c(121) : error C2059: syntax error : ')'
> > 1>.\windows.c(122) : error C2054: expected '(' to follow 'dev'
> > 1>.\windows.c(184) : error C2143: syntax error : missing ')' before '*'
> > 1>.\windows.c(184) : error C2143: syntax error : missing '{' before '*'
> > 1>.\windows.c(184) : error C2059: syntax error : ')'
> > 1>.\windows.c(185) : error C2054: expected '(' to follow 'dev'
> > 1>.\windows.c(202) : error C2143: syntax error : missing ')' before '*'
> > 1>.\windows.c(202) : error C2143: syntax error : missing '{' before '*'
> > 1>.\windows.c(202) : error C2059: syntax error : 'type'
> > 1>.\windows.c(202) : error C2059: syntax error : ')'
> > 1>.\windows.c(242) : error C2143: syntax error : missing ')' before '*'
> > 1>.\windows.c(242) : error C2143: syntax error : missing '{' before '*'
> > 1>.\windows.c(242) : error C2059: syntax error : 'type'
> > 1>.\windows.c(242) : error C2059: syntax error : ')'
> > 1>.\windows.c(281) : error C2143: syntax error : missing ')' before '*'
> > 1>.\windows.c(281) : error C2143: syntax error : missing '{' before '*'
> > 1>.\windows.c(281) : error C2059: syntax error : 'type'
> > 1>.\windows.c(281) : error C2059: syntax error : ')'
> > 1>.\windows.c(316) : error C2143: syntax error : missing ')' before '*'
> > 1>.\windows.c(316) : error C2143: syntax error : missing '{' before '*'
> > 1>.\windows.c(316) : error C2059: syntax error : 'type'
> > 1>.\windows.c(316) : error C2059: syntax error : ')'
> > 1>.\windows.c(359) : error C2143: syntax error : missing ')' before '*'
> > 1>.\windows.c(359) : error C2143: syntax error : missing '{' before '*'
> > 1>.\windows.c(359) : error C2059: syntax error : 'type'
> > 1>.\windows.c(361) : error C2059: syntax error : ')'
> > 1>.\windows.c(483) : error C2065: 'ETIMEDOUT' : undeclared identifier
> > 1>.\windows.c(550) : error C2143: syntax error : missing ')' before '*'
> > 1>.\windows.c(550) : error C2143: syntax error : missing '{' before '*'
> > 1>.\windows.c(550) : error C2059: syntax error : 'type'
> > 1>.\windows.c(552) : error C2059: syntax error : ')'
> > 1>.\windows.c(596) : error C2143: syntax error : missing ')' before '*'
> > 1>.\windows.c(596) : error C2143: syntax error : missing '{' before '*'
> > 1>.\windows.c(596) : error C2059: syntax error : 'type'
> > 1>.\windows.c(597) : error C2059: syntax error : ')'
> > 1>.\windows.c(603) : error C2143: syntax error : missing ')' before '*'
> > 1>.\windows.c(603) : error C2143: syntax error : missing '{' before '*'
> > 1>.\windows.c(603) : error C2059: syntax error : 'type'
> > 1>.\windows.c(604) : error C2059: syntax error : ')'
> > 1>.\windows.c(610) : error C2143: syntax error : missing ')' before '*'
> > 1>.\windows.c(610) : error C2143: syntax error : missing '{' before '*'
> > 1>.\windows.c(610) : error C2059: syntax error : 'type'
> > 1>.\windows.c(611) : error C2059: syntax error : ')'
> > 1>.\windows.c(617) : error C2143: syntax error : missing ')' before '*'
> > 1>.\windows.c(617) : error C2143: syntax error : missing '{' before '*'
> > 1>.\windows.c(617) : error C2059: syntax error : 'type'
> > 1>.\windows.c(618) : error C2059: syntax error : ')'
> > 1>.\windows.c(624) : error C2143: syntax error : missing ')' before '*'
> > 1>.\windows.c(624) : error C2143: syntax error : missing '{' before '*'
> > 1>.\windows.c(624) : error C2059: syntax error : 'type'
> > 1>.\windows.c(625) : error C2059: syntax error : ')'
> > 1>.\windows.c(635) : error C2143: syntax error : missing ')' before '*'
> > 1>.\windows.c(635) : error C2143: syntax error : missing '{' before '*'
> > 1>.\windows.c(635) : error C2059: syntax error : 'type'
> > 1>.\windows.c(635) : error C2059: syntax error : ')'
> > 1>.\windows.c(645) : error C2143: syntax error : missing ')' before '*'
> > 1>.\windows.c(645) : error C2143: syntax error : missing '{' before '*'
> > 1>.\windows.c(645) : error C2059: syntax error : 'type'
> > 1>.\windows.c(646) : error C2059: syntax error : ')'
> > 1>.\windows.c(656) : error C2143: syntax error : missing ')' before '*'
> > 1>.\windows.c(656) : error C2143: syntax error : missing '{' before '*'
> > 1>.\windows.c(656) : error C2059: syntax error : 'type'
> > 1>.\windows.c(657) : error C2059: syntax error : ')'
> >
> > Where is this VERSION_MAJOR and other macros are declared? Any idea?
> >
> > -Taimoor
> >
> >
> > > Date: Wed, 30 Apr 2008 08:42:21 +0200
> >
> > > From: ste.meyer1 <at> googlemail.com
> > > To: libusb-win32-devel <at> lists.sourceforge.net
> > > Subject: Re: [Libusb-win32-devel] Problem with DeviceIoControl
> > >
> > > Please try the latest windows.c from the SVN
> > >
> > (http://libusb-win32.svn.sourceforge.net/viewvc/libusb-win32/trunk/libusb/src/)
> > >
> > > There had been some changes since the last release.
> > >
> > > Stephan
> > >
> > >
> > >
> > > On 4/30/08, Taimoor Mirza <mooni_mirza <at> hotmail.com> wrote:
> > > > Well actually the problem that I am getting is the one I mentioned in
> > last
> > > > paragraph of my email i.e. I am actually trying to communicate with a
> > > > printer device using libusb.lib and driver dll. I installed driver
> > > > successfully and my testlibusb-win.exe is running fine.
> > > >
> > > > But the problem is that in my application when call usb_control_msg to
> > send
> > > > class specific request to get device ID of my printer device it returns
> > -5.
> > > >
> > > > Parameters I am passing to this call are
> > > > bmRequestType = 0xa1
> > > > bRequest = 0x00 // Class specific request to get device Id
> > > >
> > > > Now I don't know why is it happening.I've used usb analyzer to check
> > whether
> > > > printer device is rejecting this request or something else. What I've
> > found
> > > > out is that usb_control_msg does not send this request to usb bus.
> > > >
> > > > I then thought to debug it myself........for that I took the source code
> > of
> > > > libusb and built my own library and dll....just to debug. But doing so I
> > > > found out that I am getting error in DeviceIoControl method in
> > > > usb_os_find_devices of windows.c.
> > > >
> > > > I hope you've got my point..........
> > > >
> > > > > Date: Tue, 29 Apr 2008 15:05:30 +0200
> > > > > From: ste.meyer1 <at> googlemail.com
> > > > > To: libusb-win32-devel <at> lists.sourceforge.net
> > > > > Subject: Re: [Libusb-win32-devel] Problem with DeviceIoControl
> > > >
> > > > >
> > > > > What is LIBUSB_IOCTL_GET_DEVICE_INFO?
> > > > > Why aren't you using the DLL that comes with the driver?
> > > > >
> > > > >
> > > > > On 4/29/08, Taimoor Mirza <mooni_mirza <at> hotmail.com> wrote:
> > > > > > Hi all,
> > > > > >
> > > > > > I am trying to run my application for printer device. I've installed
> > > > device
> > > > > > driver for this device but I am getting a problem in my
> > > > usb_os_find_devices
> > > > > > method in windows.c . In this method my CreateFile runs successfully
> > and
> > > > > > returned me handle of device.
> > > > > >
> > > > > > But after that when DeviceIoControl method is called it fails. I've
> > > > checked
> > > > > > the error message using GetLastError and it is returning 87 means
> > > > > > INVALID_PARAMETER. Below is code of usb_os_find_devices method
> > > > > >
> > > > > >
> > > > > >
> > > > > > handle = CreateFile(dev->filename, 0, 0, NULL, OPEN_EXISTING,
> > > > > > FILE_ATTRIBUTE_NORMAL, NULL);
> > > > > >
> > > > > > if(handle == INVALID_HANDLE_VALUE)
> > > > > > {
> > > > > > free(dev);
> > > > > > stat = GetLastError();
> > > > > > continue;
> > > > > > }
> > > > > >
> > > > > > if(!DeviceIoControl(handle, LIBUSB_IOCTL_GET_DEVICE_INFO,
> > > > > > &req, sizeof(libusb_request),
> > > > > > &req, sizeof(libusb_request),
> > > > > > &ret, NULL))
> > > > > > {
> > > > > > USB_MESSAGE_STR(LIBUSB_DEBUG_ERR,
> > "usb_os_find_devices:
> > > > > > getting "
> > > > > > "device info failed");
> > > > > > CloseHandle(handle);
> > > > > > stat = GetLastError();
> > > > > >
> > > > > > ...................
> > > > > >
> > > > > > Any clue? One more thing is that if I use libusb library then it
> > does
> > > > not
> > > > > > give this problem. But in that case when I call usb_control_msg to
> > send
> > > > > > class specific request to get device ID of my printer device it
> > returns
> > > > -5.
> > > > > > Parameters I am passing to this call are
> > > > > > bmRequestType = 0xa1
> > > > > > bRequest = 0x00 // Class specific request to get device Id
> > > > > >
> > > > > > -mooni
> > > > > >
> > > > > >
> > > > > >
> > > > > > ________________________________
> > > > > > Discover the new Windows Vista Learn more!
> > > > > >
> > > >
> > -------------------------------------------------------------------------
> > > > > > This SF.net email is sponsored by the 2008 JavaOne(SM) Conference
> > > > > > Don't miss this year's exciting event. There's still time to save
> > $100.
> > > > > > Use priority code J8TL2D2.
> > > > > >
> > > >
> > http://ad.doubleclick.net/clk;198757673;13503038;p?http://java.sun.com/javaone
> > > > > > _______________________________________________
> > > > > > Libusb-win32-devel mailing list
> > > > > > Libusb-win32-devel <at> lists.sourceforge.net
> > > > > >
> > > >
> > https://lists.sourceforge.net/lists/listinfo/libusb-win32-devel
> > > > > >
> > > > > >
> > > > >
> > > > >
> > > >
> > -------------------------------------------------------------------------
> > > > > This SF.net email is sponsored by the 2008 JavaOne(SM) Conference
> > > > > Don't miss this year's exciting event. There's still time to save
> > $100.
> > > > > Use priority code J8TL2D2.
> > > > >
> > > >
> > http://ad.doubleclick.net/clk;198757673;13503038;p?http://java.sun.com/javaone
> > > > > _______________________________________________
> > > > > Libusb-win32-devel mailing list
> > > > > Libusb-win32-devel <at> lists.sourceforge.net
> > > > >
> > > >
> > https://lists.sourceforge.net/lists/listinfo/libusb-win32-devel
> > > >
> > > >
> > > > ________________________________
> > > > Get news, entertainment and everything you care about at Live.com. Check
> > it
> > > > out!
> > > >
> > -------------------------------------------------------------------------
> > > > This SF.net email is sponsored by the 2008 JavaOne(SM) Conference
> > > > Don't miss this year's exciting event. There's still time to save $100.
> > > > Use priority code J8TL2D2.
> > > >
> > http://ad.doubleclick.net/clk;198757673;13503038;p?http://java.sun.com/javaone
> > > > _______________________________________________
> > > > Libusb-win32-devel mailing list
> > > > Libusb-win32-devel <at> lists.sourceforge.net
> > > >
> > https://lists.sourceforge.net/lists/listinfo/libusb-win32-devel
> > > >
> > > >
> > >
> > >
> > -------------------------------------------------------------------------
> > > This SF.net email is sponsored by the 2008 JavaOne(SM) Conference
> > > Don't miss this year's exciting event. There's still time to save $100.
> > > Use priority code J8TL2D2.
> > >
> > http://ad.doubleclick.net/clk;198757673;13503038;p?http://java.sun.com/javaone
> > > _______________________________________________
> > > Libusb-win32-devel mailing list
> > > Libusb-win32-devel <at> lists.sourceforge.net
> > >
> > https://lists.sourceforge.net/lists/listinfo/libusb-win32-devel
> >
> >
> > ________________________________
> > Invite your mail contacts to join your friends list with Windows Live
> > Spaces. It's easy! Try it!
> > -------------------------------------------------------------------------
> > This SF.net email is sponsored by the 2008 JavaOne(SM) Conference
> > Don't miss this year's exciting event. There's still time to save $100.
> > Use priority code J8TL2D2.
> > http://ad.doubleclick.net/clk;198757673;13503038;p?http://java.sun.com/javaone
> > _______________________________________________
> > Libusb-win32-devel mailing list
> > Libusb-win32-devel <at> lists.sourceforge.net
> > https://lists.sourceforge.net/lists/listinfo/libusb-win32-devel
> >
> >
>
> -------------------------------------------------------------------------
> This SF.net email is sponsored by the 2008 JavaOne(SM) Conference
> Don't miss this year's exciting event. There's still time to save $100.
> Use priority code J8TL2D2.
> http://ad.doubleclick.net/clk;198757673;13503038;p?http://java.sun.com/javaone
> _______________________________________________
> Libusb-win32-devel mailing list
> Libusb-win32-devel <at> lists.sourceforge.net
> https://lists.sourceforge.net/lists/listinfo/libusb-win32-devel


Get news, entertainment and everything you care about at Live.com. Check it out!
-------------------------------------------------------------------------
This SF.net email is sponsored by the 2008 JavaOne(SM) Conference 
Don't miss this year's exciting event. There's still time to save $100. 
Use priority code J8TL2D2. 
http://ad.doubleclick.net/clk;198757673;13503038;p?http://java.sun.com/javaone
_______________________________________________
Libusb-win32-devel mailing list
Libusb-win32-devel <at> lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/libusb-win32-devel
Taimoor Mirza | 6 May 2008 10:53
Picon
Favicon

Re: Problem with DeviceIoControl


Hi all,
 
I've finally resolved the problem. The problem was actually with my application calling thie usb_control_msg API of LIBUSB with wrong value of size parameter.
 
Anyways Thanks to all of you and especially hats off for stephen for bearing with me.
 
Best Regards,
Taimoor
From: mooni_mirza <at> hotmail.com
To: libusb-win32-devel <at> lists.sourceforge.net
Date: Tue, 6 May 2008 11:29:27 +0500
Subject: Re: [Libusb-win32-devel] Problem with DeviceIoControl

.ExternalClass .EC_hmmessage P {padding:0px;} .ExternalClass body.EC_hmmessage {font-size:10pt;font-family:Tahoma;}
Thanks Stephan,
 
I've debugged it using latest LIBUSB source code. It is actually failing in DeviceIoControl function which is returning error code 998 means ERROR_NOACCESS. Below are my findings:
 
usb_control_msg calls _usb_io_sync with following parameters
dev->impl_info : 0x00000df4 // this is fine
code:               0x00222034              // It also looks fine
out:                 0x041efd4c
out_size:           0x00000018
in :                   0x034efd00
in_size:             0x000003fc
read:                0x00000000
 
This _usb_io_sync then calls DeviceIoControl with following parameters:
dev:         0x00000df4
code:        0x00222034
out:          0x041efd4c
out_size:   0x00000018
in:            0x034efd00
in_size:      0x000003fc
NULL,
ol:         every thing is NULL in it.......looks fine
 
it fails and GetLastError returns 998............any idea Y is it failing........one thing very interesting is that what we are passing in out parameter is actually in parameter for DeviceIoControl.......you can see it here ...........you can see 3rd and 4th parameters
> Date: Mon, 5 May 2008 08:27:34 +0200
> From: ste.meyer1 <at> googlemail.com
> To: libusb-win32-devel <at> lists.sourceforge.net
> Subject: Re: [Libusb-win32-devel] Problem with DeviceIoControl
>
> These constants are defined in the Makefile. Just pass these constants
> as command line arguments to your compiler if you're not using GCC.
>
> Stephan
>
>
> On 5/5/08, Taimoor Mirza <mooni_mirza <at> hotmail.com> wrote:
> > Stephen,
> >
> > I tried to compile this windows.c with other files of libusb and I am
> > getting following errors:
> >
> > 1>Compiling...
> > 1>windows.c
> > 1>.\windows.c(56) : error C2065: 'VERSION_MAJOR' : undeclared identifier
> > 1>.\windows.c(56) : error C2099: initializer is not a constant
> > 1>.\windows.c(57) : error C2065: 'VERSION_MINOR' : undeclared identifier
> > 1>.\windows.c(57) : error C2099: initializer is not a constant
> > 1>.\windows.c(58) : error C2065: 'VERSION_MICRO' : undeclared identifier
> > 1>.\windows.c(58) : error C2099: initializer is not a constant
> > 1>.\windows.c(59) : error C2065: 'VERSION_NANO' : undeclared identifier
> > 1>.\windows.c(59) : error C2099: initializer is not a constant
> > 1>.\windows.c(64) : error C2143: syntax error : missing ')' before '*'
> > 1>.\windows.c(64) : error C2143: syntax error : missing '{' before '*'
> > 1>.\windows.c(64) : error C2059: syntax error : 'type'
> > 1>.\windows.c(66) : error C2059: syntax error : ')'
> > 1>.\windows.c(67) : error C2143: syntax error : missing ')' before '*'
> > 1>.\windows.c(67) : error C2143: syntax error : missing '{' before '*'
> > 1>.\windows.c(67) : error C2059: syntax error : 'type'
> > 1>.\windows.c(69) : error C2059: syntax error : ')'
> > 1>.\windows.c(73) : error C2143: syntax error : missing ')' before '*'
> > 1>.\windows.c(73) : error C2143: syntax error : missing '{' before '*'
> > 1>.\windows.c(73) : error C2059: syntax error : 'type'
> > 1>.\windows.c(73) : error C2059: syntax error : ')'
> > 1>.\windows.c(121) : error C2143: syntax error : missing ')' before '*'
> > 1>.\windows.c(121) : error C2143: syntax error : missing '{' before '*'
> > 1>.\windows.c(121) : error C2059: syntax error : ')'
> > 1>.\windows.c(122) : error C2054: expected '(' to follow 'dev'
> > 1>.\windows.c(184) : error C2143: syntax error : missing ')' before '*'
> > 1>.\windows.c(184) : error C2143: syntax error : missing '{' before '*'
> > 1>.\windows.c(184) : error C2059: syntax error : ')'
> > 1>.\windows.c(185) : error C2054: expected '(' to follow 'dev'
> > 1>.\windows.c(202) : error C2143: syntax error : missing ')' before '*'
> > 1>.\windows.c(202) : error C2143: syntax error : missing '{' before '*'
> > 1>.\windows.c(202) : error C2059: syntax error : 'type'
> > 1>.\windows.c(202) : error C2059: syntax error : ')'
> > 1>.\windows.c(242) : error C2143: syntax error : missing ')' before '*'
> > 1>.\windows.c(242) : error C2143: syntax error : missing '{' before '*'
> > 1>.\windows.c(242) : error C2059: syntax error : 'type'
> > 1>.\windows.c(242) : error C2059: syntax error : ')'
> > 1>.\windows.c(281) : error C2143: syntax error : missing ')' before '*'
> > 1>.\windows.c(281) : error C2143: syntax error : missing '{' before '*'
> > 1>.\windows.c(281) : error C2059: syntax error : 'type'
> > 1>.\windows.c(281) : error C2059: syntax error : ')'
> > 1>.\windows.c(316) : error C2143: syntax error : missing ')' before '*'
> > 1>.\windows.c(316) : error C2143: syntax error : missing '{' before '*'
> > 1>.\windows.c(316) : error C2059: syntax error : 'type'
> > 1>.\windows.c(316) : error C2059: syntax error : ')'
> > 1>.\windows.c(359) : error C2143: syntax error : missing ')' before '*'
> > 1>.\windows.c(359) : error C2143: syntax error : missing '{' before '*'
> > 1>.\windows.c(359) : error C2059: syntax error : 'type'
> > 1>.\windows.c(361) : error C2059: syntax error : ')'
> > 1>.\windows.c(483) : error C2065: 'ETIMEDOUT' : undeclared identifier
> > 1>.\windows.c(550) : error C2143: syntax error : missing ')' before '*'
> > 1>.\windows.c(550) : error C2143: syntax error : missing '{' before '*'
> > 1>.\windows.c(550) : error C2059: syntax error : 'type'
> > 1>.\windows.c(552) : error C2059: syntax error : ')'
> > 1>.\windows.c(596) : error C2143: syntax error : missing ')' before '*'
> > 1>.\windows.c(596) : error C2143: syntax error : missing '{' before '*'
> > 1>.\windows.c(596) : error C2059: syntax error : 'type'
> > 1>.\windows.c(597) : error C2059: syntax error : ')'
> > 1>.\windows.c(603) : error C2143: syntax error : missing ')' before '*'
> > 1>.\windows.c(603) : error C2143: syntax error : missing '{' before '*'
> > 1>.\windows.c(603) : error C2059: syntax error : 'type'
> > 1>.\windows.c(604) : error C2059: syntax error : ')'
> > 1>.\windows.c(610) : error C2143: syntax error : missing ')' before '*'
> > 1>.\windows.c(610) : error C2143: syntax error : missing '{' before '*'
> > 1>.\windows.c(610) : error C2059: syntax error : 'type'
> > 1>.\windows.c(611) : error C2059: syntax error : ')'
> > 1>.\windows.c(617) : error C2143: syntax error : missing ')' before '*'
> > 1>.\windows.c(617) : error C2143: syntax error : missing '{' before '*'
> > 1>.\windows.c(617) : error C2059: syntax error : 'type'
> > 1>.\windows.c(618) : error C2059: syntax error : ')'
> > 1>.\windows.c(624) : error C2143: syntax error : missing ')' before '*'
> > 1>.\windows.c(624) : error C2143: syntax error : missing '{' before '*'
> > 1>.\windows.c(624) : error C2059: syntax error : 'type'
> > 1>.\windows.c(625) : error C2059: syntax error : ')'
> > 1>.\windows.c(635) : error C2143: syntax error : missing ')' before '*'
> > 1>.\windows.c(635) : error C2143: syntax error : missing '{' before '*'
> > 1>.\windows.c(635) : error C2059: syntax error : 'type'
> > 1>.\windows.c(635) : error C2059: syntax error : ')'
> > 1>.\windows.c(645) : error C2143: syntax error : missing ')' before '*'
> > 1>.\windows.c(645) : error C2143: syntax error : missing '{' before '*'
> > 1>.\windows.c(645) : error C2059: syntax error : 'type'
> > 1>.\windows.c(646) : error C2059: syntax error : ')'
> > 1>.\windows.c(656) : error C2143: syntax error : missing ')' before '*'
> > 1>.\windows.c(656) : error C2143: syntax error : missing '{' before '*'
> > 1>.\windows.c(656) : error C2059: syntax error : 'type'
> > 1>.\windows.c(657) : error C2059: syntax error : ')'
> >
> > Where is this VERSION_MAJOR and other macros are declared? Any idea?
> >
> > -Taimoor
> >
> >
> > > Date: Wed, 30 Apr 2008 08:42:21 +0200
> >
> > > From: ste.meyer1 <at> googlemail.com
> > > To: libusb-win32-devel <at> lists.sourceforge.net
> > > Subject: Re: [Libusb-win32-devel] Problem with DeviceIoControl
> > >
> > > Please try the latest windows.c from the SVN
> > >
> > (http://libusb-win32.svn.sourceforge.net/viewvc/libusb-win32/trunk/libusb/src/)
> > >
> > > There had been some changes since the last release.
> > >
> > > Stephan
> > >
> > >
> > >
> > > On 4/30/08, Taimoor Mirza <mooni_mirza <at> hotmail.com> wrote:
> > > > Well actually the problem that I am getting is the one I mentioned in
> > last
> > > > paragraph of my email i.e. I am actually trying to communicate with a
> > > > printer device using libusb.lib and driver dll. I installed driver
> > > > successfully and my testlibusb-win.exe is running fine.
> > > >
> > > > But the problem is that in my application when call usb_control_msg to
> > send
> > > > class specific request to get device ID of my printer device it returns
> > -5.
> > > >
> > > > Parameters I am passing to this call are
> > > > bmRequestType = 0xa1
> > > > bRequest = 0x00 // Class specific request to get device Id
> > > >
> > > > Now I don't know why is it happening.I've used usb analyzer to check
> > whether
> > > > printer device is rejecting this request or something else. What I've
> > found
> > > > out is that usb_control_msg does not send this request to usb bus.
> > > >
> > > > I then thought to debug it myself........for that I took the source code
> > of
> > > > libusb and built my own library and dll....just to debug. But doing so I
> > > > found out that I am getting error in DeviceIoControl method in
> > > > usb_os_find_devices of windows.c.
> > > >
> > > > I hope you've got my point..........
> > > >
> > > > > Date: Tue, 29 Apr 2008 15:05:30 +0200
> > > > > From: ste.meyer1 <at> googlemail.com
> > > > > To: libusb-win32-devel <at> lists.sourceforge.net
> > > > > Subject: Re: [Libusb-win32-devel] Problem with DeviceIoControl
> > > >
> > > > >
> > > > > What is LIBUSB_IOCTL_GET_DEVICE_INFO?
> > > > > Why aren't you using the DLL that comes with the driver?
> > > > >
> > > > >
> > > > > On 4/29/08, Taimoor Mirza <mooni_mirza <at> hotmail.com> wrote:
> > > > > > Hi all,
> > > > > >
> > > > > > I am trying to run my application for printer device. I've installed
> > > > device
> > > > > > driver for this device but I am getting a problem in my
> > > > usb_os_find_devices
> > > > > > method in windows.c . In this method my CreateFile runs successfully
> > and
> > > > > > returned me handle of device.
> > > > > >
> > > > > > But after that when DeviceIoControl method is called it fails. I've
> > > > checked
> > > > > > the error message using GetLastError and it is returning 87 means
> > > > > > INVALID_PARAMETER. Below is code of usb_os_find_devices method
> > > > > >
> > > > > >
> > > > > >
> > > > > > handle = CreateFile(dev->filename, 0, 0, NULL, OPEN_EXISTING,
> > > > > > FILE_ATTRIBUTE_NORMAL, NULL);
> > > > > >
> > > > > > if(handle == INVALID_HANDLE_VALUE)
> > > > > > {
> > > > > > free(dev);
> > > > > > stat = GetLastError();
> > > > > > continue;
> > > > > > }
> > > > > >
> > > > > > if(!DeviceIoControl(handle, LIBUSB_IOCTL_GET_DEVICE_INFO,
> > > > > > &req, sizeof(libusb_request),
> > > > > > &req, sizeof(libusb_request),
> > > > > > &ret, NULL))
> > > > > > {
> > > > > > USB_MESSAGE_STR(LIBUSB_DEBUG_ERR,
> > "usb_os_find_devices:
> > > > > > getting "
> > > > > > "device info failed");
> > > > > > CloseHandle(handle);
> > > > > > stat = GetLastError();
> > > > > >
> > > > > > ...................
> > > > > >
> > > > > > Any clue? One more thing is that if I use libusb library then it
> > does
> > > > not
> > > > > > give this problem. But in that case when I call usb_control_msg to
> > send
> > > > > > class specific request to get device ID of my printer device it
> > returns
> > > > -5.
> > > > > > Parameters I am passing to this call are
> > > > > > bmRequestType = 0xa1
> > > > > > bRequest = 0x00 // Class specific request to get device Id
> > > > > >
> > > > > > -mooni
> > > > > >
> > > > > >
> > > > > >
> > > > > > ________________________________
> > > > > > Discover the new Windows Vista Learn more!
> > > > > >
> > > >
> > -------------------------------------------------------------------------
> > > > > > This SF.net email is sponsored by the 2008 JavaOne(SM) Conference
> > > > > > Don't miss this year's exciting event. There's still time to save
> > $100.
> > > > > > Use priority code J8TL2D2.
> > > > > >
> > > >
> > http://ad.doubleclick.net/clk;198757673;13503038;p?http://java.sun.com/javaone
> > > > > > _______________________________________________
> > > > > > Libusb-win32-devel mailing list
> > > > > > Libusb-win32-devel <at> lists.sourceforge.net
> > > > > >
> > > >
> > https://lists.sourceforge.net/lists/listinfo/libusb-win32-devel
> > > > > >
> > > > > >
> > > > >
> > > > >
> > > >
> > -------------------------------------------------------------------------
> > > > > This SF.net email is sponsored by the 2008 JavaOne(SM) Conference
> > > > > Don't miss this year's exciting event. There's still time to save
> > $100.
> > > > > Use priority code J8TL2D2.
> > > > >
> > > >
> > http://ad.doubleclick.net/clk;198757673;13503038;p?http://java.sun.com/javaone
> > > > > _______________________________________________
> > > > > Libusb-win32-devel mailing list
> > > > > Libusb-win32-devel <at> lists.sourceforge.net
> > > > >
> > > >
> > https://lists.sourceforge.net/lists/listinfo/libusb-win32-devel
> > > >
> > > >
> > > > ________________________________
> > > > Get news, entertainment and everything you care about at Live.com. Check
> > it
> > > > out!
> > > >
> > -------------------------------------------------------------------------
> > > > This SF.net email is sponsored by the 2008 JavaOne(SM) Conference
> > > > Don't miss this year's exciting event. There's still time to save $100.
> > > > Use priority code J8TL2D2.
> > > >
> > http://ad.doubleclick.net/clk;198757673;13503038;p?http://java.sun.com/javaone
> > > > _______________________________________________
> > > > Libusb-win32-devel mailing list
> > > > Libusb-win32-devel <at> lists.sourceforge.net
> > > >
> > https://lists.sourceforge.net/lists/listinfo/libusb-win32-devel
> > > >
> > > >
> > >
> > >
> > -------------------------------------------------------------------------
> > > This SF.net email is sponsored by the 2008 JavaOne(SM) Conference
> > > Don't miss this year's exciting event. There's still time to save $100.
> > > Use priority code J8TL2D2.
> > >
> > http://ad.doubleclick.net/clk;198757673;13503038;p?http://java.sun.com/javaone
> > > _______________________________________________
> > > Libusb-win32-devel mailing list
> > > Libusb-win32-devel <at> lists.sourceforge.net
> > >
> > https://lists.sourceforge.net/lists/listinfo/libusb-win32-devel
> >
> >
> > ________________________________
> > Invite your mail contacts to join your friends list with Windows Live
> > Spaces. It's easy! Try it!
> > -------------------------------------------------------------------------
> > This SF.net email is sponsored by the 2008 JavaOne(SM) Conference
> > Don't miss this year's exciting event. There's still time to save $100.
> > Use priority code J8TL2D2.
> > http://ad.doubleclick.net/clk;198757673;13503038;p?http://java.sun.com/javaone
> > _______________________________________________
> > Libusb-win32-devel mailing list
> > Libusb-win32-devel <at> lists.sourceforge.net
> > https://lists.sourceforge.net/lists/listinfo/libusb-win32-devel
> >
> >
>
> -------------------------------------------------------------------------
> This SF.net email is sponsored by the 2008 JavaOne(SM) Conference
> Don't miss this year's exciting event. There's still time to save $100.
> Use priority code J8TL2D2.
> http://ad.doubleclick.net/clk;198757673;13503038;p?http://java.sun.com/javaone
> _______________________________________________
> Libusb-win32-devel mailing list
> Libusb-win32-devel <at> lists.sourceforge.net
> https://lists.sourceforge.net/lists/listinfo/libusb-win32-devel


Get news, entertainment and everything you care about at Live.com. Check it out!

Explore the seven wonders of the world Learn more!
-------------------------------------------------------------------------
This SF.net email is sponsored by the 2008 JavaOne(SM) Conference 
Don't miss this year's exciting event. There's still time to save $100. 
Use priority code J8TL2D2. 
http://ad.doubleclick.net/clk;198757673;13503038;p?http://java.sun.com/javaone
_______________________________________________
Libusb-win32-devel mailing list
Libusb-win32-devel <at> lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/libusb-win32-devel
Taimoor Mirza | 6 May 2008 13:41
Picon
Favicon

An urgent query regarding LIBUSB

Hi everyone,
 
Does LIBUSB support isochronous transfer? Which API should I use for this?
 
-Taimoor
 
 

Connect to the next generation of MSN Messenger  Get it now!
-------------------------------------------------------------------------
This SF.net email is sponsored by the 2008 JavaOne(SM) Conference 
Don't miss this year's exciting event. There's still time to save $100. 
Use priority code J8TL2D2. 
http://ad.doubleclick.net/clk;198757673;13503038;p?http://java.sun.com/javaone
_______________________________________________
Libusb-win32-devel mailing list
Libusb-win32-devel <at> lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/libusb-win32-devel
Xiaofan Chen | 6 May 2008 14:05
Picon

Re: An urgent query regarding LIBUSB

On Tue, May 6, 2008 at 7:41 PM, Taimoor Mirza <mooni_mirza <at> hotmail.com> wrote:
>  Does LIBUSB support isochronous transfer? Which API should I use for this?
>

Yes, at least libusb-win32 does support isochronous transfer. I tried
it once but
I do not understand it well.

My example based on "copy and paste".
http://article.gmane.org/gmane.comp.lib.libusb.devel.windows/1439

libusb-0.1.x under Linux does not support isochronous transfer.
The new libubs-1.0 and openusb (both under development)
will support isochronous transfer under Linux.

Xiaofan
http://mcuee.blogspot.com

-------------------------------------------------------------------------
This SF.net email is sponsored by the 2008 JavaOne(SM) Conference 
Don't miss this year's exciting event. There's still time to save $100. 
Use priority code J8TL2D2. 
http://ad.doubleclick.net/clk;198757673;13503038;p?http://java.sun.com/javaone
Taimoor Mirza | 8 May 2008 08:43
Picon
Favicon

Why do we need usb_set_configuration API

Hi all,
 
I am confused about a little thing. Why do we need usb_set_configuration API when we have standard usb request for set configuration?
 
And also what is diffferenc is passing LIBUSB_USB_REQ_SET_INTERFACE setup request and calling usb_claim_interface? Aren't they same?
 
-Taimoor

Explore the seven wonders of the world Learn more!
-------------------------------------------------------------------------
This SF.net email is sponsored by the 2008 JavaOne(SM) Conference 
Don't miss this year's exciting event. There's still time to save $100. 
Use priority code J8TL2D2. 
http://ad.doubleclick.net/clk;198757673;13503038;p?http://java.sun.com/javaone
_______________________________________________
Libusb-win32-devel mailing list
Libusb-win32-devel <at> lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/libusb-win32-devel

Gmane