Export (0) Print
Expand All
Expand Minimize

Marshal.GetUnmanagedThunkForManagedMethodPtr Method

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

[Visual Basic]
Public Shared Function GetUnmanagedThunkForManagedMethodPtr( _
   ByVal pfnMethodToWrap As IntPtr, _
   ByVal pbSignature As IntPtr, _
   ByVal cbSignature As Integer _
) As IntPtr
[C#]
public static IntPtr GetUnmanagedThunkForManagedMethodPtr(
 IntPtr pfnMethodToWrap,
 IntPtr pbSignature,
 int cbSignature
);
[C++]
public: static IntPtr GetUnmanagedThunkForManagedMethodPtr(
 IntPtr pfnMethodToWrap,
 IntPtr pbSignature,
 int cbSignature
);
[JScript]
public static function GetUnmanagedThunkForManagedMethodPtr(
   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 pfnMethodToWrap.

Remarks

GetUnmanagedThunkForManagedMethodPtr is exposed for complier 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:
© 2014 Microsoft