You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
<summary>Creates and returns a reference to a safe file handle for the IStorage instance that is being extended.</summary>
62
+
<remarks>
63
+
<formattype="text/markdown">
64
+
<. 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 <xref:System.IO.FileStream>. Using a path will often throw <xref:System.AccessViolationException> in these cases.
<paramname="rootDirectory">The current storage folder instance.</param>
104
+
<paramname="relativePath">The name of the file that you want to get a handle to.</param>
105
+
<paramname="mode">The mode in which the operating system should open the file.</param>
106
+
<summary>Creates a safe file handle for a file that is in the current storage folder instance.</summary>
107
+
<returns>A safe file handle instance if the operation succeeds; <seelangword="null" /> if the conversion of the <paramrefname="rootDirectory" /> to an IStorageFolderHandleAccess returns <seelangword="null" />.</returns>
108
+
<remarks>
109
+
<formattype="text/markdown"><![CDATA[
110
+
111
+
## Remarks
112
+
113
+
When calling this method, if the specified mode is <xref:System.IO.FileMode.Append?displayProperty=nameWithType>, the file will be opened with <xref:System.IO.FileAccess.Read?displayProperty=nameWithType> access permission. For any other modes, the file will be opened with <xref:System.IO.FileAccess.ReadWrite?displayProperty=nameWithType> access permission.
114
+
115
+
Additionally, this method will open the file with <xref:System.IO.FileShare.Read?displayProperty=nameWithType> stream sharing access and with <xref:System.IO.FileOptions.None?displayProperty=nameWithType> advanced file creation options.
116
+
117
+
]]></format>
118
+
</remarks>
119
+
<exceptioncref="T:System.ArgumentNullException"><paramrefname="rootDirectory" /> is <seelangword="null" />.
120
+
121
+
-or-
122
+
123
+
<paramrefname="relativePath" /> is <seelangword="null" />.</exception>
87
124
</Docs>
88
125
</Member>
89
126
<MemberMemberName="CreateSafeFileHandle">
@@ -112,13 +149,14 @@ The next example shows the XAML code that is associated with the previous exampl
<paramname="access">The kind of access that should be used when opening the file. The default value is <seecref="F:System.IO.FileAccess.ReadWrite" />.</param>
154
+
<paramname="share">The kind of stream sharing access other <seecref="T:System.IO.FileStream" /> objects can have to the same file. The default value is <seecref="F:System.IO.FileShare.Read" />.</param>
155
+
<paramname="options">Advanced options for creating the <seecref="T:System.IO.FileStream" /> object. The default value is <seecref="F:System.IO.FileOptions.None" />.</param>
156
+
<summary>Creates a safe file handle for a the current storage file instance.</summary>
157
+
<returns>A safe file handle instance if the operation succeeds; <seelangword="null" /> if the conversion of the <paramrefname="windowsRuntimeFile" /> to an IStorageItemHandleAccess returns <seelangword="null" />.</returns>
121
158
<remarks>To be added.</remarks>
159
+
<exceptioncref="T:System.ArgumentNullException"><paramrefname="windowsRuntimeFile" /> is <seelangword="null" />.</exception>
122
160
</Docs>
123
161
</Member>
124
162
<MemberMemberName="CreateSafeFileHandle">
@@ -149,15 +187,20 @@ The next example shows the XAML code that is associated with the previous exampl
<paramname="rootDirectory">The current storage folder instance.</param>
191
+
<paramname="relativePath">The name of the file that you want to get a handle to.</param>
192
+
<paramname="mode">The mode in which the operating system should open the file.</param>
193
+
<paramname="access">The kind of access that should be used when opening the file.</param>
194
+
<paramname="share">The kind of stream sharing access other <seecref="T:System.IO.FileStream" /> objects can have to the same file. The default value is <seecref="F:System.IO.FileShare.Read" />.</param>
195
+
<paramname="options">Advanced options for creating the <seecref="T:System.IO.FileStream" /> object. The default value is <seecref="F:System.IO.FileOptions.None" />.</param>
196
+
<summary>Creates a safe file handle for a file that is in the current storage folder instance.</summary>
197
+
<returns>A safe file handle instance if the operation succeeds; <seelangword="null" /> if the conversion of the <paramrefname="rootDirectory" /> to an IStorageFolderHandleAccess returns <seelangword="null" />.</returns>
160
198
<remarks>To be added.</remarks>
199
+
<exceptioncref="T:System.ArgumentNullException"><paramrefname="rootDirectory" /> is <seelangword="null" />.
200
+
201
+
-or-
202
+
203
+
<paramrefname="relativePath" /> is <seelangword="null" />.</exception>
161
204
</Docs>
162
205
</Member>
163
206
<MemberMemberName="OpenStreamForReadAsync">
@@ -384,4 +427,4 @@ The next example shows the XAML code that is associated with the previous exampl
0 commit comments