microsoft/Windows-classic-samples

CloudMirror / CFAPI / Can't get access to cloud data via system service.

Modin-ua opened this issue · 1 comments

Turned out app started in service session (0) despite system privileges can't trigger data hydration from the cloud.
Although if data already pulled to sync root service app can read data without issues.

Exception discovered: if executable placed in %systemroot% it can trigger hydration.

Error client (service session) app receives: Access to the cloud file is denied. - 0x0000018B (395)
in ProcessMonitor(sysinternals) it would be error 0xC000CF18 indicated in CreateFile.

Issue can be reproduced by pointing any service app to not yet hydrated file in sync root for reading.

Or this way:

  • Copy executable file C:\Windows\System32\more.com to C:\more.com

  • Run in elevated console: psexec -h -s cmd

  • Try open any file in local sync root like: C:\more.com C:\sync_root_folder\cloud_file
    get Cannot access file error.

  • Run: C:\WINDOWS\system32\more.com C:\sync_root_folder\cloud_file
    see it opens fine.

Already discussed in Docs Q&A, directed to this issue tracker from there.
https://docs.microsoft.com/en-us/answers/questions/892349/cfapi-allow-data-fetch-for-services.html

Thanks,