2 using System
.Runtime
.InteropServices
;
3 using System
.Runtime
.CompilerServices
;
5 public class MonoPInvokeCallbackAttribute
: Attribute
{
6 public MonoPInvokeCallbackAttribute (Type delegateType
) { }
10 private static bool fired
;
12 [MonoPInvokeCallback (typeof (Action
))]
13 private static void CallBack ()
15 Console
.WriteLine ("Called back");
19 [DllImport ("proftest_pinvokes", EntryPoint
="test_reverse_pinvoke")]
20 private static extern void test_reverse_pinvoke (Action cb
);
23 public static int Main ()
33 [MethodImpl (MethodImplOptions
.NoInlining
)]
34 private static void Helper ()
36 test_reverse_pinvoke (new Action (CallBack
));