public static IntPtr GetFunctionPointer(this Delegate @delegate) { return Marshal.GetFunctionPointerForDelegate(@delegate); }