2.1.5.11.29 FileStreamInformation

OutputBuffer is of type FILE_STREAM_INFORMATION, as described in [MS-FSCC] section 2.4.40. Object stores that do not support alternate data streams SHOULD<134> return STATUS_INVALID_INFO_CLASS.

This routine uses the following local variables:

  • 32-bit unsigned integer: StreamNameLength, RemainingLength, ThisElementSize, PreviousElementPadding

  • Stream: ThisStream

  • Pointer to a buffer of type FILE_STREAM_INFORMATION: CurrentPosition, LastPosition

Pseudocode for the operation is as follows:

  • If OutputBufferSize is smaller than sizeof(FILE_STREAM_INFORMATION), the operation MUST be failed with STATUS_INFO_LENGTH_MISMATCH.

  • Initialize PreviousElementPadding to 0.

  • Initialize CurrentPosition to point to the 0th byte of OutputBuffer.

  • Initialize RemainingLength to be equal to OutputBufferSize.

  • For each Stream ThisStream of Open.File:

    • Set StreamNameLength equal to the length, in bytes, of ThisStream.Name plus the length, in bytes, of the Unicode string "$DATA" plus the length, in bytes, of two Unicode characters. This accommodates the length of the full stream name in the form :<ThisStream.Name>:$DATA.

    • Set ThisElementSize equal to the byte offset of CurrentPosition.StreamName plus StreamNameLength.

    • If ThisElementSize plus PreviousElementPadding is greater than RemainingLength, the operation MUST be failed with STATUS_BUFFER_OVERFLOW.

    • The object store MUST set CurrentPosition.StreamSize equal to ThisStream.Size.

    • The object store MUST set CurrentPosition.AllocationSize equal to ThisStream.AllocationSize.

    • The object store MUST set CurrentPosition.StreamNameLength equal to StreamNameLength.

    • The object store MUST set CurrentPosition.StreamName to the Unicode character ":", then append ThisStream.Name, then append the Unicode character ":", then append the Unicode string "$DATA".

    • Set PreviousElementPadding equal to BlockAlign(ThisElementSize, 8) minus ThisElementSize. The value PreviousElementPadding is used to align each FILE_STREAM_INFORMATION element in OutputBuffer on an 8-byte boundary.

    • The object store MUST set CurrentPosition.NextEntryOffset equal to ThisElementSize plus PreviousElementPadding.

    • Set RemainingLength equal to RemainingLength minus (ThisElementSize plus PreviousElementPadding).

    • Set LastPosition equal to CurrentPosition.

    • Advance CurrentPosition by a number of bytes equal to ThisElementSize plus PreviousElementPadding.

  • EndFor

  • The object store MUST set LastPosition.NextEntryOffset equal to 0.

  • The operation returns STATUS_SUCCESS.

Show: