共用方式為


2.1.5.15.3 FileDispositionInformation

InputBuffer is of type FILE_DISPOSITION_INFORMATION as described in [MS-FSCC] section 2.4.11.

Pseudocode for the operation is as follows:

  • If InputBufferSize is less than the size, in bytes, of the FILE_DISPOSITION_INFORMATION structure, the operation MUST be failed with STATUS_INFO_LENGTH_MISMATCH.

  • If Open.GrantedAccess does not contain DELETE, the operation MUST be failed with STATUS_ACCESS_DENIED.

  • If InputBuffer.DeletePending is TRUE:

    • If File.FileAttributes.FILE_ATTRIBUTE_READONLY is TRUE, the operation MUST be failed with STATUS_CANNOT_DELETE.

    • If Open.Stream.Name is empty:

      • If Open.Stream.StreamType is DirectoryStream and Open.File.DirectoryList is not empty, the operation MUST be failed with STATUS_DIRECTORY_NOT_EMPTY.

      • Set Open.Link.IsDeleted to TRUE.

      • If Open.Stream.StreamType is DirectoryStream:

        • For each ChangeNotifyEntry in Volume.ChangeNotifyList where ChangeNotifyEntry .OpenedDirectory.File is equal to Open.File then the following actions MUST be taken:

          • Remove ChangeNotifyEntry from Volume.ChangeNotifyList.

          • Complete the ChangeNotify operation with status STATUS_DELETE_PENDING.

        • EndFor

      • EndIf

    • Else:

      • Set Open.Stream.IsDeleted to TRUE.

    • EndIf

  • Else:

    • If Open.Stream.Name is empty:

      • Set Open.Link.IsDeleted to FALSE.

    • Else:

      • Set Open.Stream.IsDeleted to FALSE.

    • EndIf

  • EndIf

  • The operation returns STATUS_SUCCESS.