Share via

Cloud Filter API Delete callback deletes a file regardless of the CompletionStatus code

WebDAV 106 Reputation points
2021-08-23T05:03:05.523+00:00

I am trying to implement CF_CALLBACK_TYPE_NOTIFY_DELETE callback in Cloud Filter API. Whatever error code I return from the delete callback the placeholder is always deleted. This issue appeared in the recent Windows update 21H1. It was working properly on the previous Windows versions.

The expected behaviour is:
If the file fails to delete in my remote storage, I set the error code in CompletionStatus and the placeholder is NOT deleted in the client file system.

Here is my code:

void CALLBACK FakeCloudProvider::OnNotifyDelete(
    _In_ CONST CF_CALLBACK_INFO* callbackInfo,
    _In_ CONST CF_CALLBACK_PARAMETERS* callbackParameters)
{
    CF_OPERATION_INFO opInfo = { 0 };

    opInfo.StructSize = sizeof(CF_OPERATION_INFO);
    opInfo.Type = CF_OPERATION_TYPE_ACK_DELETE;
    opInfo.ConnectionKey = callbackInfo->ConnectionKey;
    opInfo.TransferKey = callbackInfo->TransferKey;
    opInfo.CorrelationVector = callbackInfo->CorrelationVector;
    opInfo.RequestKey = callbackInfo->RequestKey;

    CF_OPERATION_PARAMETERS params = {0};
    params.ParamSize = sizeof(CF_OPERATION_PARAMETERS);
    params.AckDelete.Flags = CF_OPERATION_ACK_DELETE_FLAG_NONE;

    // Whatever code I set here the file is always deleted
    params.AckDelete.CompletionStatus = STATUS_IO_DEVICE_ERROR; 

    HRESULT res = CfExecute(&opInfo, &params);
}
Windows development | Windows API - Win32
0 comments No comments

Answer accepted by question author

Xiaopo Yang - MSFT 12,736 Reputation points Microsoft External Staff
2021-08-23T07:27:11.247+00:00

According to the Question, This does be a bug.

Was this answer helpful?

0 comments No comments

0 additional answers

Sort by: Most helpful

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.