question

cgrom-6970 avatar image
0 Votes"
cgrom-6970 asked ·

Error State Icon on Placeholder

Hi,
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 cfOpenFileFlags = CF_OPEN_FILE_FLAGS::CF_OPEN_FILE_FLAG_EXCLUSIVE;
                
     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);
     }
     else
     {
         // Convert to Placeholder with error state
     }
     CfCloseHandle(opLock);
     return hr;
 }
windows-api-general
10 |1000 characters needed characters left characters exceeded

Up to 10 attachments (including images) can be used with a maximum of 3.0 MiB each and 30.0 MiB total.

1 Answer

StriveSun-MSFT avatar image
0 Votes"
StriveSun-MSFT answered ·

Hello, @cgrom-6970

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.


· 2 ·
10 |1000 characters needed characters left characters exceeded

Up to 10 attachments (including images) can be used with a maximum of 3.0 MiB each and 30.0 MiB total.

Hello, @StriveSun-MSFT

thank you, but we'd like to replace the icon (like @WebDAV asked for in that thread).
Adding an icon of our choice on the rights hand side to the existing one like in the Cloud Mirror Sample would not be the best solution for us.
We'd like to have an error icon like OneDrive.

0 Votes 0 ·

@cgrom-6970, I am looking into this issue, any update will post here.

0 Votes 0 ·