public class marshalbool
{
+ [AttributeUsage (AttributeTargets.Method)]
+ sealed class MonoPInvokeCallbackAttribute : Attribute {
+ public MonoPInvokeCallbackAttribute (Type t) {}
+ }
+
[DllImport ("libtest")]
static extern int mono_test_marshal_bool_in (int arg, uint expected,
bool bDefaultMarsh,
unsafe public static int test_0_VariantBool_In_Native ()
{
int ret;
+ int m1 = -1;
ret = mono_test_marshal_bool_in (5, 0, false, false, false, false, false);
if (ret != 0)
return 0x0100 + ret;
- ret = mono_test_marshal_bool_in (5, 0xFFFF, false, false, false, false, true);
+ ret = mono_test_marshal_bool_in (5, (uint)m1, false, false, false, false, true);
if (ret != 0)
return 0x0200 + ret;
bool* ptestVal = &testVal;
Marshal.WriteByte ((IntPtr)ptestVal, 0x22);
- ret = mono_test_marshal_bool_in (5, 0xFFFF, false, false, false, false, testVal);
+ ret = mono_test_marshal_bool_in (5, (uint)m1, false, false, false, false, testVal);
if (ret != 0)
return 0x0300 + ret;
public static int test_0_Default_In_Managed ()
{
- MarshalBoolInDelegate fcn = new MarshalBoolInDelegate (new marshalbool ().MarshalBoolInHelper);
+ MarshalBoolInDelegate fcn = new MarshalBoolInDelegate (MarshalBoolInHelper);
int ret;
ret = mono_test_managed_marshal_bool_in (1, 0, 0, fcn);
public static int test_0_Bool_In_Managed ()
{
- MarshalBoolInDelegate fcn = new MarshalBoolInDelegate (new marshalbool ().MarshalBoolInHelper);
+ MarshalBoolInDelegate fcn = new MarshalBoolInDelegate (MarshalBoolInHelper);
int ret;
ret = mono_test_managed_marshal_bool_in (2, 0, 0, fcn);
public static int test_0_I1_In_Managed ()
{
- MarshalBoolInDelegate fcn = new MarshalBoolInDelegate (new marshalbool ().MarshalBoolInHelper);
+ MarshalBoolInDelegate fcn = new MarshalBoolInDelegate (MarshalBoolInHelper);
int ret;
ret = mono_test_managed_marshal_bool_in (3, 0, 0, fcn);
public static int test_0_U1_In_Managed ()
{
- MarshalBoolInDelegate fcn = new MarshalBoolInDelegate (new marshalbool ().MarshalBoolInHelper);
+ MarshalBoolInDelegate fcn = new MarshalBoolInDelegate (MarshalBoolInHelper);
int ret;
ret = mono_test_managed_marshal_bool_in (4, 0, 0, fcn);
public static int test_0_VariantBool_In_Managed ()
{
- MarshalBoolInDelegate fcn = new MarshalBoolInDelegate (new marshalbool ().MarshalBoolInHelper);
+ MarshalBoolInDelegate fcn = new MarshalBoolInDelegate (MarshalBoolInHelper);
int ret;
ret = mono_test_managed_marshal_bool_in (5, 0, 0, fcn);
public static int test_0_Default_Out_Managed ()
{
- MarshalBoolOutDelegate fcn = new MarshalBoolOutDelegate (new marshalbool ().MarshalBoolOutHelper);
+ MarshalBoolOutDelegate fcn = new MarshalBoolOutDelegate (MarshalBoolOutHelper);
int ret;
ret = mono_test_managed_marshal_bool_out (1, 0, 0, fcn);
public static int test_0_Bool_Out_Managed ()
{
- MarshalBoolOutDelegate fcn = new MarshalBoolOutDelegate (new marshalbool ().MarshalBoolOutHelper);
+ MarshalBoolOutDelegate fcn = new MarshalBoolOutDelegate (MarshalBoolOutHelper);
int ret;
ret = mono_test_managed_marshal_bool_out (2, 0, 0, fcn);
public static int test_0_I1_Out_Managed ()
{
- MarshalBoolOutDelegate fcn = new MarshalBoolOutDelegate (new marshalbool ().MarshalBoolOutHelper);
+ MarshalBoolOutDelegate fcn = new MarshalBoolOutDelegate (MarshalBoolOutHelper);
int ret;
ret = mono_test_managed_marshal_bool_out (3, 0, 0, fcn);
public static int test_0_U1_Out_Managed ()
{
- MarshalBoolOutDelegate fcn = new MarshalBoolOutDelegate (new marshalbool ().MarshalBoolOutHelper);
+ MarshalBoolOutDelegate fcn = new MarshalBoolOutDelegate (MarshalBoolOutHelper);
int ret;
ret = mono_test_managed_marshal_bool_out (4, 0, 0, fcn);
public static int test_0_VariantBool_Out_Managed ()
{
- MarshalBoolOutDelegate fcn = new MarshalBoolOutDelegate (new marshalbool ().MarshalBoolOutHelper);
+ MarshalBoolOutDelegate fcn = new MarshalBoolOutDelegate (MarshalBoolOutHelper);
int ret;
ret = mono_test_managed_marshal_bool_out (5, 0, 0, fcn);
public static int test_0_Default_Ref_Managed ()
{
- MarshalBoolRefDelegate fcn = new MarshalBoolRefDelegate (new marshalbool ().MarshalBoolRefHelper);
+ MarshalBoolRefDelegate fcn = new MarshalBoolRefDelegate (MarshalBoolRefHelper);
int ret;
ret = mono_test_managed_marshal_bool_ref (1, 0, 0, 0, 0, fcn);
public static int test_0_Bool_Ref_Managed ()
{
- MarshalBoolRefDelegate fcn = new MarshalBoolRefDelegate (new marshalbool ().MarshalBoolRefHelper);
+ MarshalBoolRefDelegate fcn = new MarshalBoolRefDelegate (MarshalBoolRefHelper);
int ret;
ret = mono_test_managed_marshal_bool_ref (2, 0, 0, 0, 0, fcn);
public static int test_0_I1_Ref_Managed ()
{
- MarshalBoolRefDelegate fcn = new MarshalBoolRefDelegate (new marshalbool ().MarshalBoolRefHelper);
+ MarshalBoolRefDelegate fcn = new MarshalBoolRefDelegate (MarshalBoolRefHelper);
int ret;
ret = mono_test_managed_marshal_bool_ref (3, 0, 0, 0, 0, fcn);
public static int test_0_U1_Ref_Managed ()
{
- MarshalBoolRefDelegate fcn = new MarshalBoolRefDelegate (new marshalbool ().MarshalBoolRefHelper);
+ MarshalBoolRefDelegate fcn = new MarshalBoolRefDelegate (MarshalBoolRefHelper);
int ret;
ret = mono_test_managed_marshal_bool_ref (4, 0, 0, 0, 0, fcn);
public static int test_0_VariantBool_Ref_Managed ()
{
- MarshalBoolRefDelegate fcn = new MarshalBoolRefDelegate (new marshalbool ().MarshalBoolRefHelper);
+ MarshalBoolRefDelegate fcn = new MarshalBoolRefDelegate (MarshalBoolRefHelper);
int ret;
ret = mono_test_managed_marshal_bool_ref (5, 0, 0, 0, 0, fcn);
///////////////////////////////////////////////////////////////////
- unsafe int MarshalBoolInHelper (int arg, uint expected, bool bDefaultMarsh, bool bBoolCustMarsh, bool bI1CustMarsh,
- bool bU1CustMarsh, bool bVBCustMarsh)
+ [MonoPInvokeCallback (typeof (MarshalBoolInDelegate))]
+ unsafe static int MarshalBoolInHelper (int arg, uint expected, bool bDefaultMarsh, bool bBoolCustMarsh, bool bI1CustMarsh,
+ bool bU1CustMarsh, bool bVBCustMarsh)
{
bool* ptestVal;
switch (arg) {
return 0;
}
- unsafe int MarshalBoolOutHelper (int arg, uint testVal, out bool bDefaultMarsh, out bool bBoolCustMarsh,
- out bool bI1CustMarsh, out bool bU1CustMarsh, out bool bVBCustMarsh)
+ [MonoPInvokeCallback (typeof (MarshalBoolOutDelegate))]
+ unsafe static int MarshalBoolOutHelper (int arg, uint testVal, out bool bDefaultMarsh, out bool bBoolCustMarsh,
+ out bool bI1CustMarsh, out bool bU1CustMarsh, out bool bVBCustMarsh)
{
bDefaultMarsh = bBoolCustMarsh = bI1CustMarsh = bU1CustMarsh = bVBCustMarsh = false;
switch (arg) {
return 0;
}
- unsafe int MarshalBoolRefHelper (int arg, uint expected, uint testVal, ref bool bDefaultMarsh, ref bool bBoolCustMarsh,
- ref bool bI1CustMarsh, ref bool bU1CustMarsh, ref bool bVBCustMarsh)
+ [MonoPInvokeCallback (typeof (MarshalBoolRefDelegate))]
+ unsafe static int MarshalBoolRefHelper (int arg, uint expected, uint testVal, ref bool bDefaultMarsh, ref bool bBoolCustMarsh,
+ ref bool bI1CustMarsh, ref bool bU1CustMarsh, ref bool bVBCustMarsh)
{
switch (arg) {
case 1: