Skip to content
This repository has been archived by the owner on Jan 23, 2023. It is now read-only.

Move Native Library APIs to NativeLibrary class #21821

Merged
merged 1 commit into from
Jan 6, 2019

Conversation

swaroop-sridhar
Copy link

Move APIs that manipulate native libraries from
System.Runtime.InteropServices.Marshal class to the new
System.Runtime.InteropServices.NativeLibrary class.

In API review: #32015,
The LoadLibrary APIs were originally Approved to live in
System.Runtime.InteropServices.Marshal class.

However, recently the decision was changed such that the APIs are
in a new NativeLibrary class.

/// <exception cref="System.ArgumentNullException">If libraryPath is null</exception>
/// <exception cref="System.DllNotFoundException ">If the library can't be found.</exception>
/// <exception cref="System.BadImageFormatException">If the library is not valid.</exception>
public static IntPtr LoadLibrary(string libraryPath)
Copy link
Member

@jkotas jkotas Jan 5, 2019

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Is Library still needed in the method names now that the Library is in the type name? "Library" in the
method names looks superfluous:

var handle = NativeLibrary.LoadLibrary("foo")
var p = NativeLibrary.GetLibraryExport(handle, "m");

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks; The Library is dropped in the new version of the API. I'll fix this.

//

//
// FCall's for the PInvoke classlibs
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Nit: This comment looks useless.

@swaroop-sridhar
Copy link
Author

Thanks for the feedback @AaronRobinsonMSFT and @jkotas
I've addressed these comments in b20b30e

@swaroop-sridhar
Copy link
Author

@dotnet-bot test CentOS7.1 x64 Debug Innerloop Build
@dotnet-bot test Windows_NT arm Cross Checked Innerloop Build and Test
@dotnet-bot test Windows_NT arm Cross Debug Innerloop Build
@dotnet-bot test Windows_NT arm64 Cross Checked Innerloop Build and Test
@dotnet-bot test Windows_NT arm64 Cross Debug Innerloop Build
@dotnet-bot test Windows_NT x64 full_opt ryujit CoreCLR Perf Tests Correctness
@dotnet-bot test Windows_NT x64 min_opt ryujit CoreCLR Perf Tests Correctness
@dotnet-bot test Windows_NT x86 full_opt ryujit CoreCLR Perf Tests Correctness
@dotnet-bot test Windows_NT x86 min_opt ryujit CoreCLR Perf Tests Correctness

Move APIs that manipulate native libraries from
System.Runtime.InteropServices.Marshal class to the new
System.Runtime.InteropServices.NativeLibrary class.

In API review: #32015,
The LoadLibrary APIs were originally Approved to live in
System.Runtime.InteropServices.Marshal class.

However, recently the decision was changed such that the APIs are
in a new NativeLibrary class.
@jkotas
Copy link
Member

jkotas commented Jan 5, 2019

@dotnet-bot test OSX10.12 x64 Checked Innerloop Build and Test please
@dotnet-bot test Ubuntu arm Cross Checked Innerloop Build and Test please

@jkotas jkotas merged commit 110835b into dotnet:master Jan 6, 2019
jkotas added a commit that referenced this pull request Jan 6, 2019
sandreenko pushed a commit to sandreenko/coreclr that referenced this pull request Jan 8, 2019
Move APIs that manipulate native libraries from
System.Runtime.InteropServices.Marshal class to the new
System.Runtime.InteropServices.NativeLibrary class.

In API review: #32015,
The LoadLibrary APIs were originally Approved to live in
System.Runtime.InteropServices.Marshal class.

However, recently the decision was changed such that the APIs are
in a new NativeLibrary class.
swaroop-sridhar added a commit to swaroop-sridhar/corefx that referenced this pull request Jan 12, 2019
Expose the System.Runtime.Interop.NativeLibrary APIs implemented in CoreCLR.

API review: #32015
CoreCLR Change: dotnet/coreclr#21821
swaroop-sridhar added a commit to swaroop-sridhar/corefx that referenced this pull request Jan 17, 2019
Expose the System.Runtime.Interop.NativeLibrary APIs implemented in CoreCLR.

API review: #32015
CoreCLR Change: dotnet/coreclr#21821

Tests for the API are here:
https://github.com/dotnet/coreclr/blob/master/tests/src/Interop/NativeLibrary/NativeLibraryTests.cs
jkotas pushed a commit to dotnet/corefx that referenced this pull request Jan 17, 2019
Expose the System.Runtime.Interop.NativeLibrary APIs implemented in CoreCLR.

API review: #32015
CoreCLR Change: dotnet/coreclr#21821

Tests for the API are here:
https://github.com/dotnet/coreclr/blob/master/tests/src/Interop/NativeLibrary/NativeLibraryTests.cs
picenka21 pushed a commit to picenka21/runtime that referenced this pull request Feb 18, 2022
Move APIs that manipulate native libraries from
System.Runtime.InteropServices.Marshal class to the new
System.Runtime.InteropServices.NativeLibrary class.

In API review: dotnet/coreclr#32015,
The LoadLibrary APIs were originally Approved to live in
System.Runtime.InteropServices.Marshal class.

However, recently the decision was changed such that the APIs are
in a new NativeLibrary class.

Commit migrated from dotnet/coreclr@110835b
picenka21 pushed a commit to picenka21/runtime that referenced this pull request Feb 18, 2022
Expose the System.Runtime.Interop.NativeLibrary APIs implemented in CoreCLR.

API review: dotnet/corefx#32015
CoreCLR Change: dotnet/coreclr#21821

Tests for the API are here:
https://github.com/dotnet/coreclr/blob/master/tests/src/Interop/NativeLibrary/NativeLibraryTests.cs

Commit migrated from dotnet/corefx@5241ad4
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants