IOCTL_DISK_GET_LENGTH_INFO on the platform Windows Server 2000

Hi, all
How can I get the capacity of a disk on the platform Windows Server 2000?

Thanks & regards.

Any help will be grateful.

Use the System.IO namespace, instantiate a DriveInfo class, enumerate the
logical drives, select the one you want, and get the drive’s information.

The personal opinion of
Gary G. Little

-----Original Message-----
From: xxxxx@lists.osr.com
[mailto:xxxxx@lists.osr.com] On Behalf Of
kuangnuzhiren@163.com
Sent: Thursday, September 10, 2009 6:53 AM
To: Windows System Software Devs Interest List
Subject: [ntdev] IOCTL_DISK_GET_LENGTH_INFO on the platform Windows Server
2000

Hi, all
How can I get the capacity of a disk on the platform Windows Server 2000?

Thanks & regards.


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

__________ Information from ESET Smart Security, version of virus signature
database 4413 (20090910) __________

The message was checked by ESET Smart Security.

http://www.eset.com

__________ Information from ESET Smart Security, version of virus signature
database 4414 (20090910) __________

The message was checked by ESET Smart Security.

http://www.eset.com

You can’t use this IOCTL in Windows Server 2000. Windows supports IOCTL_DISK_GET_LENGTH_INFO since XP. For Win 2000 you could use IOCTL_DISK_GET_DRIVE_GEOMETRY. This IOCTL returns DISK_GEOMETRY struct which contains information to get a length of a disk.

Igor Sharovar

> How can I get the capacity of a disk on the platform Windows Server 2000?

IOCTL_DISK_GET_PARTITION_INFO the PartitionLength field.

It is also faked and works for Dynamic Disk volumes.


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