IOCTL_DISK_GROW_PARTITION - NtDoc

Native API online documentation, based on the System Informer (formerly Process Hacker) phnt headers
// ntdddisk.h

// CTL_CODE(0x0007, 0x034, METHOD_BUFFERED, FILE_READ_ACCESS | FILE_WRITE_ACCESS)
#define IOCTL_DISK_GROW_PARTITION 0x0007C0D0
View the official Windows Driver Kit DDI reference
// winioctl.h

// CTL_CODE(0x0007, 0x034, METHOD_BUFFERED, FILE_READ_ACCESS | FILE_WRITE_ACCESS)
#define IOCTL_DISK_GROW_PARTITION 0x0007C0D0
View the official Win32 API reference

NtDoc

No description available.

Windows Driver Kit DDI reference (ni-ntdddisk-ioctl_disk_grow_partition)

IOCTL_DISK_GROW_PARTITION IOCTL

Description

Increases the size of an existing partition. It is used in conjunction with IOCTL_DISK_UPDATE_DRIVE_SIZE to extend a disk, so that it will contain a new free space area, and then to extend an existing partition on the disk into the newly attached free space. It takes a DISK_GROW_PARTITION structure as the only parameter. For this operation to work, the space after the specified partition must be free. A partition cannot be extended over another existing partition.

Parameters

Major code

Input buffer

The buffer at Irp->AssociatedIrp.SystemBuffer contains the DISK_GROW_PARTITION values - that will be used to increase the size of the partition.

Input buffer length

Parameters.DeviceIoControl.InputBufferLength in the I/O stack location of the IRP indicates the size, in bytes, of the buffer made available to the driver, which must be >= sizeof(DISK_GROW_PARTITION). Otherwise, the driver returns with an error status of STATUS_BUFFER_TOO_SMALL.

Output buffer

None.

Output buffer length

None.

Input/output buffer

Input/output buffer length

Status block

The Status field is set to STATUS_SUCCESS, or possibly to STATUS_BUFFER_TOO_SMALL, STATUS_INVALID_PARAMETER, STATUS_UNSUCCESSFUL, or STATUS_DRIVER_INTERNAL_ERROR.

See also

DISK_GROW_PARTITION


Win32 API reference (ni-winioctl-ioctl_disk_grow_partition)

IOCTL_DISK_GROW_PARTITION IOCTL

Description

Enlarges the specified partition.

To perform this operation, call the DeviceIoControl function with the following parameters.

BOOL DeviceIoControl(
  (HANDLE) hDevice,             // handle to device
  IOCTL_DISK_GROW_PARTITION,    // dwIoControlCode
  (LPVOID) lpInBuffer,          // input buffer
  (DWORD) nInBufferSize,        // size of the input buffer
  NULL,                         // lpOutBuffer
  0,                            // nOutBufferSize
  (LPDWORD) lpBytesReturned,    // number of bytes returned
  (LPOVERLAPPED) lpOverlapped   // OVERLAPPED structure
);

Parameters

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

You can extend or shrink a live partition, and the partition can be open for sharing during the extend or shrink operation.

You do not need to lock a partition that you are extending, nor do you need to shut down other applications or services during the extend operation.

For more information, see DISK_GROW_PARTITION.

See also