A while back I spent a lot of time on NTDEV asking about changing the PnP
IDs in a SCSI Bus filter so the PnP system would load a different class
driver on a device. That worked fine for me, once I understood which IRPs
to muck with. I didn't get around to running verifier on it, but from
recent posts, running verifier could be a problem for me. Without Verifier,
I could change all the instances of DISK to DIAG, for a particular PDO, and
the system thought I had a DiagDevice. My Inf installs my DiagClas driver,
I can enumerate the DiagDevices with the interface GUID the DiagDevice class
driver exports, and everyone is happy.
During that discussion, one of the MS storage guys suggested that
SetupDiSetDeviceRegistryProperty, with the SPDRP_SERVICE property, could be
used to change the driver for a specific device. For another use, I don't
want to use the filter, so I'm trying to do this, with mixed results.
The registry entry gets changed OK, and stopping and restarting the device
causes my custom class driver to load, but it's not causing the PnP system
to think it's something new, the system still thinks that it's a disk, so
partmgr still attaches to it. Maybe I could use it that way, except that
enumerating the interface GUIDs for disk and my diag driver doesn't find
anything at all. So somehow this different driver in the stack for this one
devnode has not only failed to produce a DiagDevice, it causes some
impairment of the normal disk interface. I tried
SetupDiSetDeviceInterfaceDefault with the DiagClas interface GUID in the
SP_DEVICE_INTERFACE_DATA for the device, but that resulted in a 0xE0000225,
which is ERROR_NO_SUCH_DEVICE_INTERFACE, in SetupAPI.h.
Removing and re-enumerating results in my class driver not being loaded
again. This isn't a surprise, since my custom class driver isn't signed,
and probably never will be, so I expect the system to load the signed disk
driver in the absence of my filter.
So at this point, all I've done is substituted my custom class driver for
disk.sys, and that's not what I want to do. I want to remove the device as
a disk, and load it as a DiagDevice.
So my question devolves to:
Constraining to user-mode only, what else do I need to do to create a
DiagDevice, instead of a disk with a different class driver? Remember that
I can already do this OK with a filter, I'm trying to do it without using
the filter. Since SPDRP_HARDWAREID and SPDRP_COMPATIBLEIDS are R/W, should
I be changing those, too? Anything else I should change?
Thanks,
Phil
--
Philip D. Barila Windows DDK MVP
Seagate Technology, LLC
(720) 684-1842
As if I need to say it: Not speaking for Seagate.
E-mail address is pointed at a domain squatter. Use reply-to instead.