I have a KMDF filter driver that is able to attach to media class devices and it can selectively block I/O. I need to be able to limit the scope to input devices like microphones while leaving output devices like speakers unaffected. When they are separate devices the simple strategy works fine, but when a single device contains speakers and a mic, for example, then it’s an all or nothing proposition which isn’t sufficient.
From what I can tell by the time the IOCTL_KS_* requests arrive the destination is already decided, I just can’t quite tell how. How can I correlate which file objects relate to which pin categories to know whether or not I want to block a particular request? I’ve tried looking at the DirectKS sample and ksuser.dll and when they create a handle, which will get an eventual IOCTL_KS_* sent to it, they seem to do the NtCreateFile passing the handle to the filter (audio filter, not filter driver) as the root directory of the objAttr and then passing some undocumented GUID as the filename. I’m not really following how this is mapped…
Thanks for reading!
-JT