NativeLibrary.TryGetExport(IntPtr, String, IntPtr) Method

Definition

Gets the address of an exported symbol and returns a value that indicates whether the method call succeeded.

C#
public static bool TryGetExport(IntPtr handle, string name, out IntPtr address);

Parameters

handle
IntPtr

The native library OS handle.

name
String

The name of the exported symbol.

address
IntPtr

When the method returns, contains the symbol address, if it exists.

Returns

true if the address of the exported symbol was found successfully; otherwise, false.

Exceptions

handle is Zero or name is null.

Remarks

This is a simple wrapper around OS calls and does not perform any name mangling.

Calling this method with a invalid handle parameter other than IntPtr.Zero is not supported and will result in undefined behaviour.

Applies to

Produk Versi
.NET Core 3.0, Core 3.1, 5, 6, 7, 8, 9, 10