IOCTL_DISK_GET_DRIVE_LAYOUT IOCTL

Retrieves information for each entry in the partition tables for a disk.

Note  IOCTL_DISK_GET_DRIVE_LAYOUT has been superseded by IOCTL_DISK_GET_DRIVE_LAYOUT_EX, which retrieves layout information for AT and EFI (Extensible Firmware Interface) partitions.
 
To perform this operation, call the DeviceIoControl function with the following parameters. You must have read access to the drive in order to use this control code.
C++
BOOL DeviceIoControl(
  (HANDLE) hDevice,            // handle to device
  IOCTL_DISK_GET_DRIVE_LAYOUT, // dwIoControlCodeNULL,                        // lpInBuffer0,                           // nInBufferSize(LPVOID) lpOutBuffer,        // output buffer
  (DWORD) nOutBufferSize,      // size of output buffer
  (LPDWORD) lpBytesReturned,   // number of bytes returned
  (LPOVERLAPPED) lpOverlapped  // OVERLAPPED structure
);

Major Code

IRP_MJ_DEVICE_CONTROL

Input Buffer

Input Buffer Length

Output Buffer

Output Buffer Length

Input / Output Buffer

Input / Output Buffer Length

Status Block

Irp->IoStatus.Status is set to STATUS_SUCCESS if the request is successful.

Otherwise, Status to the appropriate error condition as a NTSTATUS code.

For more information, see NTSTATUS Values.

Remarks

This operation retrieves information for each primary partition as well as each logical drive. To determine whether the entry is an extended or unused partition, check the disk partition type.

Requirements

   
Windows version Windows XP [desktop apps only] Windows Server 2003 [desktop apps only]
Header winioctl.h (include Windows.h)

See Also

DRIVE_LAYOUT_INFORMATION

DeviceIoControl

Disk Management Control Codes

IOCTL_DISK_GET_DRIVE_LAYOUT_EX

IOCTL_DISK_SET_DRIVE_LAYOUT