Partager via


2.1.5.10.29.2 Algorithm for REFS_STREAM_SNAPSHOT_OPERATION_LIST

Given a set of an arbitrary number (N) of DataStreams (S), as well as (N) named attributes where each named attribute references one DataStream, then:

  • Let Q be the query string, as represented by InputBuffer.SnapshotName.

  • A search for Q is performed within the File containing S. This will match all named attributes within the file whose names match the query string Q.<125>

  • Let X be a pointer to an array of bytes, initialized to point to the first entry in the output buffer.

  • Let Y be the total amount of bytes currently written to the output buffer. Y = 0.

  • Let Z be the number of entries currently written to the output buffer. Z = 0.

  • For every matching attribute M_i,

    • Copy the M_i name into X.SnapshotName.

    • Copy the M_i name length into X.SnapshotNameLength.

    • Copy the M_i creation time into X.SnapshotCreationTime.

    • Copy the M_i stream size into X.StreamSize.

    • Copy the M_i stream allocation size into X.StreamAllocationSize.

    • Set X.Reserved to zero.

    • Set X.NextEntryOffset to QuadAlign(FIELD_OFFSET(REFS_STREAM_SNAPSHOT_LIST_OUTPUT_BUFFER_ENTRY, SnapshotName) + X.SnapshotNameLength).

    • Advance the pointer X by X.NextEntryOffset bytes.

    • Z = Z + 1.

    • Y = Y + X.

    • If Y > OutputBufferLength, then no more entries are written to the output buffer. The rest of the entries are enumerated only incrementing Y.

  • Set OutputBuffer.Reserved to zero.

  • Set OutputBuffer.EntryCount to Z.

  • Set OutputBuffer.BufferSizeRequiredForQuery to Y.

  • If Y > OutputBufferLength, then return STATUS_BUFFER_OVERFLOW. Otherwise return STATUS_SUCCESS.