UMDF USB filter driver woes

My company has a USB driver in the wild which I would like to put a user-mode filter over the top of. I am skeptically comfortable enough writing the code aspects of this project, but where I keep running into problems is with the installation side of things. The INF files I try to create to install this filter keep coming up non-functional. It doesn’t help that this would be my first attempt at writing a driver.

So I have a few questions for brighter minds to ponder:

  1. I am trying to catch all device open and close events (ie: CreateFile and CloseHandle) for a specific device class. Is a user mode filter even the correct way to go?

  2. Can I create a “stand-alone” INF file to install my filter, knowing the device class description of the devices I am targeting? Or do I have to modify the existing INF files to add in my filter sections? This would be difficult for me to do, as I have to deal with drivers already installed in the wild.

  3. Is there a resource I can read for the syntax and semantics of an INF file? My copy of Developing Drivers w/WDF discusses INF files very briefly, but I’ve not found any in-depth discussion on the topic of how to do what I’m after properly.

Thank you in advance for any insight you can provide. If you need more information, I’d be happy to give it.

> 0) I am trying to catch all device open and close events (ie: CreateFile and CloseHandle) for a

specific device class. Is a user mode filter even the correct way to go?

No need in an INF, just write your driver to class’s UpperFilters registry key by a small C app calling RegXxx APIs. Then reboot, or restart all devices of this class using SetupDi APIs.

  1. Is there a resource I can read for the syntax and semantics of an INF file?

MSDN Library and lots of samples in \windows\inf


Maxim S. Shatskih
Windows DDK MVP
xxxxx@storagecraft.com
http://www.storagecraft.com