IoReadPartitionTableEx function (ntddk.h)
The IoReadPartitionTableEx routine reads a list of partitions on a disk having a specified sector size and creates an entry in the partition list for each recognized partition.
NTSTATUS IoReadPartitionTableEx( PDEVICE_OBJECT DeviceObject, _DRIVE_LAYOUT_INFORMATION_EX **DriveLayout );
[in] Pointer to the device object for the disk whose partitions are to be read.
Pointer to an uninitialized address. If successful, IoReadPartitionTableEx allocates the memory for this buffer from nonpaged pool and returns the drive layout information in it.
This routine returns a value of STATUS_SUCCESS if at least one sector table was read. Otherwise, it returns an error status value and sets the pointer at PartitionBuffer to NULL.
IoReadPartitionTableEx must only be used by disk drivers. Other drivers should use the IOCTL_DISK_GET_DRIVE_LAYOUT_EX disk I/O request instead.
IoReadPartitionTableEx is able to read partition table information from GUID Partition Table (GPT) disks as well as legacy Master Boot Record (MBR) disks. Disk device drivers call this routine during driver initialization.
It is the responsibility of the caller to deallocate the PartitionBuffer that was allocated by this routine with ExFreePool.
Note that disk drivers also return and set partition information in response to IRP_MJ_DEVICE_CONTROL requests with the following I/O control codes:
|Header||ntddk.h (include Ntddk.h)|
|DDI compliance rules||HwStorPortProhibitedDDIs|