How to figure out boot drive during start-device

Hello,

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
C: drive.

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?

Thanks!!!

Ron

Just following up on the question I posted earlier. Basically we need to figure out how to tell if a Physical device object in the AddDevice or StartDevice handler is for the boot drive. It would also probably work if we could tell what drive letter is (or will be) assigned to the device object.

Can anyone help???

Thanks!

Ron

In the deviceObject flags field there is a flag called
DO_SYSTEM_BOOT_PARTITION. This flag will be set for the “BOOT” volume.
This flag exists in NT4 and later, I don’t know about releases before
that.

Note that the “boot” volume is the volume that contains “\winnt”. This
flag is not set for the “system” volume, which is the volume that
contains “ntldr\boot.ini”, unless they happen to be the same volume.

Neal Christiansen

-----Original Message-----
From: xxxxx@centuriontech.com
[mailto:xxxxx@centuriontech.com]
Sent: Thursday, April 13, 2000 3:14 AM
To: File Systems Developers
Subject: [ntfsd] How to figure out boot drive during start-device

Hello,

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
C: drive.

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?

Thanks!!!

Ron


You are currently subscribed to ntfsd as: xxxxx@Exchange.Microsoft.com
To unsubscribe send a blank email to $subst(‘Email.Unsub’)