ISyncChangeBatch2::AddMergeTombstoneMetadataToGroup
Adds the specified merge tombstone to the group that is currently open.
HRESULT AddMergeTombstoneMetadataToGroup(
const BYTE * pbOwnerReplicaId,
const BYTE * pbWinnerItemId,
const BYTE * pbItemId,
const SYNC_VERSION * pChangeVersion,
const SYNC_VERSION * pCreationVersion,
DWORD dwWorkForChange,
ISyncChangeBuilder ** ppChangeBuilder);
Parameters
- pbOwnerReplicaId
[in] The replica ID of the replica where pChangeVersion and pCreationVersion are valid. The ID format must match the format that is specified by the ID_PARAMETERS structure of the provider.
- pbWinnerItemId
[in] The ID of the item after the merge occurred. This is also called the winning ID. The ID format must match the format that is specified by the ID_PARAMETERS structure of the provider.
- pbItemId
[in] The ID of the item before the merge occurred. This is also called the losing ID. The ID format must match the format that is specified by the ID_PARAMETERS structure of the provider.
- pChangeVersion
[in] The version of this change.
- pCreationVersion
[in] The creation version of the item identified by pbItemId.
- dwWorkForChange
[in] The work estimate for the change. This value is used during change application to report completed work to the application.
- ppChangeBuilder
[in, out, unique] Returns an object that can be used to add change unit information to the change.
Return Value
S_OK.
E_POINTER.
SYNC_E_CHANGE_BATCH_IS_READ_ONLY when the ISyncChangeBatch2 object has been sent to a change applier or to the synchronization session, or when the object was created by using IProviderSyncServices::DeserializeChangeBatch or IProviderSyncServices::DeserializeFullEnumerationChangeBatch.
SYNC_E_INVALID_OPERATION when no group is open or an empty group was previously added to the batch.
SYNC_E_RANGE_OUT_OF_ORDER when an ordered group is open and pbItemId is less than the item ID of the previous item that was added to the group, or less than the item ID that was specified when the group was opened.
Remarks
A merge tombstone is created when a constraint conflict is resolved by merging the two items in conflict. When a constraint conflict is resolved by merging, the smaller of the item IDs is chosen as the winning item ID and the larger is the losing item ID. The winning item ID is used to identify the merged item. The merge tombstone tracks that the losing item ID identifies the same item as the winning item ID in the synchronization community. The metadata for a merge tombstone is the same as that for a deleted item tombstone, with the addition of the winning item ID.