question

StefanAngelov-6321 avatar image
0 Votes"
StefanAngelov-6321 asked XiaopoYang-MSFT answered

CldApi: Saving a hydrated text file with WordPad leads to reparse point being deleted and file not being recognized as a placeholder anymore

While working to implement a sync-engine/cloud-storage provider using Microsoft's cloud api (CldApi) I have come to across a situation, in which a text file lost its reparse point after being saved with WordPad.

The manifestation of this is the error "The file is not a cloud file." when calling CfGetPlaceholderInfo.

In contrast reparse point is not lost when saving a similar text file with Notepad.

I have verified that reparse data is missing through:

'fsutil reparsepoint query <filename>'

where in the "good/normal" case I have:

Reparse Tag Value : 0x9000601a Tag value: Microsoft Tag value: Directory Reparse Data Length: 0xf2 Reparse Data: ......... <...reparese point data...>

and in the "bad/abnormal" case, respectively:


Error: The file or directory is not a reparse point.


Could an expert advise if this is a problem of the application (Wordpad) or one of the cloud minifilter, or is it something I may be doing wrong on my end when populating/hydrating placeholder files?

Regards,
Stefan

windows-api
5 |1600 characters needed characters left characters exceeded

Up to 10 attachments (including images) can be used with a maximum of 3.0 MiB each and 30.0 MiB total.

XiaopoYang-MSFT avatar image
0 Votes"
XiaopoYang-MSFT answered

As Compatibility with applications that use reparse points said,

the cloud files API always hides its reparse points from all applications except for sync engines and processes whose main image resides under %systemroot%. Applications that understand reparse points correctly can force the platform to expose cloud files API reparse points using RtlSetProcessPlaceholderCompatibilityMode or RtlSetThreadProcessPlaceholderCompatibilityMode.

Perhaps you should check the CloudMirror sample to verify.

5 |1600 characters needed characters left characters exceeded

Up to 10 attachments (including images) can be used with a maximum of 3.0 MiB each and 30.0 MiB total.

StefanAngelov-6321 avatar image
0 Votes"
StefanAngelov-6321 answered XiaopoYang-MSFT commented

Greetings, and thanks for your reply!

I have re-read the quote you posted several times already before posting my question. In my opinion this concerns applications which ultimately work with "cloud" files (e.g. Wordpad in my case), i.e. I would not benefit from using these methods in the sync-engine itself.

I have also looked over the code of the CloudMirror sample, but I am not completely sure what I am looking to find there, or do you suggest I run it to see if the behavior is reproducible?

Regards,
Stefan

· 3
5 |1600 characters needed characters left characters exceeded

Up to 10 attachments (including images) can be used with a maximum of 3.0 MiB each and 30.0 MiB total.

Yes. Can you reproduce it with the the CloudMirror sample?

0 Votes 0 ·

Greetings, again,

The same behavior can be reproduced with the CloudMirror sample as well; took me some time to get it running..


C:\cld\dst>fsutil reparsepoint query TF2.txt
Reparse Tag Value : 0x9000201a
Tag value: Microsoft
Tag value: Directory

Reparse Data Length: 0x98
Reparse Data:
0000: 01 00 98 00 46 65 52 70 f4 13 0a ab 94 00 00 00 ....FeRp........
0010: 02 00 0a 00 07 00 01 00 60 00 00 00 0a 00 04 00 ........`.......
0020: 64 00 00 00 06 00 08 00 78 00 00 00 11 00 10 00 d.......x.......
0030: 68 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 h...............
0040: 00 00 00 00 00 00 00 00 00 00 00 00 06 00 08 00 ................
0050: 80 00 00 00 06 00 08 00 88 00 00 00 0a 00 04 00 ................
0060: 90 00 00 00 01 00 00 00 0e 00 00 00 54 00 46 00 ............T.F.
0070: 32 00 2e 00 74 00 78 00 74 00 00 00 00 00 00 00 2...t.x.t.......
0080: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 ................
0090: 00 00 00 00 00 00 00 00 ........



This is before editing and saving with WordPad; after saving the file, I am left with this:


C:\cld\dst>fsutil reparsepoint query TF2.txt
Error: The file or directory is not a reparse point.





Regards,
Stefan

0 Votes 0 ·

I have reproduced it But When testing with other tools(notepad++), the reparse point is not deleted. Perhaps It's a WordPad problem.

0 Votes 0 ·
XiaopoYang-MSFT avatar image
0 Votes"
XiaopoYang-MSFT answered

According to the two questions _1 _2, after WordPad edited(.docx), the source placeholder is deleted. So the reparse point is deleted with the placeholder deleted.

5 |1600 characters needed characters left characters exceeded

Up to 10 attachments (including images) can be used with a maximum of 3.0 MiB each and 30.0 MiB total.