Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Windows update 19041.685 broke the example code Placeholders.cpp#L73 #164

Closed
TheOneRing opened this issue Dec 15, 2020 · 3 comments
Closed

Comments

@TheOneRing
Copy link

TheOneRing commented Dec 15, 2020

The recent update 19041.685 broke the example code in

std::wstring relativeName(sourceSubDir);

The code now fails with the error Failed to create placeholder for folder\file.txt with 8007017c for all relative paths including a folder.

A workaround for the issue is to provide the complete directory as BaseDirectoryPath to CfCreatePlaceholders
and set the RelativeFileName of CF_PLACEHOLDER_CREATE_INFO to the file name only.
While the documentation can be interpreted that way, the wording and this example here were misleading.

The behavioural change in combination with bad error handling on our side has caused us quite some trouble and potential data loss for our customers.

@oldnewthing
Copy link
Member

oldnewthing commented Dec 15, 2020

Thanks. The team is working on putting together an update to the sample.

I do have confirmation that the problem is indeed that the sample wasn't setting RelativeFileName to just a file name. The update tightened enforcement of this pre-existing requirement.

@ban-dana
Copy link

On this note, any way to get more detailed information about the infamous 0x8007017c error? There seems to be some ETL logs in %windir%\system32\LogFiles\CloudFiles, but they seem to require private pdbs.... Anything else maybe?

oldnewthing pushed a commit that referenced this issue Dec 24, 2020
RelativeFileName must be a file name, not a relative path.

Other fixes:
* Use std::wstring::size() instead of calling wcslen.
* Use c_str() instead of data() if you want a null-terminated read-only C-style string.
* Fix typos in wprintf format strings.
@oldnewthing
Copy link
Member

Fix is out. Thanks for your patience.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants