Any clarifications/pointers most welcome.
(Background: I've added a IOCTL interface to the MSVAD sample which allows
the device to be accessed via CreateFile() and DeviceIoControl(). This all
works fine.)
An old thread
(//www.freelists.org/post/wdmaudiodev/Overriding-IRP-MJ-DEVICE-CONTROL-
handling-is-possible,6) describes how to check the origin of an incoming
IRP. Part of the process is to test stack->fileobject->filename to see it
matches a device name registered earlier in the driver's AddDevice()
function. Given that this is a WDM driver I've been using
IoRegisterDeviceInterface(..,&KSCATEGORY_RENDER,..) to do this.
A userland enumeration of the devices matching KSCATEGORY_RENDER gives me
this:
\\?\root#media#0000#{65e8773e-8f56-11d0-a3b9-00a0c9223196} => matches string
returned by IoRegisterDeviceInterface()
\\?\root#media#0000#{65e8773e-8f56-11d0-a3b9-00a0c9223196}\wave
Now, if I try and open using the first name, CreateFile() fails. If I use
the second variety, all is OK and things are accessible via
DeviceIoControl().
Finally, then, returning to the IRP origin check. When a userland app opens
the device, the stack->fileobject->filename contains '\wave'. That's all, no
GUID string in the name.
If you are still reading, thanks! Questions arising then are:
1. What is adding the \wave to the devicename?
2. Can this controlled by what is specified in the AddInterface
section of .INF file? A quick experiment indicates not .
3. If not, can this naming be relied on . ?
Hope this is clear.
Muchas gracias.
Jerry.