Share via


ReplFindNextChange (Compact 2013)

3/26/2014

This function is used by synchronization clients use to enumerate the changes made by other applications in the object store or database volume.

Syntax

BOOL ReplFindNextChange(
  HREPL hRepl,
  REPLCHANGEINFO* lpChangeInfo,
  BOOL fRestart
);

Parameters

  • hRepl
    [in] Handle to an open synchronization session, obtained from the ReplOpenSync function.
  • lpChangeInfo
    [out] Pointer to a REPLCHANGEINFO structure that receives information about one changed object in the volume.
  • fRestart
    [in] Flag that indicates whether to reset the iteration at the beginning of changes since the last checkpoint.

Return Value

TRUE indicates success. FALSE indicates failure. For extended error information, call GetLastError.

If no more changed items exist, the call returns FALSE, and GetLastError returns ERROR_NO_MORE_ITEMS.

Remarks

On the first call to this function after the synchronization opens or following a checkpoint, the synchronization state receives a list of changed items to enumerate. On each following call to this function, the position in the list is incremented and the next item returned. You can reset the position in the list with fRestart. Using fRestart resets the enumeration of changed items following the synchronization session creation or since the last checkpoint. It does not back up past a previous checkpoint. To completely re-enumerate items in the volume, create a new synchronization session by calling ReplOpenSync without a state buffer.

Performing a checkpoint resets the enumeration state used by this function. Following a checkpoint, this function returns the changes made by other threads and applications since the previous checkpoint. Calling the ReplCheckpoint function before all changes have been enumerated discards the list of changes to be enumerated by this function and can result in some data not being synchronized.

The state of the enumeration is included in the state information obtained from the ReplGetSyncState function. If you pass the saved state buffer to ReplOpenSync, the enumeration can resume without loss after a call to the ReplCloseSyncReplCloseSync function.

With the exception of deletions, this function does not return changes made by the present client to the present client. Due to the incomplete information that is stored about deleted items, this function can report some deletions to the thread that performed them. In addition, a client can receive duplicate reports of some deletions if an application deletes and does not reuse an OID. Write clients so that unexpected deletion reports do not cause problems.

This function returns only items that have been created, modified, or deleted before the last checkpoint. Items that were changed since the last checkpoint are not reported until after the next checkpoint.

This function returns only items that have a status of REPLSTATUS_MODIFIED or REPLSTATUS_DELETED. For more information about these status flags, see REPLCHANGEINFO.

Requirements

Header

pwindbas.h

Library

coredll.lib

See Also

Reference

Database Replication Functions
ReplCheckpoint
ReplCloseSync
ReplGetOidStatus
ReplGetSyncState
ReplOpenSync
REPLCHANGEINFO