Disk Management Interfaces
Component Object Model (COM) programming provides a rich set of standards for implementing and using objects and for inter-object communication. Interfaces are used in COM programming and for every interface there are many methods that can be used. The following interfaces are used in disk management:
|
Interface |
Description |
|
IDiskQuotaControl() |
Controls the disk quota facilities of a single NTFS file system volume. The client can query and set volume-specific quota attributes through IDiskQuotaControl(). The client can also enumerate all per-user quota entries on the volume. A client instantiates this interface by calling the CoCreateInstance() function using the class identifier CLSID_DiskQuotaControl. |
|
IDiskQuotaEvents() |
A client must implement the IDiskQuotaEvents() interface as an event sink that receives the quota-related event notifications. Its methods are called by the system whenever significant quota events have occurred. Currently, the only event supported is the asynchronous resolution of user account name information. |
|
IDiskQuotaUser() |
Represents a single user quota entry in the volume quota information file. Through this interface, you can query and modify user-specific quota information on an NTFS file system volume. This interface is instantiated by using IEnumDiskQuotaUsers(), IDiskQuotaControl::FindUserSid(), IDiskQuotaControl::FindUserName(), IDiskQuotaControl::AddUserSid(), or IDiskQuotaControl::AddUserName(). |
|
IDiskQuotaUserBatch() |
Adds multiple quota user objects to a container that is then submitted for update in a single call. This reduces the number of calls to the underlying file system, improving update efficiency when a large number of user objects must be updated. This interface is instantiated by using the IDiskQuotaControl::CreateUserBatch() method |
|
IEnumDiskQuotaUsers() |
Enumerates user quota entries on the volume. This interface is instantiated by using the IDiskQuotaControl::CreateEnumUsers() method. |
Disk Management Structures
The following list identifies the structures that are used in disk management:
|
Structure |
Description |
|
CREATE_DISK |
Contains information that the IOCTL_DISK_CREATE_DISK control code uses to initialize GUID partition table (GPT), master boot record (MBR), or raw disks. |
|
CREATE_DISK_GPT |
Contains information used by the IOCTL_DISK_CREATE_DISK control code to initialize GUID partition table (GPT) disks. |
|
CREATE_DISK_MBR |
Contains information that the IOCTL_DISK_CREATE_DISK control code uses to initialize master boot record (MBR) disks. |
|
DISK_CACHE_INFORMATION |
Provides information about the disk cache. This structure is used by the IOCTL_DISK_GET_CACHE_INFORMATION and IOCTL_DISK_SET_CACHE_INFORMATION control codes. |
|
DISK_DETECTION_INFO |
Contains detected drive parameters. |
|
DISK_EX_INT13_INFO |
Contains extended Int13 drive parameters. |
|
DISK_EXTENT |
Represents a disk extent. |
|
DISK_GEOMETRY |
Describes the geometry of disk devices and media. |
|
DISK_GEOMETRY_EX |
Describes the extended geometry of disk devices and media. |
|
DISK_GROW_PARTITION |
Contains information used to increase the size of a partition. This structure is used by the IOCTL_DISK_GROW_PARTITION control code. |
|
DISK_INT13_INFO |
Contains standard Int13 drive geometry parameters. |
|
DISK_PARTITION_INFO |
Contains the disk partition information. |
|
DISK_PERFORMANCE |
Provides disk performance information. It is used by the IOCTL_DISK_PERFORMANCE control code. |
|
DISKQUOTA_USER_INFORMATION |
Represents the per-user quota information. |
|
DRIVE_LAYOUT_INFORMATION_EX |
Contains extended information about a drive's partitions. |
|
DRIVE_LAYOUT_INFORMATION_GPT |
Contains information about a drive's GUID partition table (GPT) partitions. |
|
DRIVE_LAYOUT_INFORMATION_MBR |
Provides information about a drive's master boot record (MBR) partitions. |
|
FORMAT_PARAMETERS |
- Contains information used in formatting a contiguous set of disk tracks. It is used by the IOCTL_DISK_FORMAT_TRACKS control code. |
|
FORMAT_EX_PARAMETERS |
- Contains information used in formatting a contiguous set of disk tracks. It is used by the IOCTL_DISK_FORMAT_TRACKS_EX control code. |
|
GET_LENGTH_INFORMATION |
- Contains disk, volume, or partition length information used by the IOCTL_DISK_GET_LENGTH_INFO control code. |
|
PARTITION_INFORMATION_EX |
- Contains partition information for standard AT-style master boot record (MBR) and Extensible Firmware Interface (EFI) disks. |
|
PARTITION_INFORMATION_GPT |
- Contains GUID partition table (GPT) partition information. |
|
PARTITION_INFORMATION_MBR |
- Contains partition information specific to master boot record (MBR) disks. |
|
REASSIGN_BLOCKS |
- Contains disk block reassignment data. This is a variable length structure where the last member is an array of block numbers to be reassigned. It is used by the IOCTL_DISK_REASSIGN_BLOCKS control code. |
|
VERIFY_INFORMATION |
- Contains information used to verify a disk extent. It is the output buffer for the IOCTL_DISK_VERIFY control code. |
The following list identifies the device input and output structures that are obsolete:
1. DRIVE_LAYOUT_INFORMATION
2. PARTITION_INFORMATION
3. SET_PARTITION_INFORMATION
Disk Partition Types
The following table identifies the valid partition types that are used by disk drivers.
|
String Constant (value) |
Description |
|
PARTITION_ENTRY_UNUSED (0x00) |
An unused entry partition. |
|
PARTITION_EXTENDED (0x05) |
An extended partition. |
|
PARTITION_FAT_12 (0x01) |
A FAT12 file system partition. |
|
PARTITION_FAT_16 (0x04) |
A FAT16 file system partition. |
|
PARTITION_FAT32 (0x0B) |
A FAT32 file system partition. |
|
PARTITION_IFS (0x07) |
An IFS partition. |
|
PARTITION_LDM (0x42) |
A logical disk manager (LDM) partition. |
|
PARTITION_NTFT (0x80) |
An NTFT partition (Novell NetWare). |
|
VALID_NTFT (0xC0) |
A valid NTFT partition. The high bit of a partition type code indicates that a partition is part of an NTFT mirror or striped array. |
There are several macros that can help you detect the partition type which are IsContainerPartition(), IsFTPartition(), and IsRecognizedPartition().