2.1.5.12.30 FileNormalizedNameInformation

OutputBuffer is of type FILE_NAME_INFORMATION as specified in [MS-FSCC] section 2.1.7.

This routine uses the following local variables:

  • Unicode string: FileName

  • 32-bit unsigned integers: FileNameLength, AvailableNameLength

Pseudocode for the operation is as follows:

  • If the Open was created with FILE_OPEN_BY_FILE_ID in CreateOptions and Open.GrantedAccess.FILE_TRAVERSE is not set, the operation MUST be failed with a status code of STATUS_ACCESS_DENIED.

  • If Link.ParentFile is NULL and the Open was created without FILE_OPEN_BY_FILE_ID in CreateOptions, the operation MUST be failed with a status code of STATUS_INVALID_PARAMETER.

  • If OutputBufferSize is smaller than BlockAlign(FieldOffset(FILE_NAME_INFORMATION.FileName) + 2, 4), the operation MUST be failed with a status code of STATUS_INFO_LENGTH_MISMATCH.

  • Set FileName to BuildRelativeName(Open.Link, Open.File.Volume.RootDirectory).

  • Set FileNameLength to the length, in bytes, of FileName.

  • Set OutputBuffer.FileNameLength to FileNameLength.

  • Set AvailableNameLength to BlockAlignTruncate((OutputBufferSize - FieldOffset(FILE_NAME_INFORMATION.FileName)), 2).

  • If AvailableNameLength < FileNameLength, the object store MUST fail the operation with:

    • AvailableNameLength bytes copied from FileName to OutputBuffer.FileName.

    • ByteCount set to FieldOffset(FILE_NAME_INFORMATION.FileName) + AvailableNameLength.

    • Status set to STATUS_BUFFER_OVERFLOW.

  • EndIf

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

    • FileNameLength bytes copied from FileName to OutputBuffer.FileName.

    • ByteCount set to FieldOffset(FILE_NAME_INFORMATION.FileName) + FileNameLength.

    • Status set to STATUS_SUCCESS.