Retrieves the integrity status of a file or directory on a ReFS volume.

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

BOOL DeviceIoControl(
  (HANDLE) hDevice,                     // handle to file or directory
  (DWORD) InBufferSize,                 // size of input buffer
  (LPDWORD) NULL,                       // pOutBuffer
  (DWORD) 0,                            // OutBufferSize
  (LPDWORD) NULL,                       // lpBytesReturned
  (LPOVERLAPPED) lpOverlapped           // OVERLAPPED structure


The integrity status can only be changed for empty files.

If the ReplaceFile is used to replace a file with integrity set, and the lpBackupFileName parameter points to a location that does not have integrity set, the integrity status of the original file will not be persisted.

Writes to integrity streams are always cluster-sized. Reads from integrity streams are always done in 16 KB blocks. This can lead to reads failing even when the corrupt area is outside the region being read. For example, if 4 KB is read at offset 0 in a file and there is corruption starting 12 KB into the file, a read would fail with ERROR_DATA_CHECKSUM_ERROR (0x143).


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

See also