Details
-
Bug
-
Resolution: Invalid
-
P2: Important
-
None
-
5.15.7, 6.4.0
-
None
Description
When a a virtual file provider (https://learn.microsoft.com/en-us/windows/win32/api/_cloudapi/) reports an error on a virtual file, the error is ignored by QFile.
File operations like open, read and write succeed, no error is reported.
Read operations always return an empty byte array.
Writes succeed, the underlying file is however not actually changed which results in data loss.
When using Windows native commands like CreateFile, ReadFile and WriteFile, the operation fails and reports "The cloud operation was unsuccessful.".
Attached to the issue you will find a patch for the Microsofts CloudMirror example https://learn.microsoft.com/en-us/samples/microsoft/windows-classic-samples/cloudmirror-sample/ , with the patch applied the example will provide an `STATUS_CLOUD_FILE_UNSUCCESSFUL` error for all files.
Additionally I attached an example application that demonstrates the the behavior of QFile vs Windows native file commands.
- Follow the instructions provided by Microsoft and compile the CloudMirror example
- The CloudMirror example will ask you for a src and a dest directory
- Create a file in the src location
- Copy the dest file path to the `fileName` variable in the attached demonstrator src
- Run the demonstrator