ISaveChangeContext2::SetConstraintConflictOnChange
Reports that a constraint conflict occurred when the destination provider tried to apply the change to the destination replica.
HRESULT SetConstraintConflictOnChange(
const BYTE * pbConflictingItemId,
CONSTRAINT_CONFLICT_REASON constraintConflictReason);
Parameters
- pbConflictingItemId
[in, unique] The item ID of the destination item that conflicts with the change to be applied.
- constraintConflictReason
[in] The reason the conflict occurred.
Return Value
S_OK.
E_INVALIDARG when constraintConflictReason is not a valid value, or when constraintConflictReason is CCR_COLLISION and pbConflictingItemId is NULL.
SYNC_E_INVALID_OPERATION if a constraint conflict or recoverable error has already been set on this object.
Remarks
A constraint conflict occurs when a destination provider tries to apply a change to the destination replica, and the change violates a constraint of the destination replica, such as the relationship of folders or the location of identically named data within a file system.
When the destination provider uses this method to report a constraint conflict, the change applier resolves the conflict according to either the conflict resolution policy set for the session, or the conflict resolution action set by the application for the specified conflict. The change applier then dispatches any necessary calls to the destination provider so that the destination provider can apply the resolved conflict to the destination replica. For more information, see Detecting and Resolving Constraint Conflicts.