Cannot send IOCTLs to filter from UM app

I have an HID filter, which is on the very top of a HID device stack. I’m trying to have a UM app send a custom IOCTL to the filter. I’ve tried to do this two ways, but failed:

  1. Use the HID GUID for the SetupDi calls and use DeviceIoControl() to send the custom IOCTL code. This results in GetLastError() returning ERROR_INVALID_FUNCTION.
  2. Use the custom interface GUID of the filter, which was created through WdfDeviceCreateDeviceInterface(). However, SetupDiEnumDeviceInterfaces() cannot enumerate any device interfaces. Thus I cannot go on and send custom IOCTLs to my filter.

Any ideas? Thanks!

I assume you are filtering hid pdos, not the parent stack which does not support opens. Not finding your custom guid is odd (assuming you are enabling it on a pnp device). How did you install the filter? Does a kernel debugger and !devstack verify you are attached to the stacks you expect?

d

Bent from my phone


From: xxxxx@gmail.commailto:xxxxx
Sent: ?4/?18/?2015 10:34 PM
To: Windows System Software Devs Interest Listmailto:xxxxx
Subject: [ntdev] Cannot send IOCTLs to filter from UM app

I have an HID filter, which is on the very top of a HID device stack. I’m trying to have a UM app send a custom IOCTL to the filter. I’ve tried to do this two ways, but failed:

1. Use the HID GUID for the SetupDi calls and use DeviceIoControl() to send the custom IOCTL code. This results in GetLastError() returning ERROR_INVALID_FUNCTION.
2. Use the custom interface GUID of the filter, which was created through WdfDeviceCreateDeviceInterface(). However, SetupDiEnumDeviceInterfaces() cannot enumerate any device interfaces. Thus I cannot go on and send custom IOCTLs to my filter.

Any ideas? Thanks!


NTDEV is sponsored by OSR

Visit the list at: http://www.osronline.com/showlists.cfm?list=ntdev

OSR is HIRING!! See http://www.osr.com/careers

For our schedule of WDF, WDM, debugging and other seminars visit:
http://www.osr.com/seminars

To unsubscribe, visit the List Server section of OSR Online at http://www.osronline.com/page.cfm?name=ListServer</mailto:xxxxx></mailto:xxxxx>

Thank you very much for pointing out that my filter is indeed attached to the device stack. Turns out that it isn’t. Now it is and I can send my custom IOCTLs and my filter receives them successfully.

my filter might not be indeed attached*