Sending IOCTLs to USBD from a HID filter driver.

Hi all,

I’m a newbie of kernel programming and I came across this problem:
I wrote a filter driver that should sit on top of HIDUSB in order to
filter mouse reports going to MouClass.
The mouse I’m working with has a special feature that can be enabled by
a Device Set Feature.

So, I use UsbBuildFeatureRequest with
URB_FUNCTION_SET_FEATURE_TO_DEVICE and I use together with
IoBuildDeviceIoControlRequest to build the right irp.

When it comes to IoCallDriver I start wondering who should be the
target of the call.
I already tried to send it to the PDO and to the Device Object returned
by the IoAttachDeviceToDeviceStack but with no luck. I guess my driver
is just to high in the chain…

If this is the case, how do I walk through the chain up to the USBD
instance corresponding to my device?

Thanks a lot,
Marco.

If you are sitting in the mouse class, you do not communicate with URBs.
You communicate via the HID protocol. There is no way to walk down the
chain below your PDO. Instead, you send a HID set feature request to
the attached device below you (not directly to the PDO, there could be
other drivers in between you and the PDO…but the attached device could
be the PDO).

The firefly example in the DDK clearly shows how you can set a feature
within a filter driver. Note that to send HID requests, you must have a
PFILE_OBJECT. In the firefly example, see vfeature.c and the function
FireflySetFeature()

d

-----Original Message-----
From: xxxxx@lists.osr.com
[mailto:xxxxx@lists.osr.com] On Behalf Of Marco Laurenzano
Sent: Tuesday, April 12, 2005 10:18 AM
To: Windows System Software Devs Interest List
Subject: [ntdev] Sending IOCTLs to USBD from a HID filter driver.

Hi all,

I’m a newbie of kernel programming and I came across this problem:
I wrote a filter driver that should sit on top of HIDUSB in order to
filter mouse reports going to MouClass.
The mouse I’m working with has a special feature that can be enabled by
a Device Set Feature.

So, I use UsbBuildFeatureRequest with
URB_FUNCTION_SET_FEATURE_TO_DEVICE and I use together with
IoBuildDeviceIoControlRequest to build the right irp.

When it comes to IoCallDriver I start wondering who should be the
target of the call.
I already tried to send it to the PDO and to the Device Object returned
by the IoAttachDeviceToDeviceStack but with no luck. I guess my driver
is just to high in the chain…

If this is the case, how do I walk through the chain up to the USBD
instance corresponding to my device?

Thanks a lot,
Marco.


Questions? First check the Kernel Driver FAQ at
http://www.osronline.com/article.cfm?id=256

You are currently subscribed to ntdev as: xxxxx@windows.microsoft.com
To unsubscribe send a blank email to xxxxx@lists.osr.com

hi, it really seems in the right direction however I couldn’t find the
firefly example in the WinXP DDK.
I looked for it on the microsoft site and the only thing I found is an
article called “Developing a Device Driver Using Windows Driver Framework”
where the also mention the firefly example in the DDK.
I guess the DDK I have is too old… could you please copy/paste a snippet
of code?

Thanks a lot,
Marco.

If you are sitting in the mouse class, you do not communicate with
URBs.
You communicate via the HID protocol. There is no way to walk down
the
chain below your PDO. Instead, you send a HID set feature request
to
the attached device below you (not directly to the PDO, there could
be
other drivers in between you and the PDO…but the attached device
could
be the PDO).

The firefly example in the DDK clearly shows how you can set a
feature
within a filter driver. Note that to send HID requests, you must
have a
PFILE_OBJECT. In the firefly example, see vfeature.c and the
function
FireflySetFeature()

d

-----Original Message-----
From: xxxxx@lists.osr.com
[mailto:xxxxx@lists.osr.com] On Behalf Of Marco
Laurenzano
Sent: Tuesday, April 12, 2005 10:18 AM
To: Windows System Software Devs Interest List
Subject: [ntdev] Sending IOCTLs to USBD from a HID filter driver.

Hi all,

I’m a newbie of kernel programming and I came across this problem:
I wrote a filter driver that should sit on top of HIDUSB in order to
filter mouse reports going to MouClass.
The mouse I’m working with has a special feature that can be enabled
by
a Device Set Feature.

So, I use UsbBuildFeatureRequest with
URB_FUNCTION_SET_FEATURE_TO_DEVICE and I use together with
IoBuildDeviceIoControlRequest to build the right irp.

When it comes to IoCallDriver I start wondering who should be the
target of the call.
I already tried to send it to the PDO and to the Device Object
returned
by the IoAttachDeviceToDeviceStack but with no luck. I guess my
driver
is just to high in the chain…

If this is the case, how do I walk through the chain up to the USBD
instance corresponding to my device?

Thanks a lot,
Marco.


Questions? First check the Kernel Driver FAQ at
http://www.osronline.com/article.cfm?id=256

You are currently subscribed to ntdev as:
xxxxx@windows.microsoft.com
To unsubscribe send a blank email to xxxxx@lists.osr.com

You need to order the server 2003 DDK from the website. I cannot send
you code from a released DDK.

d

-----Original Message-----
From: xxxxx@lists.osr.com
[mailto:xxxxx@lists.osr.com] On Behalf Of Marco Laurenzano
Sent: Tuesday, April 12, 2005 4:48 PM
To: Windows System Software Devs Interest List
Subject: Re:[ntdev] Sending IOCTLs to USBD from a HID filter driver.

hi, it really seems in the right direction however I couldn’t find the
firefly example in the WinXP DDK.
I looked for it on the microsoft site and the only thing I found is an
article called “Developing a Device Driver Using Windows Driver
Framework”
where the also mention the firefly example in the DDK.
I guess the DDK I have is too old… could you please copy/paste a
snippet
of code?

Thanks a lot,
Marco.

If you are sitting in the mouse class, you do not communicate
with
URBs.
You communicate via the HID protocol. There is no way to walk
down
the
chain below your PDO. Instead, you send a HID set feature
request
to
the attached device below you (not directly to the PDO, there
could
be
other drivers in between you and the PDO…but the attached
device
could
be the PDO).

The firefly example in the DDK clearly shows how you can set a
feature
within a filter driver. Note that to send HID requests, you
must
have a
PFILE_OBJECT. In the firefly example, see vfeature.c and the
function
FireflySetFeature()

d

-----Original Message-----
From: xxxxx@lists.osr.com
[mailto:xxxxx@lists.osr.com] On Behalf Of Marco
Laurenzano
Sent: Tuesday, April 12, 2005 10:18 AM
To: Windows System Software Devs Interest List
Subject: [ntdev] Sending IOCTLs to USBD from a HID filter
driver.

Hi all,

I’m a newbie of kernel programming and I came across this
problem:
I wrote a filter driver that should sit on top of HIDUSB in
order to
filter mouse reports going to MouClass.
The mouse I’m working with has a special feature that can be
enabled
by
a Device Set Feature.

So, I use UsbBuildFeatureRequest with
URB_FUNCTION_SET_FEATURE_TO_DEVICE and I use together with
IoBuildDeviceIoControlRequest to build the right irp.

When it comes to IoCallDriver I start wondering who should be
the
target of the call.
I already tried to send it to the PDO and to the Device Object
returned
by the IoAttachDeviceToDeviceStack but with no luck. I guess my
driver
is just to high in the chain…

If this is the case, how do I walk through the chain up to the
USBD
instance corresponding to my device?

Thanks a lot,
Marco.


Questions? First check the Kernel Driver FAQ at
http://www.osronline.com/article.cfm?id=256

You are currently subscribed to ntdev as:
xxxxx@windows.microsoft.com
To unsubscribe send a blank email to
xxxxx@lists.osr.com


Questions? First check the Kernel Driver FAQ at
http://www.osronline.com/article.cfm?id=256

You are currently subscribed to ntdev as: xxxxx@windows.microsoft.com
To unsubscribe send a blank email to xxxxx@lists.osr.com