locked
Will CreateFile2 be able to open files of a folder in the access list picked by FolderPicker?

    Question

  • I have legacy code that uses CreateFile API to open files in a folder. I wonder if folders that are contained in an apps storage access list can be opened using the new CreateFile2 API?
    Tuesday, March 24, 2015 2:38 PM

Answers

  • No. CreateFile2 (and other Win32 and C runtime calls) can open only files the app has direct access to (I.e. app data and install locations).

    You need to use the StorageItem classes to read locations the app has been granted permission for. This will use the file broker to read the app with the users full permissions and then stream the contents to the app

    Tuesday, March 24, 2015 2:56 PM
    Owner