Disk Management Control Codes

The following table identifies the control codes that are used in disk management.

In this section

Control Code Description
IOCTL_DISK_ARE_VOLUMES_READY
Waits for all volumes on the specified disk to be ready for use.
IOCTL_DISK_CREATE_DISK
Initializes the specified disk and disk partition table using the information in the CREATE_DISK structure.
IOCTL_DISK_DELETE_DRIVE_LAYOUT
Removes the boot signature from the master boot record, so that the disk will be formatted from sector zero to the end of the disk.
IOCTL_DISK_FORMAT_TRACKS
Formats a specified, contiguous set of tracks on a floppy disk. To provide additional parameters, use IOCTL_DISK_FORMAT_TRACKS_EX instead.
IOCTL_DISK_FORMAT_TRACKS_EX
Formats a specified, contiguous set of tracks on a floppy disk.
IOCTL_DISK_GET_CACHE_INFORMATION
Retrieves the disk cache configuration data.
IOCTL_DISK_GET_CLUSTER_INFO
Retrieves the attributes of the specified disk device.
IOCTL_DISK_GET_DISK_ATTRIBUTES
Retrieves the attributes of the specified disk device.
IOCTL_DISK_GET_DRIVE_GEOMETRY
Retrieves information about the physical disk's geometry: type, number of cylinders, tracks per cylinder, sectors per track, and bytes per sector.
IOCTL_DISK_GET_DRIVE_GEOMETRY_EX
Retrieves extended information about the physical disk's geometry: type, number of cylinders, tracks per cylinder, sectors per track, and bytes per sector.
IOCTL_DISK_GET_DRIVE_LAYOUT
Retrieves information for each entry in the partition tables for a disk.
IOCTL_DISK_GET_DRIVE_LAYOUT_EX
Retrieves extended information for each entry in the partition tables for a disk.
IOCTL_DISK_GET_LENGTH_INFO
Retrieves the length of the specified disk, volume, or partition.
IOCTL_DISK_GET_PARTITION_INFO
Retrieves information about the type, size, and nature of a disk partition.
IOCTL_DISK_GET_PARTITION_INFO_EX
Retrieves extended information about the type, size, and nature of a disk partition.
IOCTL_DISK_GROW_PARTITION
Enlarges the specified partition.
IOCTL_DISK_IS_WRITABLE
Determines whether the specified disk is writable.
IOCTL_DISK_PERFORMANCE
Enables performance counters that provide disk performance information.
IOCTL_DISK_PERFORMANCE_OFF
Disables the performance counters that provide disk performance information.
IOCTL_DISK_REASSIGN_BLOCKS
Directs the disk device to map one or more blocks to its spare-block pool.
IOCTL_DISK_REASSIGN_BLOCKS_EX
Directs the disk device to map one or more blocks to its spare-block pool.
IOCTL_DISK_RESET_SNAPSHOT_INFO
Clears all Volume Shadow Copy Service (VSS) hardware-based shadow copy (also called "snapshot") information from the disk.
To perform this operation, call the DeviceIoControl function with the following parameters.
IOCTL_DISK_SET_CACHE_INFORMATION
Sets the disk configuration data.
IOCTL_DISK_SET_CLUSTER_INFO
Sets the cluster information on a disk.
IOCTL_DISK_SET_DISK_ATTRIBUTES
Sets the attributes of the specified disk device.
IOCTL_DISK_SET_DRIVE_LAYOUT
Partitions a disk as specified by drive layout and partition information data.
IOCTL_DISK_SET_DRIVE_LAYOUT_EX
Partitions a disk according to the specified drive layout and partition information data.
IOCTL_DISK_SET_PARTITION_INFO
Sets partition information for the specified disk partition.
IOCTL_DISK_SET_PARTITION_INFO_EX
Sets partition information for the specified disk partition, including layout information for AT and EFI (Extensible Firmware Interface) partitions.
IOCTL_DISK_UPDATE_PROPERTIES
Invalidates the cached partition table and re-enumerates the device.
IOCTL_DISK_VERIFY
Verifies the specified extent on a fixed disk.
IOCTL_STORAGE_DEVICE_POWER_CAP
Windows applications can use this control code to specify a maximum operational power consumption level for a storage device. The OS will do it's best to transition the device to a power state that will not exceed the given maximum. However, this depends on what the device supports. The actual maximum may be less than or greater than the desired maximum.
To perform this operation, call the DeviceIoControl function with the following parameters.
IOCTL_STORAGE_FIRMWARE_ACTIVATE
Windows applications can use this control code to activate a firmware image on a specified device.
To perform this operation, call the DeviceIoControl function with the following parameters.
IOCTL_STORAGE_FIRMWARE_DOWNLOAD
Windows applications can use this control code to download a firmware image to the target device, but not activate it. If the image to be downloaded is larger than the controller s maximum data transfer size, this IOCTL will have to be called multiple times until the entire image is downloaded.
To perform this operation, call the DeviceIoControl function with the following parameters.
IOCTL_STORAGE_FIRMWARE_GET_INFO
Windows applications can use this control code to query the storage device for detailed firmware information. A successful call will return information about firmware revisions, activity status, as well as read/write attributes for each slot. The amount of data returned will vary based on storage protocol.
To perform this operation, call the DeviceIoControl function with the following parameters.
IOCTL_STORAGE_PROTOCOL_COMMAND
Windows applications can use this control code to return properties of a storage device or adapter. The request indicates the kind of information to retrieve, such as inquiry data for a device or capabilities and limitations of an adapter.
IOCTL_STORAGE_QUERY_PROPERTY
Windows applications can use this control code to return the properties of a storage device or adapter. The request indicates the kind of information to retrieve, such as the inquiry data for a device or the capabilities and limitations of an adapter. IOCTL_STORAGE_QUERY_PROPERTY can also be used to determine whether the port driver supports a particular property or which fields in the property descriptor can be modified with a subsequent change-property request.
IOCTL_STORAGE_SET_TEMPERATURE_THRESHOLD
Windows applications can use this control code to set the temperature threshold of a device (when it's supported by the device).

The following control codes are obsolete:

IOCTL_DISK_CONTROLLER_NUMBER
IOCTL_DISK_GET_DRIVE_GEOMETRY
IOCTL_DISK_GET_DRIVE_LAYOUT
IOCTL_DISK_GET_PARTITION_INFO
IOCTL_DISK_HISTOGRAM_DATA
IOCTL_DISK_HISTOGRAM_RESET
IOCTL_DISK_HISTOGRAM_STRUCTURE
IOCTL_DISK_LOGGING
IOCTL_DISK_REQUEST_DATA
IOCTL_DISK_REQUEST_STRUCTURE
IOCTL_DISK_SET_DRIVE_LAYOUT
IOCTL_DISK_SET_PARTITION_INFO