I don't think this is an fsd question, but the ifs kit does have some
storage filter driver examples, so I thought I would try here. Please let
me know if this is not appropriate.
We are working on a storage filter driver that is an upper class filter for
the DiskDrive class. Our desire is to filter irps that correspond to the
physical disk that holds boot disk (C: presumably)
We're having difficulty detecting which drive is being initialized from our
Add device routines (this would be the best place since we could just not
attach to the stack if we're not interested in the device object that's
being added). Microsoft was unable to help at all with this issue...
We ended up having to wait until StartDevice and using
IOCTL_STORAGE_GET_DEVICE_NUMBER ioctl to figure out what the device number
and partition numbers are (we used code similar to the
DiskPerfRegisterDevice() code that creates an "NT like" device name). Then
we assumed (incorrectly we now know) that device 0 partition 0 would be the
This works great as long as there isn't a scsi boot device installed in the
system along with an ide disk device. When we boot from a scsi disk device
and have an ide disk device in the system as well, the ide device is
designated as device 0 partition 0 but assigned d: for the drive letter
(scsi is C:).
So our question is: how can we tell, either in AddDevice (preferably) or in
StartDevice, what device object represents the boot drive?