DllImportResolver Delegate
Definition
Important
Some information relates to prerelease product that may be substantially modified before it’s released. Microsoft makes no warranties, express or implied, with respect to the information provided here.
Provides a delegate used to resolve native libraries via callback.
public delegate IntPtr DllImportResolver(System::String ^ libraryName, Assembly ^ assembly, Nullable<DllImportSearchPath> searchPath);
public delegate IntPtr DllImportResolver(string libraryName, Assembly assembly, DllImportSearchPath? searchPath);
type DllImportResolver = delegate of string * Assembly * Nullable<DllImportSearchPath> -> nativeint
Public Delegate Function DllImportResolver(libraryName As String, assembly As Assembly, searchPath As Nullable(Of DllImportSearchPath)) As IntPtr
Parameters
- libraryName
- String
The native library to resolve.
- assembly
- Assembly
The assembly requesting the resolution.
- searchPath
- Nullable<DllImportSearchPath>
The DefaultDllImportSearchPathsAttribute on the PInvoke, if any. Otherwise, the DefaultDllImportSearchPathsAttribute on the assembly, if any. Otherwise null
.
Return Value
nativeint
The handle for the loaded native library on success, or Zero on failure.
Remarks
The runtime does not do any lifetime management around the handle returned by a DllImportResolver. It is left to the implementation and consuming code to keep the library loaded for as long as necessary and free it if/when desired.
Extension Methods
GetMethodInfo(Delegate) |
Gets an object that represents the method represented by the specified delegate. |