2.1.5.10.34 FSCTL_SET_INTEGRITY_INFORMATION_EX

The server provides:<137>

  • Open: An Open of a DataFile or DirectoryFile.

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

  • 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.<138><139>

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_EX).

  • InputBuffer.Version != 1.

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

  • InputBuffer.EnableIntegrity == 0, InputBuffer.KeepIntegrityStateUnchanged == 0, and InputBuffer.Flags.FSCTL_INTEGRITY_FLAG_CHECKSUM_ENFORCEMENT_OFF is TRUE.

  • InputBuffer.KeepIntegrityStateUnchanged != 0, 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.KeepIntegrityStateUnchanged == 0, the object store MUST:

      • If InputBuffer.EnableIntegrity != 0 set Open.Stream.CheckSumAlgorithm to one of the supported checksum types defined [MS-FSCC] section 2.3.75.<140>

      • Else set Open.Stream.CheckSumAlgorithm to CHECKSUM_TYPE_NONE as defined in [MS-FSCC] section 2.3.75.

      • EndIf

    • 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. KeepIntegrityStateUnchanged == 0, the object store MUST:

      • If InputBuffer.EnableIntegrity != 0 set Open.Stream.CheckSumAlgorithm to one of the supported checksum types defined in [MS-FSCC] section 2.3.75.<141>

      • Else set Open.Stream.CheckSumAlgorithm to CHECKSUM_TYPE_NONE as defined in [MS-FSCC] section 2.3.75.

      • EndIf

    • Endif

    • 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.