2.5.1.2 DISK_INFO_EX

The DISK_INFO_EX structure provides information about a disk.

 struct diskinfoex {
   LdmObjectId id;
   LONGLONG length;
   LONGLONG freeBytes;
   unsigned long bytesPerTrack;
   unsigned long bytesPerCylinder;
   unsigned long bytesPerSector;
   unsigned long regionCount;
   unsigned long dflags;
   unsigned long deviceType;
   unsigned long deviceState;
   unsigned long busType;
   unsigned long attributes;
   unsigned long maxPartitionCount;
   boolean isUpgradeable;
   boolean maySwitchStyle;
   PARTITIONSTYLE partitionStyle;
   [switch_is(partitionStyle)] union {
     [case(PARTITIONSTYLE_MBR)] 
       struct {
       unsigned long signature;
     } mbr;
     [case(PARTITIONSTYLE_GPT)] 
       struct {
       GUID diskId;
     } gpt;
     [default]       ;
   };
   int portNumber;
   int targetNumber;
   int lunNumber;
   LONGLONG lastKnownState;
   LdmObjectId taskId;
   int cchName;
   int cchVendor;
   int cchDgid;
   int cchAdapterName;
   int cchDgName;
   int cchDevInstId;
   [size_is(cchName)] wchar_t* name;
   [size_is(cchVendor)] wchar_t* vendor;
   [size_is(cchDgid)] byte* dgid;
   [size_is(cchAdapterName)] wchar_t* adapterName;
   [size_is(cchDgName)] wchar_t* dgName;
   [size_is(cchDevInstId)] wchar_t* devInstId;
 };
 typedef struct diskinfoex DISK_INFO_EX;

id: Specifies the OID of the disk.

length: Size of the disk in bytes.

freeBytes: Number of unallocated bytes on the disk.

bytesPerTrack: Size of a disk track in bytes.

bytesPerCylinder: Size of a disk cylinder in bytes.

bytesPerSector: Size of a disk sector in bytes.

regionCount: Total number of regions on the disk.

dflags: Disk type of the disk. The value of this field is generated by combining zero or more of the applicable flags with a logical OR operation.

Value

Meaning

DISK_AUDIO_CD

0x00000001

Disk is an audio CD.

DISK_NEC98

0x00000002

This value is obsolete and MUST NOT be returned.

DISK_FORMATTABLE_DVD

0x00000004

Disk is a DVD that can be formatted.

DISK_MEMORY_STICK

0x00000008

Disk is a memory stick.

DISK_NTFS_NOT_SUPPORTED

0x000000010

Disk does not support being formatted as NTFS.

deviceType: Device type of the disk.

Value

Meaning

DEVICETYPE_UNKNOWN

0x00000000

Device is of an unknown type.

DEVICETYPE_VM

0x00000001

Device is a dynamic disk.

DEVICETYPE_REMOVABLE

0x00000002

Device uses removable media.

DEVICETYPE_CDROM

0x00000003

Device is a CD-ROM.

DEVICETYPE_FDISK

0x00000004

Device is a basic disk.

DEVICETYPE_DVD

0x00000005

Device is a DVD.

deviceState: Device state of the disk.

Value

Meaning

DEVICESTATE_UNKNOWN

0x00000000

Disk is in an unknown state.

DEVICESTATE_HEALTHY

0x00000001

Disk is fully functional.

DEVICESTATE_NO_MEDIA

0x00000002

Disk has no media.

DEVICESTATE_NOSIG

0x00000004

Disk has an invalid signature.

DEVICESTATE_BAD

0x00000008

Disk experienced a geometry failure.

DEVICESTATE_NOT_READY

0x00000010

Disk is not ready yet.

DEVICESTATE_MISSING

0x00000020

Disk is no longer available.

DEVICESTATE_OFFLINE

0x00000040

Disk is offline.

DEVICESTATE_FAILING

0x00000080

Disk experienced a physical I/O error.

DEVICESTATE_IMPORT_FAILED

0x00000100

Disk belongs to a group whose import failed. See disk group import.

DEVICESTATE_UNCLAIMED

0x00000200

Disk belongs to a foreign disk group.

busType: Type of bus on which the disk resides.

Value

Meaning

BUSTYPE_UNKNOWN

0x00000000

Bus type is unknown.

BUSTYPE_IDE

0x00000001

Disk resides on an IDE bus.

BUSTYPE_SCSI

0x00000002

Disk resides on an SCSI bus.

BUSTYPE_FIBRE

0x00000003

Disk resides on a fiber channel bus.

BUSTYPE_USB

0x00000004

Disk resides on a USB.

BUSTYPE_SSA

0x00000005

Disk resides on an SSA bus.

BUSTYPE_1394

0x00000006

Disk resides on an IEEE 1394 bus.

attributes: Bitmap of disk attributes.

Value

Meaning

DEVICEATTR_NONE

0x00000000

Disk has no attributes.

DEVICEATTR_RDONLY

0x00000001

Disk is read-only.

DEVICEATTR_NTMS

0x00000002

This value is obsolete.

maxPartitionCount: Maximum number of partitions on the disk.

isUpgradeable: Boolean value that indicates if the disk can be converted to a dynamic disk. True if the disk is basic, healthy, and has 512-byte sectors.

Value

Meaning

FALSE

0

Disk cannot be encapsulated or converted to a dynamic disk.

TRUE

1

Disk can be encapsulated or converted to a dynamic disk.

maySwitchStyle: Boolean value that indicates if the disk's partition style can be changed from MBR to GPT, or changed from GPT to MBR.

Value

Meaning

FALSE

0

Partition style of the disk cannot be changed.

TRUE

1

Partition style of the disk can be changed between MBR and GPT.

partitionStyle: Value from the PARTITIONSTYLE enumeration that indicates the disk's partitioning style.

(unnamed union): A union that contains either a signature or a diskId, depending on the value of partitionStyle:

signature: Signature of the disk. The disk signature is not guaranteed to be unique across machines.<8>

diskId: GUID, as specified in [MS-DTYP], section 2.3.4.1, of the disk.<9>

portNumber: SCSI port number of the disk.

targetNumber: SCSI target identifier of the disk.

lunNumber: SCSI LUN of the disk.

lastKnownState: Modification sequence number of the disk.

taskId: The task identifier of the associated user request. If no request is made, the value is 0.

cchName: Length of the hard disk's physical name, including the terminating null character.

cchVendor: Length of the disk's vendor name, including the terminating null character.

cchDgid: Length of the disk's group identification handle, including the terminating null character.

cchAdapterName: Length of the disk's adapter name, including the terminating null character.

cchDgName: Length of the disk's group name, including the terminating null character.

cchDevInstId: Length of the disk's device instance path, including the terminating null character.

name: Null-terminated physical name of the hard disk. For example: '\device\Harddisk1'.

vendor: Null-terminated name of the hard disk vendor. This is the disk vendor's disk model name. For example: "SEAGATE ST34573N SCSI Disk Device".

dgid: Specifies the object identifier of the disk's disk group.

adapterName: Null-terminated name of the disk adapter. For example: "Adaptec AHA-2940U2W - Ultra2 SCSI".

dgName: Null-terminated name for the disk's disk group, if the disk is dynamic.

devInstId: Null-terminated device instance path of the disk with the backslashes replaced by "#", "\\?\" prepended to the beginning, and the Pnp disk class GUID, as specified in [MS-DTYP] section 2.3.4.3, appended to the end. For example: "\\?\ide#diskwdc_wd1600jd-75hbb0_____________________08.02d08#5&15c8d966&0&0.0.0#{53f56307-b6bf-11d0-94f2-00a0c91efb8b}".