Edit

Share via


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.

public:
 static bool TryGetExport(IntPtr handle, System::String ^ name, [Runtime::InteropServices::Out] IntPtr % address);
public static bool TryGetExport (IntPtr handle, string name, out IntPtr address);
static member TryGetExport : nativeint * string * nativeint -> bool
Public Shared Function TryGetExport (handle As IntPtr, name As String, ByRef address As IntPtr) As Boolean

Parameters

handle
IntPtr

nativeint

The native library OS handle.

name
String

The name of the exported symbol.

address
IntPtr

nativeint

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