Cloud File API FAQ

alan henry 0 Reputation points
2025-06-28T02:40:29.4833333+00:00

Based on the introduction from Windows official documentation at https://learn.microsoft.com/en-us/windows/win32/cfapi/build-a-cloud-file-sync-engine and the ​​Cloud Mirror Sample​​, we attempted to develop a SyncEngine independently. However, we encountered numerous issues. We believe other developers may face similar challenges, so we have listed them in detail below, hoping that Windows system developers can provide thorough explanations.

  1. The article https://learn.microsoft.com/en-us/windows/win32/cfapi/build-a-cloud-file-sync-engine suggests that the Cloud File API comprises two parts: the ​​Cloud Filter API​​ and the ​​Windows.Storage.Provider namespace​​. What is the relationship between these two? In the sample, winrt::StorageProviderSyncRootManager::Register is used, while the Cloud Filter API provides CfRegisterSyncRoot. What is the difference between these two functions? Must both be used? Or which one is recommended?
  2. Can a ​​background console application​​ (without a desktop UI) be developed using the Cloud File API?
  3. After developing with the Cloud File API, is the article https://learn.microsoft.com/en-us/windows/win32/shell/integrate-cloud-storage still relevant as a reference?
  4. Referring to the Cloud Mirror sample, we implemented the creation and deletion of file and directory placeholders. However, when deleting an ​​empty directory​​, Explorer prompts a timeout error (error code 0x800701AA). Why does this occur? Is it due to an unimplemented callback? Or could there be an issue with the properties of the placeholder created via CfCreatePlaceholders?
  5. What is the ​​default timeout duration​​ for the Cloud File API? Can this timeout be adjusted? If the timeout is short and non-adjustable, and user operations are frequent, what approach is recommended for implementing the SyncEngine?
  6. Does the Cloud File API provide ​​logs​​ to assist in issue diagnosis? How can we quickly identify which specific interface timed out?
  7. Is the ​​status and UI display​​ implemented via COM interfaces in the sample mandatory?
  8. While the SyncEngine is ​​online​​, how should it identify ​​newly added files​​ under the SyncRoot? If the SyncEngine is ​​offline​​, and files are added/deleted under the SyncRoot, how should these changes be detected later?
  9. When the SyncEngine starts, will new files created under the SyncRoot automatically have placeholders added? After the SyncEngine uploads a local file to the cloud, is it necessary to manually call a function to transition the file state to "full"?​
  10. During the ​​Hydrate process​​, if file download is canceled, will the system ​​automatically clear​​ the partially downloaded data? Or must Dehydrate be explicitly called?
  11. Can a ​​chunked download approach​​ be used for hydration? Does CfExecute support this method?
  12. During file deletion, we received ​​two Delete callbacks​​. Is this behavior expected?
  13. As development progresses, additional questions may arise. We appreciate ongoing support for future issues.

My questions might be a bit lengthy and complicated—please bear with me.

Windows development | Windows API - Win32
{count} votes

1 answer

Sort by: Most helpful
  1. Danny Nguyen (WICLOUD CORPORATION) 3,930 Reputation points Microsoft External Staff Moderator
    2025-11-10T10:57:25.4366667+00:00

    Hi,

    Thank you for posting in Microsoft Learn Q&A forum,

    I will try to address your answer in chunks to keep the response not bloat. Feel free to let me know if you need clarification anywhere.

    1. The Cloud Files API consists of the Cloud Filter API and Windows.Storage.Provider namespace.
      • Cloud Filter API: "This native Win32 API provides functionality at the boundary between the user mode and the file system. This API handles the creation and management of placeholder files and directories."
      • Windows.Storage.Provider namespace: "This WinRT API enables applications to configure the cloud storage provider and register the sync root with the operating system."
      Cloud Filter API manages file system interactions; Windows.Storage.Provider handles configuration and shell integration.
      • CfRegisterSyncRoot: Win32 function for sync root registration using CF_SYNC_REGISTRATION structure.
      • winrt::StorageProviderSyncRootManager::Register: WinRT method that "Registers a sync root with the operating system" using StorageProviderSyncRootInfo.
      In short, CfRegisterSyncRoot is low-level (Win32); Register is high-level (WinRT) for easier shell integration. Use one, not both. WinRT Register is recommended for modern apps.
    2. Yes, a background console application (no UI) can use the Cloud Files API, as sync engines can run as background processes via Win32 APIs.
    3. Yes, aside from legacy overlay/placeholder parts superseded by CFAPI, the “Integrate cloud storage” doc is still relevant for Shell integration (context menus, property/thumbnail handlers, indexing, UX guidelines).
    4. Error 0x800701AA means "The cloud operation was not completed before the time-out period expired." This occurs if the sync engine doesn't respond to deletion callbacks in time, likely due to an unimplemented callback like CF_CALLBACK_DELETE_FLAGS: "This callback informs the sync provider that a placeholder file or directory under one of its sync roots is about to be deleted or undeleted." Not typically an issue with CfCreatePlaceholders properties; implement deletion callbacks properly.

Your answer

Answers can be marked as 'Accepted' by the question author and 'Recommended' by moderators, which helps users know the answer solved the author's problem.