Instructs the file system to copy a range of file bytes on behalf of an application. The destination file may be the same as, or different from, the source file. See Block Cloning for more information.

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

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

Major Code


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.


For the implications of overlapped I/O on this operation, see the Remarks section of the DeviceIoControl topic.

See Block Cloning for more information on this operation.

In Windows Server 2016, this function is supported by the following technologies.

Technology Supported
Server Message Block (SMB) 3.1.1 protocol Yes
SMB 3.1.1 Transparent Failover (TFO) Yes
SMB 3.1.1 with Scale-out File Shares (SoFS) Yes
Cluster Shared Volume File System (CsvFS) Yes
Resilient File System (ReFS) Yes


Minimum supported client None supported
Minimum supported server Windows Server 2016 [desktop apps only]
Header winioctl.h (include Windows.h)

See Also

Block Cloning



File Management Control Codes