microsoft/Windows-classic-samples

CloudMirror doesn't provide an example of IStorageProviderCopyHook implementation

dmitryshunkov opened this issue · 1 comments

The documentation for CloudMirror was updated to reflect the support of IStorageProviderCopyHook interface by cloud files API. The interface is not documented.
I tried to implement it without success. Only the constructor and destructor of the custom implementation are getting called, but not the CopyCallback method. Example code:

#include "stdafx.h"
#include "StorageProviderCopyHook.h"

StorageProviderCopyHook::StorageProviderCopyHook()
{
    wprintf(L"StorageProviderCopyHook constructor called\n");
}

StorageProviderCopyHook::~StorageProviderCopyHook()
{
    wprintf(L"StorageProviderCopyHook destructor called\n");
}

IFACEMETHODIMP StorageProviderCopyHook::CopyCallback(_In_ HWND hwnd, _In_ UINT operation, _In_ UINT flags, _In_ LPCWSTR srcFile, _In_ DWORD srcAttribs, _In_ LPCWSTR destFile, _In_ DWORD destAttribs, _Out_ UINT* result)
{
    wprintf(L"StorageProviderCopyHook CopyCallback called\n");
    return E_NOTIMPL;
}

Produces next output on file renaming:

StorageProviderCopyHook constructor called
StorageProviderCopyHook destructor called
Thumbnail requested for....

So, CopyCallback never gets called. Please, provide an example of working IStorageProviderCopyHook implementation in the CloudMirror sample.

@dmitryshunkov The doc says:

The Shell calls the cloud provider's copy hook handler for every folder under the registered sync root.

renaming file won't trigger the CopyCallback, try rename a folder.