Note

Access to this page requires authorization. You can try signing in or .

Access to this page requires authorization. You can try .

IOCTL_DISK_REASSIGN_BLOCKS_EX IOCTL (winioctl.h)

Directs the disk device to map one or more blocks to its spare-block pool.

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

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

Remarks

The REASSIGN_BLOCKS_EX structure that the IOCTL_DISK_REASSIGN_BLOCKS_EX control code uses supports 8-byte Logical Block Addresses (LBA). For compatibility, the IOCTL_DISK_REASSIGN_BLOCKS control code and REASSIGN_BLOCKS structure should be used where the LBA fits in the 4-byte LBA that the REASSIGN_BLOCKS structure supports (typically drives up to 2 TB).

Requirements

Requirement Value
Minimum supported client Windows Vista [desktop apps only]
Minimum supported server Windows Server 2008, Windows Server 2003 with SP1 [desktop apps only]
Header winioctl.h (include Windows.h)

See also


Feedback

Was this page helpful?

Additional resources