Error State Icon on Placeholder

cgrom 26 Reputation points

we are developping a sync engine using Cloud Filter API.
If we place a file in a synced folder, the upload to the server might fail on any reason.
We would like to set the file state to an error icon instead of the Pending or In Sync state icon.

Any help would be appreciated.

HRESULT SyncFolder::ConvertToPlaceholder(LPWSTR path)
    FileIdentity identity;
    HANDLE opLock;

    auto hr = CfOpenFileWithOplock(path, cfOpenFileFlags, &opLock);

    USN usn = {};
    if (hr != S_OK)
        return hr;

    HRESULT hrUpload = Upload(opLock, &identity);
    if ((hrUpload == S_OK)
        hr = CfConvertToPlaceholder(opLock, &identity, sizeof(FileIdentity), 
                    CF_CONVERT_FLAGS::CF_CONVERT_FLAG_MARK_IN_SYNC, &usn, nullptr);
        // Convert to Placeholder with error state
    return hr;
Windows API - Win32
Windows API - Win32
A core set of Windows application programming interfaces (APIs) for desktop and server applications. Previously known as Win32 API.
2,519 questions
0 comments No comments
{count} votes

1 answer

Sort by: Most helpful
  1. Strive Sun-MSFT 426 Reputation points

    Hello, @cgrom

    Please check if this thread is useful.

    How to change a Cloud File placeholder's status icon?


    Thank you!

    If the answer is helpful, please click "Accept Answer" and upvote it.

    Note: Please follow the steps in our documentation to enable e-mail notifications if you want to receive the related email notification for this thread.