3.2.4.1.14.1 Custom Marshaling Format

The encapsulated marshaled format is a byte stream that encodes a sequence of headers that describe the type and length of the marshaled data that is encoded between the headers. A header is a structure of type MARSHAL_BLOCK_HEADER.


0


1


2


3


4


5


6


7


8


9

1
0


1


2


3


4


5


6


7


8


9

2
0


1


2


3


4


5


6


7


8


9

3
0


1

streamType

blockSize

Flags

streamType: An enumeration, which MUST be one of the following values.

Value

Meaning

MS_TYPE_META_DATA

0x00000001

MS_TYPE_COMPRESSION_DATA

0x00000002

MS_TYPE_REPARSE_DATA

0x00000003

MS_TYPE_FLAT_DATA

0x00000004

MS_TYPE_SECURITY_DATA

0x00000006

Stream type 0x00000005 is not used.

blockSize: The number of bytes of data in the chunk following the header.

Flags: The bitmask, with the HEADER_FLAGS_END_OF_STREAM bit (0x00000001) set if the end of the stream being marshaled has been reached. All other bits MUST be set to 0.

The HEADER_FLAGS_END_OF_STREAM bit indicates that an end of the stream that is being marshaled has been reached. For instance, if a stream requires multiple chunks, only the last header from that stream MUST have the HEADER_FLAGS_END_OF_STREAM bit set; all other headers MUST have the flags set to 0.

The data MUST be tightly packed. There MUST NOT be any additional bytes of padding.

The format of the data between the headers depends on the value of streamType. These formats are described as follows.

MS_TYPE_META_DATA (1): The metadata is written to the top of the marshaled file. The metadata contains information used by the marshaler and other processing code. It consists of data of the following format.


0


1


2


3


4


5


6


7


8


9

1
0


1


2


3


4


5


6


7


8


9

2
0


1


2


3


4


5


6


7


8


9

3
0


1

version

Reserved1

basicInfo

... (continues for a total of 10 rows)

sdControl

Reserved2

...

primaryDataStreamSize

...

Reserved3

...

version: The marshaler version. It MUST be 3.

Reserved 1: Unused, 4 bytes for alignment. MUST be 0. MUST be ignored on receipt.

basicInfo: The FILE_BASIC_INFORMATION structure, as specified in [MS-FSCC] section 2.4.7. It contains file times that are stamped on replicated files.

sdControl: The original SD control bits of the file being transferred. The format conforms to the format for SECURITY_DESCRIPTOR_CONTROL, as specified in [MS-LSAD] section 2.2.3.3.

Reserved2: Unused, 6 bytes for alignment. MUST be 0. MUST be ignored on receipt.

primaryDataStreamSize: A 64-bit unsigned integer. Only used in version 0x00050002 or later. It contains the absolute new end-of-file position as a byte offset from the start of the file, as specified in [MS-FSCC] section 2.4.41 (FileStandardInformation).

Reserved3: Unused, pads 8 bytes. MUST be 0. MUST be ignored on receipt.

MS_TYPE_COMPRESSION_DATA (2): Defines which compression algorithm is used to store the file in compressed format on disk. DFS-R replicates the compression attribute as well as the compression algorithm to allow that files get compressed uniformly among replication partners.


0


1


2


3


4


5


6


7


8


9

1
0


1


2


3


4


5


6


7


8


9

2
0


1


2


3


4


5


6


7


8


9

3
0


1

format

format: This SHOULD be the value of the CompressionFormat field of the FILE_COMPRESSION_INFORMATION structure, as specified in [MS-FSCC] section 2.4.9.

MS_TYPE_REPARSE_DATA (3): Reparse point data from reparse points that are replicated by DFS-R.<32> The data that follows a header tagged by MS_TYPE_REPARSE_DATA MUST be of a format compatible with the reply format of FSCTL_GET_REPARSE_POINT, as specified in [MS-FSCC] section 2.3.28.

MS_TYPE_FLAT_DATA (4): A sequence of bytes that represents the file. This sequence complies with the format of an NT Backup File, as specified in [MS-BKUP], section 2.1.

This is the last data stream of the marshaled data. The MARSHAL_BLOCK_HEADER of this stream, blockSize and Flags are set to 0. The client reads the stream as specified in [MS-BKUP], section 2.1, until there is no more data received from the server.<33>

A file's security information is sent using the MS_TYPE_SECURITY_DATA stream, and not sent as part of the [MS-BKUP] formatted MS_TYPE_FLAT_DATA stream.

MS_TYPE_SECURITY_DATA (6): A sequence of bytes that complies with the format of SECURITY_DESCRIPTOR. For more information, see [MS-LSAD] section 2.2.3.3.

File hash:  DFS-R defines the hash of a marshaled file to be the SHA-1 hash of only the chunks associated with the following.

  • MS_TYPE_FLAT_DATA

  • MS_TYPE_SECURITY_DATA

Changes to, for instance, the time stamps that are transferred in chunks associated with MS_TYPE_META_DATA, do not incur a change of the hash. Also, notice that the hash is computed only for the chunks and does not include the headers.

The file hash is included in the hash field of FRS_UPDATE.