Skip to content

Commit 457f027

Browse files
authored
Update NativeLibrary.xml
This changes the parameter **libraryPath** into **executableName** Reasoning: The path is automatically handled by the abstraction of the API itself. The user is **not** supposed to provide a path: That would simply be not sensical, considering macOS, Linux, etc, all have different paths to begin with. The argument could never be multiple paths to all of them, and it's the executable name (that has to be on the PATH, obviously) that is our concern. I hope this is fine this way, and I also corrected two small typos. Thanks
1 parent b314392 commit 457f027

File tree

1 file changed

+22
-22
lines changed

1 file changed

+22
-22
lines changed

xml/System.Runtime.InteropServices/NativeLibrary.xml

Lines changed: 22 additions & 22 deletions
Original file line numberDiff line numberDiff line change
@@ -133,12 +133,12 @@ Calling this method with an invalid `handle` parameter other than <xref:System.I
133133
</Docs>
134134
</Member>
135135
<Member MemberName="Load">
136-
<MemberSignature Language="C#" Value="public static IntPtr Load (string libraryPath);" />
137-
<MemberSignature Language="ILAsm" Value=".method public static hidebysig native int Load(string libraryPath) cil managed" />
136+
<MemberSignature Language="C#" Value="public static IntPtr Load (string executableName);" />
137+
<MemberSignature Language="ILAsm" Value=".method public static hidebysig native int Load(string executableName) cil managed" />
138138
<MemberSignature Language="DocId" Value="M:System.Runtime.InteropServices.NativeLibrary.Load(System.String)" />
139-
<MemberSignature Language="VB.NET" Value="Public Shared Function Load (libraryPath As String) As IntPtr" />
140-
<MemberSignature Language="F#" Value="static member Load : string -&gt; nativeint" Usage="System.Runtime.InteropServices.NativeLibrary.Load libraryPath" />
141-
<MemberSignature Language="C++ CLI" Value="public:&#xA; static IntPtr Load(System::String ^ libraryPath);" />
139+
<MemberSignature Language="VB.NET" Value="Public Shared Function Load (executableName As String) As IntPtr" />
140+
<MemberSignature Language="F#" Value="static member Load : string -&gt; nativeint" Usage="System.Runtime.InteropServices.NativeLibrary.Load executableName" />
141+
<MemberSignature Language="C++ CLI" Value="public:&#xA; static IntPtr Load(System::String ^ executableName);" />
142142
<MemberType>Method</MemberType>
143143
<AssemblyInfo>
144144
<AssemblyName>System.Runtime.InteropServices</AssemblyName>
@@ -155,15 +155,15 @@ Calling this method with an invalid `handle` parameter other than <xref:System.I
155155
<ReturnType>System.IntPtr</ReturnType>
156156
</ReturnValue>
157157
<Parameters>
158-
<Parameter Name="libraryPath" Type="System.String" />
158+
<Parameter Name="executableName" Type="System.String" />
159159
</Parameters>
160160
<Docs>
161-
<param name="libraryPath">The name of the native library to be loaded.</param>
161+
<param name="executableName">The name of the native library to be loaded.</param>
162162
<summary>Provides a simple API for loading a native library that wraps the OS loader and uses default flags.</summary>
163163
<returns>The OS handle for the loaded native library.</returns>
164164
<remarks>To be added.</remarks>
165165
<exception cref="T:System.ArgumentNullException">
166-
<paramref name="libraryPath" /> is <see langword="null" />.</exception>
166+
<paramref name="executableName" /> is <see langword="null" />.</exception>
167167
<exception cref="T:System.DllNotFoundException">The library can't be found.</exception>
168168
<exception cref="T:System.BadImageFormatException">The library is not valid.</exception>
169169
</Docs>
@@ -191,12 +191,12 @@ Calling this method with an invalid `handle` parameter other than <xref:System.I
191191
<ReturnType>System.IntPtr</ReturnType>
192192
</ReturnValue>
193193
<Parameters>
194-
<Parameter Name="libraryName" Type="System.String" />
194+
<Parameter Name="executableName" Type="System.String" />
195195
<Parameter Name="assembly" Type="System.Reflection.Assembly" />
196196
<Parameter Name="searchPath" Type="System.Nullable&lt;System.Runtime.InteropServices.DllImportSearchPath&gt;" />
197197
</Parameters>
198198
<Docs>
199-
<param name="libraryName">The name of the native library to be loaded.</param>
199+
<param name="executableName">The name of the native library to be loaded.</param>
200200
<param name="assembly">The assembly loading the native library.</param>
201201
<param name="searchPath">The search path.</param>
202202
<summary>Provides a high-level API for loading a native library.</summary>
@@ -293,7 +293,7 @@ Only one resolver can be registered per assembly. Trying to register a second re
293293
<Docs>
294294
<param name="handle">The native library OS handle.</param>
295295
<param name="name">The name of the exported symbol.</param>
296-
<param name="address">When the method returns, contains the symbol address, if it exists.</param>
296+
<param name="address">When the method returns, it contains the symbol address, if it exists.</param>
297297
<summary>Gets the address of an exported symbol and returns a value that indicates whether the method call succeeded.</summary>
298298
<returns>
299299
<see langword="true" /> if the address of the exported symbol was found successfully; otherwise, <see langword="false" />.</returns>
@@ -302,7 +302,7 @@ Only one resolver can be registered per assembly. Trying to register a second re
302302
303303
This is a simple wrapper around OS calls and does not perform any name mangling.
304304
305-
Calling this method with a invalid `handle` parameter other than <xref:System.IntPtr.Zero?displayProperty=nameWithType> is not supported and will result in undefined behaviour.
305+
Calling this method with an invalid `handle` parameter other than <xref:System.IntPtr.Zero?displayProperty=nameWithType> is not supported and will result in undefined behaviour.
306306
307307
]]></format>
308308
</remarks>
@@ -311,12 +311,12 @@ Calling this method with a invalid `handle` parameter other than <xref:System.In
311311
</Docs>
312312
</Member>
313313
<Member MemberName="TryLoad">
314-
<MemberSignature Language="C#" Value="public static bool TryLoad (string libraryPath, out IntPtr handle);" />
315-
<MemberSignature Language="ILAsm" Value=".method public static hidebysig bool TryLoad(string libraryPath, [out] native int&amp; handle) cil managed" />
314+
<MemberSignature Language="C#" Value="public static bool TryLoad (string executableName, out IntPtr handle);" />
315+
<MemberSignature Language="ILAsm" Value=".method public static hidebysig bool TryLoad(string executableName, [out] native int&amp; handle) cil managed" />
316316
<MemberSignature Language="DocId" Value="M:System.Runtime.InteropServices.NativeLibrary.TryLoad(System.String,System.IntPtr@)" />
317-
<MemberSignature Language="VB.NET" Value="Public Shared Function TryLoad (libraryPath As String, ByRef handle As IntPtr) As Boolean" />
318-
<MemberSignature Language="F#" Value="static member TryLoad : string * nativeint -&gt; bool" Usage="System.Runtime.InteropServices.NativeLibrary.TryLoad (libraryPath, handle)" />
319-
<MemberSignature Language="C++ CLI" Value="public:&#xA; static bool TryLoad(System::String ^ libraryPath, [Runtime::InteropServices::Out] IntPtr % handle);" />
317+
<MemberSignature Language="VB.NET" Value="Public Shared Function TryLoad (executableName As String, ByRef handle As IntPtr) As Boolean" />
318+
<MemberSignature Language="F#" Value="static member TryLoad : string * nativeint -&gt; bool" Usage="System.Runtime.InteropServices.NativeLibrary.TryLoad (executableName, handle)" />
319+
<MemberSignature Language="C++ CLI" Value="public:&#xA; static bool TryLoad(System::String ^ executableName, [Runtime::InteropServices::Out] IntPtr % handle);" />
320320
<MemberType>Method</MemberType>
321321
<AssemblyInfo>
322322
<AssemblyName>System.Runtime.InteropServices</AssemblyName>
@@ -333,18 +333,18 @@ Calling this method with a invalid `handle` parameter other than <xref:System.In
333333
<ReturnType>System.Boolean</ReturnType>
334334
</ReturnValue>
335335
<Parameters>
336-
<Parameter Name="libraryPath" Type="System.String" />
336+
<Parameter Name="executableName" Type="System.String" />
337337
<Parameter Name="handle" Type="System.IntPtr" RefType="out" />
338338
</Parameters>
339339
<Docs>
340-
<param name="libraryPath">The name of the native library to be loaded.</param>
340+
<param name="executableName">The name of the native library to be loaded.</param>
341341
<param name="handle">When the method returns, the OS handle of the loaded native library.</param>
342342
<summary>Provides a simple API for loading a native library and returns a value that indicates whether the operation succeeded.</summary>
343343
<returns>
344344
<see langword="true" /> if the native library was loaded successfully; otherwise, <see langword="false" />.</returns>
345345
<remarks>To be added.</remarks>
346346
<exception cref="T:System.ArgumentNullException">
347-
<paramref name="libraryPath" /> is <see langword="null" />.</exception>
347+
<paramref name="executableName" /> is <see langword="null" />.</exception>
348348
</Docs>
349349
</Member>
350350
<Member MemberName="TryLoad">
@@ -370,13 +370,13 @@ Calling this method with a invalid `handle` parameter other than <xref:System.In
370370
<ReturnType>System.Boolean</ReturnType>
371371
</ReturnValue>
372372
<Parameters>
373-
<Parameter Name="libraryName" Type="System.String" />
373+
<Parameter Name="executableName" Type="System.String" />
374374
<Parameter Name="assembly" Type="System.Reflection.Assembly" />
375375
<Parameter Name="searchPath" Type="System.Nullable&lt;System.Runtime.InteropServices.DllImportSearchPath&gt;" />
376376
<Parameter Name="handle" Type="System.IntPtr" RefType="out" />
377377
</Parameters>
378378
<Docs>
379-
<param name="libraryName">The name of the native library to be loaded.</param>
379+
<param name="executableName">The name of the native library to be loaded.</param>
380380
<param name="assembly">The assembly loading the native library.</param>
381381
<param name="searchPath">The search path.</param>
382382
<param name="handle">When the method returns, the OS handle of the loaded native library.</param>

0 commit comments

Comments
 (0)