The IoReadPartitionTable routine is obsolete and is provided only to support existing drivers. New drivers must use IoReadPartitionTableEx. IoReadPartitionTable 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
IoReadPartitionTable(
IN PDEVICE_OBJECT DeviceObject,
IN ULONG SectorSize,
IN BOOLEAN ReturnRecognizedPartitions,
OUT struct _DRIVE_LAYOUT_INFORMATION **PartitionBuffer
);
This routine returns a value of STATUS_SUCCESS if at least one sector table was read. Otherwise, it returns an error status and sets the pointer at PartitionBuffer to NULL.
Declared in ntddk.h. Include ntddk.h.
IoReadPartitionTable must only be used by disk drivers. Other drivers should use the IOCTL_DISK_GET_DRIVE_LAYOUT disk I/O request instead.
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.
The algorithm used by this routine is determined by the Boolean value ReturnRecognizedPartitions:
Callers of IoReadPartitionTable must be running at IRQL = PASSIVE_LEVEL.
IOCTL_DISK_GET_PARTITION_INFO, IOCTL_DISK_GET_DRIVE_LAYOUT, IOCTL_DISK_SET_DRIVE_LAYOUT, IoSetPartitionInformation, IoWritePartitionTable