Cfapi: Cfexecute() Data Transfer in reacting to Fetch Data callback on a NTFS compressed file results in a empty-content file

Tommy Wu 1 Reputation point

Hi I'm currently developing a syncing service with Cloud Filter API, and recently we stumbled on a issue regarding to NTFS compressed file and CfExecute() when transfering data to placeholder files.

The reproduction steps are fairly simple, technically:

  1. Under a Cloud Filter sync root folder, choose a hydrated file with random content, say test.txt
  2. Right click on test.txt
  3. Click "Properties", and click "Advanced"
  4. Check and enable the option "Compress content to save disk space"
  5. Click Ok and Ok
  6. Dehydrate the content of test.txt by calling CfPlaceholderDehydrate()
  7. Double click on the dehydrated test.txt to invoke fetch data callback function
  8. In responding to the callback function, we call CfExecute() to transfer text content buffer to test.txt
  9. When the hydration finishes, notepad shows up, and display an empty (hex 0-filled) file.

The above steps can be easily reproduced with OneDrive Client with a slight difference:

  1. A dialog shows up when double clicking on the dehydrated placeholder file, saying that "Error 0x8007017F: The Cloud sync engine failed to validate the download".
  2. And eventually OneDrive PC Client will automatically replace the original file with a new hydrated one with the same name but WITHOUT NTFS COMPRESSED.

Seems even OneDrive has some fallback guarding machanism in case of these kind of filesystem failure.

Are the above described API behaviour working with NTFS compression a bug?

Windows API - Win32
Windows API - Win32
A core set of Windows application programming interfaces (APIs) for desktop and server applications. Previously known as Win32 API.
2,481 questions
A high-level, general-purpose programming language, created as an extension of the C programming language, that has object-oriented, generic, and functional features in addition to facilities for low-level memory manipulation.
3,600 questions
0 comments No comments
{count} votes