So how do I get the length of a volume on W2K

From: Jan Bottorff (nospam4096_at_online.nospam)
Date: 03/04/05


Date: Thu, 3 Mar 2005 21:40:02 -0800

I have a storage filter driver that layers above a volume. Under W2K there
is no IOCTL I can make to find the size of the volume.

I tried IOCTL_DISK_GET_DRIVE_GEOMETRY (the _EX variant is not defined in the
W2K DDK headers), which returns the size of the physical disk the volume is
on

I tried IOCTL_VOLUME_GET_VOLUME_DISK_EXTENTS, which on RAID and Mirror
volumes returns extents that include the mirror or parity extent, so adding
them together gives the wrong size on these kinds of volumes. This might
work if there is another IOCTL that could tell me which extents to add
together.

I tried IOCTL_DISK_GET_PARTITION_INFO (the _EX variant is not defined in the
W2K DDK headers), which fails on a dynamic non-simple volumes such as RAID,
Stripe sets, mirror volumes and spanned volumes.

For W2K3 I use IOCTL_DISK_GET_LENGTH_INFO (not defined in W2K DDK headers),
but this does not exists on W2K.

Things like the file system must get the size of a volume, but see no easy
way under W2K. At the moment, I do a binary search of the last valid sector
doing IRP_MJ_READ's

Is there some other IOCTL, or is the binary search my only option?

- Jan



Relevant Pages

  • Re: Regarding storage drivers.
    ... I have a mirror filter driver which sits below filesystem driver and above ... is missing in the explorer window as the IOCTL ...
    (microsoft.public.development.device.drivers)
  • Re: GEOM is too verbose
    ... I doubt that name of this ioctl is the same on the ... >> different unices, so that binary search is still the best from the ... working code for perfection sake is not one of them. ...
    (freebsd-current)
  • Re: GEOM is too verbose
    ... >> Hm python has ioctl support, ... I doubt that name of this ioctl is the same on the ... You could always try the ioctl and fall back to a binary search if you get ... for Genesis Software - http://www.gsoft.com.au ...
    (freebsd-current)
  • Re: GEOM is too verbose
    ... >> Hm python has ioctl support, ... I doubt that name of this ioctl is the same on the ... You could always try the ioctl and fall back to a binary search if you get ... for Genesis Software - http://www.gsoft.com.au ...
    (freebsd-current)