RuntimeMethodHandle.GetFunctionPointer RuntimeMethodHandle.GetFunctionPointer RuntimeMethodHandle.GetFunctionPointer RuntimeMethodHandle.GetFunctionPointer Method

定义

获取指向此实例所表示方法的指针。Obtains a pointer to the method represented by this instance.

public:
 IntPtr GetFunctionPointer();
[System.Security.SecurityCritical]
public IntPtr GetFunctionPointer ();
member this.GetFunctionPointer : unit -> nativeint
Public Function GetFunctionPointer () As IntPtr

返回

指向此实例所表示方法的指针。A pointer to the method represented by this instance.

异常

调用方不具有执行此操作所需的权限。The caller does not have the necessary permission to perform this operation.

注解

返回IntPtr的适用于内部运行时使用情况, 不应用于从本机代码调用函数。The returned IntPtr is meant for internal runtime usage and should not be used to call the function from native code. 用于Marshal.GetFunctionPointerForDelegate获取可传递给本机代码的函数指针。Use Marshal.GetFunctionPointerForDelegate in order to get a function pointer that can be passed to native code.

安全性

SecurityCriticalAttribute
需要对直接调用方的完全信任。Requires full trust for the immediate caller. 部分受信任的或透明的代码不能使用此成员。This member cannot be used by partially trusted or transparent code.

适用于