2 using System.Runtime.InteropServices;
6 [StructLayout (LayoutKind.Sequential)]
7 public struct SimpleStruct {
14 [DllImport ("libtest", EntryPoint="mono_test_ref_vtype")]
15 public static extern int mono_test_ref_vtype (int a, ref SimpleStruct ss, int b, TestDelegate d);
17 public static int managed_test_ref_vtype (int a, ref SimpleStruct ss, int b)
19 Console.WriteLine ("Delegate called");
21 if (a == 1 && b == 2 && ss.a && !ss.b && ss.c && ss.d == "TEST2")
27 public delegate int TestDelegate (int a, ref SimpleStruct ss, int b);
30 public static int Main () {
31 SimpleStruct ss = new SimpleStruct ();
32 TestDelegate d = new TestDelegate (managed_test_ref_vtype);
37 if (mono_test_ref_vtype (1, ref ss, 2, d) != 0)
40 if (ss.a && !ss.b && ss.c && ss.d == "TEST2")