ReplOpenSync

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

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

Parameters

  • pguid
    [in] Pointer to the CEGUID 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 that the ReplGetSyncState function obtains. To begin a new session, pass in NULL for this parameter.
  • dwSize
    [in] Size of the synchronization state buffer, in bytes, that the ReplGetSyncState function obtains. To begin a new session, pass in zero for this parameter.
  • dwSyncFlags
    [in] Desired settings for the synchronization session. The following table shows the accepted flags.
    Flag Description
    REPL_SYNC_ALLOWOVERWRITE Allows this client to overwrite changes made by other applications that it has not yet synchronized.
    0 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 Values

Returns TRUE if you successfully create or reopen the session. Returns FALSE if an error occurs. For extended error information, see the GetLastError function.

Remarks

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

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

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 within the client thread's process. You may change the synchronization flags at any time to determine the future write and delete behavior of the client.

This API is part of the counter-based replication model and is not supported under the bit-based replication model.

Requirements

OS Versions: Windows CE .NET 4.0 and later.
Header: Pwindbas.h.
Link Library: Coredll.lib.

See Also

Counter-Based Replication | CeDeleteRecord | CeWriteRecordProps | ReplChangeSyncSettings | ReplCheckpoint | ReplCloseSync | ReplFindNextChange | ReplGetSyncState

Last updated on Wednesday, April 13, 2005

© 2005 Microsoft Corporation. All rights reserved.