共用方式為


2.1.5.10.33 FSCTL_SET_INTEGRITY_INFORMATION

The server provides:<134>

  • Open: An Open of a DataFile or DirectoryFile.

  • InputBuffer: An array of bytes containing an FSCTL_SET_INTEGRITY_INFORMATION_BUFFER structure indicating the requested integrity state of the directory or file, as specified in [MS-FSCC] section 2.3.73.

  • InputBufferSize: The number of bytes in InputBuffer.

On completion, the object store MUST return:

  • Status: An NTSTATUS code that specifies the result.

Support for this operation is optional. If the object store does not implement this functionality, the operation MUST be failed with STATUS_INVALID_DEVICE_REQUEST.<135><136>

The operation MUST be failed with STATUS_INVALID_PARAMETER under any of the following conditions:

  • InputBufferSize is less than sizeof(FSCTL_SET_INTEGRITY_INFORMATION_BUFFER).

  • InputBuffer.ChecksumAlgorithm is not one of the predefined values in [MS-FSCC] section 2.3.73.

  • InputBuffer.Flags is non-zero and InputBuffer.Flags.FSCTL_INTEGRITY_FLAG_CHECKSUM_ENFORCEMENT_OFF is FALSE.

  • InputBuffer.ChecksumAlgorithm == CHECKSUM_TYPE_NONE and InputBuffer.Flags. FSCTL_INTEGRITY_FLAG_CHECKSUM_ENFORCEMENT_OFF is TRUE.

  • InputBuffer.ChecksumAlgorithm == CHECKSUM_TYPE_UNCHANGED, Open.Stream.CheckSumAlgorithm == CHECKSUM_TYPE_NONE, and InputBuffer.Flags. FSCTL_INTEGRITY_FLAG_CHECKSUM_ENFORCEMENT_OFF is TRUE.

Pseudocode for the operation is as follows:

  • If Open.File.Volume.IsReadOnly is TRUE, the operation MUST be failed with STATUS_MEDIA_WRITE_PROTECTED.

  • If Open.Stream.StreamType is DirectoryStream:

    • The object store MUST post a USN change as specified in section 2.1.4.11 with File equal to Directory, Reason equal to USN_REASON_INTEGRITY_CHANGE, and FileName equal to Open.Link.Name.

    • If InputBuffer.ChecksumAlgorithm != CHECKSUM_TYPE_UNCHANGED, the object store MUST set Open.Stream.CheckSumAlgorithm to CRC32 if the ReFS cluster size is 4KB or CRC64 if the cluster size is 64K.

  • EndIf

  • If Open.Stream.StreamType is DataStream:

    • The object store MUST post a USN change as specified in section 2.1.4.11 with File equal to File, Reason equal to USN_REASON_INTEGRITY_CHANGE, and FileName equal to Open.Link.Name.

    • If InputBuffer.ChecksumAlgorithm != CHECKSUM_TYPE_UNCHANGED, the object store MUST set Open.Stream.CheckSumAlgorithm to InputBuffer.ChecksumAlgorithm.

    • If (InputBuffer.Flags & FSCTL_INTEGRITY_FLAG_CHECKSUM_ENFORCEMENT_OFF) != 0,

      • The object store MUST set Open.Stream.StreamChecksumEnforcementOff to TRUE.

    • Else:

      • The object store MUST set Open.Stream.StreamChecksumEnforcementOff to FALSE.

    • EndIf

  • EndIf

  • Upon successful completion of the operation, the object store MUST return:

    • Status set to STATUS_SUCCESS.