Tech Support > Microsoft Windows > Drivers > KMDF 1.1 and ReadFile requests to multiply USB pipes
KMDF 1.1 and ReadFile requests to multiply USB pipes
Posted by Darius on May 24th, 2006


Hello,

WdfDeviceConfigureRequestDispatching allows to configure only one request
type "WdfRequestTypeRead" for only one input queue.
Is it possible to get possibility to send Read requests for the same device
but to diferent IN pipes?

Thank you.
Darius

Posted by Doron Holan [MS] on May 24th, 2006


yes, for the top level queue, create a parallel queue. from that EvtIoRead
routine, you dispatch the i/o to another sub WDFQUEUE. you create the
subWDFQUEUEs when you select config on the usb device.

d

--
Please do not send e-mail directly to this alias. this alias is for
newsgroup purposes only.
This posting is provided "AS IS" with no warranties, and confers no rights.


"Darius" <Darius@discussions.microsoft.com> wrote in message
news:5D1DD5EC-DD0C-4E2B-A695-6BC223726A50@microsoft.com...


Posted by Darius on May 24th, 2006


Thanks, seems to be very simple, but how EvtIoRead can detect for which pipe
was sent Read request:
EvtDeviceIoRead( IN WDFQUEUE Queue, IN WDFREQUEST Request, IN
size_t Length )

Thanks in advance.

"Doron Holan [MS]" wrote:

Posted by Doron Holan [MS] on May 25th, 2006


typically you don't do this type of selection for read irps. more often,
you use IOCTLs for this type of behavior. the input buffer indicates the
pipe index and the output bufferis what you want read in.

alternatively, a more complex solution is that you specify the pipe index
when creating the file handle. then each file handle is tied to only one
pipe handle. you specify the pipe index by appending it to the device
interface string when you call CreateFile in the app. Then, in your
EvtDeviceFileCreate, you inspect the file name by calling
WdfFileObjectGetFileName() (and you have to handle the condition that it
returns NULL). You parse the string and then place the index in a context
in the WDFFILEOBJECT (which is created for you if you call
WdfDeviceInitSetFileObjectConfig() during deivce create). Then in
EvtIoRead, you get the fileobject from request (WdfRequestGetFileObject),
look at the index and do the right thing.

the bulkusb sample in the ddk shows how to do this in WDM if you care to
look there.

d

--
Please do not send e-mail directly to this alias. this alias is for
newsgroup purposes only.
This posting is provided "AS IS" with no warranties, and confers no rights.


"Darius" <Darius@discussions.microsoft.com> wrote in message
news:A4E1E546-3A3C-448A-9B84-AE57DE274B09@microsoft.com...



Similar Posts