2 using System.Runtime.InteropServices;
7 extern static int marshal_test_ref_bool
10 [MarshalAs(UnmanagedType.I1)] ref bool b1,
11 [MarshalAs(UnmanagedType.VariantBool)] ref bool b2,
18 [MarshalAs(UnmanagedType.I1)] public bool b1;
19 [MarshalAs(UnmanagedType.VariantBool)] public bool b2;
23 [DllImport("libtest")]
24 extern static int marshal_test_bool_struct(ref BoolStruct s);
26 public static int Main()
28 for (int i = 0; i < 8; i++)
30 bool b1 = (i & 4) != 0;
31 bool b2 = (i & 2) != 0;
32 bool b3 = (i & 1) != 0;
33 bool orig_b1 = b1, orig_b2 = b2, orig_b3 = b3;
34 if (marshal_test_ref_bool(i, ref b1, ref b2, ref b3) != 0)
44 for (int i = 0; i < 8; i++)
46 BoolStruct s = new BoolStruct();
52 if (marshal_test_bool_struct(ref s) != 0)
62 Console.WriteLine("Success");