Change error message when canceling delete operation in Cloud Filter API

cgrom 26 Reputation points
2021-02-19T14:53:24.87+00:00

Hi,
we are developping a sync engine using Cloud Filter API. We need to prevent deletion on some files.

We're using the delete callback (CF_CALLBACK_TYPE_NOTIFY_DELETE) to cancel the delete operation. This always displays the
following error dialog: 0x80070185 "The cloud operation was unsuccessful".

70066-cloudopunsuccessful.png

We use following code to prevent the deletion:

   HRESULT SyncFolder::AckDelete(CF_CONNECTION_KEY connectionKey, CF_TRANSFER_KEY transferKey, CF_REQUEST_KEY requestKey, NTSTATUS status)  
   {  
   	CF_OPERATION_INFO opInfo = { 0 };  
   	opInfo.ConnectionKey = connectionKey;  
   	opInfo.TransferKey = transferKey;  
   	opInfo.RequestKey = requestKey;  
   	...  
   	CF_OPERATION_PARAMETERS opParams = { 0 };  
   	opParams.AckDelete.CompletionStatus = status;	// e.g. STATUS_ACCESS_DENIED  
   	...  
   	CfExecute(&opInfo, &opParams);  
   }  

We tried different values for status but we always get the same error message.

Is there a way to provide a more specific message? (e.g. access denied)

Side note: The delete callback is called three times if we prevent the deletion.

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,654 questions
{count} votes

Accepted answer
  1. Fei Xue - MSFT 1,111 Reputation points
    2021-02-26T05:36:07.607+00:00

    @cgrom , Thanks for sharing this info.

    It must set a STATUS_CLOUD_FILE_* status in CompletionStatus. Any status code returned outside of STATUS_CLOUD_FILE_* range except for STATUS_SUCCESS will be converted to STATUS_CLOUD_FILE_UNSUCCESSFUL by the platform. Please use the STATUS_CLOUD_FILE_ACCESS_DENIED instead of STATUS_ACCESS_DENIED. More status, please refer to the ntstaus.h

    I will also try to raise the document issue about this. Thanks for your understanding.

    3 people found this answer helpful.

0 additional answers

Sort by: Most helpful

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.