public static void FreeManagedPtr_inner(System.IntPtr ptr) { Array_char_Struct obj = (Array_char_Struct)Marshal.PtrToStructure(ptr, typeof(Array_char_Struct )); if (obj._owner != 0x972f3813) { throw new System.InvalidOperationException(); } }
public static void MarshalOut(System.IntPtr ptr, char[] arg) { Array_char_Struct obj = (Array_char_Struct)Marshal.PtrToStructure(ptr, typeof(Array_char_Struct )); if (obj.length != arg.Length) { throw new System.InvalidOperationException(); } throw new System.InvalidOperationException(); }
public static void MarshalIn(System.IntPtr ptr, char[] arg) { Array_char_Struct obj = new Array_char_Struct(); obj._owner = 0x972f3813; obj.length = arg.Length; { obj.ptr = ptr + XobotOS.Runtime.MarshalGlue.Array_char_Helper.NativeSize; Marshal.Copy(arg, 0, obj.ptr, arg.Length); } Marshal.StructureToPtr(obj, ptr, false); }
public static char[] NativeToManaged(System.IntPtr ptr) { if (ptr == System.IntPtr.Zero) { return(null); } Array_char_Struct obj = (Array_char_Struct)Marshal.PtrToStructure(ptr, typeof(Array_char_Struct )); char[] arg = new char[obj.length]; if (obj.length != arg.Length) { throw new System.InvalidOperationException(); } Marshal.Copy(obj.ptr, arg, 0, obj.length); return(arg); }
public static Sharpen.INativeHandle GetPinnedPtr(char[] arg) { if (arg == null) { return(null); } PinnedHandle pinned = new PinnedHandle(); Array_char_Struct obj = new Array_char_Struct(); obj._owner = 0x337b4904; obj.length = arg.Length; { pinned.handle_array_ptr = GCHandle.Alloc(arg, GCHandleType.Pinned); obj.ptr = pinned.handle_array_ptr.AddrOfPinnedObject(); } pinned.handle = GCHandle.Alloc(obj, GCHandleType.Pinned); pinned.ptr = pinned.handle.AddrOfPinnedObject(); return(pinned); }
public static Sharpen.INativeHandle GetPinnedPtr(char[] arg) { if (arg == null) { return null; } PinnedHandle pinned = new PinnedHandle(); Array_char_Struct obj = new Array_char_Struct(); obj._owner = 0x337b4904; obj.length = arg.Length; { pinned.handle_array_ptr = GCHandle.Alloc(arg, GCHandleType.Pinned); obj.ptr = pinned.handle_array_ptr.AddrOfPinnedObject(); } pinned.handle = GCHandle.Alloc(obj, GCHandleType.Pinned); pinned.ptr = pinned.handle.AddrOfPinnedObject(); return pinned; }