Re: USBAttachDevice : LPCUSB_INTERFACE UsbInterface = NULL
- From: Rob <Rob@xxxxxxxxxxxxxxxxxxxxxxxxx>
- Date: Tue, 3 Jun 2008 10:46:07 -0700
Hi,
I'm not sure what you mean by "first time". (first time device is plugged in?)
The code that failed was a 1-on-1 copy of the USBPRN driver.
Or do you mean that USBAttach device is called multiple times ? (did not see
that)
I ommitted the problem nog by just not using the pointer.
(it's only used in 1 place, for a check that I don't think I need.)
My device is reported as having 2 interfaces, the second one having 2
endpoints (bulk_in/bulk_out).
I am guessing that that's the one I need, but that's just guesswork sofar.
The interface class for that interface is reported as 10, I have searched
everywhere for a list of interface classes numbers (note: not the GUID) and
their meaning, but have not found it yet. So I just assumed it would be
correct and adjusted the software-checks accordingly.
ActivateDevice & Init are beeing called in my driver now, tomorrow I will
try to open the device and read from it. It would suprise me if it works the
first try....
In the mean time any tips that might help me are welcome.
Greetings,
Rob.
"Michael" wrote:
On 3 juin, 16:23, Rob <R...@xxxxxxxxxxxxxxxxxxxxxxxxx> wrote:.
Is is passed from USBD hardcoded NULL....
so I guess the printer sample would just crash ?
strange...
Rob.
"Rob" wrote:
Hi,
I am building an USB-CDC driver.
I started from scratch with just the basic stream interface.
At this point, I plug in my device, it is recognized from the regsettings I
made, my DLL is loaded, and USBDeviceAttach is called.
From this point, I am using the PRN driver as an example.
I copied ParseUsbDescriptors() but this fails.
(do I need it anyway ?, the device is already the right one, else my driver
wouldn't have been loaded... (???), or is it also loaded under differrent
circumstances ? )
It fails because the UsbInterface pointer passed to USBAttachDevice is NULL.
Why is that ?
BOOL USBDeviceAttach( USB_HANDLE hDevice,LPCUSB_FUNCS UsbFuncs,
LPCUSB_INTERFACE UsbInterface,LPCWSTR UniqueDriverId,
LPBOOL AcceptControl, LPCUSB_DRIVER_SETTINGS UsbDriverSettings,
DWORD Unused)
Greetings,
Rob.
This is only passed the first time at NULL (at device level). Then for
each interface, a pointer on the interface is passed... That's the way
the printer, the mass storage, .. work...
HTH
Mike
- Follow-Ups:
- References:
- Prev by Date: SanDisk mDOC
- Next by Date: Re: Reading MAC Address
- Previous by thread: Re: USBAttachDevice : LPCUSB_INTERFACE UsbInterface = NULL
- Next by thread: Re: USBAttachDevice : LPCUSB_INTERFACE UsbInterface = NULL
- Index(es):
Relevant Pages
|