Expose the APIs to set the Native Library resolver callback.
API Review:
https://github.com/dotnet/corefx/issues/32015
Implementation:
https://github.com/dotnet/coreclr/blob/master/src/System.Private.CoreLib/src/System/Runtime/InteropServices/NativeLibrary.cs
Tests:
https://github.com/dotnet/coreclr/blob/master/tests/src/Interop/NativeLibraryResolveCallback/CallbackTests.cs
Commit migrated from https://github.com/dotnet/corefx/commit/
bcb76015585c91a1dfa63df68ef392bed317e8dd
public DllImportAttribute(string dllName) { }
public string Value { get { throw null; } }
}
+ public delegate System.IntPtr DllImportResolver(string libraryName, System.Reflection.Assembly assembly, DllImportSearchPath? searchPath);
[System.FlagsAttribute]
public enum DllImportSearchPath
{
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 void SetDllImportResolver(System.Reflection.Assembly assembly, DllImportResolver resolver) { 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; }
Compat issues with assembly System.Runtime.InteropServices:
CannotRemoveBaseTypeOrInterface : Type 'System.IO.UnmanagedMemoryStream' does not inherit from base type 'System.MarshalByRefObject' in the implementation but it does in the contract.
+TypesMustExist : Type 'System.Runtime.InteropServices.DllImportResolver' does not exist in the implementation but it does exist in the contract.
MembersMustExist : Member 'System.Runtime.InteropServices.Marshal.GenerateGuidForType(System.Type)' does not exist in the implementation but it does exist in the contract.
MembersMustExist : Member 'System.Runtime.InteropServices.Marshal.GenerateProgIdForType(System.Type)' does not exist in the implementation but it does exist in the contract.
MembersMustExist : Member 'System.Runtime.InteropServices.Marshal.GetComObjectData(System.Object, System.Object)' 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.
TypesMustExist : Type 'System.Runtime.InteropServices.NativeLibrary' does not exist in the implementation but it does exist in the contract.
-Total Issues: 16
\ No newline at end of file
+Total Issues: 19
\ No newline at end of file
Compat issues with assembly System.Runtime.InteropServices:
CannotRemoveBaseTypeOrInterface : Type 'System.IO.UnmanagedMemoryStream' does not inherit from base type 'System.MarshalByRefObject' in the implementation but it does in the contract.
+TypesMustExist : Type 'System.Runtime.InteropServices.DllImportResolver' does not exist in the implementation but it does exist in the contract.
MembersMustExist : Member 'System.Runtime.InteropServices.Marshal.GenerateGuidForType(System.Type)' does not exist in the implementation but it does exist in the contract.
MembersMustExist : Member 'System.Runtime.InteropServices.Marshal.GenerateProgIdForType(System.Type)' does not exist in the implementation but it does exist in the contract.
MembersMustExist : Member 'System.Runtime.InteropServices.Marshal.GetComObjectData(System.Object, System.Object)' 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.
TypesMustExist : Type 'System.Runtime.InteropServices.NativeLibrary' does not exist in the implementation but it does exist in the contract.
-Total Issues: 18
+Total Issues: 19