CfGetTransferKey function (cfapi.h)

Initiates a transfer of data into a placeholder file or folder.

Syntax

HRESULT CfGetTransferKey(
  [in]  HANDLE          FileHandle,
  [out] CF_TRANSFER_KEY *TransferKey
);

Parameters

[in] FileHandle

The file handle of the placeholder.

[out] TransferKey

An opaque handle to the placeholder to be serviced.

Return value

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

Remarks

CfGetTransferKey is used as an alternative to CfHydratePlaceholder to proactively initiate data transfer into a placeholder.

A sync provider should have READ_DATA or WRITE_DAC access to the file whose transfer key is to be obtained or CfGetTransferKey will be failed with HRESULT(ERROR_CLOUD_FILE_ACCESS_DENIED).

The TransferKey is valid as long as the FileHandle used to obtain it remains open. The sync provider must pass the TransferKey to CfExecute to perform the desired operation on the placeholder file or folder. When a TransferKey is no longer being used, it must be released using CfReleaseTransferKey.

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