Share via

[Cfapi.h] CF_CALLBACK_TYPE_VALIDATE_DATA Functionality Not Described in Documentation

El Booshaberra 11 Reputation points
2022-12-30T17:53:26.69+00:00

The cfapi.h header documentation provided by Microsoft Learn does not explain how CF_CALLBACK_TYPE_VALIDATE_DATA is called by the provider, and when testing this callback is not called in the latest Windows 11 Insider Beta of 22623.1037.
The methods implemented by the provider are:

CF_CALLBACK_REGISTRATION FakeCloudProvider::s_MirrorCallbackTable[] =  
{  
    { CF_CALLBACK_TYPE_FETCH_DATA, FakeCloudProvider::OnFetchData },  
    { CF_CALLBACK_TYPE_CANCEL_FETCH_DATA, FakeCloudProvider::OnCancelFetchData },  
    { CF_CALLBACK_TYPE_NOTIFY_RENAME_COMPLETION, FakeCloudProvider::OnRenameCompletion },  
    { CF_CALLBACK_TYPE_NOTIFY_DELETE_COMPLETION, FakeCloudProvider::OnDeleteCompletion },  
    { CF_CALLBACK_TYPE_VALIDATE_DATA, FakeCloudProvider::OnValidateData },  
    CF_CALLBACK_REGISTRATION_END  
};  

The method FakeCloudProvider::OnValidateData:

void CALLBACK FakeCloudProvider::OnValidateData(  
    _In_ CONST CF_CALLBACK_INFO* callbackInfo,  
    _In_ CONST CF_CALLBACK_PARAMETERS* callbackParameters)  
{  
    printf("Callback Validate Data Issued\n");  
}  

I have tried hydrating a placeholder, dehydrating a placeholder, opening the file on the system, and opening a Pinned file on the system, all without this method being called, along with Restarting the Cloud Provider. I am using the Microsoft Cloud Mirror Sample.
Is there any way I can find information regarding this feature? Thanks In Advance!
Github Issue: https://github.com/microsoft/Windows-classic-samples/issues/280

Windows development | Windows API - Win32

1 answer

Sort by: Most helpful
  1. El Booshaberra 11 Reputation points
    2023-03-16T23:25:34.6366667+00:00

    From wangfu91 on GitHub: https://github.com/microsoft/Windows-classic-samples/issues/280#issuecomment-1452843924

    Set the CF_HYDRATION_POLICY_MODIFIER to CF_HYDRATION_POLICY_MODIFIER_VALIDATION_REQUIRED during the sync root registration:

    Note that this only triggers the placeholder after the placeholder has hydrated a file, not after hydration.

    - info.HydrationPolicyModifier(winrt::StorageProviderHydrationPolicyModifier::None);
    + info.HydrationPolicyModifier(winrt::StorageProviderHydrationPolicyModifier::ValidationRequired);
    

    Was this answer helpful?

    0 comments No comments

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.