Share via


ISynchronousNotifyingChangeApplier::ApplyChanges

Performs conflict detection, conflict handling, and change application for a batch of changes,

HRESULT ApplyChanges( 
  CONFLICT_RESOLUTION_POLICY resolutionPolicy,
  ISyncChangeBatch *pSourceChanges,
  IUnknown * pUnkDataRetriever,
  IEnumSyncChanges * pDestinationVersions,
  ISyncKnowledge *pDestinationKnowledge,
  IForgottenKnowledge *pDestinationForgottenKnowledge,
  ISynchronousNotifyingChangeApplierTarget * pChangeApplierTarget,
  ISyncSessionState * pSessionState,
  ISyncCallback *pCallback);

Parameters

Parameter

Description

resolutionPolicy

[in] The policy to use for resolving conflicts.

pSourceChanges

[in] The batch of changes from the source provider.

pUnkDataRetriever

[in] An object that can be used to retrieve item data from the source replica.

pDestinationVersions

[in] A list of changes that contains the versions of items that are stored in the destination replica. These items correspond to the items in pSourceChanges.

pDestinationKnowledge

[in] The knowledge of the destination replica.

pDestinationForgottenKnowledge

[in] The forgotten knowledge of the destination replica.

pChangeApplierTarget

[in] The object that will be called to save changes and conflicts.

pSessionState

[in, unique] State information about the current session.

pCallback

[in, unique] Callbacks that will receive notifications about change application events.

Return Value

  • S_OK

  • E_OUTOFMEMORY

  • E_POINTER

  • SYNC_E_OBJECT_NEEDS_STATE

  • SYNC_E_INTERNAL_ERROR

  • SYNC_E_CHANGE_COUNT_MISMATCH

  • SYNC_E_CHANGE_NEEDS_KNOWLEDGE

  • SYNC_E_ITEM_HAS_NO_CHANGE_UNITS

  • SYNC_E_CHANGE_NOT_IN_KNOWLEDGE

  • SYNC_E_CHANGE_UNIT_COUNT_MISMATCH

  • SYNC_E_NOT_EXPECTED_CHANGE

  • SYNC_E_ITEM_MUST_EXIST

  • SYNC_E_ID_FORMAT_MISMATCH

  • SYNC_E_BATCH_NEEDS_KNOWLEDGE

Remarks

Typically, this method is called by a provider from its IKnowledgeSyncProvider::ProcessChangeBatch method. This method detects conflicts that occur between the changes sent in pSourceChanges and the corresponding items in the destination replica. It resolves any conflicts according to the policy that is specified by resolutionPolicy. If it is necessary, this method then calls methods on pChangeApplierTarget to save changes to the destination replica and to save unresolved conflicts.

If pDestinationVersions is NULL, this method calls ISynchronousNotifyingChangeApplierTarget::GetDestinationVersion on pChangeApplierTarget for each item in pSourceChanges.

See Also

Reference

ISynchronousNotifyingChangeApplier Interface
CONFLICT_RESOLUTION_POLICY Enumeration