GetManagedThunkForUnmanagedMethodPtr Method
TOC
Collapse the table of content
Expand the table of content

Marshal.GetManagedThunkForUnmanagedMethodPtr Method

Gets a pointer to a thunk that marshals a call from managed to unmanaged code.

[Visual Basic]
Public Shared Function GetManagedThunkForUnmanagedMethodPtr( _
   ByVal pfnMethodToWrap As IntPtr, _
   ByVal pbSignature As IntPtr, _
   ByVal cbSignature As Integer _
) As IntPtr
[C#]
public static IntPtr GetManagedThunkForUnmanagedMethodPtr(
 IntPtr pfnMethodToWrap,
 IntPtr pbSignature,
 int cbSignature
);
[C++]
public: static IntPtr GetManagedThunkForUnmanagedMethodPtr(
 IntPtr pfnMethodToWrap,
 IntPtr pbSignature,
 int cbSignature
);
[JScript]
public static function GetManagedThunkForUnmanagedMethodPtr(
   pfnMethodToWrap : IntPtr,
 pbSignature : IntPtr,
 cbSignature : int
) : IntPtr;

Parameters

pfnMethodToWrap
A pointer to the method to marshal.
pbSignature
A pointer to the method signature.
cbSignature
The number of bytes in pbSignature.

Return Value

A pointer to the thunk that will marshal a call from the pfnMethodToWrap parameter.

Remarks

GetManagedThunkForUnmanagedMethodPtr is exposed for compiler support only.

Note   This method uses SecurityAction.LinkDemand to prevent it from being called from untrusted code; only the immediate caller is required to have SecurityPermissionAttribute.UnmanagedCode permission. If your code can be called from partially trusted code, do not pass user input to Marshal class methods without validation. For important limitations on using the LinkDemand member, see Demand vs. LinkDemand.

Requirements

Platforms: Windows 98, Windows NT 4.0, Windows Millennium Edition, Windows 2000, Windows XP Home Edition, Windows XP Professional, Windows Server 2003 family

.NET Framework Security: 

See Also

Marshal Class | Marshal Members | System.Runtime.InteropServices Namespace

Show:
© 2016 Microsoft