2008-12-05 Zoltan Varga <vargaz@gmail.com>
[mono.git] / mono / tests / libtest.c
index 70d1f718e478802741f718524dde9487fbdfb594..3fd22de9edde942c1d9d51839c98f71c2d12295d 100644 (file)
@@ -2072,6 +2072,28 @@ mono_test_marshal_return_string_array_delegate (ReturnStringArrayDelegate d)
        return res;
 }
 
+typedef int (STDCALL *ByrefStringDelegate) (char **s);
+
+LIBTEST_API int STDCALL 
+mono_test_marshal_byref_string_delegate (ByrefStringDelegate d)
+{
+       char *s = (char*)"ABC";
+       int res;
+
+       res = d (&s);
+       if (res != 0)
+               return res;
+
+       if (!strcmp (s, "DEF"))
+               res = 0;
+       else
+               res = 2;
+
+       marshal_free (s);
+
+       return res;
+}
+
 LIBTEST_API int STDCALL 
 add_delegate (int i, int j)
 {