Share via

Why does generating desktop.ini trigger CF_CALLBACK_TYPE_FETCH_PLACEHOLDERS?

si zuo 20 Reputation points
2024-01-29T10:09:32.13+00:00

Hi dears: A program for a cloud filter has been implemented according to the following URL. https://learn.microsoft.com/en-us/windows/win32/cfapi/build-a-cloud-file-sync-engine

and it is configured for on-demand loading: The PopulationPolicy of StorageProviderSyncRootInfo is set to StorageProviderPopulationPolicy::Full.

When creating a cloud folder, the SHGetSetFolderCustomSettings function is used to set a custom icon for the folder, which generates a desktop.ini file.

At this point, the callback method for CF_CALLBACK_TYPE_FETCH_PLACEHOLDERS is triggered.

Why does this happen, and how can one avoid triggering the callback method for CF_CALLBACK_TYPE_FETCH_PLACEHOLDERS?

Thanks

Best

Windows development | Windows API - Win32
0 comments No comments

Answer accepted by question author

Jeanine Zhang-MSFT 11,356 Reputation points Microsoft External Staff
2024-01-30T02:08:18.75+00:00

Hello,

Welcome to Microsoft Q&A!

CF_CALLBACK_TYPE_FETCH_PLACEHOLDERS callback is used to ask the sync provider to provide information about the contents of a placeholder directory to satisfy a directory query operation or an attempt to open a file underneath the directory.

According to the Doc: CF_OPERATION_TRANSFER_PLACEHOLDERS_FLAGS enumeration

If the provider no longer wants its CF_CALLBACK_TYPE_FETCH_PLACEHOLDERS callback to be invoked, it should mark the placeholder directory fully populated by setting the CF_OPERATION_TRANSFER_PLACEHOLDERS_FLAG_DISABLE_ON_DEMAND_POPULATION flag in CF_OPERATION_TYPE_TRANSFER_PLACEHOLDERS`.

If you no longer want to trigger the callback method for CF_CALLBACK_TYPE_FETCH_PLACEHOLDERS. I suggest you could try to set the flag CF_OPERATION_TRANSFER_PLACEHOLDERS_FLAG_DISABLE_ON_DEMAND_POPULATION in the callback.

Thank you.

Jeanine


If the answer is the right solution, please click "Accept Answer" and kindly upvote it. If you have extra questions about this answer, please click "Comment". 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.

Was this answer helpful?


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.