ISyncMetadataStoreSerializer::SerializeReplicaMetadata

Serializes, for the specified replica, the contents of a metadata storage service store to a destination stream in a canonical format.

HRESULT SerializeReplicaMetadata(
  const BYTE * pbReplicaId,
  const ID_PARAMETERS * pIdParameters,
  IStream * pStream, 
  SYNC_SERIALIZATION_VERSION serializationVersion);

Parameters

Parameter

Description

pbReplicaId

[in] The ID of the replica for which metadata should be serialized. If the replica ID is specified as having a fixed length in the pIdParameters parameter, specify only the ID value for pbReplicaId, with no buffer size. However, if the replica ID is a variable length, the first two bytes of the buffer must include the length of the buffer passed in. For example, if the replica ID length is 16 bytes in a particular case, the value of the first two bytes in the buffer should be 18.

pIdParameters

[in] An ID_PARAMETERS Structure that specifies format settings, such as the replica ID format, for the provider whose metadata is serialized.

pStream

[in] The destination stream to which metadata is serialized. This method writes to the stream in a forward-only fashion from the current stream location. The caller must position the stream to the start of a truncated file or another appropriate starting position.

serializationVersion

[in] A SYNC_SERIALIZATION_VERSION Enumeration value that specifies for which version of Sync Framework the serialized metadata is valid. For example, if the native knowledge serialization format is Sync Framework 2.0, but the value provided for this parameter is Sync Framework 1.0, knowledge values are serialized in the 1.0 format. If knowledge values use any 2.0 features that cannot be serialized in the 1.0 format, serialization fails with a SYNC_E_INCOMPATIBLE_SERIALIZATION_VERSION error code.

Return Value

  • S_OK.

  • E_POINTER.

  • E_OUTOFMEMORY.

  • E_INVALIDARG if the specified replica ID does not exist in the associated metadata store or if the ID_PARAMETERS specified do not match the formats used for the replica.

  • SYNC_E_INVALIDOPERATION if the method is called without an open metadata store.

  • SYNC_E_METADATA_ACTIVE_TRANSACTION_REQUIRED if a transaction is not available within which to serialize metadata.

Remarks

Two conditions must be met before this method is called:

Calling this method when either of these conditions is not met results in an error return value.

See Also

Reference

ISyncMetadataStoreSerializer Interface