dynamic disk

I want to get the details of the volume on a dynamic disk.
I want to pass IOCTL_DISK_GET_DRIVELAYOUT_EX to the lower stack.
To pass this I need to know the device object.
I thought of getting the device object by using IoGetDeviceObjectPointerfunction.
I am passing the following device name to get the device object.

\device\harddiskdmvolumes\physicaldmvolumes\blockvolumex

can I use the following device name to get the device object pointer.
But how will I get the system name during the boot time??
\Device\HarddiskDmVolumes\server058\Volumex

My driver is a filter driver below file system

I also have anotehr doubt regarding dynamic disk.

whenever I pass the ioctl IOCTL_DISK_GET_DRIVE_LAYOUT_EX to a dynamic disk
I see that the partition count is always 4.
even though I have only two volume on that disk.
Is this correct???

Again when I try to check whether the 2 volumes are recognised using RecognizedPartition variable in PARTITION_INFORMATION_MBR structure I always see the first volume is the root partition only has a recognised partition.
I do something like the below in my code for basik mbr

if (!(*ppDriveLayout)->PartitionEntry[i].Mbr.RecognizedPartition)
{
continue;
}

But it succeeds only for partitionentry 0 and fails for 1,2 and so on.

any idea on this?

Generally you want to send this IOCTL to the physical disk, not to
some LDM/VDS construct. For MBR formatted physical disk partition
tables, there are always four primary partition entries, some or all
of which will be initialized. MBR Dynamic disks create one partition
that occupies all of the disk except the part they hide where they
stick their metadata. GPT dynamic disks actually create a (hidden)
partition for the metadata. As msft has re-written some of this stuff
for Vista/W2k8, they may be using a partition for the metadata on MBR
disks as well now.

Mark Roddy

On Wed, Mar 4, 2009 at 11:41 PM, wrote:
> IOCTL_DISK_GET_DRIVELAYOUT_EX

U have mentioned that"Generally you want to send this IOCTL to the physical disk, not to
some LDM/VDS construct"

so is this IOCTL_DISK_GET_DRIVE_LAYOUT_EX only for physical disk.
If I want to get the LDM details I thought I will pass the same IOCTL.

I want to populate my internal structures with the dynamic disk details.
I am not able to do that.

IOCTL_DISK_GET_DRIVE_LAYOUT_EX gives you the physical disk partition
information. For dynamic disks this is not of much interest as they
have one partition (ignoring the GPT case which has two, one hidden
one for the metadata.)

IOCTL_VOLUME_GET_VOLUME_DISK_EXTENTS might be helpful, depending on
what you are actually trying to do.

Some idiot wrote an article a long time ago describing how you can get
use this IOCTL and other interfaces to get lots of information about
volumes and disks.

http://www.wd-3.com/archive/luserland.htm

Mark Roddy

On Thu, Mar 5, 2009 at 11:12 PM, wrote:
> U have mentioned that"Generally you want to send this IOCTL to the physical disk, not to
> some LDM/VDS construct"
>
> so is this IOCTL_DISK_GET_DRIVE_LAYOUT_EX only for physical disk.
> If I want to get the LDM details I thought I will pass the same IOCTL.
>
> I want to populate my internal structures with the dynamic disk details.
> I am not able to do that.
>
>
>
> —
> NTDEV is sponsored by OSR
>
> For our schedule of WDF, WDM, debugging and other seminars visit:
> http://www.osr.com/seminars
>
> To unsubscribe, visit the List Server section of OSR Online at http://www.osronline.com/page.cfm?name=ListServer
>

> But how will I get the system name during the boot time??

Enumerate all devices with MOUNTDEV_MOUNTED_DEVICE_GUID by IoGetDeviceInterfaces


Maxim S. Shatskih
Windows DDK MVP
xxxxx@storagecraft.com
http://www.storagecraft.com

> whenever I pass the ioctl IOCTL_DISK_GET_DRIVE_LAYOUT_EX to a dynamic disk

I see that the partition count is always 4.

The usual layout of the Dynamic Disk is 1 partition with special Type value (forgot) which occupies the whole disk.

DmIo sees this Type value and understands that this is a Dynamic Disk, and its partition table is somewhere else (a data structure in IIRC sector 6 started with “PRIVHEAD”).


Maxim S. Shatskih
Windows DDK MVP
xxxxx@storagecraft.com
http://www.storagecraft.com

I see that many people tell that IOCTL_DISK_GET_DRIVE_LAYOUT_EX will be of no use for dynamic disk as it will have details of only partition0.

I have the device object of \Device\HarddiskDmVolumes\PhysicalDmVolumes\BlockVolumex.
Now I want the partitionoffset and partition length of this volume.
I guess these IOCTL_DISK_GET_PARTITION_INFO_EX is supported for dynamic disk.

Might be it is meaningless to ask the following question as the name itself says that it is dynamic.

As we have partition count for basic do we have anything simlarly for dynamic disk so that I can call IOCTL_DISK_GET_PARTITION_INFO_EX for those many volumes???

In the four hours since you posted this question, you could have tested the
various disk and storage queries to see what works and what info you see.
This is how we all learn to analyze the disk subsystem.

wrote in message news:xxxxx@ntdev…
>I see that many people tell that IOCTL_DISK_GET_DRIVE_LAYOUT_EX will be of
>no use for dynamic disk as it will have details of only partition0.
>
> I have the device object of
> \Device\HarddiskDmVolumes\PhysicalDmVolumes\BlockVolumex.
> Now I want the partitionoffset and partition length of this volume.
> I guess these IOCTL_DISK_GET_PARTITION_INFO_EX is supported for dynamic
> disk.
>
> Might be it is meaningless to ask the following question as the name
> itself says that it is dynamic.
>
> As we have partition count for basic do we have anything simlarly for
> dynamic disk so that I can call IOCTL_DISK_GET_PARTITION_INFO_EX for those
> many volumes???
>
>
>

> Might be it is meaningless to ask the following question as the name itself says that it is dynamic.

IOCTL_VOLUME_GET_VOLUME_DISK_EXTENTS for partition offset/length of each extent

IOCTL_DISK_GET_LENGTH_INFO for the whole volume (does not work on w2k)


Maxim S. Shatskih
Windows DDK MVP
xxxxx@storagecraft.com
http://www.storagecraft.com