public static System.IntPtr ManagedToNative(martin.Test.Foo[] arg) { if (arg == null) { return System.IntPtr.Zero; } System.IntPtr ptr = Marshal.AllocHGlobal(Array_Foo_Helper.NativeSize + martin.Test.Foo .Foo_Helper.NativeSize * arg.Length); Array_Foo_Helper.MarshalIn(ptr, arg); return ptr; }
public static void MarshalIn(System.IntPtr ptr, martin.Test.Foo[] arg) { Array_Foo_Struct obj = new Array_Foo_Struct(); obj._owner = 0x972f3813; obj.length = arg.Length; { obj.ptr = ptr + Array_Foo_Helper.NativeSize; System.IntPtr addr = obj.ptr; for (int i = 0; i < arg.Length; i++, addr += martin.Test.Foo.Foo_Helper.NativeSize) { martin.Test.Foo.Foo_Helper.MarshalIn(addr, arg[i]); } } Marshal.StructureToPtr(obj, ptr, false); }
public static void MarshalOut(System.IntPtr ptr, martin.Test.Foo[] arg) { Array_Foo_Struct obj = (Array_Foo_Struct)Marshal.PtrToStructure(ptr, typeof(Array_Foo_Struct )); if (obj.length != arg.Length) { throw new System.InvalidOperationException(); } { System.IntPtr addr = obj.ptr; for (int i = 0; i < obj.length; i++, addr += martin.Test.Foo.Foo_Helper.NativeSize) { martin.Test.Foo.Foo_Helper.MarshalOut(addr, arg[i]); } } }
public static void MarshalOut(System.IntPtr ptr, martin.Test.Complex arg) { Complex_Struct obj = (Complex_Struct)Marshal.PtrToStructure(ptr, typeof(Complex_Struct )); arg.foo = Array_Foo_Helper.NativeToManaged(obj.foo); arg.str = XobotOS.Runtime.MarshalGlue.String_Helper.NativeToManaged(obj.str); }
public static System.IntPtr ManagedToNative(martin.Test.Complex arg) { if (arg == null) { return System.IntPtr.Zero; } System.IntPtr ptr = Marshal.AllocHGlobal(Marshal.SizeOf(typeof(Complex_Struct))); martin.Test.Complex.Complex_Helper.MarshalIn(ptr, arg); return ptr; }
public static void MarshalOut(System.IntPtr ptr, martin.Test.Blittable arg) { Blittable_Struct obj = (Blittable_Struct)Marshal.PtrToStructure(ptr, typeof(Blittable_Struct )); arg.hello = obj.hello; }
public static void MarshalIn(System.IntPtr ptr, martin.Test.Complex arg) { Complex_Struct obj = new Complex_Struct(); obj._owner = 0x972f3813; obj.foo = Array_Foo_Helper.ManagedToNative(arg.foo); obj.str = XobotOS.Runtime.MarshalGlue.String_Helper.ManagedToNative(arg.str); Marshal.StructureToPtr(obj, ptr, false); }
public static void MarshalOut(System.IntPtr ptr, martin.Test.Foo arg) { Foo_Struct obj = (Foo_Struct)Marshal.PtrToStructure(ptr, typeof(Foo_Struct)); arg.hello = obj.hello; arg.a = XobotOS.Runtime.MarshalGlue.Array_int_Helper.NativeToManaged(obj.a); }
public static void MarshalIn(System.IntPtr ptr, martin.Test.Blittable arg) { Blittable_Struct obj = new Blittable_Struct(); obj._owner = 0x972f3813; obj.hello = arg.hello; Marshal.StructureToPtr(obj, ptr, false); }
internal static void complex(martin.Test.Complex arg) { System.IntPtr arg_ptr = System.IntPtr.Zero; try { arg_ptr = martin.Test.Complex.Complex_Helper.ManagedToNative(arg); libxobotos_Test_complex(arg_ptr); } finally { martin.Test.Complex.Complex_Helper.FreeManagedPtr(arg_ptr); } }
public static void MarshalIn(System.IntPtr ptr, martin.Test.Foo arg) { Foo_Struct obj = new Foo_Struct(); obj._owner = 0x972f3813; obj.hello = arg.hello; obj.a = XobotOS.Runtime.MarshalGlue.Array_int_Helper.ManagedToNative(arg.a); Marshal.StructureToPtr(obj, ptr, false); }
internal static void blittableRef(martin.Test.Blittable arg) { System.IntPtr arg_ptr = System.IntPtr.Zero; try { arg_ptr = martin.Test.Blittable.Blittable_Helper.ManagedToNative(arg); libxobotos_Test_blittableRef(arg_ptr); martin.Test.Blittable.Blittable_Helper.MarshalOut(arg_ptr, arg); } finally { martin.Test.Blittable.Blittable_Helper.FreeManagedPtr(arg_ptr); } }
internal static void outFunc(martin.Test.Foo arg) { System.IntPtr arg_ptr = System.IntPtr.Zero; try { libxobotos_Test_outFunc(out arg_ptr); martin.Test.Foo.Foo_Helper.MarshalOut(arg_ptr, arg); } finally { martin.Test.Foo.Foo_Helper.FreeNativePtr(arg_ptr); } }
internal static void refFunc(martin.Test.Foo arg) { System.IntPtr arg_ptr = System.IntPtr.Zero; try { arg_ptr = martin.Test.Foo.Foo_Helper.ManagedToNative(arg); libxobotos_Test_refFunc(arg_ptr); martin.Test.Foo.Foo_Helper.MarshalOut(arg_ptr, arg); } finally { martin.Test.Foo.Foo_Helper.FreeManagedPtr(arg_ptr); } }
internal static void bar(martin.Test.Foo[] arg) { System.IntPtr arg_ptr = System.IntPtr.Zero; try { arg_ptr = Array_Foo_Helper.ManagedToNative(arg); libxobotos_Test_bar(arg_ptr); } finally { Array_Foo_Helper.FreeManagedPtr(arg_ptr); } }
internal static void foo(martin.Test.Foo arg) { System.IntPtr arg_ptr = System.IntPtr.Zero; try { arg_ptr = martin.Test.Foo.Foo_Helper.ManagedToNative(arg); libxobotos_Test_foo(arg_ptr); } finally { martin.Test.Foo.Foo_Helper.FreeManagedPtr(arg_ptr); } }