CfRegisterSyncRoot function (cfapi.h)

Performs a one time sync root registration.


HRESULT CfRegisterSyncRoot(
  LPCWSTR                    SyncRootPath,
  const CF_SYNC_REGISTRATION *Registration,
  const CF_SYNC_POLICIES     *Policies,
  CF_REGISTER_FLAGS          RegisterFlags



The path to the sync root to be registered.


Contains information about the sync provider and sync root to be registered.


The policies of the sync root to be registered.


Flags for registering previous and new sync roots.

Return value

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


This can be used at a sync provider install time, first time set up for an individual user, or when a user configures another sync root (if this scenario is supported).

This performs a one time sync root registration, which allows a sync provider to utilize an entire directory tree structure. Note that no two sync roots directory trees can overlap with one another.


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