diff --git a/xml/System.IO/WindowsRuntimeStorageExtensions.xml b/xml/System.IO/WindowsRuntimeStorageExtensions.xml index f5cdf0c6436..0e3aca8be59 100644 --- a/xml/System.IO/WindowsRuntimeStorageExtensions.xml +++ b/xml/System.IO/WindowsRuntimeStorageExtensions.xml @@ -52,6 +52,28 @@ The next example shows the XAML code that is associated with the previous exampl + + + System.Runtime.WindowsRuntime + 4.0.14.0 + + + Creates and returns a reference to a safe file handle for the IStorage instance that is being extended. + + + and that allow creating a standard Win32 file handle: `IStorageFolderHandleAccess` and `IStorageItemHandleAccess`. The `CreateSafeFileHandle` group of extension methods take advantage of the `Create` methods of these interfaces. + +The key benefit of the API is access to a brokered `SafeFileHandle`. This is critically important if you want to create a around an or when you are running in an [AppContainer](https://docs.microsoft.com/en-us/windows/win32/secauthz/appcontainer-isolation). When running in an AppContainer, the application has very limited file access rights. Things like picture and document folders require the native file handle to be proxied via `RuntimeBroker.exe`, as the application process itself doesn't have rights to most files. This API gets the proxied handle. If accessing user data folders or using a file picker, this API should always be used to create . Using a path will often throw in these cases. + + ]]> + + + + @@ -78,12 +100,27 @@ The next example shows the XAML code that is associated with the previous exampl - To be added. - To be added. - To be added. - To be added. - To be added. - To be added. + The current storage folder instance. + The name of the file that you want to get a handle to. + The mode in which the operating system should open the file. + Creates a safe file handle for a file that is in the current storage folder instance. + A safe file handle instance if the operation succeeds; if the conversion of the to an IStorageFolderHandleAccess returns . + + , the file will be opened with access permission. For any other modes, the file will be opened with access permission. + +Additionally, this method will open the file with stream sharing access and with advanced file creation options. + + ]]> + + is . + + -or- + + is . @@ -112,13 +149,14 @@ The next example shows the XAML code that is associated with the previous exampl - To be added. - To be added. - To be added. - To be added. - To be added. - To be added. + A storage file instance. + The kind of access that should be used when opening the file. The default value is . + The kind of stream sharing access other objects can have to the same file. The default value is . + Advanced options for creating the object. The default value is . + Creates a safe file handle for a the current storage file instance. + A safe file handle instance if the operation succeeds; if the conversion of the to an IStorageItemHandleAccess returns . To be added. + is . @@ -149,15 +187,20 @@ The next example shows the XAML code that is associated with the previous exampl - To be added. - To be added. - To be added. - To be added. - To be added. - To be added. - To be added. - To be added. + The current storage folder instance. + The name of the file that you want to get a handle to. + The mode in which the operating system should open the file. + The kind of access that should be used when opening the file. + The kind of stream sharing access other objects can have to the same file. The default value is . + Advanced options for creating the object. The default value is . + Creates a safe file handle for a file that is in the current storage folder instance. + A safe file handle instance if the operation succeeds; if the conversion of the to an IStorageFolderHandleAccess returns . To be added. + is . + + -or- + + is . @@ -384,4 +427,4 @@ The next example shows the XAML code that is associated with the previous exampl - \ No newline at end of file +