If you get the pointer to \device\harddisk(n)\partition(n) using
IoGetDeviceObjectPointer(), you will get a pointer to the partitions device
object. If you want the physical disk device object, you need to get the
pointer to \device\harddisk(n)\partition0.
Is there a possibility that a filter driver is loaded over the partition
device object?
Jamey
Stan Miller wrote in message <36A3E06C...@worldnet.att.net>...
>I am trying to dynamically find the device object for a disk drive
>partition (e.g., \Device\Harddisk0\Partition1). If I use
>IoGetDeviceObjectPointer, I seem to be given back the pointer to the
>logical volume device object, not the actual disk drive partition (real
>device) device object.
>
>Can someone point me to a technique to secure the disk partition device
>object?
>
>Many thanks in advance.
>
>Stan Miller
>
>stan-...@worldnet.att.net
I'm sorry if I was not clear, and please correct me if I am wrong in
what I think I am seeing.
I am using osr's Device Tree tool and looking at the various drivers and
their device objects. I see the "Disk" driver and a device object for
each of the partitions on my hard disk (\Device\Harddisk0\Partition0,
\Device\Harddisk0\Partition1, \Device\Harddisk0\Partition2, etc.). These
device objects seem to represent the "real devices" (i.e., the
partitions) on the disk (including partition0).
I also see the "Fastfat" and "Ntfs" file system drivers with an unnamed
device object for each of the disk partitions which currently has a
mounted logical volume. I am assuming that these are the device objects
representing the mounts.
When I look at the vpb information in a partition device object (i.e.,
from the "Disk" driver), I see the "real device object" address matches
the device object address for the partition, and the "device object"
address matches the address of what I assumed above is the mounted
logical volume device object.
Now, when I call IoGetDeviceObjectPointer, I get back the address of
(what I have assumed above is) the mounted logical volume device object,
not the address of the partition device object. I want the address of
the partition device object.
I hope this helps.
Thanks.
Jamey Kirby wrote:
>
> I do not quite understand your problem/question.
>
> If you get the pointer to \device\harddisk(n)\partition(n) using
> IoGetDeviceObjectPointer(), you will get a pointer to the partitions device
> object. If you want the physical disk device object, you need to get the
> pointer to \device\harddisk(n)\partition0.
>
> Is there a possibility that a filter driver is loaded over the partition
> device object?
>
> Jamey
>
> Stan Miller wrote in message <36A3E06C...@worldnet.att.net>...
Jamey
Stan Miller wrote in message <36A48A27...@worldnet.att.net>...