示例#1
0
        //====================================================================
        // 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);
        }
示例#2
0
 public static Delegate GetDelegateForFunctionPointer(IntPtr ptr, Type t)
 {
     return(McgMarshal.GetPInvokeDelegateForStub(ptr, t.TypeHandle));
 }