CfConnectSyncRoot function (cfapi.h)

Initiates bi-directional communication between a sync provider and the sync filter API.

Syntax

HRESULT CfConnectSyncRoot(
  [in]           LPCWSTR                        SyncRootPath,
  [in]           const CF_CALLBACK_REGISTRATION *CallbackTable,
  [in, optional] LPCVOID                        CallbackContext,
  [in]           CF_CONNECT_FLAGS               ConnectFlags,
  [out]          CF_CONNECTION_KEY              *ConnectionKey
);

Parameters

[in] SyncRootPath

The path to the sync root.

[in] CallbackTable

The callback table to be registered.

[in, optional] CallbackContext

A callback context used by the platform anytime a specified callback function is invoked.

[in] ConnectFlags

Provides additional information when a callback is invoked.

[out] ConnectionKey

A connection key representing the communication channel with the sync filter.

Return value

If this function succeeds, it returns S_OK. Otherwise, it returns an HRESULT error code.

Remarks

This initiates a bi-directional communication channel between the sync provider and the sync filter. A sync provider typically calls this API soon after startup, once it has been initialized and is ready to service requests.

The sync root must be registered prior to being connected. For a given SyncRootPath, there can be at most one connection established at any given time.

The sync provider should have WRITE_DATA or WRITE_DAC access to the sync root to be connected or the API will be failed with HRESULT(ERROR_CLOUD_FILE_ACCESS_DENIED).

Requirements

   
Minimum supported client Windows 10, version 1709 [desktop apps only]
Minimum supported server Windows Server 2016 [desktop apps only]
Target Platform Windows
Header cfapi.h
Library CldApi.lib
DLL CldApi.dll