How to show error icon when sync fails with cloud filter apis?

Srikar Kurapati 0 Reputation points
2025-06-04T07:03:29.4133333+00:00

I am trying to create VFS using cloud filter APIs and want to implement error handling. In OnFetchData if we get any errors I want to show error icon in sync status. Can someone help what API should be called to achieve this functionality. I have tried below but no luck

CF_OPERATION_INFO opInfo = { 0 };

CF_OPERATION_PARAMETERS opParams = { 0 };

opInfo.StructSize = sizeof(opInfo);

opInfo.Type = CF_OPERATION_TYPE_TRANSFER_DATA;

opInfo.ConnectionKey = callbackInfo->ConnectionKey;

opInfo.TransferKey = callbackInfo->TransferKey;

opParams.ParamSize = CF_SIZE_OF_OP_PARAM(TransferData);

opParams.TransferData.CompletionStatus = E_FAIL;

opParams.TransferData.Buffer = nullptr;

opParams.TransferData.Offset.QuadPart = callbackParameters->FetchData.RequiredFileOffset.QuadPart;

opParams.TransferData.Length.QuadPart = callbackParameters->FetchData.RequiredLength.QuadPart;

auto hr = CfExecute(&opInfo, &opParams)

Developer technologies | C++
0 comments No comments
{count} votes

1 answer

Sort by: Most helpful
  1. Omkara Varshitha Kunapalli (INFOSYS LIMITED) 385 Reputation points Microsoft External Staff
    2025-08-18T07:00:31.97+00:00

    Thanks for reaching out !

    1. Correct Status Code: To show an error icon, you must use a STATUS_CLOUD_FILE_* error code in CompletionStatus. Using generic codes like E_FAIL will be converted to STATUS_CLOUD_FILE_UNSUCCESSFUL, which may not trigger the sync error icon.
    2. Generic codes like E_FAIL won’t trigger the icon. 
    3. Make sure CfExecute is called on the correct thread with proper access. 

     

    We are suggesting a code to fix.

    Update your code to use a more specific failure code like:

       opParams.TransferData.CompletionStatus = STATUS_CLOUD_FILE_PROVIDER_NOT_RUNNING; 

    Or any other appropriate STATUS_CLOUD_FILE_* code depending on the failure scenario.

    has context menu


Your answer

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