Hello Doron, thank you for your reply. I should have specified that I am using the WDM firefly sample. I am attaching my filter as an upper filter in the Enum\HID registry section under the device instance, which I take to be the PDO (please correct me if I am wrong…). I am attaching an output from the debugger of where I am in the device stack:
1: kd> !devstack 0x84999e80
!DevObj !DrvObj !DevExt ObjectName
84999e80 \Driver\Firefly 84999f38 0000005a
8499ed48 \Driver\HidUsb 8499ee00 00000059
Note that while the listing says \Driver\HidUsb, I see HIDCLASS in the stack when my completion routine is called (I suppose it is listed thus because it is a port/miniport?).
I have modified firefly very slightly, removing WMI registration/deregistration, and adding some completion routine with traces. From what I see, the mouse specific section is in the WMI path only.
The interesting thing is that I have no problem whatsoever if I attach firefly to a HID mouse, yet while if I can attach in the same manner to a game controller (again, as an upper filter in the Enum\HID section of the registry) IRP_MJ_READ for the game controller fails with 0xC00000E8, which means STATUS_INVALID_USER_BUFFER. This is most assuredly why I cannot get the properties of the game controller device in the control panel. Note that the flags for the next lower device of the filter do not specify buffered of direct I/O (flags: 0x3040), so I would guess that a user buffer is being used, and indeed, there is a usermode buffer in Irp->UserBuffer, which appears valid in the debugger, at least. Any idea on why IRP_MJ_READ is failing thus? Perhaps I should create my own read IRP, send it down, and complete the main IRP in my IRP_MJ_READ handler?
Note that the above tests were for Vista only (the failure mode on XP is different, DriverEntry is called, and then DriverUnload is immediately called without AddDevice being called, and Device Manager shows code 41). Strange.
I’m not sure I understand where you are proceeding with the statement “Have you tried installing your driver as the FDO for the HID PDO stack instead of a filter. It could be an issue that a FDO is required”. If possible, could you elaborate?
Thanks for any help with these questions,
Philip Lukidis
-----Original Message-----
From: xxxxx@lists.osr.com
[mailto:xxxxx@lists.osr.com]On Behalf Of Doron Holan
Sent: Friday, March 23, 2007 6:43 PM
To: Windows System Software Devs Interest List
Subject: RE: [ntdev] question on filtering (upper) HIDClass
I am confused as to which part of the HID stack you want to
filter. The
FDO part of HIDClass or one the raw PDOs that it enumerates? I think
you are trying to filter one of the PDOs. Have you tried attaching
firefly to the stack to see if it works? Or take firely, remove the
mouse specific goo and see if it works? Did you try this with a KMDF
driver vs a WDM driver?
Have you tried installing your driver as the FDO for the HID PDO stack
instead of a filter? It could be an issue that a FDO is required
otherwise things go haywire (I think this was true on win2k,
but not for
XP, but it doesn’t hurt to try)
d
-----Original Message-----
From: xxxxx@lists.osr.com
[mailto:xxxxx@lists.osr.com] On Behalf Of Philip Lukidis
Sent: Friday, March 23, 2007 3:29 PM
To: Windows System Software Devs Interest List
Subject: [ntdev] question on filtering (upper) HIDClass
Hello.
I am trying to filter HIDClass (upper filter), in order that I get
access to the HID report descriptor. For the time being, I
am confining
myself to my device, which is a composite USB device with two
interfaces
which are HID. At this moment, I have attached the filter manually by
adding the UpperFilters multi-string for my HID device (in
the HID enum
section, not the USB enum section).
However, as soon as I insert my filter above HIDClass, the HID device
ceases to work (it is an HID game controller), with code 41 in the
device manager (XP) or it displays fine in the device manager, but the
game controller properties are inaccessible. These failures occur
despite the fact that the filter is basically a passthrough (I’ve
removed my completion routines, and used the basic passthrough method
for all except required functions, like PnP and Power). I’ve started
working from the firefly sample, and thereafter tried a class upper
filter from the WDK, with the same result. The latter filter is
barebones indeed, and failure of the HID game controller
hints that I am
attaching the wrong part of the stack.
How should I attach above HIDClass, so I can have access to the input
reports, as well as the HID report descriptor(s)? I do need to parse
the HID report descriptors(s) so that I can make sense of the input
reports. I can get raw input reports in URBs if I filter
below HIDUsb,
but interpreting them without the HID report descriptor is another
matter.
thanks for any help,
Philip Lukidis
Questions? First check the Kernel Driver FAQ at
http://www.osronline.com/article.cfm?id=256
To unsubscribe, visit the List Server section of OSR Online at
http://www.osronline.com/page.cfm?name=ListServer
Questions? First check the Kernel Driver FAQ at
http://www.osronline.com/article.cfm?id=256
To unsubscribe, visit the List Server section of OSR Online
at http://www.osronline.com/page.cfm?name=ListServer