CfDisconnectSyncRoot function (cfapi.h)

Disconnects a communication channel created by CfConnectSyncRoot.


HRESULT CfDisconnectSyncRoot(
  [in] CF_CONNECTION_KEY ConnectionKey


[in] ConnectionKey

The connection key returned from CfConnectSyncRoot that is now used to disconnect the sync root.

Return value

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


This removes the communication channel with the platform that was previously established using CfConnectSyncRoot.

A sync provider can still receive callbacks during the CfDisconnectSyncRoot call, and the provider is free to choose whether the call needs to fail or be serviced. Either choice will not cause disruptions to the sync provider.

After a call to CfDisconnectSyncRoot returns, the sync provider will no longer receive callbacks and the platform will fail any operation that depends on said callbacks.

A sync provider should have WRITE_DATA or WRITE_DAC access to the sync root to be disconnected or a call to CfDisconnectSyncRoot will be failed with HRESULT(ERROR_CLOUD_FILE_ACCESS_DENIED). Also, if the sync root has not been previously connected, the call will be failed with invalid parameters.


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