CfGetSyncRootInfoByHandle function (cfapi.h)

Gets various characteristics of the sync root containing a given file specified by a file handle.

Syntax

HRESULT CfGetSyncRootInfoByHandle(
  [in]            HANDLE                  FileHandle,
  [in]            CF_SYNC_ROOT_INFO_CLASS InfoClass,
  [out]           PVOID                   InfoBuffer,
  [in]            DWORD                   InfoBufferLength,
  [out, optional] DWORD                   *ReturnedLength
);

Parameters

[in] FileHandle

Handle of the file under the sync root whose information is to be queried.

[in] InfoClass

Types of sync root information.

[out] InfoBuffer

A pointer to a buffer that will receive the sync root information.

[in] InfoBufferLength

Length, in bytes, of the InfoBuffer.

[out, optional] ReturnedLength

The number of bytes returned in the InfoBuffer.

Return value

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

Remarks

Unlike most placeholder APIs that take a file handle, this one does not modify the file in any way, therefore the FileHandle only requires READ_ATTRIBUTES access.

If the file is not underneath a cloud files sync root, the API will fail. On success, information is returned according to the specific InfoClass requested.

Requirements

Requirement Value
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

See also

CfGetSyncRootInfoByPath