//==================================================================== // Checks if "t" is MCG generated , if not fallback to public API //==================================================================== public static Delegate GetDelegateForFunctionPointer(IntPtr ptr, Type t) { Delegate dlg = McgMarshal.GetPInvokeDelegateForStub(ptr, t.TypeHandle); #if CORECLR if (dlg == null) // fall back to public marshal API { return(Marshal.GetDelegateForFunctionPointer(ptr, t)); } #endif return(dlg); }
public static Delegate GetDelegateForFunctionPointer(IntPtr ptr, Type t) { return(McgMarshal.GetPInvokeDelegateForStub(ptr, t.TypeHandle)); }