Compartilhar via


ReplOpenSync (Compact 2013)

3/26/2014

This function creates a new synchronization session or resumes an existing one.

Syntax

BOOL ReplOpenSync(
  CEGUID* pguid,
  LPBYTE lpSyncState,
  DWORD dwSize,
  DWORD dwSyncFlags,
  HREPL* phRepl
);

Parameters

  • pguid
    [in] Pointer to the CEGUID structure of the volume to synchronize. Use the CREATE_SYSTEMGUID macro to synchronize with the object store.
  • lpSyncState
    [in] Buffer of data containing state information from a previous synchronization session obtained by the ReplGetSyncState function. To begin a new session, set this parameter to NULL.
  • dwSize
    [in] Size of the synchronization state buffer, in bytes, obtained by the ReplGetSyncState function. To begin a new session, set this parameter to zero.
  • dwSyncFlags
    [in] Settings for the synchronization session. The following table table shows possible values.

    Flag

    Description

    REPL_SYNC_ALLOWOVERWRITE

    Enables this client to overwrite changes made by other applications that it has not yet synchronized.

    Zero

    Blocks this client from overwriting changes made by other applications that it has not yet synchronized.

  • phRepl
    [out] Pointer to an HREPL that receives a handle to the open session.

Return Value

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

Remarks

A client thread can only have one synchronization session open at a time, on a single database volume or on the object store. A synchronization client can have sessions open on multiple volumes at the same time. To open another session on the same volume, call the ReplCloseSync function to close the first session. Any other threads cannot use the session handle returned by this function.

The synchronization flags affect modifications made by the client thread only. They do not affect the behavior of other clients or applications or of other threads in the client thread's process. You can change the synchronization flags at any time to determine the future write and delete behavior of the client.

The synchronization flags affect the behavior of the CeWriteRecordProps (CEDB) and the CeDeleteRecord (CEDB) functions. These functions fail with ERROR_ACCESS_DENIED to block the synchronization client from overwriting changes it has not yet read.

Requirements

Header

pwindbas.h

Library

coredll.lib

See Also

Reference

Database Replication Functions
CeDeleteRecord (CEDB)
CeWriteRecordProps (CEDB)
ReplChangeSyncSettings
ReplCheckpoint
ReplCloseSync
ReplFindNextChange
ReplGetSyncState