RuntimeMethodHandle.GetFunctionPointer 메서드

정의

이 인스턴스가 나타내는 메서드에 대한 포인터를 가져옵니다.

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

반환

IntPtr

nativeint

이 인스턴스가 나타내는 메서드에 대한 포인터를 가져옵니다.

특성

예외

호출자에게 이 작업을 수행하는 데 필요한 사용 권한이 없는 경우

설명

메서드에 특성이 System.Runtime.InteropServices.UnmanagedCallersOnlyAttribute 있는 경우 반환된 값은 특성에 지정된 것과 동일한 호출 규칙을 가진 관리되지 않는 함수 포인터입니다. 이 핸들이 나타내는 메서드가 정적이면 반환된 값을 동일한 서명이 있는 C# 관리 함수 포인터 형식으로 캐스팅할 수 있습니다. 예를 들어 메서드 핸들의 경우 이 값은 사용자 코드에서 쉽게 사용할 수 없으며 런타임 내에서만 사용할 수 있습니다.

없는 메서드의 System.Runtime.InteropServices.UnmanagedCallersOnlyAttribute경우 네이티브 코드에 전달할 수 있는 함수 포인터를 가져오는 데 사용합니다 Marshal.GetFunctionPointerForDelegate .

적용 대상