Skip to content

Commit

Permalink
Expose NativeLibrary APIs
Browse files Browse the repository at this point in the history
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
  • Loading branch information
swaroop-sridhar committed Jan 17, 2019
1 parent a53ada1 commit 10f7ab1
Show file tree
Hide file tree
Showing 3 changed files with 14 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -730,6 +730,16 @@ protected MarshalDirectiveException(System.Runtime.Serialization.SerializationIn
public MarshalDirectiveException(string message) { }
public MarshalDirectiveException(string message, System.Exception inner) { }
}
public static partial class NativeLibrary
{
public static void Free(System.IntPtr handle) { }
public static System.IntPtr GetExport(System.IntPtr handle, string name) { throw null; }
public static System.IntPtr Load(string libraryPath) { throw null; }
public static System.IntPtr Load(string libraryName, System.Reflection.Assembly assembly, DllImportSearchPath? searchPath) { throw null; }
public static bool TryGetExport(IntPtr handle, string name, out IntPtr address) { throw null; }
public static bool TryLoad(string libraryPath, out System.IntPtr handle) { throw null; }
public static bool TryLoad(string libraryName, System.Reflection.Assembly assembly, DllImportSearchPath? searchPath, out System.IntPtr handle) { throw null; }
}
[System.AttributeUsageAttribute((System.AttributeTargets)(2048), Inherited = false)]
public sealed partial class OptionalAttribute : System.Attribute
{
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -16,4 +16,5 @@ MembersMustExist : Member 'System.Runtime.InteropServices.Marshal.GetExceptionPo
MembersMustExist : Member 'System.Runtime.InteropServices.Marshal.GetEndComSlot(System.Type)' does not exist in the implementation but it does exist in the contract.
MembersMustExist : Member 'System.Runtime.InteropServices.Marshal.IsTypeVisibleFromCom(System.Type)' does not exist in the implementation but it does exist in the contract.
TypeCannotChangeClassification : Type 'System.Runtime.InteropServices.HandleRef' is marked as readonly in the contract so it must also be marked readonly in the implementation.
Total Issues: 15
TypesMustExist : Type 'System.Runtime.InteropServices.NativeLibrary' does not exist in the implementation but it does exist in the contract.
Total Issues: 16
Original file line number Diff line number Diff line change
Expand Up @@ -16,4 +16,5 @@ MembersMustExist : Member 'System.Runtime.InteropServices.Marshal.GetExceptionPo
MembersMustExist : Member 'System.Runtime.InteropServices.Marshal.GetEndComSlot(System.Type)' does not exist in the implementation but it does exist in the contract.
MembersMustExist : Member 'System.Runtime.InteropServices.Marshal.IsTypeVisibleFromCom(System.Type)' does not exist in the implementation but it does exist in the contract.
TypeCannotChangeClassification : Type 'System.Runtime.InteropServices.HandleRef' is marked as readonly in the contract so it must also be marked readonly in the implementation.
Total Issues: 17
TypesMustExist : Type 'System.Runtime.InteropServices.NativeLibrary' does not exist in the implementation but it does exist in the contract.
Total Issues: 18

0 comments on commit 10f7ab1

Please sign in to comment.