OK, now I've been reading the Handling View Changes multiple time. According to Item Versioning,
if a different version of that file exists in the new view the provider may replace the placeholder on disk with an updated one whose ContentID is associated with the new timestamp by calling PrjUpdateFileIfNeeded. Alternatively, the provider may delete the placeholder by calling PrjDeleteFile so that the new view of the file will be projected in enumerations.
This is done in
if (newViewPlaceholderInfo == NULL)
{
// The file no longer exists in the new view. We want to remove its
// placeholder from the local cache.
PRJ_UPDATE_FAILURE_CAUSES deleteFailureReason;
hr = PrjDeleteFile(callbackData->NamespaceVirtualizationContext,
placeholder->RelativePath,
PRJ_UPDATE_ALLOW_DIRTY_METADATA
| PRJ_UPDATE_ALLOW_DIRTY_DATA
| PRJ_UPDATE_ALLOW_TOMBSTONE,
&deleteFailureReason);
// MyRemovePlaceholderData is a routine the provider might implement
// to remove an item from its list of placeholders it has created in
// the view.
MyRemovePlaceholderData(placeholder);
}
else
{
// The file exists in the new view. Its local cache state may need
// to be updated, for example if its content is different in this view.
// As an optimization, the provider may compare the file's ContentID
// in the new view (stored in newViewPlaceholderInfo->ContentId) with
// the ContentID it had in the old view. If they are the same, calling
// PrjUpdateFileIfNeeded would not be needed.
PRJ_UPDATE_FAILURE_CAUSES updateFailureReason;
hr = PrjUpdateFileIfNeeded(callbackData->NamespaceVirtualizationContext,
placeholder->RelativePath,
newViewPlaceholderInfo,
newViewPlaceholderInfoSize,
PRJ_UPDATE_ALLOW_DIRTY_METADATA
| PRJ_UPDATE_ALLOW_DIRTY_DATA
| PRJ_UPDATE_ALLOW_TOMBSTONE,
&updateFailureReason);
// MyUpdatePlaceholderData is a routine the provider might implement
// to update information about a placeholder it has created in the view.
MyUpdatePlaceholderData(placeholder, newViewPlaceholderInfo);
}
For the risks of getting out of sync, the 1st step supplies the timestamp solution but note
The client establishes a view by specifying the timestamp at which to present the repository contents. This would be done through some interface implemented by the provider, not via a ProjFS API.
MyGetProjectedFileInfo
uses the newViewTime
to identify the change.