Terraria v1.4.4.9
Terraria source code documentation
Loading...
Searching...
No Matches

◆ MarshalInterface()

unsafe int IMarshal. System.Runtime.InteropServices.StandardOleMarshalObject.MarshalInterface ( IntPtr pStm,
ref Guid riid,
IntPtr pv,
int dwDestContext,
IntPtr pvDestContext,
int mshlflags )
inlineprivate

Implements System.Runtime.InteropServices.IMarshal.

Definition at line 60 of file StandardOleMarshalObject.cs.

61 {
62 IntPtr stdMarshaler = GetStdMarshaler(ref riid, dwDestContext, mshlflags);
63 try
64 {
65 IntPtr intPtr = *(IntPtr*)stdMarshaler.ToPointer();
66 IntPtr ptr = *(IntPtr*)((byte*)intPtr.ToPointer() + (nint)5 * (nint)sizeof(IntPtr));
67 MarshalInterfaceDelegate marshalInterfaceDelegate = (MarshalInterfaceDelegate)Marshal.GetDelegateForFunctionPointer(ptr, typeof(MarshalInterfaceDelegate));
68 return marshalInterfaceDelegate(stdMarshaler, pStm, ref riid, pv, dwDestContext, pvDestContext, mshlflags);
69 }
70 finally
71 {
72 Marshal.Release(stdMarshaler);
73 }
74 }
delegate int MarshalInterfaceDelegate(IntPtr _this, IntPtr pStm, ref Guid riid, IntPtr pv, int dwDestContext, IntPtr pvDestContext, int mshlflags)
IntPtr GetStdMarshaler(ref Guid riid, int dwDestContext, int mshlflags)

References System.Runtime.InteropServices.Marshal.GetDelegateForFunctionPointer(), System.Runtime.InteropServices.StandardOleMarshalObject.GetStdMarshaler(), System.Runtime.InteropServices.StandardOleMarshalObject.MarshalInterfaceDelegate(), System.Runtime.InteropServices.Marshal.Release(), and System.IntPtr.ToPointer().