diff --git a/src/CppParser/Bindings/CSharp/i686-apple-darwin12.4.0/AST.cs b/src/CppParser/Bindings/CSharp/i686-apple-darwin12.4.0/AST.cs index d149adf7..05acb356 100644 --- a/src/CppParser/Bindings/CSharp/i686-apple-darwin12.4.0/AST.cs +++ b/src/CppParser/Bindings/CSharp/i686-apple-darwin12.4.0/AST.cs @@ -265,19 +265,21 @@ namespace CppSharp } public global::System.IntPtr __Instance { get; protected set; } + + protected int __PointerAdjustment; public static readonly System.Collections.Concurrent.ConcurrentDictionary NativeToManagedMap = new System.Collections.Concurrent.ConcurrentDictionary(); protected void*[] __OriginalVTables; protected bool __ownsNativeInstance; - public static Type __CreateInstance(global::System.IntPtr native, bool ownsNativeInstance = false) + public static Type __CreateInstance(global::System.IntPtr native, bool ownsNativeInstance = false, bool skipVTables = false) { - return new Type((Type.Internal*) native) { __ownsNativeInstance = ownsNativeInstance }; + return new Type((Type.Internal*) native, skipVTables) { __ownsNativeInstance = ownsNativeInstance }; } - public static Type __CreateInstance(Type.Internal native) + public static Type __CreateInstance(Type.Internal native, bool skipVTables = false) { - return new Type(native); + return new Type(native, skipVTables); } private static Type.Internal* __CopyValue(Type.Internal native) @@ -287,15 +289,17 @@ namespace CppSharp return (Type.Internal*) ret; } - private Type(Type.Internal native) - : this(__CopyValue(native)) + private Type(Type.Internal native, bool skipVTables = false) + : this(__CopyValue(native), skipVTables) { __ownsNativeInstance = true; NativeToManagedMap[__Instance] = this; } - protected Type(Type.Internal* native, bool isInternalImpl = false) + protected Type(Type.Internal* native, bool skipVTables = false) { + if (native == null) + return; __Instance = new global::System.IntPtr(native); } @@ -303,18 +307,18 @@ namespace CppSharp { __Instance = Marshal.AllocHGlobal(8); __ownsNativeInstance = true; - var arg0 = kind; - Internal.ctor_0(__Instance, arg0); NativeToManagedMap[__Instance] = this; + var arg0 = kind; + Internal.ctor_0((__Instance + __PointerAdjustment), arg0); } public Type(CppSharp.Parser.AST.Type _0) { __Instance = Marshal.AllocHGlobal(8); __ownsNativeInstance = true; - var arg0 = ReferenceEquals(_0, null) ? global::System.IntPtr.Zero : _0.__Instance; - Internal.cctor_1(__Instance, arg0); NativeToManagedMap[__Instance] = this; + var arg0 = ReferenceEquals(_0, null) ? global::System.IntPtr.Zero : _0.__Instance; + Internal.cctor_1((__Instance + __PointerAdjustment), arg0); } public void Dispose() @@ -328,7 +332,8 @@ namespace CppSharp throw new global::System.InvalidOperationException("Managed instances owned by native code cannot be disposed of."); CppSharp.Parser.AST.Type __dummy; NativeToManagedMap.TryRemove(__Instance, out __dummy); - Marshal.FreeHGlobal(__Instance); + if (__ownsNativeInstance) + Marshal.FreeHGlobal(__Instance); } public CppSharp.Parser.AST.TypeKind Kind @@ -379,19 +384,21 @@ namespace CppSharp } public global::System.IntPtr __Instance { get; protected set; } + + protected int __PointerAdjustment; public static readonly System.Collections.Concurrent.ConcurrentDictionary NativeToManagedMap = new System.Collections.Concurrent.ConcurrentDictionary(); protected void*[] __OriginalVTables; protected bool __ownsNativeInstance; - public static TypeQualifiers __CreateInstance(global::System.IntPtr native, bool ownsNativeInstance = false) + public static TypeQualifiers __CreateInstance(global::System.IntPtr native, bool ownsNativeInstance = false, bool skipVTables = false) { - return new TypeQualifiers((TypeQualifiers.Internal*) native) { __ownsNativeInstance = ownsNativeInstance }; + return new TypeQualifiers((TypeQualifiers.Internal*) native, skipVTables) { __ownsNativeInstance = ownsNativeInstance }; } - public static TypeQualifiers __CreateInstance(TypeQualifiers.Internal native) + public static TypeQualifiers __CreateInstance(TypeQualifiers.Internal native, bool skipVTables = false) { - return new TypeQualifiers(native); + return new TypeQualifiers(native, skipVTables); } private static TypeQualifiers.Internal* __CopyValue(TypeQualifiers.Internal native) @@ -401,15 +408,17 @@ namespace CppSharp return ret; } - private TypeQualifiers(TypeQualifiers.Internal native) - : this(__CopyValue(native)) + private TypeQualifiers(TypeQualifiers.Internal native, bool skipVTables = false) + : this(__CopyValue(native), skipVTables) { __ownsNativeInstance = true; NativeToManagedMap[__Instance] = this; } - protected TypeQualifiers(TypeQualifiers.Internal* native, bool isInternalImpl = false) + protected TypeQualifiers(TypeQualifiers.Internal* native, bool skipVTables = false) { + if (native == null) + return; __Instance = new global::System.IntPtr(native); } @@ -417,8 +426,8 @@ namespace CppSharp { __Instance = Marshal.AllocHGlobal(3); __ownsNativeInstance = true; - *((TypeQualifiers.Internal*) __Instance) = *((TypeQualifiers.Internal*) _0.__Instance); NativeToManagedMap[__Instance] = this; + *((TypeQualifiers.Internal*) __Instance) = *((TypeQualifiers.Internal*) _0.__Instance); } public TypeQualifiers() @@ -439,7 +448,8 @@ namespace CppSharp throw new global::System.InvalidOperationException("Managed instances owned by native code cannot be disposed of."); CppSharp.Parser.AST.TypeQualifiers __dummy; NativeToManagedMap.TryRemove(__Instance, out __dummy); - Marshal.FreeHGlobal(__Instance); + if (__ownsNativeInstance) + Marshal.FreeHGlobal(__Instance); } public bool IsConst @@ -505,19 +515,21 @@ namespace CppSharp } public global::System.IntPtr __Instance { get; protected set; } + + protected int __PointerAdjustment; public static readonly System.Collections.Concurrent.ConcurrentDictionary NativeToManagedMap = new System.Collections.Concurrent.ConcurrentDictionary(); protected void*[] __OriginalVTables; protected bool __ownsNativeInstance; - public static QualifiedType __CreateInstance(global::System.IntPtr native, bool ownsNativeInstance = false) + public static QualifiedType __CreateInstance(global::System.IntPtr native, bool ownsNativeInstance = false, bool skipVTables = false) { - return new QualifiedType((QualifiedType.Internal*) native) { __ownsNativeInstance = ownsNativeInstance }; + return new QualifiedType((QualifiedType.Internal*) native, skipVTables) { __ownsNativeInstance = ownsNativeInstance }; } - public static QualifiedType __CreateInstance(QualifiedType.Internal native) + public static QualifiedType __CreateInstance(QualifiedType.Internal native, bool skipVTables = false) { - return new QualifiedType(native); + return new QualifiedType(native, skipVTables); } private static QualifiedType.Internal* __CopyValue(QualifiedType.Internal native) @@ -527,15 +539,17 @@ namespace CppSharp return ret; } - private QualifiedType(QualifiedType.Internal native) - : this(__CopyValue(native)) + private QualifiedType(QualifiedType.Internal native, bool skipVTables = false) + : this(__CopyValue(native), skipVTables) { __ownsNativeInstance = true; NativeToManagedMap[__Instance] = this; } - protected QualifiedType(QualifiedType.Internal* native, bool isInternalImpl = false) + protected QualifiedType(QualifiedType.Internal* native, bool skipVTables = false) { + if (native == null) + return; __Instance = new global::System.IntPtr(native); } @@ -543,16 +557,16 @@ namespace CppSharp { __Instance = Marshal.AllocHGlobal(8); __ownsNativeInstance = true; - Internal.ctor_0(__Instance); NativeToManagedMap[__Instance] = this; + Internal.ctor_0((__Instance + __PointerAdjustment)); } public QualifiedType(CppSharp.Parser.AST.QualifiedType _0) { __Instance = Marshal.AllocHGlobal(8); __ownsNativeInstance = true; - *((QualifiedType.Internal*) __Instance) = *((QualifiedType.Internal*) _0.__Instance); NativeToManagedMap[__Instance] = this; + *((QualifiedType.Internal*) __Instance) = *((QualifiedType.Internal*) _0.__Instance); } public void Dispose() @@ -566,7 +580,8 @@ namespace CppSharp throw new global::System.InvalidOperationException("Managed instances owned by native code cannot be disposed of."); CppSharp.Parser.AST.QualifiedType __dummy; NativeToManagedMap.TryRemove(__Instance, out __dummy); - Marshal.FreeHGlobal(__Instance); + if (__ownsNativeInstance) + Marshal.FreeHGlobal(__Instance); } public CppSharp.Parser.AST.Type Type @@ -626,14 +641,14 @@ namespace CppSharp internal static extern void cctor_2(global::System.IntPtr instance, global::System.IntPtr _0); } - public static new TagType __CreateInstance(global::System.IntPtr native, bool ownsNativeInstance = false) + public static new TagType __CreateInstance(global::System.IntPtr native, bool ownsNativeInstance = false, bool skipVTables = false) { - return new TagType((TagType.Internal*) native) { __ownsNativeInstance = ownsNativeInstance }; + return new TagType((TagType.Internal*) native, skipVTables) { __ownsNativeInstance = ownsNativeInstance }; } - public static TagType __CreateInstance(TagType.Internal native) + public static TagType __CreateInstance(TagType.Internal native, bool skipVTables = false) { - return new TagType(native); + return new TagType(native, skipVTables); } private static TagType.Internal* __CopyValue(TagType.Internal native) @@ -643,16 +658,20 @@ namespace CppSharp return (TagType.Internal*) ret; } - private TagType(TagType.Internal native) - : this(__CopyValue(native)) + private TagType(TagType.Internal native, bool skipVTables = false) + : this(__CopyValue(native), skipVTables) { __ownsNativeInstance = true; NativeToManagedMap[__Instance] = this; } - protected TagType(TagType.Internal* native, bool isInternalImpl = false) - : base((CppSharp.Parser.AST.Type.Internal*) native) + protected TagType(TagType.Internal* native, bool skipVTables = false) + : base((CppSharp.Parser.AST.Type.Internal*) null) { + __PointerAdjustment = 0; + if (native == null) + return; + __Instance = new global::System.IntPtr(native); } public TagType() @@ -660,8 +679,8 @@ namespace CppSharp { __Instance = Marshal.AllocHGlobal(12); __ownsNativeInstance = true; - Internal.ctor_0(__Instance); NativeToManagedMap[__Instance] = this; + Internal.ctor_0((__Instance + __PointerAdjustment)); } public TagType(CppSharp.Parser.AST.TagType _0) @@ -669,9 +688,9 @@ namespace CppSharp { __Instance = Marshal.AllocHGlobal(12); __ownsNativeInstance = true; - var arg0 = ReferenceEquals(_0, null) ? global::System.IntPtr.Zero : _0.__Instance; - Internal.cctor_2(__Instance, arg0); NativeToManagedMap[__Instance] = this; + var arg0 = ReferenceEquals(_0, null) ? global::System.IntPtr.Zero : _0.__Instance; + Internal.cctor_2((__Instance + __PointerAdjustment), arg0); } public CppSharp.Parser.AST.Declaration Declaration @@ -735,14 +754,14 @@ namespace CppSharp Incomplete = 3 } - public static new ArrayType __CreateInstance(global::System.IntPtr native, bool ownsNativeInstance = false) + public static new ArrayType __CreateInstance(global::System.IntPtr native, bool ownsNativeInstance = false, bool skipVTables = false) { - return new ArrayType((ArrayType.Internal*) native) { __ownsNativeInstance = ownsNativeInstance }; + return new ArrayType((ArrayType.Internal*) native, skipVTables) { __ownsNativeInstance = ownsNativeInstance }; } - public static ArrayType __CreateInstance(ArrayType.Internal native) + public static ArrayType __CreateInstance(ArrayType.Internal native, bool skipVTables = false) { - return new ArrayType(native); + return new ArrayType(native, skipVTables); } private static ArrayType.Internal* __CopyValue(ArrayType.Internal native) @@ -752,16 +771,20 @@ namespace CppSharp return (ArrayType.Internal*) ret; } - private ArrayType(ArrayType.Internal native) - : this(__CopyValue(native)) + private ArrayType(ArrayType.Internal native, bool skipVTables = false) + : this(__CopyValue(native), skipVTables) { __ownsNativeInstance = true; NativeToManagedMap[__Instance] = this; } - protected ArrayType(ArrayType.Internal* native, bool isInternalImpl = false) - : base((CppSharp.Parser.AST.Type.Internal*) native) + protected ArrayType(ArrayType.Internal* native, bool skipVTables = false) + : base((CppSharp.Parser.AST.Type.Internal*) null) { + __PointerAdjustment = 0; + if (native == null) + return; + __Instance = new global::System.IntPtr(native); } public ArrayType() @@ -769,8 +792,8 @@ namespace CppSharp { __Instance = Marshal.AllocHGlobal(28); __ownsNativeInstance = true; - Internal.ctor_0(__Instance); NativeToManagedMap[__Instance] = this; + Internal.ctor_0((__Instance + __PointerAdjustment)); } public ArrayType(CppSharp.Parser.AST.ArrayType _0) @@ -778,9 +801,9 @@ namespace CppSharp { __Instance = Marshal.AllocHGlobal(28); __ownsNativeInstance = true; - var arg0 = ReferenceEquals(_0, null) ? global::System.IntPtr.Zero : _0.__Instance; - Internal.cctor_2(__Instance, arg0); NativeToManagedMap[__Instance] = this; + var arg0 = ReferenceEquals(_0, null) ? global::System.IntPtr.Zero : _0.__Instance; + Internal.cctor_2((__Instance + __PointerAdjustment), arg0); } public CppSharp.Parser.AST.QualifiedType QualifiedType @@ -889,14 +912,14 @@ namespace CppSharp internal static extern uint getParametersCount_0(global::System.IntPtr instance); } - public static new FunctionType __CreateInstance(global::System.IntPtr native, bool ownsNativeInstance = false) + public static new FunctionType __CreateInstance(global::System.IntPtr native, bool ownsNativeInstance = false, bool skipVTables = false) { - return new FunctionType((FunctionType.Internal*) native) { __ownsNativeInstance = ownsNativeInstance }; + return new FunctionType((FunctionType.Internal*) native, skipVTables) { __ownsNativeInstance = ownsNativeInstance }; } - public static FunctionType __CreateInstance(FunctionType.Internal native) + public static FunctionType __CreateInstance(FunctionType.Internal native, bool skipVTables = false) { - return new FunctionType(native); + return new FunctionType(native, skipVTables); } private static FunctionType.Internal* __CopyValue(FunctionType.Internal native) @@ -906,16 +929,20 @@ namespace CppSharp return (FunctionType.Internal*) ret; } - private FunctionType(FunctionType.Internal native) - : this(__CopyValue(native)) + private FunctionType(FunctionType.Internal native, bool skipVTables = false) + : this(__CopyValue(native), skipVTables) { __ownsNativeInstance = true; NativeToManagedMap[__Instance] = this; } - protected FunctionType(FunctionType.Internal* native, bool isInternalImpl = false) - : base((CppSharp.Parser.AST.Type.Internal*) native) + protected FunctionType(FunctionType.Internal* native, bool skipVTables = false) + : base((CppSharp.Parser.AST.Type.Internal*) null) { + __PointerAdjustment = 0; + if (native == null) + return; + __Instance = new global::System.IntPtr(native); } public FunctionType() @@ -923,8 +950,8 @@ namespace CppSharp { __Instance = Marshal.AllocHGlobal(32); __ownsNativeInstance = true; - Internal.ctor_0(__Instance); NativeToManagedMap[__Instance] = this; + Internal.ctor_0((__Instance + __PointerAdjustment)); } public FunctionType(CppSharp.Parser.AST.FunctionType _0) @@ -932,14 +959,14 @@ namespace CppSharp { __Instance = Marshal.AllocHGlobal(32); __ownsNativeInstance = true; - var arg0 = ReferenceEquals(_0, null) ? global::System.IntPtr.Zero : _0.__Instance; - Internal.cctor_2(__Instance, arg0); NativeToManagedMap[__Instance] = this; + var arg0 = ReferenceEquals(_0, null) ? global::System.IntPtr.Zero : _0.__Instance; + Internal.cctor_2((__Instance + __PointerAdjustment), arg0); } public CppSharp.Parser.AST.Parameter getParameters(uint i) { - var __ret = Internal.getParameters_0(__Instance, i); + var __ret = Internal.getParameters_0((__Instance + __PointerAdjustment), i); CppSharp.Parser.AST.Parameter __result0; if (__ret == IntPtr.Zero) __result0 = null; else if (CppSharp.Parser.AST.Parameter.NativeToManagedMap.ContainsKey(__ret)) @@ -951,19 +978,19 @@ namespace CppSharp public void addParameters(CppSharp.Parser.AST.Parameter s) { var arg0 = ReferenceEquals(s, null) ? global::System.IntPtr.Zero : s.__Instance; - Internal.addParameters_0(__Instance, arg0); + Internal.addParameters_0((__Instance + __PointerAdjustment), arg0); } public void clearParameters() { - Internal.clearParameters_0(__Instance); + Internal.clearParameters_0((__Instance + __PointerAdjustment)); } public uint ParametersCount { get { - var __ret = Internal.getParametersCount_0(__Instance); + var __ret = Internal.getParametersCount_0((__Instance + __PointerAdjustment)); return __ret; } } @@ -1031,14 +1058,14 @@ namespace CppSharp RVReference = 3 } - public static new PointerType __CreateInstance(global::System.IntPtr native, bool ownsNativeInstance = false) + public static new PointerType __CreateInstance(global::System.IntPtr native, bool ownsNativeInstance = false, bool skipVTables = false) { - return new PointerType((PointerType.Internal*) native) { __ownsNativeInstance = ownsNativeInstance }; + return new PointerType((PointerType.Internal*) native, skipVTables) { __ownsNativeInstance = ownsNativeInstance }; } - public static PointerType __CreateInstance(PointerType.Internal native) + public static PointerType __CreateInstance(PointerType.Internal native, bool skipVTables = false) { - return new PointerType(native); + return new PointerType(native, skipVTables); } private static PointerType.Internal* __CopyValue(PointerType.Internal native) @@ -1048,16 +1075,20 @@ namespace CppSharp return (PointerType.Internal*) ret; } - private PointerType(PointerType.Internal native) - : this(__CopyValue(native)) + private PointerType(PointerType.Internal native, bool skipVTables = false) + : this(__CopyValue(native), skipVTables) { __ownsNativeInstance = true; NativeToManagedMap[__Instance] = this; } - protected PointerType(PointerType.Internal* native, bool isInternalImpl = false) - : base((CppSharp.Parser.AST.Type.Internal*) native) + protected PointerType(PointerType.Internal* native, bool skipVTables = false) + : base((CppSharp.Parser.AST.Type.Internal*) null) { + __PointerAdjustment = 0; + if (native == null) + return; + __Instance = new global::System.IntPtr(native); } public PointerType() @@ -1065,8 +1096,8 @@ namespace CppSharp { __Instance = Marshal.AllocHGlobal(20); __ownsNativeInstance = true; - Internal.ctor_0(__Instance); NativeToManagedMap[__Instance] = this; + Internal.ctor_0((__Instance + __PointerAdjustment)); } public PointerType(CppSharp.Parser.AST.PointerType _0) @@ -1074,9 +1105,9 @@ namespace CppSharp { __Instance = Marshal.AllocHGlobal(20); __ownsNativeInstance = true; - var arg0 = ReferenceEquals(_0, null) ? global::System.IntPtr.Zero : _0.__Instance; - Internal.cctor_2(__Instance, arg0); NativeToManagedMap[__Instance] = this; + var arg0 = ReferenceEquals(_0, null) ? global::System.IntPtr.Zero : _0.__Instance; + Internal.cctor_2((__Instance + __PointerAdjustment), arg0); } public CppSharp.Parser.AST.QualifiedType QualifiedPointee @@ -1131,14 +1162,14 @@ namespace CppSharp internal static extern void cctor_2(global::System.IntPtr instance, global::System.IntPtr _0); } - public static new MemberPointerType __CreateInstance(global::System.IntPtr native, bool ownsNativeInstance = false) + public static new MemberPointerType __CreateInstance(global::System.IntPtr native, bool ownsNativeInstance = false, bool skipVTables = false) { - return new MemberPointerType((MemberPointerType.Internal*) native) { __ownsNativeInstance = ownsNativeInstance }; + return new MemberPointerType((MemberPointerType.Internal*) native, skipVTables) { __ownsNativeInstance = ownsNativeInstance }; } - public static MemberPointerType __CreateInstance(MemberPointerType.Internal native) + public static MemberPointerType __CreateInstance(MemberPointerType.Internal native, bool skipVTables = false) { - return new MemberPointerType(native); + return new MemberPointerType(native, skipVTables); } private static MemberPointerType.Internal* __CopyValue(MemberPointerType.Internal native) @@ -1148,16 +1179,20 @@ namespace CppSharp return (MemberPointerType.Internal*) ret; } - private MemberPointerType(MemberPointerType.Internal native) - : this(__CopyValue(native)) + private MemberPointerType(MemberPointerType.Internal native, bool skipVTables = false) + : this(__CopyValue(native), skipVTables) { __ownsNativeInstance = true; NativeToManagedMap[__Instance] = this; } - protected MemberPointerType(MemberPointerType.Internal* native, bool isInternalImpl = false) - : base((CppSharp.Parser.AST.Type.Internal*) native) + protected MemberPointerType(MemberPointerType.Internal* native, bool skipVTables = false) + : base((CppSharp.Parser.AST.Type.Internal*) null) { + __PointerAdjustment = 0; + if (native == null) + return; + __Instance = new global::System.IntPtr(native); } public MemberPointerType() @@ -1165,8 +1200,8 @@ namespace CppSharp { __Instance = Marshal.AllocHGlobal(16); __ownsNativeInstance = true; - Internal.ctor_0(__Instance); NativeToManagedMap[__Instance] = this; + Internal.ctor_0((__Instance + __PointerAdjustment)); } public MemberPointerType(CppSharp.Parser.AST.MemberPointerType _0) @@ -1174,9 +1209,9 @@ namespace CppSharp { __Instance = Marshal.AllocHGlobal(16); __ownsNativeInstance = true; - var arg0 = ReferenceEquals(_0, null) ? global::System.IntPtr.Zero : _0.__Instance; - Internal.cctor_2(__Instance, arg0); NativeToManagedMap[__Instance] = this; + var arg0 = ReferenceEquals(_0, null) ? global::System.IntPtr.Zero : _0.__Instance; + Internal.cctor_2((__Instance + __PointerAdjustment), arg0); } public CppSharp.Parser.AST.QualifiedType Pointee @@ -1218,14 +1253,14 @@ namespace CppSharp internal static extern void cctor_2(global::System.IntPtr instance, global::System.IntPtr _0); } - public static new TypedefType __CreateInstance(global::System.IntPtr native, bool ownsNativeInstance = false) + public static new TypedefType __CreateInstance(global::System.IntPtr native, bool ownsNativeInstance = false, bool skipVTables = false) { - return new TypedefType((TypedefType.Internal*) native) { __ownsNativeInstance = ownsNativeInstance }; + return new TypedefType((TypedefType.Internal*) native, skipVTables) { __ownsNativeInstance = ownsNativeInstance }; } - public static TypedefType __CreateInstance(TypedefType.Internal native) + public static TypedefType __CreateInstance(TypedefType.Internal native, bool skipVTables = false) { - return new TypedefType(native); + return new TypedefType(native, skipVTables); } private static TypedefType.Internal* __CopyValue(TypedefType.Internal native) @@ -1235,16 +1270,20 @@ namespace CppSharp return (TypedefType.Internal*) ret; } - private TypedefType(TypedefType.Internal native) - : this(__CopyValue(native)) + private TypedefType(TypedefType.Internal native, bool skipVTables = false) + : this(__CopyValue(native), skipVTables) { __ownsNativeInstance = true; NativeToManagedMap[__Instance] = this; } - protected TypedefType(TypedefType.Internal* native, bool isInternalImpl = false) - : base((CppSharp.Parser.AST.Type.Internal*) native) + protected TypedefType(TypedefType.Internal* native, bool skipVTables = false) + : base((CppSharp.Parser.AST.Type.Internal*) null) { + __PointerAdjustment = 0; + if (native == null) + return; + __Instance = new global::System.IntPtr(native); } public TypedefType() @@ -1252,8 +1291,8 @@ namespace CppSharp { __Instance = Marshal.AllocHGlobal(12); __ownsNativeInstance = true; - Internal.ctor_0(__Instance); NativeToManagedMap[__Instance] = this; + Internal.ctor_0((__Instance + __PointerAdjustment)); } public TypedefType(CppSharp.Parser.AST.TypedefType _0) @@ -1261,9 +1300,9 @@ namespace CppSharp { __Instance = Marshal.AllocHGlobal(12); __ownsNativeInstance = true; - var arg0 = ReferenceEquals(_0, null) ? global::System.IntPtr.Zero : _0.__Instance; - Internal.cctor_2(__Instance, arg0); NativeToManagedMap[__Instance] = this; + var arg0 = ReferenceEquals(_0, null) ? global::System.IntPtr.Zero : _0.__Instance; + Internal.cctor_2((__Instance + __PointerAdjustment), arg0); } public CppSharp.Parser.AST.TypedefDecl Declaration @@ -1313,14 +1352,14 @@ namespace CppSharp internal static extern void cctor_2(global::System.IntPtr instance, global::System.IntPtr _0); } - public static new AttributedType __CreateInstance(global::System.IntPtr native, bool ownsNativeInstance = false) + public static new AttributedType __CreateInstance(global::System.IntPtr native, bool ownsNativeInstance = false, bool skipVTables = false) { - return new AttributedType((AttributedType.Internal*) native) { __ownsNativeInstance = ownsNativeInstance }; + return new AttributedType((AttributedType.Internal*) native, skipVTables) { __ownsNativeInstance = ownsNativeInstance }; } - public static AttributedType __CreateInstance(AttributedType.Internal native) + public static AttributedType __CreateInstance(AttributedType.Internal native, bool skipVTables = false) { - return new AttributedType(native); + return new AttributedType(native, skipVTables); } private static AttributedType.Internal* __CopyValue(AttributedType.Internal native) @@ -1330,16 +1369,20 @@ namespace CppSharp return (AttributedType.Internal*) ret; } - private AttributedType(AttributedType.Internal native) - : this(__CopyValue(native)) + private AttributedType(AttributedType.Internal native, bool skipVTables = false) + : this(__CopyValue(native), skipVTables) { __ownsNativeInstance = true; NativeToManagedMap[__Instance] = this; } - protected AttributedType(AttributedType.Internal* native, bool isInternalImpl = false) - : base((CppSharp.Parser.AST.Type.Internal*) native) + protected AttributedType(AttributedType.Internal* native, bool skipVTables = false) + : base((CppSharp.Parser.AST.Type.Internal*) null) { + __PointerAdjustment = 0; + if (native == null) + return; + __Instance = new global::System.IntPtr(native); } public AttributedType() @@ -1347,8 +1390,8 @@ namespace CppSharp { __Instance = Marshal.AllocHGlobal(24); __ownsNativeInstance = true; - Internal.ctor_0(__Instance); NativeToManagedMap[__Instance] = this; + Internal.ctor_0((__Instance + __PointerAdjustment)); } public AttributedType(CppSharp.Parser.AST.AttributedType _0) @@ -1356,9 +1399,9 @@ namespace CppSharp { __Instance = Marshal.AllocHGlobal(24); __ownsNativeInstance = true; - var arg0 = ReferenceEquals(_0, null) ? global::System.IntPtr.Zero : _0.__Instance; - Internal.cctor_2(__Instance, arg0); NativeToManagedMap[__Instance] = this; + var arg0 = ReferenceEquals(_0, null) ? global::System.IntPtr.Zero : _0.__Instance; + Internal.cctor_2((__Instance + __PointerAdjustment), arg0); } public CppSharp.Parser.AST.QualifiedType Modified @@ -1419,14 +1462,14 @@ namespace CppSharp internal static extern void cctor_2(global::System.IntPtr instance, global::System.IntPtr _0); } - public static new DecayedType __CreateInstance(global::System.IntPtr native, bool ownsNativeInstance = false) + public static new DecayedType __CreateInstance(global::System.IntPtr native, bool ownsNativeInstance = false, bool skipVTables = false) { - return new DecayedType((DecayedType.Internal*) native) { __ownsNativeInstance = ownsNativeInstance }; + return new DecayedType((DecayedType.Internal*) native, skipVTables) { __ownsNativeInstance = ownsNativeInstance }; } - public static DecayedType __CreateInstance(DecayedType.Internal native) + public static DecayedType __CreateInstance(DecayedType.Internal native, bool skipVTables = false) { - return new DecayedType(native); + return new DecayedType(native, skipVTables); } private static DecayedType.Internal* __CopyValue(DecayedType.Internal native) @@ -1436,16 +1479,20 @@ namespace CppSharp return (DecayedType.Internal*) ret; } - private DecayedType(DecayedType.Internal native) - : this(__CopyValue(native)) + private DecayedType(DecayedType.Internal native, bool skipVTables = false) + : this(__CopyValue(native), skipVTables) { __ownsNativeInstance = true; NativeToManagedMap[__Instance] = this; } - protected DecayedType(DecayedType.Internal* native, bool isInternalImpl = false) - : base((CppSharp.Parser.AST.Type.Internal*) native) + protected DecayedType(DecayedType.Internal* native, bool skipVTables = false) + : base((CppSharp.Parser.AST.Type.Internal*) null) { + __PointerAdjustment = 0; + if (native == null) + return; + __Instance = new global::System.IntPtr(native); } public DecayedType() @@ -1453,8 +1500,8 @@ namespace CppSharp { __Instance = Marshal.AllocHGlobal(32); __ownsNativeInstance = true; - Internal.ctor_0(__Instance); NativeToManagedMap[__Instance] = this; + Internal.ctor_0((__Instance + __PointerAdjustment)); } public DecayedType(CppSharp.Parser.AST.DecayedType _0) @@ -1462,9 +1509,9 @@ namespace CppSharp { __Instance = Marshal.AllocHGlobal(32); __ownsNativeInstance = true; - var arg0 = ReferenceEquals(_0, null) ? global::System.IntPtr.Zero : _0.__Instance; - Internal.cctor_2(__Instance, arg0); NativeToManagedMap[__Instance] = this; + var arg0 = ReferenceEquals(_0, null) ? global::System.IntPtr.Zero : _0.__Instance; + Internal.cctor_2((__Instance + __PointerAdjustment), arg0); } public CppSharp.Parser.AST.QualifiedType Decayed @@ -1548,19 +1595,21 @@ namespace CppSharp } public global::System.IntPtr __Instance { get; protected set; } + + protected int __PointerAdjustment; public static readonly System.Collections.Concurrent.ConcurrentDictionary NativeToManagedMap = new System.Collections.Concurrent.ConcurrentDictionary(); protected void*[] __OriginalVTables; protected bool __ownsNativeInstance; - public static TemplateArgument __CreateInstance(global::System.IntPtr native, bool ownsNativeInstance = false) + public static TemplateArgument __CreateInstance(global::System.IntPtr native, bool ownsNativeInstance = false, bool skipVTables = false) { - return new TemplateArgument((TemplateArgument.Internal*) native) { __ownsNativeInstance = ownsNativeInstance }; + return new TemplateArgument((TemplateArgument.Internal*) native, skipVTables) { __ownsNativeInstance = ownsNativeInstance }; } - public static TemplateArgument __CreateInstance(TemplateArgument.Internal native) + public static TemplateArgument __CreateInstance(TemplateArgument.Internal native, bool skipVTables = false) { - return new TemplateArgument(native); + return new TemplateArgument(native, skipVTables); } private static TemplateArgument.Internal* __CopyValue(TemplateArgument.Internal native) @@ -1570,15 +1619,17 @@ namespace CppSharp return ret; } - private TemplateArgument(TemplateArgument.Internal native) - : this(__CopyValue(native)) + private TemplateArgument(TemplateArgument.Internal native, bool skipVTables = false) + : this(__CopyValue(native), skipVTables) { __ownsNativeInstance = true; NativeToManagedMap[__Instance] = this; } - protected TemplateArgument(TemplateArgument.Internal* native, bool isInternalImpl = false) + protected TemplateArgument(TemplateArgument.Internal* native, bool skipVTables = false) { + if (native == null) + return; __Instance = new global::System.IntPtr(native); } @@ -1586,16 +1637,16 @@ namespace CppSharp { __Instance = Marshal.AllocHGlobal(20); __ownsNativeInstance = true; - Internal.ctor_0(__Instance); NativeToManagedMap[__Instance] = this; + Internal.ctor_0((__Instance + __PointerAdjustment)); } public TemplateArgument(CppSharp.Parser.AST.TemplateArgument _0) { __Instance = Marshal.AllocHGlobal(20); __ownsNativeInstance = true; - *((TemplateArgument.Internal*) __Instance) = *((TemplateArgument.Internal*) _0.__Instance); NativeToManagedMap[__Instance] = this; + *((TemplateArgument.Internal*) __Instance) = *((TemplateArgument.Internal*) _0.__Instance); } public void Dispose() @@ -1609,7 +1660,8 @@ namespace CppSharp throw new global::System.InvalidOperationException("Managed instances owned by native code cannot be disposed of."); CppSharp.Parser.AST.TemplateArgument __dummy; NativeToManagedMap.TryRemove(__Instance, out __dummy); - Marshal.FreeHGlobal(__Instance); + if (__ownsNativeInstance) + Marshal.FreeHGlobal(__Instance); } public CppSharp.Parser.AST.TemplateArgument.ArgumentKind Kind @@ -1723,14 +1775,14 @@ namespace CppSharp internal static extern uint getArgumentsCount_0(global::System.IntPtr instance); } - public static new TemplateSpecializationType __CreateInstance(global::System.IntPtr native, bool ownsNativeInstance = false) + public static new TemplateSpecializationType __CreateInstance(global::System.IntPtr native, bool ownsNativeInstance = false, bool skipVTables = false) { - return new TemplateSpecializationType((TemplateSpecializationType.Internal*) native) { __ownsNativeInstance = ownsNativeInstance }; + return new TemplateSpecializationType((TemplateSpecializationType.Internal*) native, skipVTables) { __ownsNativeInstance = ownsNativeInstance }; } - public static TemplateSpecializationType __CreateInstance(TemplateSpecializationType.Internal native) + public static TemplateSpecializationType __CreateInstance(TemplateSpecializationType.Internal native, bool skipVTables = false) { - return new TemplateSpecializationType(native); + return new TemplateSpecializationType(native, skipVTables); } private static TemplateSpecializationType.Internal* __CopyValue(TemplateSpecializationType.Internal native) @@ -1740,16 +1792,20 @@ namespace CppSharp return (TemplateSpecializationType.Internal*) ret; } - private TemplateSpecializationType(TemplateSpecializationType.Internal native) - : this(__CopyValue(native)) + private TemplateSpecializationType(TemplateSpecializationType.Internal native, bool skipVTables = false) + : this(__CopyValue(native), skipVTables) { __ownsNativeInstance = true; NativeToManagedMap[__Instance] = this; } - protected TemplateSpecializationType(TemplateSpecializationType.Internal* native, bool isInternalImpl = false) - : base((CppSharp.Parser.AST.Type.Internal*) native) + protected TemplateSpecializationType(TemplateSpecializationType.Internal* native, bool skipVTables = false) + : base((CppSharp.Parser.AST.Type.Internal*) null) { + __PointerAdjustment = 0; + if (native == null) + return; + __Instance = new global::System.IntPtr(native); } public TemplateSpecializationType() @@ -1757,8 +1813,8 @@ namespace CppSharp { __Instance = Marshal.AllocHGlobal(28); __ownsNativeInstance = true; - Internal.ctor_0(__Instance); NativeToManagedMap[__Instance] = this; + Internal.ctor_0((__Instance + __PointerAdjustment)); } public TemplateSpecializationType(CppSharp.Parser.AST.TemplateSpecializationType _0) @@ -1766,34 +1822,34 @@ namespace CppSharp { __Instance = Marshal.AllocHGlobal(28); __ownsNativeInstance = true; - var arg0 = ReferenceEquals(_0, null) ? global::System.IntPtr.Zero : _0.__Instance; - Internal.cctor_1(__Instance, arg0); NativeToManagedMap[__Instance] = this; + var arg0 = ReferenceEquals(_0, null) ? global::System.IntPtr.Zero : _0.__Instance; + Internal.cctor_1((__Instance + __PointerAdjustment), arg0); } public CppSharp.Parser.AST.TemplateArgument getArguments(uint i) { var __ret = new CppSharp.Parser.AST.TemplateArgument.Internal(); - Internal.getArguments_0(new IntPtr(&__ret), __Instance, i); + Internal.getArguments_0(new IntPtr(&__ret), (__Instance + __PointerAdjustment), i); return CppSharp.Parser.AST.TemplateArgument.__CreateInstance(__ret); } public void addArguments(CppSharp.Parser.AST.TemplateArgument s) { var arg0 = ReferenceEquals(s, null) ? global::System.IntPtr.Zero : s.__Instance; - Internal.addArguments_0(__Instance, arg0); + Internal.addArguments_0((__Instance + __PointerAdjustment), arg0); } public void clearArguments() { - Internal.clearArguments_0(__Instance); + Internal.clearArguments_0((__Instance + __PointerAdjustment)); } public uint ArgumentsCount { get { - var __ret = Internal.getArgumentsCount_0(__Instance); + var __ret = Internal.getArgumentsCount_0((__Instance + __PointerAdjustment)); return __ret; } } @@ -1862,7 +1918,7 @@ namespace CppSharp [DllImport("CppSharp.CppParser.dll", CallingConvention = global::System.Runtime.InteropServices.CallingConvention.Cdecl, EntryPoint="_ZNK8CppSharp9CppParser3AST17TemplateParametereqERKS2_")] [return: MarshalAsAttribute(UnmanagedType.I1)] - internal static extern byte OperatorEqualEqual_0(global::System.IntPtr instance, global::System.IntPtr param); + internal static extern bool OperatorEqualEqual_0(global::System.IntPtr instance, global::System.IntPtr param); [SuppressUnmanagedCodeSecurity] [DllImport("CppSharp.CppParser.dll", CallingConvention = global::System.Runtime.InteropServices.CallingConvention.Cdecl, @@ -1876,19 +1932,21 @@ namespace CppSharp } public global::System.IntPtr __Instance { get; protected set; } + + protected int __PointerAdjustment; public static readonly System.Collections.Concurrent.ConcurrentDictionary NativeToManagedMap = new System.Collections.Concurrent.ConcurrentDictionary(); protected void*[] __OriginalVTables; protected bool __ownsNativeInstance; - public static TemplateParameter __CreateInstance(global::System.IntPtr native, bool ownsNativeInstance = false) + public static TemplateParameter __CreateInstance(global::System.IntPtr native, bool ownsNativeInstance = false, bool skipVTables = false) { - return new TemplateParameter((TemplateParameter.Internal*) native) { __ownsNativeInstance = ownsNativeInstance }; + return new TemplateParameter((TemplateParameter.Internal*) native, skipVTables) { __ownsNativeInstance = ownsNativeInstance }; } - public static TemplateParameter __CreateInstance(TemplateParameter.Internal native) + public static TemplateParameter __CreateInstance(TemplateParameter.Internal native, bool skipVTables = false) { - return new TemplateParameter(native); + return new TemplateParameter(native, skipVTables); } private static TemplateParameter.Internal* __CopyValue(TemplateParameter.Internal native) @@ -1898,15 +1956,17 @@ namespace CppSharp return (TemplateParameter.Internal*) ret; } - private TemplateParameter(TemplateParameter.Internal native) - : this(__CopyValue(native)) + private TemplateParameter(TemplateParameter.Internal native, bool skipVTables = false) + : this(__CopyValue(native), skipVTables) { __ownsNativeInstance = true; NativeToManagedMap[__Instance] = this; } - protected TemplateParameter(TemplateParameter.Internal* native, bool isInternalImpl = false) + protected TemplateParameter(TemplateParameter.Internal* native, bool skipVTables = false) { + if (native == null) + return; __Instance = new global::System.IntPtr(native); } @@ -1914,17 +1974,17 @@ namespace CppSharp { __Instance = Marshal.AllocHGlobal(16); __ownsNativeInstance = true; - Internal.ctor_0(__Instance); NativeToManagedMap[__Instance] = this; + Internal.ctor_0((__Instance + __PointerAdjustment)); } public TemplateParameter(CppSharp.Parser.AST.TemplateParameter _0) { __Instance = Marshal.AllocHGlobal(16); __ownsNativeInstance = true; - var arg0 = ReferenceEquals(_0, null) ? global::System.IntPtr.Zero : _0.__Instance; - Internal.cctor_1(__Instance, arg0); NativeToManagedMap[__Instance] = this; + var arg0 = ReferenceEquals(_0, null) ? global::System.IntPtr.Zero : _0.__Instance; + Internal.cctor_1((__Instance + __PointerAdjustment), arg0); } public void Dispose() @@ -1938,8 +1998,9 @@ namespace CppSharp throw new global::System.InvalidOperationException("Managed instances owned by native code cannot be disposed of."); CppSharp.Parser.AST.TemplateParameter __dummy; NativeToManagedMap.TryRemove(__Instance, out __dummy); - Internal.dtor_0(__Instance); - Marshal.FreeHGlobal(__Instance); + Internal.dtor_0((__Instance + __PointerAdjustment)); + if (__ownsNativeInstance) + Marshal.FreeHGlobal(__Instance); } public static bool operator !=(CppSharp.Parser.AST.TemplateParameter __op, CppSharp.Parser.AST.TemplateParameter param) @@ -1956,7 +2017,7 @@ namespace CppSharp var arg0 = __op.__Instance; var arg1 = param.__Instance; var __ret = Internal.OperatorEqualEqual_0(arg0, arg1); - return __ret != 0; + return __ret; } public override bool Equals(object obj) @@ -1964,18 +2025,25 @@ namespace CppSharp return this == obj as TemplateParameter; } + public override int GetHashCode() + { + if (__Instance == global::System.IntPtr.Zero) + return global::System.IntPtr.Zero.GetHashCode(); + return (*(Internal*) __Instance).GetHashCode(); + } + public string Name { get { - var __ret = Internal.getName_0(__Instance); + var __ret = Internal.getName_0((__Instance + __PointerAdjustment)); return Marshal.PtrToStringAnsi(__ret); } set { var arg0 = Marshal.StringToHGlobalAnsi(value); - Internal.setName_0(__Instance, arg0); + Internal.setName_0((__Instance + __PointerAdjustment), arg0); Marshal.FreeHGlobal(arg0); } } @@ -2033,14 +2101,14 @@ namespace CppSharp internal static extern void dtor_0(global::System.IntPtr instance); } - public static new TemplateParameterType __CreateInstance(global::System.IntPtr native, bool ownsNativeInstance = false) + public static new TemplateParameterType __CreateInstance(global::System.IntPtr native, bool ownsNativeInstance = false, bool skipVTables = false) { - return new TemplateParameterType((TemplateParameterType.Internal*) native) { __ownsNativeInstance = ownsNativeInstance }; + return new TemplateParameterType((TemplateParameterType.Internal*) native, skipVTables) { __ownsNativeInstance = ownsNativeInstance }; } - public static TemplateParameterType __CreateInstance(TemplateParameterType.Internal native) + public static TemplateParameterType __CreateInstance(TemplateParameterType.Internal native, bool skipVTables = false) { - return new TemplateParameterType(native); + return new TemplateParameterType(native, skipVTables); } private static TemplateParameterType.Internal* __CopyValue(TemplateParameterType.Internal native) @@ -2050,16 +2118,20 @@ namespace CppSharp return (TemplateParameterType.Internal*) ret; } - private TemplateParameterType(TemplateParameterType.Internal native) - : this(__CopyValue(native)) + private TemplateParameterType(TemplateParameterType.Internal native, bool skipVTables = false) + : this(__CopyValue(native), skipVTables) { __ownsNativeInstance = true; NativeToManagedMap[__Instance] = this; } - protected TemplateParameterType(TemplateParameterType.Internal* native, bool isInternalImpl = false) - : base((CppSharp.Parser.AST.Type.Internal*) native) + protected TemplateParameterType(TemplateParameterType.Internal* native, bool skipVTables = false) + : base((CppSharp.Parser.AST.Type.Internal*) null) { + __PointerAdjustment = 0; + if (native == null) + return; + __Instance = new global::System.IntPtr(native); } public TemplateParameterType() @@ -2067,8 +2139,8 @@ namespace CppSharp { __Instance = Marshal.AllocHGlobal(36); __ownsNativeInstance = true; - Internal.ctor_0(__Instance); NativeToManagedMap[__Instance] = this; + Internal.ctor_0((__Instance + __PointerAdjustment)); } public TemplateParameterType(CppSharp.Parser.AST.TemplateParameterType _0) @@ -2076,9 +2148,9 @@ namespace CppSharp { __Instance = Marshal.AllocHGlobal(36); __ownsNativeInstance = true; - var arg0 = ReferenceEquals(_0, null) ? global::System.IntPtr.Zero : _0.__Instance; - Internal.cctor_2(__Instance, arg0); NativeToManagedMap[__Instance] = this; + var arg0 = ReferenceEquals(_0, null) ? global::System.IntPtr.Zero : _0.__Instance; + Internal.cctor_2((__Instance + __PointerAdjustment), arg0); } public CppSharp.Parser.AST.TemplateParameter Parameter @@ -2159,14 +2231,14 @@ namespace CppSharp internal static extern void cctor_2(global::System.IntPtr instance, global::System.IntPtr _0); } - public static new TemplateParameterSubstitutionType __CreateInstance(global::System.IntPtr native, bool ownsNativeInstance = false) + public static new TemplateParameterSubstitutionType __CreateInstance(global::System.IntPtr native, bool ownsNativeInstance = false, bool skipVTables = false) { - return new TemplateParameterSubstitutionType((TemplateParameterSubstitutionType.Internal*) native) { __ownsNativeInstance = ownsNativeInstance }; + return new TemplateParameterSubstitutionType((TemplateParameterSubstitutionType.Internal*) native, skipVTables) { __ownsNativeInstance = ownsNativeInstance }; } - public static TemplateParameterSubstitutionType __CreateInstance(TemplateParameterSubstitutionType.Internal native) + public static TemplateParameterSubstitutionType __CreateInstance(TemplateParameterSubstitutionType.Internal native, bool skipVTables = false) { - return new TemplateParameterSubstitutionType(native); + return new TemplateParameterSubstitutionType(native, skipVTables); } private static TemplateParameterSubstitutionType.Internal* __CopyValue(TemplateParameterSubstitutionType.Internal native) @@ -2176,16 +2248,20 @@ namespace CppSharp return (TemplateParameterSubstitutionType.Internal*) ret; } - private TemplateParameterSubstitutionType(TemplateParameterSubstitutionType.Internal native) - : this(__CopyValue(native)) + private TemplateParameterSubstitutionType(TemplateParameterSubstitutionType.Internal native, bool skipVTables = false) + : this(__CopyValue(native), skipVTables) { __ownsNativeInstance = true; NativeToManagedMap[__Instance] = this; } - protected TemplateParameterSubstitutionType(TemplateParameterSubstitutionType.Internal* native, bool isInternalImpl = false) - : base((CppSharp.Parser.AST.Type.Internal*) native) + protected TemplateParameterSubstitutionType(TemplateParameterSubstitutionType.Internal* native, bool skipVTables = false) + : base((CppSharp.Parser.AST.Type.Internal*) null) { + __PointerAdjustment = 0; + if (native == null) + return; + __Instance = new global::System.IntPtr(native); } public TemplateParameterSubstitutionType() @@ -2193,8 +2269,8 @@ namespace CppSharp { __Instance = Marshal.AllocHGlobal(16); __ownsNativeInstance = true; - Internal.ctor_0(__Instance); NativeToManagedMap[__Instance] = this; + Internal.ctor_0((__Instance + __PointerAdjustment)); } public TemplateParameterSubstitutionType(CppSharp.Parser.AST.TemplateParameterSubstitutionType _0) @@ -2202,9 +2278,9 @@ namespace CppSharp { __Instance = Marshal.AllocHGlobal(16); __ownsNativeInstance = true; - var arg0 = ReferenceEquals(_0, null) ? global::System.IntPtr.Zero : _0.__Instance; - Internal.cctor_2(__Instance, arg0); NativeToManagedMap[__Instance] = this; + var arg0 = ReferenceEquals(_0, null) ? global::System.IntPtr.Zero : _0.__Instance; + Internal.cctor_2((__Instance + __PointerAdjustment), arg0); } public CppSharp.Parser.AST.QualifiedType Replacement @@ -2249,14 +2325,14 @@ namespace CppSharp internal static extern void cctor_2(global::System.IntPtr instance, global::System.IntPtr _0); } - public static new InjectedClassNameType __CreateInstance(global::System.IntPtr native, bool ownsNativeInstance = false) + public static new InjectedClassNameType __CreateInstance(global::System.IntPtr native, bool ownsNativeInstance = false, bool skipVTables = false) { - return new InjectedClassNameType((InjectedClassNameType.Internal*) native) { __ownsNativeInstance = ownsNativeInstance }; + return new InjectedClassNameType((InjectedClassNameType.Internal*) native, skipVTables) { __ownsNativeInstance = ownsNativeInstance }; } - public static InjectedClassNameType __CreateInstance(InjectedClassNameType.Internal native) + public static InjectedClassNameType __CreateInstance(InjectedClassNameType.Internal native, bool skipVTables = false) { - return new InjectedClassNameType(native); + return new InjectedClassNameType(native, skipVTables); } private static InjectedClassNameType.Internal* __CopyValue(InjectedClassNameType.Internal native) @@ -2266,16 +2342,20 @@ namespace CppSharp return (InjectedClassNameType.Internal*) ret; } - private InjectedClassNameType(InjectedClassNameType.Internal native) - : this(__CopyValue(native)) + private InjectedClassNameType(InjectedClassNameType.Internal native, bool skipVTables = false) + : this(__CopyValue(native), skipVTables) { __ownsNativeInstance = true; NativeToManagedMap[__Instance] = this; } - protected InjectedClassNameType(InjectedClassNameType.Internal* native, bool isInternalImpl = false) - : base((CppSharp.Parser.AST.Type.Internal*) native) + protected InjectedClassNameType(InjectedClassNameType.Internal* native, bool skipVTables = false) + : base((CppSharp.Parser.AST.Type.Internal*) null) { + __PointerAdjustment = 0; + if (native == null) + return; + __Instance = new global::System.IntPtr(native); } public InjectedClassNameType() @@ -2283,8 +2363,8 @@ namespace CppSharp { __Instance = Marshal.AllocHGlobal(16); __ownsNativeInstance = true; - Internal.ctor_0(__Instance); NativeToManagedMap[__Instance] = this; + Internal.ctor_0((__Instance + __PointerAdjustment)); } public InjectedClassNameType(CppSharp.Parser.AST.InjectedClassNameType _0) @@ -2292,9 +2372,9 @@ namespace CppSharp { __Instance = Marshal.AllocHGlobal(16); __ownsNativeInstance = true; - var arg0 = ReferenceEquals(_0, null) ? global::System.IntPtr.Zero : _0.__Instance; - Internal.cctor_2(__Instance, arg0); NativeToManagedMap[__Instance] = this; + var arg0 = ReferenceEquals(_0, null) ? global::System.IntPtr.Zero : _0.__Instance; + Internal.cctor_2((__Instance + __PointerAdjustment), arg0); } public CppSharp.Parser.AST.TemplateSpecializationType TemplateSpecialization @@ -2356,14 +2436,14 @@ namespace CppSharp internal static extern void cctor_2(global::System.IntPtr instance, global::System.IntPtr _0); } - public static new DependentNameType __CreateInstance(global::System.IntPtr native, bool ownsNativeInstance = false) + public static new DependentNameType __CreateInstance(global::System.IntPtr native, bool ownsNativeInstance = false, bool skipVTables = false) { - return new DependentNameType((DependentNameType.Internal*) native) { __ownsNativeInstance = ownsNativeInstance }; + return new DependentNameType((DependentNameType.Internal*) native, skipVTables) { __ownsNativeInstance = ownsNativeInstance }; } - public static DependentNameType __CreateInstance(DependentNameType.Internal native) + public static DependentNameType __CreateInstance(DependentNameType.Internal native, bool skipVTables = false) { - return new DependentNameType(native); + return new DependentNameType(native, skipVTables); } private static DependentNameType.Internal* __CopyValue(DependentNameType.Internal native) @@ -2373,16 +2453,20 @@ namespace CppSharp return (DependentNameType.Internal*) ret; } - private DependentNameType(DependentNameType.Internal native) - : this(__CopyValue(native)) + private DependentNameType(DependentNameType.Internal native, bool skipVTables = false) + : this(__CopyValue(native), skipVTables) { __ownsNativeInstance = true; NativeToManagedMap[__Instance] = this; } - protected DependentNameType(DependentNameType.Internal* native, bool isInternalImpl = false) - : base((CppSharp.Parser.AST.Type.Internal*) native) + protected DependentNameType(DependentNameType.Internal* native, bool skipVTables = false) + : base((CppSharp.Parser.AST.Type.Internal*) null) { + __PointerAdjustment = 0; + if (native == null) + return; + __Instance = new global::System.IntPtr(native); } public DependentNameType() @@ -2390,8 +2474,8 @@ namespace CppSharp { __Instance = Marshal.AllocHGlobal(8); __ownsNativeInstance = true; - Internal.ctor_0(__Instance); NativeToManagedMap[__Instance] = this; + Internal.ctor_0((__Instance + __PointerAdjustment)); } public DependentNameType(CppSharp.Parser.AST.DependentNameType _0) @@ -2399,9 +2483,9 @@ namespace CppSharp { __Instance = Marshal.AllocHGlobal(8); __ownsNativeInstance = true; - var arg0 = ReferenceEquals(_0, null) ? global::System.IntPtr.Zero : _0.__Instance; - Internal.cctor_2(__Instance, arg0); NativeToManagedMap[__Instance] = this; + var arg0 = ReferenceEquals(_0, null) ? global::System.IntPtr.Zero : _0.__Instance; + Internal.cctor_2((__Instance + __PointerAdjustment), arg0); } } @@ -2427,14 +2511,14 @@ namespace CppSharp internal static extern void cctor_2(global::System.IntPtr instance, global::System.IntPtr _0); } - public static new PackExpansionType __CreateInstance(global::System.IntPtr native, bool ownsNativeInstance = false) + public static new PackExpansionType __CreateInstance(global::System.IntPtr native, bool ownsNativeInstance = false, bool skipVTables = false) { - return new PackExpansionType((PackExpansionType.Internal*) native) { __ownsNativeInstance = ownsNativeInstance }; + return new PackExpansionType((PackExpansionType.Internal*) native, skipVTables) { __ownsNativeInstance = ownsNativeInstance }; } - public static PackExpansionType __CreateInstance(PackExpansionType.Internal native) + public static PackExpansionType __CreateInstance(PackExpansionType.Internal native, bool skipVTables = false) { - return new PackExpansionType(native); + return new PackExpansionType(native, skipVTables); } private static PackExpansionType.Internal* __CopyValue(PackExpansionType.Internal native) @@ -2444,16 +2528,20 @@ namespace CppSharp return (PackExpansionType.Internal*) ret; } - private PackExpansionType(PackExpansionType.Internal native) - : this(__CopyValue(native)) + private PackExpansionType(PackExpansionType.Internal native, bool skipVTables = false) + : this(__CopyValue(native), skipVTables) { __ownsNativeInstance = true; NativeToManagedMap[__Instance] = this; } - protected PackExpansionType(PackExpansionType.Internal* native, bool isInternalImpl = false) - : base((CppSharp.Parser.AST.Type.Internal*) native) + protected PackExpansionType(PackExpansionType.Internal* native, bool skipVTables = false) + : base((CppSharp.Parser.AST.Type.Internal*) null) { + __PointerAdjustment = 0; + if (native == null) + return; + __Instance = new global::System.IntPtr(native); } public PackExpansionType() @@ -2461,8 +2549,8 @@ namespace CppSharp { __Instance = Marshal.AllocHGlobal(8); __ownsNativeInstance = true; - Internal.ctor_0(__Instance); NativeToManagedMap[__Instance] = this; + Internal.ctor_0((__Instance + __PointerAdjustment)); } public PackExpansionType(CppSharp.Parser.AST.PackExpansionType _0) @@ -2470,9 +2558,9 @@ namespace CppSharp { __Instance = Marshal.AllocHGlobal(8); __ownsNativeInstance = true; - var arg0 = ReferenceEquals(_0, null) ? global::System.IntPtr.Zero : _0.__Instance; - Internal.cctor_2(__Instance, arg0); NativeToManagedMap[__Instance] = this; + var arg0 = ReferenceEquals(_0, null) ? global::System.IntPtr.Zero : _0.__Instance; + Internal.cctor_2((__Instance + __PointerAdjustment), arg0); } } @@ -2501,14 +2589,14 @@ namespace CppSharp internal static extern void cctor_2(global::System.IntPtr instance, global::System.IntPtr _0); } - public static new BuiltinType __CreateInstance(global::System.IntPtr native, bool ownsNativeInstance = false) + public static new BuiltinType __CreateInstance(global::System.IntPtr native, bool ownsNativeInstance = false, bool skipVTables = false) { - return new BuiltinType((BuiltinType.Internal*) native) { __ownsNativeInstance = ownsNativeInstance }; + return new BuiltinType((BuiltinType.Internal*) native, skipVTables) { __ownsNativeInstance = ownsNativeInstance }; } - public static BuiltinType __CreateInstance(BuiltinType.Internal native) + public static BuiltinType __CreateInstance(BuiltinType.Internal native, bool skipVTables = false) { - return new BuiltinType(native); + return new BuiltinType(native, skipVTables); } private static BuiltinType.Internal* __CopyValue(BuiltinType.Internal native) @@ -2518,16 +2606,20 @@ namespace CppSharp return (BuiltinType.Internal*) ret; } - private BuiltinType(BuiltinType.Internal native) - : this(__CopyValue(native)) + private BuiltinType(BuiltinType.Internal native, bool skipVTables = false) + : this(__CopyValue(native), skipVTables) { __ownsNativeInstance = true; NativeToManagedMap[__Instance] = this; } - protected BuiltinType(BuiltinType.Internal* native, bool isInternalImpl = false) - : base((CppSharp.Parser.AST.Type.Internal*) native) + protected BuiltinType(BuiltinType.Internal* native, bool skipVTables = false) + : base((CppSharp.Parser.AST.Type.Internal*) null) { + __PointerAdjustment = 0; + if (native == null) + return; + __Instance = new global::System.IntPtr(native); } public BuiltinType() @@ -2535,8 +2627,8 @@ namespace CppSharp { __Instance = Marshal.AllocHGlobal(12); __ownsNativeInstance = true; - Internal.ctor_0(__Instance); NativeToManagedMap[__Instance] = this; + Internal.ctor_0((__Instance + __PointerAdjustment)); } public BuiltinType(CppSharp.Parser.AST.BuiltinType _0) @@ -2544,9 +2636,9 @@ namespace CppSharp { __Instance = Marshal.AllocHGlobal(12); __ownsNativeInstance = true; - var arg0 = ReferenceEquals(_0, null) ? global::System.IntPtr.Zero : _0.__Instance; - Internal.cctor_2(__Instance, arg0); NativeToManagedMap[__Instance] = this; + var arg0 = ReferenceEquals(_0, null) ? global::System.IntPtr.Zero : _0.__Instance; + Internal.cctor_2((__Instance + __PointerAdjustment), arg0); } public CppSharp.Parser.AST.PrimitiveType Type @@ -2589,19 +2681,21 @@ namespace CppSharp } public global::System.IntPtr __Instance { get; protected set; } + + protected int __PointerAdjustment; public static readonly System.Collections.Concurrent.ConcurrentDictionary NativeToManagedMap = new System.Collections.Concurrent.ConcurrentDictionary(); protected void*[] __OriginalVTables; protected bool __ownsNativeInstance; - public static VTableComponent __CreateInstance(global::System.IntPtr native, bool ownsNativeInstance = false) + public static VTableComponent __CreateInstance(global::System.IntPtr native, bool ownsNativeInstance = false, bool skipVTables = false) { - return new VTableComponent((VTableComponent.Internal*) native) { __ownsNativeInstance = ownsNativeInstance }; + return new VTableComponent((VTableComponent.Internal*) native, skipVTables) { __ownsNativeInstance = ownsNativeInstance }; } - public static VTableComponent __CreateInstance(VTableComponent.Internal native) + public static VTableComponent __CreateInstance(VTableComponent.Internal native, bool skipVTables = false) { - return new VTableComponent(native); + return new VTableComponent(native, skipVTables); } private static VTableComponent.Internal* __CopyValue(VTableComponent.Internal native) @@ -2611,15 +2705,17 @@ namespace CppSharp return ret; } - private VTableComponent(VTableComponent.Internal native) - : this(__CopyValue(native)) + private VTableComponent(VTableComponent.Internal native, bool skipVTables = false) + : this(__CopyValue(native), skipVTables) { __ownsNativeInstance = true; NativeToManagedMap[__Instance] = this; } - protected VTableComponent(VTableComponent.Internal* native, bool isInternalImpl = false) + protected VTableComponent(VTableComponent.Internal* native, bool skipVTables = false) { + if (native == null) + return; __Instance = new global::System.IntPtr(native); } @@ -2627,16 +2723,16 @@ namespace CppSharp { __Instance = Marshal.AllocHGlobal(12); __ownsNativeInstance = true; - Internal.ctor_0(__Instance); NativeToManagedMap[__Instance] = this; + Internal.ctor_0((__Instance + __PointerAdjustment)); } public VTableComponent(CppSharp.Parser.AST.VTableComponent _0) { __Instance = Marshal.AllocHGlobal(12); __ownsNativeInstance = true; - *((VTableComponent.Internal*) __Instance) = *((VTableComponent.Internal*) _0.__Instance); NativeToManagedMap[__Instance] = this; + *((VTableComponent.Internal*) __Instance) = *((VTableComponent.Internal*) _0.__Instance); } public void Dispose() @@ -2650,7 +2746,8 @@ namespace CppSharp throw new global::System.InvalidOperationException("Managed instances owned by native code cannot be disposed of."); CppSharp.Parser.AST.VTableComponent __dummy; NativeToManagedMap.TryRemove(__Instance, out __dummy); - Marshal.FreeHGlobal(__Instance); + if (__ownsNativeInstance) + Marshal.FreeHGlobal(__Instance); } public CppSharp.Parser.AST.VTableComponentKind Kind @@ -2740,19 +2837,21 @@ namespace CppSharp } public global::System.IntPtr __Instance { get; protected set; } + + protected int __PointerAdjustment; public static readonly System.Collections.Concurrent.ConcurrentDictionary NativeToManagedMap = new System.Collections.Concurrent.ConcurrentDictionary(); protected void*[] __OriginalVTables; protected bool __ownsNativeInstance; - public static VTableLayout __CreateInstance(global::System.IntPtr native, bool ownsNativeInstance = false) + public static VTableLayout __CreateInstance(global::System.IntPtr native, bool ownsNativeInstance = false, bool skipVTables = false) { - return new VTableLayout((VTableLayout.Internal*) native) { __ownsNativeInstance = ownsNativeInstance }; + return new VTableLayout((VTableLayout.Internal*) native, skipVTables) { __ownsNativeInstance = ownsNativeInstance }; } - public static VTableLayout __CreateInstance(VTableLayout.Internal native) + public static VTableLayout __CreateInstance(VTableLayout.Internal native, bool skipVTables = false) { - return new VTableLayout(native); + return new VTableLayout(native, skipVTables); } private static VTableLayout.Internal* __CopyValue(VTableLayout.Internal native) @@ -2762,15 +2861,17 @@ namespace CppSharp return (VTableLayout.Internal*) ret; } - private VTableLayout(VTableLayout.Internal native) - : this(__CopyValue(native)) + private VTableLayout(VTableLayout.Internal native, bool skipVTables = false) + : this(__CopyValue(native), skipVTables) { __ownsNativeInstance = true; NativeToManagedMap[__Instance] = this; } - protected VTableLayout(VTableLayout.Internal* native, bool isInternalImpl = false) + protected VTableLayout(VTableLayout.Internal* native, bool skipVTables = false) { + if (native == null) + return; __Instance = new global::System.IntPtr(native); } @@ -2778,17 +2879,17 @@ namespace CppSharp { __Instance = Marshal.AllocHGlobal(12); __ownsNativeInstance = true; - Internal.ctor_0(__Instance); NativeToManagedMap[__Instance] = this; + Internal.ctor_0((__Instance + __PointerAdjustment)); } public VTableLayout(CppSharp.Parser.AST.VTableLayout _0) { __Instance = Marshal.AllocHGlobal(12); __ownsNativeInstance = true; - var arg0 = ReferenceEquals(_0, null) ? global::System.IntPtr.Zero : _0.__Instance; - Internal.cctor_1(__Instance, arg0); NativeToManagedMap[__Instance] = this; + var arg0 = ReferenceEquals(_0, null) ? global::System.IntPtr.Zero : _0.__Instance; + Internal.cctor_1((__Instance + __PointerAdjustment), arg0); } public void Dispose() @@ -2802,33 +2903,34 @@ namespace CppSharp throw new global::System.InvalidOperationException("Managed instances owned by native code cannot be disposed of."); CppSharp.Parser.AST.VTableLayout __dummy; NativeToManagedMap.TryRemove(__Instance, out __dummy); - Internal.dtor_0(__Instance); - Marshal.FreeHGlobal(__Instance); + Internal.dtor_0((__Instance + __PointerAdjustment)); + if (__ownsNativeInstance) + Marshal.FreeHGlobal(__Instance); } public CppSharp.Parser.AST.VTableComponent getComponents(uint i) { var __ret = new CppSharp.Parser.AST.VTableComponent.Internal(); - Internal.getComponents_0(new IntPtr(&__ret), __Instance, i); + Internal.getComponents_0(new IntPtr(&__ret), (__Instance + __PointerAdjustment), i); return CppSharp.Parser.AST.VTableComponent.__CreateInstance(__ret); } public void addComponents(CppSharp.Parser.AST.VTableComponent s) { var arg0 = ReferenceEquals(s, null) ? global::System.IntPtr.Zero : s.__Instance; - Internal.addComponents_0(__Instance, arg0); + Internal.addComponents_0((__Instance + __PointerAdjustment), arg0); } public void clearComponents() { - Internal.clearComponents_0(__Instance); + Internal.clearComponents_0((__Instance + __PointerAdjustment)); } public uint ComponentsCount { get { - var __ret = Internal.getComponentsCount_0(__Instance); + var __ret = Internal.getComponentsCount_0((__Instance + __PointerAdjustment)); return __ret; } } @@ -2868,19 +2970,21 @@ namespace CppSharp } public global::System.IntPtr __Instance { get; protected set; } + + protected int __PointerAdjustment; public static readonly System.Collections.Concurrent.ConcurrentDictionary NativeToManagedMap = new System.Collections.Concurrent.ConcurrentDictionary(); protected void*[] __OriginalVTables; protected bool __ownsNativeInstance; - public static VFTableInfo __CreateInstance(global::System.IntPtr native, bool ownsNativeInstance = false) + public static VFTableInfo __CreateInstance(global::System.IntPtr native, bool ownsNativeInstance = false, bool skipVTables = false) { - return new VFTableInfo((VFTableInfo.Internal*) native) { __ownsNativeInstance = ownsNativeInstance }; + return new VFTableInfo((VFTableInfo.Internal*) native, skipVTables) { __ownsNativeInstance = ownsNativeInstance }; } - public static VFTableInfo __CreateInstance(VFTableInfo.Internal native) + public static VFTableInfo __CreateInstance(VFTableInfo.Internal native, bool skipVTables = false) { - return new VFTableInfo(native); + return new VFTableInfo(native, skipVTables); } private static VFTableInfo.Internal* __CopyValue(VFTableInfo.Internal native) @@ -2890,15 +2994,17 @@ namespace CppSharp return (VFTableInfo.Internal*) ret; } - private VFTableInfo(VFTableInfo.Internal native) - : this(__CopyValue(native)) + private VFTableInfo(VFTableInfo.Internal native, bool skipVTables = false) + : this(__CopyValue(native), skipVTables) { __ownsNativeInstance = true; NativeToManagedMap[__Instance] = this; } - protected VFTableInfo(VFTableInfo.Internal* native, bool isInternalImpl = false) + protected VFTableInfo(VFTableInfo.Internal* native, bool skipVTables = false) { + if (native == null) + return; __Instance = new global::System.IntPtr(native); } @@ -2906,17 +3012,17 @@ namespace CppSharp { __Instance = Marshal.AllocHGlobal(28); __ownsNativeInstance = true; - Internal.ctor_0(__Instance); NativeToManagedMap[__Instance] = this; + Internal.ctor_0((__Instance + __PointerAdjustment)); } public VFTableInfo(CppSharp.Parser.AST.VFTableInfo _0) { __Instance = Marshal.AllocHGlobal(28); __ownsNativeInstance = true; - var arg0 = ReferenceEquals(_0, null) ? global::System.IntPtr.Zero : _0.__Instance; - Internal.cctor_1(__Instance, arg0); NativeToManagedMap[__Instance] = this; + var arg0 = ReferenceEquals(_0, null) ? global::System.IntPtr.Zero : _0.__Instance; + Internal.cctor_1((__Instance + __PointerAdjustment), arg0); } public void Dispose() @@ -2930,8 +3036,9 @@ namespace CppSharp throw new global::System.InvalidOperationException("Managed instances owned by native code cannot be disposed of."); CppSharp.Parser.AST.VFTableInfo __dummy; NativeToManagedMap.TryRemove(__Instance, out __dummy); - Internal.dtor_0(__Instance); - Marshal.FreeHGlobal(__Instance); + Internal.dtor_0((__Instance + __PointerAdjustment)); + if (__ownsNativeInstance) + Marshal.FreeHGlobal(__Instance); } public ulong VBTableIndex @@ -3050,19 +3157,21 @@ namespace CppSharp } public global::System.IntPtr __Instance { get; protected set; } + + protected int __PointerAdjustment; public static readonly System.Collections.Concurrent.ConcurrentDictionary NativeToManagedMap = new System.Collections.Concurrent.ConcurrentDictionary(); protected void*[] __OriginalVTables; protected bool __ownsNativeInstance; - public static ClassLayout __CreateInstance(global::System.IntPtr native, bool ownsNativeInstance = false) + public static ClassLayout __CreateInstance(global::System.IntPtr native, bool ownsNativeInstance = false, bool skipVTables = false) { - return new ClassLayout((ClassLayout.Internal*) native) { __ownsNativeInstance = ownsNativeInstance }; + return new ClassLayout((ClassLayout.Internal*) native, skipVTables) { __ownsNativeInstance = ownsNativeInstance }; } - public static ClassLayout __CreateInstance(ClassLayout.Internal native) + public static ClassLayout __CreateInstance(ClassLayout.Internal native, bool skipVTables = false) { - return new ClassLayout(native); + return new ClassLayout(native, skipVTables); } private static ClassLayout.Internal* __CopyValue(ClassLayout.Internal native) @@ -3072,15 +3181,17 @@ namespace CppSharp return (ClassLayout.Internal*) ret; } - private ClassLayout(ClassLayout.Internal native) - : this(__CopyValue(native)) + private ClassLayout(ClassLayout.Internal native, bool skipVTables = false) + : this(__CopyValue(native), skipVTables) { __ownsNativeInstance = true; NativeToManagedMap[__Instance] = this; } - protected ClassLayout(ClassLayout.Internal* native, bool isInternalImpl = false) + protected ClassLayout(ClassLayout.Internal* native, bool skipVTables = false) { + if (native == null) + return; __Instance = new global::System.IntPtr(native); } @@ -3088,17 +3199,17 @@ namespace CppSharp { __Instance = Marshal.AllocHGlobal(48); __ownsNativeInstance = true; - Internal.ctor_0(__Instance); NativeToManagedMap[__Instance] = this; + Internal.ctor_0((__Instance + __PointerAdjustment)); } public ClassLayout(CppSharp.Parser.AST.ClassLayout _0) { __Instance = Marshal.AllocHGlobal(48); __ownsNativeInstance = true; - var arg0 = ReferenceEquals(_0, null) ? global::System.IntPtr.Zero : _0.__Instance; - Internal.cctor_2(__Instance, arg0); NativeToManagedMap[__Instance] = this; + var arg0 = ReferenceEquals(_0, null) ? global::System.IntPtr.Zero : _0.__Instance; + Internal.cctor_2((__Instance + __PointerAdjustment), arg0); } public void Dispose() @@ -3112,33 +3223,34 @@ namespace CppSharp throw new global::System.InvalidOperationException("Managed instances owned by native code cannot be disposed of."); CppSharp.Parser.AST.ClassLayout __dummy; NativeToManagedMap.TryRemove(__Instance, out __dummy); - Internal.dtor_0(__Instance); - Marshal.FreeHGlobal(__Instance); + Internal.dtor_0((__Instance + __PointerAdjustment)); + if (__ownsNativeInstance) + Marshal.FreeHGlobal(__Instance); } public CppSharp.Parser.AST.VFTableInfo getVFTables(uint i) { var __ret = new CppSharp.Parser.AST.VFTableInfo.Internal(); - Internal.getVFTables_0(new IntPtr(&__ret), __Instance, i); + Internal.getVFTables_0(new IntPtr(&__ret), (__Instance + __PointerAdjustment), i); return CppSharp.Parser.AST.VFTableInfo.__CreateInstance(__ret); } public void addVFTables(CppSharp.Parser.AST.VFTableInfo s) { var arg0 = ReferenceEquals(s, null) ? global::System.IntPtr.Zero : s.__Instance; - Internal.addVFTables_0(__Instance, arg0); + Internal.addVFTables_0((__Instance + __PointerAdjustment), arg0); } public void clearVFTables() { - Internal.clearVFTables_0(__Instance); + Internal.clearVFTables_0((__Instance + __PointerAdjustment)); } public uint VFTablesCount { get { - var __ret = Internal.getVFTablesCount_0(__Instance); + var __ret = Internal.getVFTablesCount_0((__Instance + __PointerAdjustment)); return __ret; } } @@ -3333,19 +3445,21 @@ namespace CppSharp } public global::System.IntPtr __Instance { get; protected set; } + + protected int __PointerAdjustment; public static readonly System.Collections.Concurrent.ConcurrentDictionary NativeToManagedMap = new System.Collections.Concurrent.ConcurrentDictionary(); protected void*[] __OriginalVTables; protected bool __ownsNativeInstance; - public static Declaration __CreateInstance(global::System.IntPtr native, bool ownsNativeInstance = false) + public static Declaration __CreateInstance(global::System.IntPtr native, bool ownsNativeInstance = false, bool skipVTables = false) { - return new Declaration((Declaration.Internal*) native) { __ownsNativeInstance = ownsNativeInstance }; + return new Declaration((Declaration.Internal*) native, skipVTables) { __ownsNativeInstance = ownsNativeInstance }; } - public static Declaration __CreateInstance(Declaration.Internal native) + public static Declaration __CreateInstance(Declaration.Internal native, bool skipVTables = false) { - return new Declaration(native); + return new Declaration(native, skipVTables); } private static Declaration.Internal* __CopyValue(Declaration.Internal native) @@ -3355,15 +3469,17 @@ namespace CppSharp return (Declaration.Internal*) ret; } - private Declaration(Declaration.Internal native) - : this(__CopyValue(native)) + private Declaration(Declaration.Internal native, bool skipVTables = false) + : this(__CopyValue(native), skipVTables) { __ownsNativeInstance = true; NativeToManagedMap[__Instance] = this; } - protected Declaration(Declaration.Internal* native, bool isInternalImpl = false) + protected Declaration(Declaration.Internal* native, bool skipVTables = false) { + if (native == null) + return; __Instance = new global::System.IntPtr(native); } @@ -3371,18 +3487,18 @@ namespace CppSharp { __Instance = Marshal.AllocHGlobal(92); __ownsNativeInstance = true; - var arg0 = kind; - Internal.ctor_0(__Instance, arg0); NativeToManagedMap[__Instance] = this; + var arg0 = kind; + Internal.ctor_0((__Instance + __PointerAdjustment), arg0); } public Declaration(CppSharp.Parser.AST.Declaration _0) { __Instance = Marshal.AllocHGlobal(92); __ownsNativeInstance = true; - var arg0 = ReferenceEquals(_0, null) ? global::System.IntPtr.Zero : _0.__Instance; - Internal.cctor_1(__Instance, arg0); NativeToManagedMap[__Instance] = this; + var arg0 = ReferenceEquals(_0, null) ? global::System.IntPtr.Zero : _0.__Instance; + Internal.cctor_1((__Instance + __PointerAdjustment), arg0); } public void Dispose() @@ -3396,13 +3512,14 @@ namespace CppSharp throw new global::System.InvalidOperationException("Managed instances owned by native code cannot be disposed of."); CppSharp.Parser.AST.Declaration __dummy; NativeToManagedMap.TryRemove(__Instance, out __dummy); - Internal.dtor_0(__Instance); - Marshal.FreeHGlobal(__Instance); + Internal.dtor_0((__Instance + __PointerAdjustment)); + if (__ownsNativeInstance) + Marshal.FreeHGlobal(__Instance); } public CppSharp.Parser.AST.PreprocessedEntity getPreprocessedEntities(uint i) { - var __ret = Internal.getPreprocessedEntities_0(__Instance, i); + var __ret = Internal.getPreprocessedEntities_0((__Instance + __PointerAdjustment), i); CppSharp.Parser.AST.PreprocessedEntity __result0; if (__ret == IntPtr.Zero) __result0 = null; else if (CppSharp.Parser.AST.PreprocessedEntity.NativeToManagedMap.ContainsKey(__ret)) @@ -3414,26 +3531,26 @@ namespace CppSharp public void addPreprocessedEntities(CppSharp.Parser.AST.PreprocessedEntity s) { var arg0 = ReferenceEquals(s, null) ? global::System.IntPtr.Zero : s.__Instance; - Internal.addPreprocessedEntities_0(__Instance, arg0); + Internal.addPreprocessedEntities_0((__Instance + __PointerAdjustment), arg0); } public void clearPreprocessedEntities() { - Internal.clearPreprocessedEntities_0(__Instance); + Internal.clearPreprocessedEntities_0((__Instance + __PointerAdjustment)); } public string Name { get { - var __ret = Internal.getName_0(__Instance); + var __ret = Internal.getName_0((__Instance + __PointerAdjustment)); return Marshal.PtrToStringAnsi(__ret); } set { var arg0 = Marshal.StringToHGlobalAnsi(value); - Internal.setName_0(__Instance, arg0); + Internal.setName_0((__Instance + __PointerAdjustment), arg0); Marshal.FreeHGlobal(arg0); } } @@ -3442,14 +3559,14 @@ namespace CppSharp { get { - var __ret = Internal.getDebugText_0(__Instance); + var __ret = Internal.getDebugText_0((__Instance + __PointerAdjustment)); return Marshal.PtrToStringAnsi(__ret); } set { var arg0 = Marshal.StringToHGlobalAnsi(value); - Internal.setDebugText_0(__Instance, arg0); + Internal.setDebugText_0((__Instance + __PointerAdjustment), arg0); Marshal.FreeHGlobal(arg0); } } @@ -3458,7 +3575,7 @@ namespace CppSharp { get { - var __ret = Internal.getPreprocessedEntitiesCount_0(__Instance); + var __ret = Internal.getPreprocessedEntitiesCount_0((__Instance + __PointerAdjustment)); return __ret; } } @@ -3855,14 +3972,14 @@ namespace CppSharp internal static extern uint getFriendsCount_0(global::System.IntPtr instance); } - public static new DeclarationContext __CreateInstance(global::System.IntPtr native, bool ownsNativeInstance = false) + public static new DeclarationContext __CreateInstance(global::System.IntPtr native, bool ownsNativeInstance = false, bool skipVTables = false) { - return new DeclarationContext((DeclarationContext.Internal*) native) { __ownsNativeInstance = ownsNativeInstance }; + return new DeclarationContext((DeclarationContext.Internal*) native, skipVTables) { __ownsNativeInstance = ownsNativeInstance }; } - public static DeclarationContext __CreateInstance(DeclarationContext.Internal native) + public static DeclarationContext __CreateInstance(DeclarationContext.Internal native, bool skipVTables = false) { - return new DeclarationContext(native); + return new DeclarationContext(native, skipVTables); } private static DeclarationContext.Internal* __CopyValue(DeclarationContext.Internal native) @@ -3872,16 +3989,20 @@ namespace CppSharp return (DeclarationContext.Internal*) ret; } - private DeclarationContext(DeclarationContext.Internal native) - : this(__CopyValue(native)) + private DeclarationContext(DeclarationContext.Internal native, bool skipVTables = false) + : this(__CopyValue(native), skipVTables) { __ownsNativeInstance = true; NativeToManagedMap[__Instance] = this; } - protected DeclarationContext(DeclarationContext.Internal* native, bool isInternalImpl = false) - : base((CppSharp.Parser.AST.Declaration.Internal*) native) + protected DeclarationContext(DeclarationContext.Internal* native, bool skipVTables = false) + : base((CppSharp.Parser.AST.Declaration.Internal*) null) { + __PointerAdjustment = 0; + if (native == null) + return; + __Instance = new global::System.IntPtr(native); } public DeclarationContext(CppSharp.Parser.AST.DeclarationKind kind) @@ -3889,9 +4010,9 @@ namespace CppSharp { __Instance = Marshal.AllocHGlobal(204); __ownsNativeInstance = true; - var arg0 = kind; - Internal.ctor_0(__Instance, arg0); NativeToManagedMap[__Instance] = this; + var arg0 = kind; + Internal.ctor_0((__Instance + __PointerAdjustment), arg0); } public DeclarationContext(CppSharp.Parser.AST.DeclarationContext _0) @@ -3899,14 +4020,14 @@ namespace CppSharp { __Instance = Marshal.AllocHGlobal(204); __ownsNativeInstance = true; - var arg0 = ReferenceEquals(_0, null) ? global::System.IntPtr.Zero : _0.__Instance; - Internal.cctor_2(__Instance, arg0); NativeToManagedMap[__Instance] = this; + var arg0 = ReferenceEquals(_0, null) ? global::System.IntPtr.Zero : _0.__Instance; + Internal.cctor_2((__Instance + __PointerAdjustment), arg0); } public CppSharp.Parser.AST.Namespace getNamespaces(uint i) { - var __ret = Internal.getNamespaces_0(__Instance, i); + var __ret = Internal.getNamespaces_0((__Instance + __PointerAdjustment), i); CppSharp.Parser.AST.Namespace __result0; if (__ret == IntPtr.Zero) __result0 = null; else if (CppSharp.Parser.AST.Namespace.NativeToManagedMap.ContainsKey(__ret)) @@ -3918,17 +4039,17 @@ namespace CppSharp public void addNamespaces(CppSharp.Parser.AST.Namespace s) { var arg0 = ReferenceEquals(s, null) ? global::System.IntPtr.Zero : s.__Instance; - Internal.addNamespaces_0(__Instance, arg0); + Internal.addNamespaces_0((__Instance + __PointerAdjustment), arg0); } public void clearNamespaces() { - Internal.clearNamespaces_0(__Instance); + Internal.clearNamespaces_0((__Instance + __PointerAdjustment)); } public CppSharp.Parser.AST.Enumeration getEnums(uint i) { - var __ret = Internal.getEnums_0(__Instance, i); + var __ret = Internal.getEnums_0((__Instance + __PointerAdjustment), i); CppSharp.Parser.AST.Enumeration __result0; if (__ret == IntPtr.Zero) __result0 = null; else if (CppSharp.Parser.AST.Enumeration.NativeToManagedMap.ContainsKey(__ret)) @@ -3940,17 +4061,17 @@ namespace CppSharp public void addEnums(CppSharp.Parser.AST.Enumeration s) { var arg0 = ReferenceEquals(s, null) ? global::System.IntPtr.Zero : s.__Instance; - Internal.addEnums_0(__Instance, arg0); + Internal.addEnums_0((__Instance + __PointerAdjustment), arg0); } public void clearEnums() { - Internal.clearEnums_0(__Instance); + Internal.clearEnums_0((__Instance + __PointerAdjustment)); } public CppSharp.Parser.AST.Function getFunctions(uint i) { - var __ret = Internal.getFunctions_0(__Instance, i); + var __ret = Internal.getFunctions_0((__Instance + __PointerAdjustment), i); CppSharp.Parser.AST.Function __result0; if (__ret == IntPtr.Zero) __result0 = null; else if (CppSharp.Parser.AST.Function.NativeToManagedMap.ContainsKey(__ret)) @@ -3962,17 +4083,17 @@ namespace CppSharp public void addFunctions(CppSharp.Parser.AST.Function s) { var arg0 = ReferenceEquals(s, null) ? global::System.IntPtr.Zero : s.__Instance; - Internal.addFunctions_0(__Instance, arg0); + Internal.addFunctions_0((__Instance + __PointerAdjustment), arg0); } public void clearFunctions() { - Internal.clearFunctions_0(__Instance); + Internal.clearFunctions_0((__Instance + __PointerAdjustment)); } public CppSharp.Parser.AST.Class getClasses(uint i) { - var __ret = Internal.getClasses_0(__Instance, i); + var __ret = Internal.getClasses_0((__Instance + __PointerAdjustment), i); CppSharp.Parser.AST.Class __result0; if (__ret == IntPtr.Zero) __result0 = null; else if (CppSharp.Parser.AST.Class.NativeToManagedMap.ContainsKey(__ret)) @@ -3984,17 +4105,17 @@ namespace CppSharp public void addClasses(CppSharp.Parser.AST.Class s) { var arg0 = ReferenceEquals(s, null) ? global::System.IntPtr.Zero : s.__Instance; - Internal.addClasses_0(__Instance, arg0); + Internal.addClasses_0((__Instance + __PointerAdjustment), arg0); } public void clearClasses() { - Internal.clearClasses_0(__Instance); + Internal.clearClasses_0((__Instance + __PointerAdjustment)); } public CppSharp.Parser.AST.Template getTemplates(uint i) { - var __ret = Internal.getTemplates_0(__Instance, i); + var __ret = Internal.getTemplates_0((__Instance + __PointerAdjustment), i); CppSharp.Parser.AST.Template __result0; if (__ret == IntPtr.Zero) __result0 = null; else if (CppSharp.Parser.AST.Template.NativeToManagedMap.ContainsKey(__ret)) @@ -4006,17 +4127,17 @@ namespace CppSharp public void addTemplates(CppSharp.Parser.AST.Template s) { var arg0 = ReferenceEquals(s, null) ? global::System.IntPtr.Zero : s.__Instance; - Internal.addTemplates_0(__Instance, arg0); + Internal.addTemplates_0((__Instance + __PointerAdjustment), arg0); } public void clearTemplates() { - Internal.clearTemplates_0(__Instance); + Internal.clearTemplates_0((__Instance + __PointerAdjustment)); } public CppSharp.Parser.AST.TypedefDecl getTypedefs(uint i) { - var __ret = Internal.getTypedefs_0(__Instance, i); + var __ret = Internal.getTypedefs_0((__Instance + __PointerAdjustment), i); CppSharp.Parser.AST.TypedefDecl __result0; if (__ret == IntPtr.Zero) __result0 = null; else if (CppSharp.Parser.AST.TypedefDecl.NativeToManagedMap.ContainsKey(__ret)) @@ -4028,17 +4149,17 @@ namespace CppSharp public void addTypedefs(CppSharp.Parser.AST.TypedefDecl s) { var arg0 = ReferenceEquals(s, null) ? global::System.IntPtr.Zero : s.__Instance; - Internal.addTypedefs_0(__Instance, arg0); + Internal.addTypedefs_0((__Instance + __PointerAdjustment), arg0); } public void clearTypedefs() { - Internal.clearTypedefs_0(__Instance); + Internal.clearTypedefs_0((__Instance + __PointerAdjustment)); } public CppSharp.Parser.AST.Variable getVariables(uint i) { - var __ret = Internal.getVariables_0(__Instance, i); + var __ret = Internal.getVariables_0((__Instance + __PointerAdjustment), i); CppSharp.Parser.AST.Variable __result0; if (__ret == IntPtr.Zero) __result0 = null; else if (CppSharp.Parser.AST.Variable.NativeToManagedMap.ContainsKey(__ret)) @@ -4050,17 +4171,17 @@ namespace CppSharp public void addVariables(CppSharp.Parser.AST.Variable s) { var arg0 = ReferenceEquals(s, null) ? global::System.IntPtr.Zero : s.__Instance; - Internal.addVariables_0(__Instance, arg0); + Internal.addVariables_0((__Instance + __PointerAdjustment), arg0); } public void clearVariables() { - Internal.clearVariables_0(__Instance); + Internal.clearVariables_0((__Instance + __PointerAdjustment)); } public CppSharp.Parser.AST.Friend getFriends(uint i) { - var __ret = Internal.getFriends_0(__Instance, i); + var __ret = Internal.getFriends_0((__Instance + __PointerAdjustment), i); CppSharp.Parser.AST.Friend __result0; if (__ret == IntPtr.Zero) __result0 = null; else if (CppSharp.Parser.AST.Friend.NativeToManagedMap.ContainsKey(__ret)) @@ -4072,19 +4193,19 @@ namespace CppSharp public void addFriends(CppSharp.Parser.AST.Friend s) { var arg0 = ReferenceEquals(s, null) ? global::System.IntPtr.Zero : s.__Instance; - Internal.addFriends_0(__Instance, arg0); + Internal.addFriends_0((__Instance + __PointerAdjustment), arg0); } public void clearFriends() { - Internal.clearFriends_0(__Instance); + Internal.clearFriends_0((__Instance + __PointerAdjustment)); } public uint NamespacesCount { get { - var __ret = Internal.getNamespacesCount_0(__Instance); + var __ret = Internal.getNamespacesCount_0((__Instance + __PointerAdjustment)); return __ret; } } @@ -4093,7 +4214,7 @@ namespace CppSharp { get { - var __ret = Internal.getEnumsCount_0(__Instance); + var __ret = Internal.getEnumsCount_0((__Instance + __PointerAdjustment)); return __ret; } } @@ -4102,7 +4223,7 @@ namespace CppSharp { get { - var __ret = Internal.getFunctionsCount_0(__Instance); + var __ret = Internal.getFunctionsCount_0((__Instance + __PointerAdjustment)); return __ret; } } @@ -4111,7 +4232,7 @@ namespace CppSharp { get { - var __ret = Internal.getClassesCount_0(__Instance); + var __ret = Internal.getClassesCount_0((__Instance + __PointerAdjustment)); return __ret; } } @@ -4120,7 +4241,7 @@ namespace CppSharp { get { - var __ret = Internal.getTemplatesCount_0(__Instance); + var __ret = Internal.getTemplatesCount_0((__Instance + __PointerAdjustment)); return __ret; } } @@ -4129,7 +4250,7 @@ namespace CppSharp { get { - var __ret = Internal.getTypedefsCount_0(__Instance); + var __ret = Internal.getTypedefsCount_0((__Instance + __PointerAdjustment)); return __ret; } } @@ -4138,7 +4259,7 @@ namespace CppSharp { get { - var __ret = Internal.getVariablesCount_0(__Instance); + var __ret = Internal.getVariablesCount_0((__Instance + __PointerAdjustment)); return __ret; } } @@ -4147,7 +4268,7 @@ namespace CppSharp { get { - var __ret = Internal.getFriendsCount_0(__Instance); + var __ret = Internal.getFriendsCount_0((__Instance + __PointerAdjustment)); return __ret; } } @@ -4226,14 +4347,14 @@ namespace CppSharp internal static extern void dtor_0(global::System.IntPtr instance); } - public static new TypedefDecl __CreateInstance(global::System.IntPtr native, bool ownsNativeInstance = false) + public static new TypedefDecl __CreateInstance(global::System.IntPtr native, bool ownsNativeInstance = false, bool skipVTables = false) { - return new TypedefDecl((TypedefDecl.Internal*) native) { __ownsNativeInstance = ownsNativeInstance }; + return new TypedefDecl((TypedefDecl.Internal*) native, skipVTables) { __ownsNativeInstance = ownsNativeInstance }; } - public static TypedefDecl __CreateInstance(TypedefDecl.Internal native) + public static TypedefDecl __CreateInstance(TypedefDecl.Internal native, bool skipVTables = false) { - return new TypedefDecl(native); + return new TypedefDecl(native, skipVTables); } private static TypedefDecl.Internal* __CopyValue(TypedefDecl.Internal native) @@ -4243,16 +4364,20 @@ namespace CppSharp return (TypedefDecl.Internal*) ret; } - private TypedefDecl(TypedefDecl.Internal native) - : this(__CopyValue(native)) + private TypedefDecl(TypedefDecl.Internal native, bool skipVTables = false) + : this(__CopyValue(native), skipVTables) { __ownsNativeInstance = true; NativeToManagedMap[__Instance] = this; } - protected TypedefDecl(TypedefDecl.Internal* native, bool isInternalImpl = false) - : base((CppSharp.Parser.AST.Declaration.Internal*) native) + protected TypedefDecl(TypedefDecl.Internal* native, bool skipVTables = false) + : base((CppSharp.Parser.AST.Declaration.Internal*) null) { + __PointerAdjustment = 0; + if (native == null) + return; + __Instance = new global::System.IntPtr(native); } public TypedefDecl() @@ -4260,8 +4385,8 @@ namespace CppSharp { __Instance = Marshal.AllocHGlobal(100); __ownsNativeInstance = true; - Internal.ctor_0(__Instance); NativeToManagedMap[__Instance] = this; + Internal.ctor_0((__Instance + __PointerAdjustment)); } public TypedefDecl(CppSharp.Parser.AST.TypedefDecl _0) @@ -4269,9 +4394,9 @@ namespace CppSharp { __Instance = Marshal.AllocHGlobal(100); __ownsNativeInstance = true; - var arg0 = ReferenceEquals(_0, null) ? global::System.IntPtr.Zero : _0.__Instance; - Internal.cctor_2(__Instance, arg0); NativeToManagedMap[__Instance] = this; + var arg0 = ReferenceEquals(_0, null) ? global::System.IntPtr.Zero : _0.__Instance; + Internal.cctor_2((__Instance + __PointerAdjustment), arg0); } public CppSharp.Parser.AST.QualifiedType QualifiedType @@ -4348,14 +4473,14 @@ namespace CppSharp internal static extern void dtor_0(global::System.IntPtr instance); } - public static new Friend __CreateInstance(global::System.IntPtr native, bool ownsNativeInstance = false) + public static new Friend __CreateInstance(global::System.IntPtr native, bool ownsNativeInstance = false, bool skipVTables = false) { - return new Friend((Friend.Internal*) native) { __ownsNativeInstance = ownsNativeInstance }; + return new Friend((Friend.Internal*) native, skipVTables) { __ownsNativeInstance = ownsNativeInstance }; } - public static Friend __CreateInstance(Friend.Internal native) + public static Friend __CreateInstance(Friend.Internal native, bool skipVTables = false) { - return new Friend(native); + return new Friend(native, skipVTables); } private static Friend.Internal* __CopyValue(Friend.Internal native) @@ -4365,16 +4490,20 @@ namespace CppSharp return (Friend.Internal*) ret; } - private Friend(Friend.Internal native) - : this(__CopyValue(native)) + private Friend(Friend.Internal native, bool skipVTables = false) + : this(__CopyValue(native), skipVTables) { __ownsNativeInstance = true; NativeToManagedMap[__Instance] = this; } - protected Friend(Friend.Internal* native, bool isInternalImpl = false) - : base((CppSharp.Parser.AST.Declaration.Internal*) native) + protected Friend(Friend.Internal* native, bool skipVTables = false) + : base((CppSharp.Parser.AST.Declaration.Internal*) null) { + __PointerAdjustment = 0; + if (native == null) + return; + __Instance = new global::System.IntPtr(native); } public Friend() @@ -4382,8 +4511,8 @@ namespace CppSharp { __Instance = Marshal.AllocHGlobal(96); __ownsNativeInstance = true; - Internal.ctor_0(__Instance); NativeToManagedMap[__Instance] = this; + Internal.ctor_0((__Instance + __PointerAdjustment)); } public Friend(CppSharp.Parser.AST.Friend _0) @@ -4391,9 +4520,9 @@ namespace CppSharp { __Instance = Marshal.AllocHGlobal(96); __ownsNativeInstance = true; - var arg0 = ReferenceEquals(_0, null) ? global::System.IntPtr.Zero : _0.__Instance; - Internal.cctor_2(__Instance, arg0); NativeToManagedMap[__Instance] = this; + var arg0 = ReferenceEquals(_0, null) ? global::System.IntPtr.Zero : _0.__Instance; + Internal.cctor_2((__Instance + __PointerAdjustment), arg0); } public CppSharp.Parser.AST.Declaration Declaration @@ -4448,19 +4577,21 @@ namespace CppSharp } public global::System.IntPtr __Instance { get; protected set; } + + protected int __PointerAdjustment; public static readonly System.Collections.Concurrent.ConcurrentDictionary NativeToManagedMap = new System.Collections.Concurrent.ConcurrentDictionary(); protected void*[] __OriginalVTables; protected bool __ownsNativeInstance; - public static Statement __CreateInstance(global::System.IntPtr native, bool ownsNativeInstance = false) + public static Statement __CreateInstance(global::System.IntPtr native, bool ownsNativeInstance = false, bool skipVTables = false) { - return new Statement((Statement.Internal*) native) { __ownsNativeInstance = ownsNativeInstance }; + return new Statement((Statement.Internal*) native, skipVTables) { __ownsNativeInstance = ownsNativeInstance }; } - public static Statement __CreateInstance(Statement.Internal native) + public static Statement __CreateInstance(Statement.Internal native, bool skipVTables = false) { - return new Statement(native); + return new Statement(native, skipVTables); } private static Statement.Internal* __CopyValue(Statement.Internal native) @@ -4470,15 +4601,17 @@ namespace CppSharp return (Statement.Internal*) ret; } - private Statement(Statement.Internal native) - : this(__CopyValue(native)) + private Statement(Statement.Internal native, bool skipVTables = false) + : this(__CopyValue(native), skipVTables) { __ownsNativeInstance = true; NativeToManagedMap[__Instance] = this; } - protected Statement(Statement.Internal* native, bool isInternalImpl = false) + protected Statement(Statement.Internal* native, bool skipVTables = false) { + if (native == null) + return; __Instance = new global::System.IntPtr(native); } @@ -4486,9 +4619,9 @@ namespace CppSharp { __Instance = Marshal.AllocHGlobal(20); __ownsNativeInstance = true; - var arg0 = ReferenceEquals(_0, null) ? global::System.IntPtr.Zero : _0.__Instance; - Internal.cctor_2(__Instance, arg0); NativeToManagedMap[__Instance] = this; + var arg0 = ReferenceEquals(_0, null) ? global::System.IntPtr.Zero : _0.__Instance; + Internal.cctor_2((__Instance + __PointerAdjustment), arg0); } public void Dispose() @@ -4502,22 +4635,23 @@ namespace CppSharp throw new global::System.InvalidOperationException("Managed instances owned by native code cannot be disposed of."); CppSharp.Parser.AST.Statement __dummy; NativeToManagedMap.TryRemove(__Instance, out __dummy); - Internal.dtor_0(__Instance); - Marshal.FreeHGlobal(__Instance); + Internal.dtor_0((__Instance + __PointerAdjustment)); + if (__ownsNativeInstance) + Marshal.FreeHGlobal(__Instance); } public string String { get { - var __ret = Internal.getString_0(__Instance); + var __ret = Internal.getString_0((__Instance + __PointerAdjustment)); return Marshal.PtrToStringAnsi(__ret); } set { var arg0 = Marshal.StringToHGlobalAnsi(value); - Internal.setString_0(__Instance, arg0); + Internal.setString_0((__Instance + __PointerAdjustment), arg0); Marshal.FreeHGlobal(arg0); } } @@ -4576,14 +4710,14 @@ namespace CppSharp internal static extern void dtor_0(global::System.IntPtr instance); } - public static new Expression __CreateInstance(global::System.IntPtr native, bool ownsNativeInstance = false) + public static new Expression __CreateInstance(global::System.IntPtr native, bool ownsNativeInstance = false, bool skipVTables = false) { - return new Expression((Expression.Internal*) native) { __ownsNativeInstance = ownsNativeInstance }; + return new Expression((Expression.Internal*) native, skipVTables) { __ownsNativeInstance = ownsNativeInstance }; } - public static Expression __CreateInstance(Expression.Internal native) + public static Expression __CreateInstance(Expression.Internal native, bool skipVTables = false) { - return new Expression(native); + return new Expression(native, skipVTables); } private static Expression.Internal* __CopyValue(Expression.Internal native) @@ -4593,16 +4727,20 @@ namespace CppSharp return (Expression.Internal*) ret; } - private Expression(Expression.Internal native) - : this(__CopyValue(native)) + private Expression(Expression.Internal native, bool skipVTables = false) + : this(__CopyValue(native), skipVTables) { __ownsNativeInstance = true; NativeToManagedMap[__Instance] = this; } - protected Expression(Expression.Internal* native, bool isInternalImpl = false) - : base((CppSharp.Parser.AST.Statement.Internal*) native) + protected Expression(Expression.Internal* native, bool skipVTables = false) + : base((CppSharp.Parser.AST.Statement.Internal*) null) { + __PointerAdjustment = 0; + if (native == null) + return; + __Instance = new global::System.IntPtr(native); } public Expression(CppSharp.Parser.AST.Expression _0) @@ -4610,9 +4748,9 @@ namespace CppSharp { __Instance = Marshal.AllocHGlobal(20); __ownsNativeInstance = true; - var arg0 = ReferenceEquals(_0, null) ? global::System.IntPtr.Zero : _0.__Instance; - Internal.cctor_1(__Instance, arg0); NativeToManagedMap[__Instance] = this; + var arg0 = ReferenceEquals(_0, null) ? global::System.IntPtr.Zero : _0.__Instance; + Internal.cctor_1((__Instance + __PointerAdjustment), arg0); } } @@ -4654,14 +4792,14 @@ namespace CppSharp internal static extern void setOpcodeStr_0(global::System.IntPtr instance, global::System.IntPtr s); } - public static new BinaryOperator __CreateInstance(global::System.IntPtr native, bool ownsNativeInstance = false) + public static new BinaryOperator __CreateInstance(global::System.IntPtr native, bool ownsNativeInstance = false, bool skipVTables = false) { - return new BinaryOperator((BinaryOperator.Internal*) native) { __ownsNativeInstance = ownsNativeInstance }; + return new BinaryOperator((BinaryOperator.Internal*) native, skipVTables) { __ownsNativeInstance = ownsNativeInstance }; } - public static BinaryOperator __CreateInstance(BinaryOperator.Internal native) + public static BinaryOperator __CreateInstance(BinaryOperator.Internal native, bool skipVTables = false) { - return new BinaryOperator(native); + return new BinaryOperator(native, skipVTables); } private static BinaryOperator.Internal* __CopyValue(BinaryOperator.Internal native) @@ -4671,16 +4809,20 @@ namespace CppSharp return (BinaryOperator.Internal*) ret; } - private BinaryOperator(BinaryOperator.Internal native) - : this(__CopyValue(native)) + private BinaryOperator(BinaryOperator.Internal native, bool skipVTables = false) + : this(__CopyValue(native), skipVTables) { __ownsNativeInstance = true; NativeToManagedMap[__Instance] = this; } - protected BinaryOperator(BinaryOperator.Internal* native, bool isInternalImpl = false) - : base((CppSharp.Parser.AST.Expression.Internal*) native) + protected BinaryOperator(BinaryOperator.Internal* native, bool skipVTables = false) + : base((CppSharp.Parser.AST.Expression.Internal*) null) { + __PointerAdjustment = 0; + if (native == null) + return; + __Instance = new global::System.IntPtr(native); } public BinaryOperator(CppSharp.Parser.AST.BinaryOperator _0) @@ -4688,23 +4830,23 @@ namespace CppSharp { __Instance = Marshal.AllocHGlobal(40); __ownsNativeInstance = true; - var arg0 = ReferenceEquals(_0, null) ? global::System.IntPtr.Zero : _0.__Instance; - Internal.cctor_2(__Instance, arg0); NativeToManagedMap[__Instance] = this; + var arg0 = ReferenceEquals(_0, null) ? global::System.IntPtr.Zero : _0.__Instance; + Internal.cctor_2((__Instance + __PointerAdjustment), arg0); } public string OpcodeStr { get { - var __ret = Internal.getOpcodeStr_0(__Instance); + var __ret = Internal.getOpcodeStr_0((__Instance + __PointerAdjustment)); return Marshal.PtrToStringAnsi(__ret); } set { var arg0 = Marshal.StringToHGlobalAnsi(value); - Internal.setOpcodeStr_0(__Instance, arg0); + Internal.setOpcodeStr_0((__Instance + __PointerAdjustment), arg0); Marshal.FreeHGlobal(arg0); } } @@ -4788,14 +4930,14 @@ namespace CppSharp internal static extern uint getArgumentsCount_0(global::System.IntPtr instance); } - public static new CXXConstructExpr __CreateInstance(global::System.IntPtr native, bool ownsNativeInstance = false) + public static new CXXConstructExpr __CreateInstance(global::System.IntPtr native, bool ownsNativeInstance = false, bool skipVTables = false) { - return new CXXConstructExpr((CXXConstructExpr.Internal*) native) { __ownsNativeInstance = ownsNativeInstance }; + return new CXXConstructExpr((CXXConstructExpr.Internal*) native, skipVTables) { __ownsNativeInstance = ownsNativeInstance }; } - public static CXXConstructExpr __CreateInstance(CXXConstructExpr.Internal native) + public static CXXConstructExpr __CreateInstance(CXXConstructExpr.Internal native, bool skipVTables = false) { - return new CXXConstructExpr(native); + return new CXXConstructExpr(native, skipVTables); } private static CXXConstructExpr.Internal* __CopyValue(CXXConstructExpr.Internal native) @@ -4805,16 +4947,20 @@ namespace CppSharp return (CXXConstructExpr.Internal*) ret; } - private CXXConstructExpr(CXXConstructExpr.Internal native) - : this(__CopyValue(native)) + private CXXConstructExpr(CXXConstructExpr.Internal native, bool skipVTables = false) + : this(__CopyValue(native), skipVTables) { __ownsNativeInstance = true; NativeToManagedMap[__Instance] = this; } - protected CXXConstructExpr(CXXConstructExpr.Internal* native, bool isInternalImpl = false) - : base((CppSharp.Parser.AST.Expression.Internal*) native) + protected CXXConstructExpr(CXXConstructExpr.Internal* native, bool skipVTables = false) + : base((CppSharp.Parser.AST.Expression.Internal*) null) { + __PointerAdjustment = 0; + if (native == null) + return; + __Instance = new global::System.IntPtr(native); } public CXXConstructExpr(CppSharp.Parser.AST.CXXConstructExpr _0) @@ -4822,14 +4968,14 @@ namespace CppSharp { __Instance = Marshal.AllocHGlobal(32); __ownsNativeInstance = true; - var arg0 = ReferenceEquals(_0, null) ? global::System.IntPtr.Zero : _0.__Instance; - Internal.cctor_2(__Instance, arg0); NativeToManagedMap[__Instance] = this; + var arg0 = ReferenceEquals(_0, null) ? global::System.IntPtr.Zero : _0.__Instance; + Internal.cctor_2((__Instance + __PointerAdjustment), arg0); } public CppSharp.Parser.AST.Expression getArguments(uint i) { - var __ret = Internal.getArguments_0(__Instance, i); + var __ret = Internal.getArguments_0((__Instance + __PointerAdjustment), i); CppSharp.Parser.AST.Expression __result0; if (__ret == IntPtr.Zero) __result0 = null; else if (CppSharp.Parser.AST.Expression.NativeToManagedMap.ContainsKey(__ret)) @@ -4841,19 +4987,19 @@ namespace CppSharp public void addArguments(CppSharp.Parser.AST.Expression s) { var arg0 = ReferenceEquals(s, null) ? global::System.IntPtr.Zero : s.__Instance; - Internal.addArguments_0(__Instance, arg0); + Internal.addArguments_0((__Instance + __PointerAdjustment), arg0); } public void clearArguments() { - Internal.clearArguments_0(__Instance); + Internal.clearArguments_0((__Instance + __PointerAdjustment)); } public uint ArgumentsCount { get { - var __ret = Internal.getArgumentsCount_0(__Instance); + var __ret = Internal.getArgumentsCount_0((__Instance + __PointerAdjustment)); return __ret; } } @@ -4931,14 +5077,14 @@ namespace CppSharp internal static extern void dtor_0(global::System.IntPtr instance); } - public static new Parameter __CreateInstance(global::System.IntPtr native, bool ownsNativeInstance = false) + public static new Parameter __CreateInstance(global::System.IntPtr native, bool ownsNativeInstance = false, bool skipVTables = false) { - return new Parameter((Parameter.Internal*) native) { __ownsNativeInstance = ownsNativeInstance }; + return new Parameter((Parameter.Internal*) native, skipVTables) { __ownsNativeInstance = ownsNativeInstance }; } - public static Parameter __CreateInstance(Parameter.Internal native) + public static Parameter __CreateInstance(Parameter.Internal native, bool skipVTables = false) { - return new Parameter(native); + return new Parameter(native, skipVTables); } private static Parameter.Internal* __CopyValue(Parameter.Internal native) @@ -4948,16 +5094,20 @@ namespace CppSharp return (Parameter.Internal*) ret; } - private Parameter(Parameter.Internal native) - : this(__CopyValue(native)) + private Parameter(Parameter.Internal native, bool skipVTables = false) + : this(__CopyValue(native), skipVTables) { __ownsNativeInstance = true; NativeToManagedMap[__Instance] = this; } - protected Parameter(Parameter.Internal* native, bool isInternalImpl = false) - : base((CppSharp.Parser.AST.Declaration.Internal*) native) + protected Parameter(Parameter.Internal* native, bool skipVTables = false) + : base((CppSharp.Parser.AST.Declaration.Internal*) null) { + __PointerAdjustment = 0; + if (native == null) + return; + __Instance = new global::System.IntPtr(native); } public Parameter() @@ -4965,8 +5115,8 @@ namespace CppSharp { __Instance = Marshal.AllocHGlobal(112); __ownsNativeInstance = true; - Internal.ctor_0(__Instance); NativeToManagedMap[__Instance] = this; + Internal.ctor_0((__Instance + __PointerAdjustment)); } public Parameter(CppSharp.Parser.AST.Parameter _0) @@ -4974,9 +5124,9 @@ namespace CppSharp { __Instance = Marshal.AllocHGlobal(112); __ownsNativeInstance = true; - var arg0 = ReferenceEquals(_0, null) ? global::System.IntPtr.Zero : _0.__Instance; - Internal.cctor_1(__Instance, arg0); NativeToManagedMap[__Instance] = this; + var arg0 = ReferenceEquals(_0, null) ? global::System.IntPtr.Zero : _0.__Instance; + Internal.cctor_1((__Instance + __PointerAdjustment), arg0); } public CppSharp.Parser.AST.QualifiedType QualifiedType @@ -5177,14 +5327,14 @@ namespace CppSharp internal static extern uint getParametersCount_0(global::System.IntPtr instance); } - public static new Function __CreateInstance(global::System.IntPtr native, bool ownsNativeInstance = false) + public static new Function __CreateInstance(global::System.IntPtr native, bool ownsNativeInstance = false, bool skipVTables = false) { - return new Function((Function.Internal*) native) { __ownsNativeInstance = ownsNativeInstance }; + return new Function((Function.Internal*) native, skipVTables) { __ownsNativeInstance = ownsNativeInstance }; } - public static Function __CreateInstance(Function.Internal native) + public static Function __CreateInstance(Function.Internal native, bool skipVTables = false) { - return new Function(native); + return new Function(native, skipVTables); } private static Function.Internal* __CopyValue(Function.Internal native) @@ -5194,16 +5344,20 @@ namespace CppSharp return (Function.Internal*) ret; } - private Function(Function.Internal native) - : this(__CopyValue(native)) + private Function(Function.Internal native, bool skipVTables = false) + : this(__CopyValue(native), skipVTables) { __ownsNativeInstance = true; NativeToManagedMap[__Instance] = this; } - protected Function(Function.Internal* native, bool isInternalImpl = false) - : base((CppSharp.Parser.AST.Declaration.Internal*) native) + protected Function(Function.Internal* native, bool skipVTables = false) + : base((CppSharp.Parser.AST.Declaration.Internal*) null) { + __PointerAdjustment = 0; + if (native == null) + return; + __Instance = new global::System.IntPtr(native); } public Function() @@ -5211,8 +5365,8 @@ namespace CppSharp { __Instance = Marshal.AllocHGlobal(156); __ownsNativeInstance = true; - Internal.ctor_0(__Instance); NativeToManagedMap[__Instance] = this; + Internal.ctor_0((__Instance + __PointerAdjustment)); } public Function(CppSharp.Parser.AST.Function _0) @@ -5220,14 +5374,14 @@ namespace CppSharp { __Instance = Marshal.AllocHGlobal(156); __ownsNativeInstance = true; - var arg0 = ReferenceEquals(_0, null) ? global::System.IntPtr.Zero : _0.__Instance; - Internal.cctor_2(__Instance, arg0); NativeToManagedMap[__Instance] = this; + var arg0 = ReferenceEquals(_0, null) ? global::System.IntPtr.Zero : _0.__Instance; + Internal.cctor_2((__Instance + __PointerAdjustment), arg0); } public CppSharp.Parser.AST.Parameter getParameters(uint i) { - var __ret = Internal.getParameters_0(__Instance, i); + var __ret = Internal.getParameters_0((__Instance + __PointerAdjustment), i); CppSharp.Parser.AST.Parameter __result0; if (__ret == IntPtr.Zero) __result0 = null; else if (CppSharp.Parser.AST.Parameter.NativeToManagedMap.ContainsKey(__ret)) @@ -5239,26 +5393,26 @@ namespace CppSharp public void addParameters(CppSharp.Parser.AST.Parameter s) { var arg0 = ReferenceEquals(s, null) ? global::System.IntPtr.Zero : s.__Instance; - Internal.addParameters_0(__Instance, arg0); + Internal.addParameters_0((__Instance + __PointerAdjustment), arg0); } public void clearParameters() { - Internal.clearParameters_0(__Instance); + Internal.clearParameters_0((__Instance + __PointerAdjustment)); } public string Mangled { get { - var __ret = Internal.getMangled_0(__Instance); + var __ret = Internal.getMangled_0((__Instance + __PointerAdjustment)); return Marshal.PtrToStringAnsi(__ret); } set { var arg0 = Marshal.StringToHGlobalAnsi(value); - Internal.setMangled_0(__Instance, arg0); + Internal.setMangled_0((__Instance + __PointerAdjustment), arg0); Marshal.FreeHGlobal(arg0); } } @@ -5267,14 +5421,14 @@ namespace CppSharp { get { - var __ret = Internal.getSignature_0(__Instance); + var __ret = Internal.getSignature_0((__Instance + __PointerAdjustment)); return Marshal.PtrToStringAnsi(__ret); } set { var arg0 = Marshal.StringToHGlobalAnsi(value); - Internal.setSignature_0(__Instance, arg0); + Internal.setSignature_0((__Instance + __PointerAdjustment), arg0); Marshal.FreeHGlobal(arg0); } } @@ -5283,7 +5437,7 @@ namespace CppSharp { get { - var __ret = Internal.getParametersCount_0(__Instance); + var __ret = Internal.getParametersCount_0((__Instance + __PointerAdjustment)); return __ret; } } @@ -5547,14 +5701,14 @@ namespace CppSharp internal static extern void dtor_0(global::System.IntPtr instance); } - public static new Method __CreateInstance(global::System.IntPtr native, bool ownsNativeInstance = false) + public static new Method __CreateInstance(global::System.IntPtr native, bool ownsNativeInstance = false, bool skipVTables = false) { - return new Method((Method.Internal*) native) { __ownsNativeInstance = ownsNativeInstance }; + return new Method((Method.Internal*) native, skipVTables) { __ownsNativeInstance = ownsNativeInstance }; } - public static Method __CreateInstance(Method.Internal native) + public static Method __CreateInstance(Method.Internal native, bool skipVTables = false) { - return new Method(native); + return new Method(native, skipVTables); } private static Method.Internal* __CopyValue(Method.Internal native) @@ -5564,16 +5718,20 @@ namespace CppSharp return (Method.Internal*) ret; } - private Method(Method.Internal native) - : this(__CopyValue(native)) + private Method(Method.Internal native, bool skipVTables = false) + : this(__CopyValue(native), skipVTables) { __ownsNativeInstance = true; NativeToManagedMap[__Instance] = this; } - protected Method(Method.Internal* native, bool isInternalImpl = false) - : base((CppSharp.Parser.AST.Function.Internal*) native) + protected Method(Method.Internal* native, bool skipVTables = false) + : base((CppSharp.Parser.AST.Function.Internal*) null) { + __PointerAdjustment = 0; + if (native == null) + return; + __Instance = new global::System.IntPtr(native); } public Method() @@ -5581,8 +5739,8 @@ namespace CppSharp { __Instance = Marshal.AllocHGlobal(184); __ownsNativeInstance = true; - Internal.ctor_0(__Instance); NativeToManagedMap[__Instance] = this; + Internal.ctor_0((__Instance + __PointerAdjustment)); } public Method(CppSharp.Parser.AST.Method _0) @@ -5590,9 +5748,9 @@ namespace CppSharp { __Instance = Marshal.AllocHGlobal(184); __ownsNativeInstance = true; - var arg0 = ReferenceEquals(_0, null) ? global::System.IntPtr.Zero : _0.__Instance; - Internal.cctor_1(__Instance, arg0); NativeToManagedMap[__Instance] = this; + var arg0 = ReferenceEquals(_0, null) ? global::System.IntPtr.Zero : _0.__Instance; + Internal.cctor_1((__Instance + __PointerAdjustment), arg0); } public CppSharp.Parser.AST.AccessSpecifierDecl AccessDecl @@ -5924,14 +6082,14 @@ namespace CppSharp internal static extern void setExpression_0(global::System.IntPtr instance, global::System.IntPtr s); } - public static new Item __CreateInstance(global::System.IntPtr native, bool ownsNativeInstance = false) + public static new Item __CreateInstance(global::System.IntPtr native, bool ownsNativeInstance = false, bool skipVTables = false) { - return new Item((Item.Internal*) native) { __ownsNativeInstance = ownsNativeInstance }; + return new Item((Item.Internal*) native, skipVTables) { __ownsNativeInstance = ownsNativeInstance }; } - public static Item __CreateInstance(Item.Internal native) + public static Item __CreateInstance(Item.Internal native, bool skipVTables = false) { - return new Item(native); + return new Item(native, skipVTables); } private static Item.Internal* __CopyValue(Item.Internal native) @@ -5941,16 +6099,20 @@ namespace CppSharp return (Item.Internal*) ret; } - private Item(Item.Internal native) - : this(__CopyValue(native)) + private Item(Item.Internal native, bool skipVTables = false) + : this(__CopyValue(native), skipVTables) { __ownsNativeInstance = true; NativeToManagedMap[__Instance] = this; } - protected Item(Item.Internal* native, bool isInternalImpl = false) - : base((CppSharp.Parser.AST.Declaration.Internal*) native) + protected Item(Item.Internal* native, bool skipVTables = false) + : base((CppSharp.Parser.AST.Declaration.Internal*) null) { + __PointerAdjustment = 0; + if (native == null) + return; + __Instance = new global::System.IntPtr(native); } public Item() @@ -5958,8 +6120,8 @@ namespace CppSharp { __Instance = Marshal.AllocHGlobal(112); __ownsNativeInstance = true; - Internal.ctor_0(__Instance); NativeToManagedMap[__Instance] = this; + Internal.ctor_0((__Instance + __PointerAdjustment)); } public Item(CppSharp.Parser.AST.Enumeration.Item _0) @@ -5967,23 +6129,23 @@ namespace CppSharp { __Instance = Marshal.AllocHGlobal(112); __ownsNativeInstance = true; - var arg0 = ReferenceEquals(_0, null) ? global::System.IntPtr.Zero : _0.__Instance; - Internal.cctor_1(__Instance, arg0); NativeToManagedMap[__Instance] = this; + var arg0 = ReferenceEquals(_0, null) ? global::System.IntPtr.Zero : _0.__Instance; + Internal.cctor_1((__Instance + __PointerAdjustment), arg0); } public string Expression { get { - var __ret = Internal.getExpression_0(__Instance); + var __ret = Internal.getExpression_0((__Instance + __PointerAdjustment)); return Marshal.PtrToStringAnsi(__ret); } set { var arg0 = Marshal.StringToHGlobalAnsi(value); - Internal.setExpression_0(__Instance, arg0); + Internal.setExpression_0((__Instance + __PointerAdjustment), arg0); Marshal.FreeHGlobal(arg0); } } @@ -6002,14 +6164,14 @@ namespace CppSharp } } - public static new Enumeration __CreateInstance(global::System.IntPtr native, bool ownsNativeInstance = false) + public static new Enumeration __CreateInstance(global::System.IntPtr native, bool ownsNativeInstance = false, bool skipVTables = false) { - return new Enumeration((Enumeration.Internal*) native) { __ownsNativeInstance = ownsNativeInstance }; + return new Enumeration((Enumeration.Internal*) native, skipVTables) { __ownsNativeInstance = ownsNativeInstance }; } - public static Enumeration __CreateInstance(Enumeration.Internal native) + public static Enumeration __CreateInstance(Enumeration.Internal native, bool skipVTables = false) { - return new Enumeration(native); + return new Enumeration(native, skipVTables); } private static Enumeration.Internal* __CopyValue(Enumeration.Internal native) @@ -6019,16 +6181,20 @@ namespace CppSharp return (Enumeration.Internal*) ret; } - private Enumeration(Enumeration.Internal native) - : this(__CopyValue(native)) + private Enumeration(Enumeration.Internal native, bool skipVTables = false) + : this(__CopyValue(native), skipVTables) { __ownsNativeInstance = true; NativeToManagedMap[__Instance] = this; } - protected Enumeration(Enumeration.Internal* native, bool isInternalImpl = false) - : base((CppSharp.Parser.AST.DeclarationContext.Internal*) native) + protected Enumeration(Enumeration.Internal* native, bool skipVTables = false) + : base((CppSharp.Parser.AST.DeclarationContext.Internal*) null) { + __PointerAdjustment = 0; + if (native == null) + return; + __Instance = new global::System.IntPtr(native); } public Enumeration() @@ -6036,8 +6202,8 @@ namespace CppSharp { __Instance = Marshal.AllocHGlobal(228); __ownsNativeInstance = true; - Internal.ctor_0(__Instance); NativeToManagedMap[__Instance] = this; + Internal.ctor_0((__Instance + __PointerAdjustment)); } public Enumeration(CppSharp.Parser.AST.Enumeration _0) @@ -6045,34 +6211,34 @@ namespace CppSharp { __Instance = Marshal.AllocHGlobal(228); __ownsNativeInstance = true; - var arg0 = ReferenceEquals(_0, null) ? global::System.IntPtr.Zero : _0.__Instance; - Internal.cctor_2(__Instance, arg0); NativeToManagedMap[__Instance] = this; + var arg0 = ReferenceEquals(_0, null) ? global::System.IntPtr.Zero : _0.__Instance; + Internal.cctor_2((__Instance + __PointerAdjustment), arg0); } public CppSharp.Parser.AST.Enumeration.Item getItems(uint i) { var __ret = new CppSharp.Parser.AST.Enumeration.Item.Internal(); - Internal.getItems_0(new IntPtr(&__ret), __Instance, i); + Internal.getItems_0(new IntPtr(&__ret), (__Instance + __PointerAdjustment), i); return CppSharp.Parser.AST.Enumeration.Item.__CreateInstance(__ret); } public void addItems(CppSharp.Parser.AST.Enumeration.Item s) { var arg0 = ReferenceEquals(s, null) ? global::System.IntPtr.Zero : s.__Instance; - Internal.addItems_0(__Instance, arg0); + Internal.addItems_0((__Instance + __PointerAdjustment), arg0); } public void clearItems() { - Internal.clearItems_0(__Instance); + Internal.clearItems_0((__Instance + __PointerAdjustment)); } public uint ItemsCount { get { - var __ret = Internal.getItemsCount_0(__Instance); + var __ret = Internal.getItemsCount_0((__Instance + __PointerAdjustment)); return __ret; } } @@ -6197,14 +6363,14 @@ namespace CppSharp internal static extern void setMangled_0(global::System.IntPtr instance, global::System.IntPtr s); } - public static new Variable __CreateInstance(global::System.IntPtr native, bool ownsNativeInstance = false) + public static new Variable __CreateInstance(global::System.IntPtr native, bool ownsNativeInstance = false, bool skipVTables = false) { - return new Variable((Variable.Internal*) native) { __ownsNativeInstance = ownsNativeInstance }; + return new Variable((Variable.Internal*) native, skipVTables) { __ownsNativeInstance = ownsNativeInstance }; } - public static Variable __CreateInstance(Variable.Internal native) + public static Variable __CreateInstance(Variable.Internal native, bool skipVTables = false) { - return new Variable(native); + return new Variable(native, skipVTables); } private static Variable.Internal* __CopyValue(Variable.Internal native) @@ -6214,16 +6380,20 @@ namespace CppSharp return (Variable.Internal*) ret; } - private Variable(Variable.Internal native) - : this(__CopyValue(native)) + private Variable(Variable.Internal native, bool skipVTables = false) + : this(__CopyValue(native), skipVTables) { __ownsNativeInstance = true; NativeToManagedMap[__Instance] = this; } - protected Variable(Variable.Internal* native, bool isInternalImpl = false) - : base((CppSharp.Parser.AST.Declaration.Internal*) native) + protected Variable(Variable.Internal* native, bool skipVTables = false) + : base((CppSharp.Parser.AST.Declaration.Internal*) null) { + __PointerAdjustment = 0; + if (native == null) + return; + __Instance = new global::System.IntPtr(native); } public Variable() @@ -6231,8 +6401,8 @@ namespace CppSharp { __Instance = Marshal.AllocHGlobal(112); __ownsNativeInstance = true; - Internal.ctor_0(__Instance); NativeToManagedMap[__Instance] = this; + Internal.ctor_0((__Instance + __PointerAdjustment)); } public Variable(CppSharp.Parser.AST.Variable _0) @@ -6240,23 +6410,23 @@ namespace CppSharp { __Instance = Marshal.AllocHGlobal(112); __ownsNativeInstance = true; - var arg0 = ReferenceEquals(_0, null) ? global::System.IntPtr.Zero : _0.__Instance; - Internal.cctor_2(__Instance, arg0); NativeToManagedMap[__Instance] = this; + var arg0 = ReferenceEquals(_0, null) ? global::System.IntPtr.Zero : _0.__Instance; + Internal.cctor_2((__Instance + __PointerAdjustment), arg0); } public string Mangled { get { - var __ret = Internal.getMangled_0(__Instance); + var __ret = Internal.getMangled_0((__Instance + __PointerAdjustment)); return Marshal.PtrToStringAnsi(__ret); } set { var arg0 = Marshal.StringToHGlobalAnsi(value); - Internal.setMangled_0(__Instance, arg0); + Internal.setMangled_0((__Instance + __PointerAdjustment), arg0); Marshal.FreeHGlobal(arg0); } } @@ -6304,19 +6474,21 @@ namespace CppSharp } public global::System.IntPtr __Instance { get; protected set; } + + protected int __PointerAdjustment; public static readonly System.Collections.Concurrent.ConcurrentDictionary NativeToManagedMap = new System.Collections.Concurrent.ConcurrentDictionary(); protected void*[] __OriginalVTables; protected bool __ownsNativeInstance; - public static BaseClassSpecifier __CreateInstance(global::System.IntPtr native, bool ownsNativeInstance = false) + public static BaseClassSpecifier __CreateInstance(global::System.IntPtr native, bool ownsNativeInstance = false, bool skipVTables = false) { - return new BaseClassSpecifier((BaseClassSpecifier.Internal*) native) { __ownsNativeInstance = ownsNativeInstance }; + return new BaseClassSpecifier((BaseClassSpecifier.Internal*) native, skipVTables) { __ownsNativeInstance = ownsNativeInstance }; } - public static BaseClassSpecifier __CreateInstance(BaseClassSpecifier.Internal native) + public static BaseClassSpecifier __CreateInstance(BaseClassSpecifier.Internal native, bool skipVTables = false) { - return new BaseClassSpecifier(native); + return new BaseClassSpecifier(native, skipVTables); } private static BaseClassSpecifier.Internal* __CopyValue(BaseClassSpecifier.Internal native) @@ -6326,15 +6498,17 @@ namespace CppSharp return ret; } - private BaseClassSpecifier(BaseClassSpecifier.Internal native) - : this(__CopyValue(native)) + private BaseClassSpecifier(BaseClassSpecifier.Internal native, bool skipVTables = false) + : this(__CopyValue(native), skipVTables) { __ownsNativeInstance = true; NativeToManagedMap[__Instance] = this; } - protected BaseClassSpecifier(BaseClassSpecifier.Internal* native, bool isInternalImpl = false) + protected BaseClassSpecifier(BaseClassSpecifier.Internal* native, bool skipVTables = false) { + if (native == null) + return; __Instance = new global::System.IntPtr(native); } @@ -6342,16 +6516,16 @@ namespace CppSharp { __Instance = Marshal.AllocHGlobal(16); __ownsNativeInstance = true; - Internal.ctor_0(__Instance); NativeToManagedMap[__Instance] = this; + Internal.ctor_0((__Instance + __PointerAdjustment)); } public BaseClassSpecifier(CppSharp.Parser.AST.BaseClassSpecifier _0) { __Instance = Marshal.AllocHGlobal(16); __ownsNativeInstance = true; - *((BaseClassSpecifier.Internal*) __Instance) = *((BaseClassSpecifier.Internal*) _0.__Instance); NativeToManagedMap[__Instance] = this; + *((BaseClassSpecifier.Internal*) __Instance) = *((BaseClassSpecifier.Internal*) _0.__Instance); } public void Dispose() @@ -6365,7 +6539,8 @@ namespace CppSharp throw new global::System.InvalidOperationException("Managed instances owned by native code cannot be disposed of."); CppSharp.Parser.AST.BaseClassSpecifier __dummy; NativeToManagedMap.TryRemove(__Instance, out __dummy); - Marshal.FreeHGlobal(__Instance); + if (__ownsNativeInstance) + Marshal.FreeHGlobal(__Instance); } public CppSharp.Parser.AST.AccessSpecifier Access @@ -6498,14 +6673,14 @@ namespace CppSharp internal static extern void dtor_0(global::System.IntPtr instance); } - public static new Field __CreateInstance(global::System.IntPtr native, bool ownsNativeInstance = false) + public static new Field __CreateInstance(global::System.IntPtr native, bool ownsNativeInstance = false, bool skipVTables = false) { - return new Field((Field.Internal*) native) { __ownsNativeInstance = ownsNativeInstance }; + return new Field((Field.Internal*) native, skipVTables) { __ownsNativeInstance = ownsNativeInstance }; } - public static Field __CreateInstance(Field.Internal native) + public static Field __CreateInstance(Field.Internal native, bool skipVTables = false) { - return new Field(native); + return new Field(native, skipVTables); } private static Field.Internal* __CopyValue(Field.Internal native) @@ -6515,16 +6690,20 @@ namespace CppSharp return (Field.Internal*) ret; } - private Field(Field.Internal native) - : this(__CopyValue(native)) + private Field(Field.Internal native, bool skipVTables = false) + : this(__CopyValue(native), skipVTables) { __ownsNativeInstance = true; NativeToManagedMap[__Instance] = this; } - protected Field(Field.Internal* native, bool isInternalImpl = false) - : base((CppSharp.Parser.AST.Declaration.Internal*) native) + protected Field(Field.Internal* native, bool skipVTables = false) + : base((CppSharp.Parser.AST.Declaration.Internal*) null) { + __PointerAdjustment = 0; + if (native == null) + return; + __Instance = new global::System.IntPtr(native); } public Field() @@ -6532,8 +6711,8 @@ namespace CppSharp { __Instance = Marshal.AllocHGlobal(116); __ownsNativeInstance = true; - Internal.ctor_0(__Instance); NativeToManagedMap[__Instance] = this; + Internal.ctor_0((__Instance + __PointerAdjustment)); } public Field(CppSharp.Parser.AST.Field _0) @@ -6541,9 +6720,9 @@ namespace CppSharp { __Instance = Marshal.AllocHGlobal(116); __ownsNativeInstance = true; - var arg0 = ReferenceEquals(_0, null) ? global::System.IntPtr.Zero : _0.__Instance; - Internal.cctor_2(__Instance, arg0); NativeToManagedMap[__Instance] = this; + var arg0 = ReferenceEquals(_0, null) ? global::System.IntPtr.Zero : _0.__Instance; + Internal.cctor_2((__Instance + __PointerAdjustment), arg0); } public CppSharp.Parser.AST.QualifiedType QualifiedType @@ -6674,14 +6853,14 @@ namespace CppSharp internal static extern void dtor_0(global::System.IntPtr instance); } - public static new AccessSpecifierDecl __CreateInstance(global::System.IntPtr native, bool ownsNativeInstance = false) + public static new AccessSpecifierDecl __CreateInstance(global::System.IntPtr native, bool ownsNativeInstance = false, bool skipVTables = false) { - return new AccessSpecifierDecl((AccessSpecifierDecl.Internal*) native) { __ownsNativeInstance = ownsNativeInstance }; + return new AccessSpecifierDecl((AccessSpecifierDecl.Internal*) native, skipVTables) { __ownsNativeInstance = ownsNativeInstance }; } - public static AccessSpecifierDecl __CreateInstance(AccessSpecifierDecl.Internal native) + public static AccessSpecifierDecl __CreateInstance(AccessSpecifierDecl.Internal native, bool skipVTables = false) { - return new AccessSpecifierDecl(native); + return new AccessSpecifierDecl(native, skipVTables); } private static AccessSpecifierDecl.Internal* __CopyValue(AccessSpecifierDecl.Internal native) @@ -6691,16 +6870,20 @@ namespace CppSharp return (AccessSpecifierDecl.Internal*) ret; } - private AccessSpecifierDecl(AccessSpecifierDecl.Internal native) - : this(__CopyValue(native)) + private AccessSpecifierDecl(AccessSpecifierDecl.Internal native, bool skipVTables = false) + : this(__CopyValue(native), skipVTables) { __ownsNativeInstance = true; NativeToManagedMap[__Instance] = this; } - protected AccessSpecifierDecl(AccessSpecifierDecl.Internal* native, bool isInternalImpl = false) - : base((CppSharp.Parser.AST.Declaration.Internal*) native) + protected AccessSpecifierDecl(AccessSpecifierDecl.Internal* native, bool skipVTables = false) + : base((CppSharp.Parser.AST.Declaration.Internal*) null) { + __PointerAdjustment = 0; + if (native == null) + return; + __Instance = new global::System.IntPtr(native); } public AccessSpecifierDecl() @@ -6708,8 +6891,8 @@ namespace CppSharp { __Instance = Marshal.AllocHGlobal(92); __ownsNativeInstance = true; - Internal.ctor_0(__Instance); NativeToManagedMap[__Instance] = this; + Internal.ctor_0((__Instance + __PointerAdjustment)); } public AccessSpecifierDecl(CppSharp.Parser.AST.AccessSpecifierDecl _0) @@ -6717,9 +6900,9 @@ namespace CppSharp { __Instance = Marshal.AllocHGlobal(92); __ownsNativeInstance = true; - var arg0 = ReferenceEquals(_0, null) ? global::System.IntPtr.Zero : _0.__Instance; - Internal.cctor_2(__Instance, arg0); NativeToManagedMap[__Instance] = this; + var arg0 = ReferenceEquals(_0, null) ? global::System.IntPtr.Zero : _0.__Instance; + Internal.cctor_2((__Instance + __PointerAdjustment), arg0); } } @@ -6893,14 +7076,14 @@ namespace CppSharp internal static extern uint getSpecifiersCount_0(global::System.IntPtr instance); } - public static new Class __CreateInstance(global::System.IntPtr native, bool ownsNativeInstance = false) + public static new Class __CreateInstance(global::System.IntPtr native, bool ownsNativeInstance = false, bool skipVTables = false) { - return new Class((Class.Internal*) native) { __ownsNativeInstance = ownsNativeInstance }; + return new Class((Class.Internal*) native, skipVTables) { __ownsNativeInstance = ownsNativeInstance }; } - public static Class __CreateInstance(Class.Internal native) + public static Class __CreateInstance(Class.Internal native, bool skipVTables = false) { - return new Class(native); + return new Class(native, skipVTables); } private static Class.Internal* __CopyValue(Class.Internal native) @@ -6910,16 +7093,20 @@ namespace CppSharp return (Class.Internal*) ret; } - private Class(Class.Internal native) - : this(__CopyValue(native)) + private Class(Class.Internal native, bool skipVTables = false) + : this(__CopyValue(native), skipVTables) { __ownsNativeInstance = true; NativeToManagedMap[__Instance] = this; } - protected Class(Class.Internal* native, bool isInternalImpl = false) - : base((CppSharp.Parser.AST.DeclarationContext.Internal*) native) + protected Class(Class.Internal* native, bool skipVTables = false) + : base((CppSharp.Parser.AST.DeclarationContext.Internal*) null) { + __PointerAdjustment = 0; + if (native == null) + return; + __Instance = new global::System.IntPtr(native); } public Class() @@ -6927,8 +7114,8 @@ namespace CppSharp { __Instance = Marshal.AllocHGlobal(268); __ownsNativeInstance = true; - Internal.ctor_0(__Instance); NativeToManagedMap[__Instance] = this; + Internal.ctor_0((__Instance + __PointerAdjustment)); } public Class(CppSharp.Parser.AST.Class _0) @@ -6936,14 +7123,14 @@ namespace CppSharp { __Instance = Marshal.AllocHGlobal(268); __ownsNativeInstance = true; - var arg0 = ReferenceEquals(_0, null) ? global::System.IntPtr.Zero : _0.__Instance; - Internal.cctor_1(__Instance, arg0); NativeToManagedMap[__Instance] = this; + var arg0 = ReferenceEquals(_0, null) ? global::System.IntPtr.Zero : _0.__Instance; + Internal.cctor_1((__Instance + __PointerAdjustment), arg0); } public CppSharp.Parser.AST.BaseClassSpecifier getBases(uint i) { - var __ret = Internal.getBases_0(__Instance, i); + var __ret = Internal.getBases_0((__Instance + __PointerAdjustment), i); CppSharp.Parser.AST.BaseClassSpecifier __result0; if (__ret == IntPtr.Zero) __result0 = null; else if (CppSharp.Parser.AST.BaseClassSpecifier.NativeToManagedMap.ContainsKey(__ret)) @@ -6955,17 +7142,17 @@ namespace CppSharp public void addBases(CppSharp.Parser.AST.BaseClassSpecifier s) { var arg0 = ReferenceEquals(s, null) ? global::System.IntPtr.Zero : s.__Instance; - Internal.addBases_0(__Instance, arg0); + Internal.addBases_0((__Instance + __PointerAdjustment), arg0); } public void clearBases() { - Internal.clearBases_0(__Instance); + Internal.clearBases_0((__Instance + __PointerAdjustment)); } public CppSharp.Parser.AST.Field getFields(uint i) { - var __ret = Internal.getFields_0(__Instance, i); + var __ret = Internal.getFields_0((__Instance + __PointerAdjustment), i); CppSharp.Parser.AST.Field __result0; if (__ret == IntPtr.Zero) __result0 = null; else if (CppSharp.Parser.AST.Field.NativeToManagedMap.ContainsKey(__ret)) @@ -6977,17 +7164,17 @@ namespace CppSharp public void addFields(CppSharp.Parser.AST.Field s) { var arg0 = ReferenceEquals(s, null) ? global::System.IntPtr.Zero : s.__Instance; - Internal.addFields_0(__Instance, arg0); + Internal.addFields_0((__Instance + __PointerAdjustment), arg0); } public void clearFields() { - Internal.clearFields_0(__Instance); + Internal.clearFields_0((__Instance + __PointerAdjustment)); } public CppSharp.Parser.AST.Method getMethods(uint i) { - var __ret = Internal.getMethods_0(__Instance, i); + var __ret = Internal.getMethods_0((__Instance + __PointerAdjustment), i); CppSharp.Parser.AST.Method __result0; if (__ret == IntPtr.Zero) __result0 = null; else if (CppSharp.Parser.AST.Method.NativeToManagedMap.ContainsKey(__ret)) @@ -6999,17 +7186,17 @@ namespace CppSharp public void addMethods(CppSharp.Parser.AST.Method s) { var arg0 = ReferenceEquals(s, null) ? global::System.IntPtr.Zero : s.__Instance; - Internal.addMethods_0(__Instance, arg0); + Internal.addMethods_0((__Instance + __PointerAdjustment), arg0); } public void clearMethods() { - Internal.clearMethods_0(__Instance); + Internal.clearMethods_0((__Instance + __PointerAdjustment)); } public CppSharp.Parser.AST.AccessSpecifierDecl getSpecifiers(uint i) { - var __ret = Internal.getSpecifiers_0(__Instance, i); + var __ret = Internal.getSpecifiers_0((__Instance + __PointerAdjustment), i); CppSharp.Parser.AST.AccessSpecifierDecl __result0; if (__ret == IntPtr.Zero) __result0 = null; else if (CppSharp.Parser.AST.AccessSpecifierDecl.NativeToManagedMap.ContainsKey(__ret)) @@ -7021,19 +7208,19 @@ namespace CppSharp public void addSpecifiers(CppSharp.Parser.AST.AccessSpecifierDecl s) { var arg0 = ReferenceEquals(s, null) ? global::System.IntPtr.Zero : s.__Instance; - Internal.addSpecifiers_0(__Instance, arg0); + Internal.addSpecifiers_0((__Instance + __PointerAdjustment), arg0); } public void clearSpecifiers() { - Internal.clearSpecifiers_0(__Instance); + Internal.clearSpecifiers_0((__Instance + __PointerAdjustment)); } public uint BasesCount { get { - var __ret = Internal.getBasesCount_0(__Instance); + var __ret = Internal.getBasesCount_0((__Instance + __PointerAdjustment)); return __ret; } } @@ -7042,7 +7229,7 @@ namespace CppSharp { get { - var __ret = Internal.getFieldsCount_0(__Instance); + var __ret = Internal.getFieldsCount_0((__Instance + __PointerAdjustment)); return __ret; } } @@ -7051,7 +7238,7 @@ namespace CppSharp { get { - var __ret = Internal.getMethodsCount_0(__Instance); + var __ret = Internal.getMethodsCount_0((__Instance + __PointerAdjustment)); return __ret; } } @@ -7060,7 +7247,7 @@ namespace CppSharp { get { - var __ret = Internal.getSpecifiersCount_0(__Instance); + var __ret = Internal.getSpecifiersCount_0((__Instance + __PointerAdjustment)); return __ret; } } @@ -7286,14 +7473,14 @@ namespace CppSharp internal static extern uint getParametersCount_0(global::System.IntPtr instance); } - public static new Template __CreateInstance(global::System.IntPtr native, bool ownsNativeInstance = false) + public static new Template __CreateInstance(global::System.IntPtr native, bool ownsNativeInstance = false, bool skipVTables = false) { - return new Template((Template.Internal*) native) { __ownsNativeInstance = ownsNativeInstance }; + return new Template((Template.Internal*) native, skipVTables) { __ownsNativeInstance = ownsNativeInstance }; } - public static Template __CreateInstance(Template.Internal native) + public static Template __CreateInstance(Template.Internal native, bool skipVTables = false) { - return new Template(native); + return new Template(native, skipVTables); } private static Template.Internal* __CopyValue(Template.Internal native) @@ -7303,16 +7490,20 @@ namespace CppSharp return (Template.Internal*) ret; } - private Template(Template.Internal native) - : this(__CopyValue(native)) + private Template(Template.Internal native, bool skipVTables = false) + : this(__CopyValue(native), skipVTables) { __ownsNativeInstance = true; NativeToManagedMap[__Instance] = this; } - protected Template(Template.Internal* native, bool isInternalImpl = false) - : base((CppSharp.Parser.AST.Declaration.Internal*) native) + protected Template(Template.Internal* native, bool skipVTables = false) + : base((CppSharp.Parser.AST.Declaration.Internal*) null) { + __PointerAdjustment = 0; + if (native == null) + return; + __Instance = new global::System.IntPtr(native); } public Template(CppSharp.Parser.AST.DeclarationKind kind) @@ -7320,9 +7511,9 @@ namespace CppSharp { __Instance = Marshal.AllocHGlobal(108); __ownsNativeInstance = true; - var arg0 = kind; - Internal.ctor_0(__Instance, arg0); NativeToManagedMap[__Instance] = this; + var arg0 = kind; + Internal.ctor_0((__Instance + __PointerAdjustment), arg0); } public Template() @@ -7330,8 +7521,8 @@ namespace CppSharp { __Instance = Marshal.AllocHGlobal(108); __ownsNativeInstance = true; - Internal.ctor_1(__Instance); NativeToManagedMap[__Instance] = this; + Internal.ctor_1((__Instance + __PointerAdjustment)); } public Template(CppSharp.Parser.AST.Template _0) @@ -7339,34 +7530,34 @@ namespace CppSharp { __Instance = Marshal.AllocHGlobal(108); __ownsNativeInstance = true; - var arg0 = ReferenceEquals(_0, null) ? global::System.IntPtr.Zero : _0.__Instance; - Internal.cctor_3(__Instance, arg0); NativeToManagedMap[__Instance] = this; + var arg0 = ReferenceEquals(_0, null) ? global::System.IntPtr.Zero : _0.__Instance; + Internal.cctor_3((__Instance + __PointerAdjustment), arg0); } public CppSharp.Parser.AST.TemplateParameter getParameters(uint i) { var __ret = new CppSharp.Parser.AST.TemplateParameter.Internal(); - Internal.getParameters_0(new IntPtr(&__ret), __Instance, i); + Internal.getParameters_0(new IntPtr(&__ret), (__Instance + __PointerAdjustment), i); return CppSharp.Parser.AST.TemplateParameter.__CreateInstance(__ret); } public void addParameters(CppSharp.Parser.AST.TemplateParameter s) { var arg0 = ReferenceEquals(s, null) ? global::System.IntPtr.Zero : s.__Instance; - Internal.addParameters_0(__Instance, arg0); + Internal.addParameters_0((__Instance + __PointerAdjustment), arg0); } public void clearParameters() { - Internal.clearParameters_0(__Instance); + Internal.clearParameters_0((__Instance + __PointerAdjustment)); } public uint ParametersCount { get { - var __ret = Internal.getParametersCount_0(__Instance); + var __ret = Internal.getParametersCount_0((__Instance + __PointerAdjustment)); return __ret; } } @@ -7470,14 +7661,14 @@ namespace CppSharp internal static extern uint getSpecializationsCount_0(global::System.IntPtr instance); } - public static new ClassTemplate __CreateInstance(global::System.IntPtr native, bool ownsNativeInstance = false) + public static new ClassTemplate __CreateInstance(global::System.IntPtr native, bool ownsNativeInstance = false, bool skipVTables = false) { - return new ClassTemplate((ClassTemplate.Internal*) native) { __ownsNativeInstance = ownsNativeInstance }; + return new ClassTemplate((ClassTemplate.Internal*) native, skipVTables) { __ownsNativeInstance = ownsNativeInstance }; } - public static ClassTemplate __CreateInstance(ClassTemplate.Internal native) + public static ClassTemplate __CreateInstance(ClassTemplate.Internal native, bool skipVTables = false) { - return new ClassTemplate(native); + return new ClassTemplate(native, skipVTables); } private static ClassTemplate.Internal* __CopyValue(ClassTemplate.Internal native) @@ -7487,16 +7678,20 @@ namespace CppSharp return (ClassTemplate.Internal*) ret; } - private ClassTemplate(ClassTemplate.Internal native) - : this(__CopyValue(native)) + private ClassTemplate(ClassTemplate.Internal native, bool skipVTables = false) + : this(__CopyValue(native), skipVTables) { __ownsNativeInstance = true; NativeToManagedMap[__Instance] = this; } - protected ClassTemplate(ClassTemplate.Internal* native, bool isInternalImpl = false) - : base((CppSharp.Parser.AST.Template.Internal*) native) + protected ClassTemplate(ClassTemplate.Internal* native, bool skipVTables = false) + : base((CppSharp.Parser.AST.Template.Internal*) null) { + __PointerAdjustment = 0; + if (native == null) + return; + __Instance = new global::System.IntPtr(native); } public ClassTemplate() @@ -7504,8 +7699,8 @@ namespace CppSharp { __Instance = Marshal.AllocHGlobal(120); __ownsNativeInstance = true; - Internal.ctor_0(__Instance); NativeToManagedMap[__Instance] = this; + Internal.ctor_0((__Instance + __PointerAdjustment)); } public ClassTemplate(CppSharp.Parser.AST.ClassTemplate _0) @@ -7513,14 +7708,14 @@ namespace CppSharp { __Instance = Marshal.AllocHGlobal(120); __ownsNativeInstance = true; - var arg0 = ReferenceEquals(_0, null) ? global::System.IntPtr.Zero : _0.__Instance; - Internal.cctor_2(__Instance, arg0); NativeToManagedMap[__Instance] = this; + var arg0 = ReferenceEquals(_0, null) ? global::System.IntPtr.Zero : _0.__Instance; + Internal.cctor_2((__Instance + __PointerAdjustment), arg0); } public CppSharp.Parser.AST.ClassTemplateSpecialization getSpecializations(uint i) { - var __ret = Internal.getSpecializations_0(__Instance, i); + var __ret = Internal.getSpecializations_0((__Instance + __PointerAdjustment), i); CppSharp.Parser.AST.ClassTemplateSpecialization __result0; if (__ret == IntPtr.Zero) __result0 = null; else if (CppSharp.Parser.AST.ClassTemplateSpecialization.NativeToManagedMap.ContainsKey(__ret)) @@ -7532,19 +7727,19 @@ namespace CppSharp public void addSpecializations(CppSharp.Parser.AST.ClassTemplateSpecialization s) { var arg0 = ReferenceEquals(s, null) ? global::System.IntPtr.Zero : s.__Instance; - Internal.addSpecializations_0(__Instance, arg0); + Internal.addSpecializations_0((__Instance + __PointerAdjustment), arg0); } public void clearSpecializations() { - Internal.clearSpecializations_0(__Instance); + Internal.clearSpecializations_0((__Instance + __PointerAdjustment)); } public uint SpecializationsCount { get { - var __ret = Internal.getSpecializationsCount_0(__Instance); + var __ret = Internal.getSpecializationsCount_0((__Instance + __PointerAdjustment)); return __ret; } } @@ -7666,14 +7861,14 @@ namespace CppSharp internal static extern uint getArgumentsCount_0(global::System.IntPtr instance); } - public static new ClassTemplateSpecialization __CreateInstance(global::System.IntPtr native, bool ownsNativeInstance = false) + public static new ClassTemplateSpecialization __CreateInstance(global::System.IntPtr native, bool ownsNativeInstance = false, bool skipVTables = false) { - return new ClassTemplateSpecialization((ClassTemplateSpecialization.Internal*) native) { __ownsNativeInstance = ownsNativeInstance }; + return new ClassTemplateSpecialization((ClassTemplateSpecialization.Internal*) native, skipVTables) { __ownsNativeInstance = ownsNativeInstance }; } - public static ClassTemplateSpecialization __CreateInstance(ClassTemplateSpecialization.Internal native) + public static ClassTemplateSpecialization __CreateInstance(ClassTemplateSpecialization.Internal native, bool skipVTables = false) { - return new ClassTemplateSpecialization(native); + return new ClassTemplateSpecialization(native, skipVTables); } private static ClassTemplateSpecialization.Internal* __CopyValue(ClassTemplateSpecialization.Internal native) @@ -7683,16 +7878,20 @@ namespace CppSharp return (ClassTemplateSpecialization.Internal*) ret; } - private ClassTemplateSpecialization(ClassTemplateSpecialization.Internal native) - : this(__CopyValue(native)) + private ClassTemplateSpecialization(ClassTemplateSpecialization.Internal native, bool skipVTables = false) + : this(__CopyValue(native), skipVTables) { __ownsNativeInstance = true; NativeToManagedMap[__Instance] = this; } - protected ClassTemplateSpecialization(ClassTemplateSpecialization.Internal* native, bool isInternalImpl = false) - : base((CppSharp.Parser.AST.Class.Internal*) native) + protected ClassTemplateSpecialization(ClassTemplateSpecialization.Internal* native, bool skipVTables = false) + : base((CppSharp.Parser.AST.Class.Internal*) null) { + __PointerAdjustment = 0; + if (native == null) + return; + __Instance = new global::System.IntPtr(native); } public ClassTemplateSpecialization() @@ -7700,8 +7899,8 @@ namespace CppSharp { __Instance = Marshal.AllocHGlobal(288); __ownsNativeInstance = true; - Internal.ctor_0(__Instance); NativeToManagedMap[__Instance] = this; + Internal.ctor_0((__Instance + __PointerAdjustment)); } public ClassTemplateSpecialization(CppSharp.Parser.AST.ClassTemplateSpecialization _0) @@ -7709,34 +7908,34 @@ namespace CppSharp { __Instance = Marshal.AllocHGlobal(288); __ownsNativeInstance = true; - var arg0 = ReferenceEquals(_0, null) ? global::System.IntPtr.Zero : _0.__Instance; - Internal.cctor_2(__Instance, arg0); NativeToManagedMap[__Instance] = this; + var arg0 = ReferenceEquals(_0, null) ? global::System.IntPtr.Zero : _0.__Instance; + Internal.cctor_2((__Instance + __PointerAdjustment), arg0); } public CppSharp.Parser.AST.TemplateArgument getArguments(uint i) { var __ret = new CppSharp.Parser.AST.TemplateArgument.Internal(); - Internal.getArguments_0(new IntPtr(&__ret), __Instance, i); + Internal.getArguments_0(new IntPtr(&__ret), (__Instance + __PointerAdjustment), i); return CppSharp.Parser.AST.TemplateArgument.__CreateInstance(__ret); } public void addArguments(CppSharp.Parser.AST.TemplateArgument s) { var arg0 = ReferenceEquals(s, null) ? global::System.IntPtr.Zero : s.__Instance; - Internal.addArguments_0(__Instance, arg0); + Internal.addArguments_0((__Instance + __PointerAdjustment), arg0); } public void clearArguments() { - Internal.clearArguments_0(__Instance); + Internal.clearArguments_0((__Instance + __PointerAdjustment)); } public uint ArgumentsCount { get { - var __ret = Internal.getArgumentsCount_0(__Instance); + var __ret = Internal.getArgumentsCount_0((__Instance + __PointerAdjustment)); return __ret; } } @@ -7869,14 +8068,14 @@ namespace CppSharp internal static extern void dtor_0(global::System.IntPtr instance); } - public static new ClassTemplatePartialSpecialization __CreateInstance(global::System.IntPtr native, bool ownsNativeInstance = false) + public static new ClassTemplatePartialSpecialization __CreateInstance(global::System.IntPtr native, bool ownsNativeInstance = false, bool skipVTables = false) { - return new ClassTemplatePartialSpecialization((ClassTemplatePartialSpecialization.Internal*) native) { __ownsNativeInstance = ownsNativeInstance }; + return new ClassTemplatePartialSpecialization((ClassTemplatePartialSpecialization.Internal*) native, skipVTables) { __ownsNativeInstance = ownsNativeInstance }; } - public static ClassTemplatePartialSpecialization __CreateInstance(ClassTemplatePartialSpecialization.Internal native) + public static ClassTemplatePartialSpecialization __CreateInstance(ClassTemplatePartialSpecialization.Internal native, bool skipVTables = false) { - return new ClassTemplatePartialSpecialization(native); + return new ClassTemplatePartialSpecialization(native, skipVTables); } private static ClassTemplatePartialSpecialization.Internal* __CopyValue(ClassTemplatePartialSpecialization.Internal native) @@ -7886,16 +8085,20 @@ namespace CppSharp return (ClassTemplatePartialSpecialization.Internal*) ret; } - private ClassTemplatePartialSpecialization(ClassTemplatePartialSpecialization.Internal native) - : this(__CopyValue(native)) + private ClassTemplatePartialSpecialization(ClassTemplatePartialSpecialization.Internal native, bool skipVTables = false) + : this(__CopyValue(native), skipVTables) { __ownsNativeInstance = true; NativeToManagedMap[__Instance] = this; } - protected ClassTemplatePartialSpecialization(ClassTemplatePartialSpecialization.Internal* native, bool isInternalImpl = false) - : base((CppSharp.Parser.AST.ClassTemplateSpecialization.Internal*) native) + protected ClassTemplatePartialSpecialization(ClassTemplatePartialSpecialization.Internal* native, bool skipVTables = false) + : base((CppSharp.Parser.AST.ClassTemplateSpecialization.Internal*) null) { + __PointerAdjustment = 0; + if (native == null) + return; + __Instance = new global::System.IntPtr(native); } public ClassTemplatePartialSpecialization() @@ -7903,8 +8106,8 @@ namespace CppSharp { __Instance = Marshal.AllocHGlobal(288); __ownsNativeInstance = true; - Internal.ctor_0(__Instance); NativeToManagedMap[__Instance] = this; + Internal.ctor_0((__Instance + __PointerAdjustment)); } public ClassTemplatePartialSpecialization(CppSharp.Parser.AST.ClassTemplatePartialSpecialization _0) @@ -7912,9 +8115,9 @@ namespace CppSharp { __Instance = Marshal.AllocHGlobal(288); __ownsNativeInstance = true; - var arg0 = ReferenceEquals(_0, null) ? global::System.IntPtr.Zero : _0.__Instance; - Internal.cctor_1(__Instance, arg0); NativeToManagedMap[__Instance] = this; + var arg0 = ReferenceEquals(_0, null) ? global::System.IntPtr.Zero : _0.__Instance; + Internal.cctor_1((__Instance + __PointerAdjustment), arg0); } } @@ -7998,14 +8201,14 @@ namespace CppSharp internal static extern uint getSpecializationsCount_0(global::System.IntPtr instance); } - public static new FunctionTemplate __CreateInstance(global::System.IntPtr native, bool ownsNativeInstance = false) + public static new FunctionTemplate __CreateInstance(global::System.IntPtr native, bool ownsNativeInstance = false, bool skipVTables = false) { - return new FunctionTemplate((FunctionTemplate.Internal*) native) { __ownsNativeInstance = ownsNativeInstance }; + return new FunctionTemplate((FunctionTemplate.Internal*) native, skipVTables) { __ownsNativeInstance = ownsNativeInstance }; } - public static FunctionTemplate __CreateInstance(FunctionTemplate.Internal native) + public static FunctionTemplate __CreateInstance(FunctionTemplate.Internal native, bool skipVTables = false) { - return new FunctionTemplate(native); + return new FunctionTemplate(native, skipVTables); } private static FunctionTemplate.Internal* __CopyValue(FunctionTemplate.Internal native) @@ -8015,16 +8218,20 @@ namespace CppSharp return (FunctionTemplate.Internal*) ret; } - private FunctionTemplate(FunctionTemplate.Internal native) - : this(__CopyValue(native)) + private FunctionTemplate(FunctionTemplate.Internal native, bool skipVTables = false) + : this(__CopyValue(native), skipVTables) { __ownsNativeInstance = true; NativeToManagedMap[__Instance] = this; } - protected FunctionTemplate(FunctionTemplate.Internal* native, bool isInternalImpl = false) - : base((CppSharp.Parser.AST.Template.Internal*) native) + protected FunctionTemplate(FunctionTemplate.Internal* native, bool skipVTables = false) + : base((CppSharp.Parser.AST.Template.Internal*) null) { + __PointerAdjustment = 0; + if (native == null) + return; + __Instance = new global::System.IntPtr(native); } public FunctionTemplate() @@ -8032,8 +8239,8 @@ namespace CppSharp { __Instance = Marshal.AllocHGlobal(120); __ownsNativeInstance = true; - Internal.ctor_0(__Instance); NativeToManagedMap[__Instance] = this; + Internal.ctor_0((__Instance + __PointerAdjustment)); } public FunctionTemplate(CppSharp.Parser.AST.FunctionTemplate _0) @@ -8041,14 +8248,14 @@ namespace CppSharp { __Instance = Marshal.AllocHGlobal(120); __ownsNativeInstance = true; - var arg0 = ReferenceEquals(_0, null) ? global::System.IntPtr.Zero : _0.__Instance; - Internal.cctor_2(__Instance, arg0); NativeToManagedMap[__Instance] = this; + var arg0 = ReferenceEquals(_0, null) ? global::System.IntPtr.Zero : _0.__Instance; + Internal.cctor_2((__Instance + __PointerAdjustment), arg0); } public CppSharp.Parser.AST.FunctionTemplateSpecialization getSpecializations(uint i) { - var __ret = Internal.getSpecializations_0(__Instance, i); + var __ret = Internal.getSpecializations_0((__Instance + __PointerAdjustment), i); CppSharp.Parser.AST.FunctionTemplateSpecialization __result0; if (__ret == IntPtr.Zero) __result0 = null; else if (CppSharp.Parser.AST.FunctionTemplateSpecialization.NativeToManagedMap.ContainsKey(__ret)) @@ -8060,19 +8267,19 @@ namespace CppSharp public void addSpecializations(CppSharp.Parser.AST.FunctionTemplateSpecialization s) { var arg0 = ReferenceEquals(s, null) ? global::System.IntPtr.Zero : s.__Instance; - Internal.addSpecializations_0(__Instance, arg0); + Internal.addSpecializations_0((__Instance + __PointerAdjustment), arg0); } public void clearSpecializations() { - Internal.clearSpecializations_0(__Instance); + Internal.clearSpecializations_0((__Instance + __PointerAdjustment)); } public uint SpecializationsCount { get { - var __ret = Internal.getSpecializationsCount_0(__Instance); + var __ret = Internal.getSpecializationsCount_0((__Instance + __PointerAdjustment)); return __ret; } } @@ -8129,19 +8336,21 @@ namespace CppSharp } public global::System.IntPtr __Instance { get; protected set; } + + protected int __PointerAdjustment; public static readonly System.Collections.Concurrent.ConcurrentDictionary NativeToManagedMap = new System.Collections.Concurrent.ConcurrentDictionary(); protected void*[] __OriginalVTables; protected bool __ownsNativeInstance; - public static FunctionTemplateSpecialization __CreateInstance(global::System.IntPtr native, bool ownsNativeInstance = false) + public static FunctionTemplateSpecialization __CreateInstance(global::System.IntPtr native, bool ownsNativeInstance = false, bool skipVTables = false) { - return new FunctionTemplateSpecialization((FunctionTemplateSpecialization.Internal*) native) { __ownsNativeInstance = ownsNativeInstance }; + return new FunctionTemplateSpecialization((FunctionTemplateSpecialization.Internal*) native, skipVTables) { __ownsNativeInstance = ownsNativeInstance }; } - public static FunctionTemplateSpecialization __CreateInstance(FunctionTemplateSpecialization.Internal native) + public static FunctionTemplateSpecialization __CreateInstance(FunctionTemplateSpecialization.Internal native, bool skipVTables = false) { - return new FunctionTemplateSpecialization(native); + return new FunctionTemplateSpecialization(native, skipVTables); } private static FunctionTemplateSpecialization.Internal* __CopyValue(FunctionTemplateSpecialization.Internal native) @@ -8151,15 +8360,17 @@ namespace CppSharp return (FunctionTemplateSpecialization.Internal*) ret; } - private FunctionTemplateSpecialization(FunctionTemplateSpecialization.Internal native) - : this(__CopyValue(native)) + private FunctionTemplateSpecialization(FunctionTemplateSpecialization.Internal native, bool skipVTables = false) + : this(__CopyValue(native), skipVTables) { __ownsNativeInstance = true; NativeToManagedMap[__Instance] = this; } - protected FunctionTemplateSpecialization(FunctionTemplateSpecialization.Internal* native, bool isInternalImpl = false) + protected FunctionTemplateSpecialization(FunctionTemplateSpecialization.Internal* native, bool skipVTables = false) { + if (native == null) + return; __Instance = new global::System.IntPtr(native); } @@ -8167,17 +8378,17 @@ namespace CppSharp { __Instance = Marshal.AllocHGlobal(24); __ownsNativeInstance = true; - Internal.ctor_0(__Instance); NativeToManagedMap[__Instance] = this; + Internal.ctor_0((__Instance + __PointerAdjustment)); } public FunctionTemplateSpecialization(CppSharp.Parser.AST.FunctionTemplateSpecialization _0) { __Instance = Marshal.AllocHGlobal(24); __ownsNativeInstance = true; - var arg0 = ReferenceEquals(_0, null) ? global::System.IntPtr.Zero : _0.__Instance; - Internal.cctor_2(__Instance, arg0); NativeToManagedMap[__Instance] = this; + var arg0 = ReferenceEquals(_0, null) ? global::System.IntPtr.Zero : _0.__Instance; + Internal.cctor_2((__Instance + __PointerAdjustment), arg0); } public void Dispose() @@ -8191,33 +8402,34 @@ namespace CppSharp throw new global::System.InvalidOperationException("Managed instances owned by native code cannot be disposed of."); CppSharp.Parser.AST.FunctionTemplateSpecialization __dummy; NativeToManagedMap.TryRemove(__Instance, out __dummy); - Internal.dtor_0(__Instance); - Marshal.FreeHGlobal(__Instance); + Internal.dtor_0((__Instance + __PointerAdjustment)); + if (__ownsNativeInstance) + Marshal.FreeHGlobal(__Instance); } public CppSharp.Parser.AST.TemplateArgument getArguments(uint i) { var __ret = new CppSharp.Parser.AST.TemplateArgument.Internal(); - Internal.getArguments_0(new IntPtr(&__ret), __Instance, i); + Internal.getArguments_0(new IntPtr(&__ret), (__Instance + __PointerAdjustment), i); return CppSharp.Parser.AST.TemplateArgument.__CreateInstance(__ret); } public void addArguments(CppSharp.Parser.AST.TemplateArgument s) { var arg0 = ReferenceEquals(s, null) ? global::System.IntPtr.Zero : s.__Instance; - Internal.addArguments_0(__Instance, arg0); + Internal.addArguments_0((__Instance + __PointerAdjustment), arg0); } public void clearArguments() { - Internal.clearArguments_0(__Instance); + Internal.clearArguments_0((__Instance + __PointerAdjustment)); } public uint ArgumentsCount { get { - var __ret = Internal.getArgumentsCount_0(__Instance); + var __ret = Internal.getArgumentsCount_0((__Instance + __PointerAdjustment)); return __ret; } } @@ -8335,14 +8547,14 @@ namespace CppSharp internal static extern void dtor_0(global::System.IntPtr instance); } - public static new Namespace __CreateInstance(global::System.IntPtr native, bool ownsNativeInstance = false) + public static new Namespace __CreateInstance(global::System.IntPtr native, bool ownsNativeInstance = false, bool skipVTables = false) { - return new Namespace((Namespace.Internal*) native) { __ownsNativeInstance = ownsNativeInstance }; + return new Namespace((Namespace.Internal*) native, skipVTables) { __ownsNativeInstance = ownsNativeInstance }; } - public static Namespace __CreateInstance(Namespace.Internal native) + public static Namespace __CreateInstance(Namespace.Internal native, bool skipVTables = false) { - return new Namespace(native); + return new Namespace(native, skipVTables); } private static Namespace.Internal* __CopyValue(Namespace.Internal native) @@ -8352,16 +8564,20 @@ namespace CppSharp return (Namespace.Internal*) ret; } - private Namespace(Namespace.Internal native) - : this(__CopyValue(native)) + private Namespace(Namespace.Internal native, bool skipVTables = false) + : this(__CopyValue(native), skipVTables) { __ownsNativeInstance = true; NativeToManagedMap[__Instance] = this; } - protected Namespace(Namespace.Internal* native, bool isInternalImpl = false) - : base((CppSharp.Parser.AST.DeclarationContext.Internal*) native) + protected Namespace(Namespace.Internal* native, bool skipVTables = false) + : base((CppSharp.Parser.AST.DeclarationContext.Internal*) null) { + __PointerAdjustment = 0; + if (native == null) + return; + __Instance = new global::System.IntPtr(native); } public Namespace() @@ -8369,8 +8585,8 @@ namespace CppSharp { __Instance = Marshal.AllocHGlobal(204); __ownsNativeInstance = true; - Internal.ctor_0(__Instance); NativeToManagedMap[__Instance] = this; + Internal.ctor_0((__Instance + __PointerAdjustment)); } public Namespace(CppSharp.Parser.AST.Namespace _0) @@ -8378,9 +8594,9 @@ namespace CppSharp { __Instance = Marshal.AllocHGlobal(204); __ownsNativeInstance = true; - var arg0 = ReferenceEquals(_0, null) ? global::System.IntPtr.Zero : _0.__Instance; - Internal.cctor_1(__Instance, arg0); NativeToManagedMap[__Instance] = this; + var arg0 = ReferenceEquals(_0, null) ? global::System.IntPtr.Zero : _0.__Instance; + Internal.cctor_1((__Instance + __PointerAdjustment), arg0); } public bool IsInline @@ -8457,14 +8673,14 @@ namespace CppSharp internal static extern void dtor_0(global::System.IntPtr instance); } - public static new PreprocessedEntity __CreateInstance(global::System.IntPtr native, bool ownsNativeInstance = false) + public static new PreprocessedEntity __CreateInstance(global::System.IntPtr native, bool ownsNativeInstance = false, bool skipVTables = false) { - return new PreprocessedEntity((PreprocessedEntity.Internal*) native) { __ownsNativeInstance = ownsNativeInstance }; + return new PreprocessedEntity((PreprocessedEntity.Internal*) native, skipVTables) { __ownsNativeInstance = ownsNativeInstance }; } - public static PreprocessedEntity __CreateInstance(PreprocessedEntity.Internal native) + public static PreprocessedEntity __CreateInstance(PreprocessedEntity.Internal native, bool skipVTables = false) { - return new PreprocessedEntity(native); + return new PreprocessedEntity(native, skipVTables); } private static PreprocessedEntity.Internal* __CopyValue(PreprocessedEntity.Internal native) @@ -8474,16 +8690,20 @@ namespace CppSharp return (PreprocessedEntity.Internal*) ret; } - private PreprocessedEntity(PreprocessedEntity.Internal native) - : this(__CopyValue(native)) + private PreprocessedEntity(PreprocessedEntity.Internal native, bool skipVTables = false) + : this(__CopyValue(native), skipVTables) { __ownsNativeInstance = true; NativeToManagedMap[__Instance] = this; } - protected PreprocessedEntity(PreprocessedEntity.Internal* native, bool isInternalImpl = false) - : base((CppSharp.Parser.AST.Declaration.Internal*) native) + protected PreprocessedEntity(PreprocessedEntity.Internal* native, bool skipVTables = false) + : base((CppSharp.Parser.AST.Declaration.Internal*) null) { + __PointerAdjustment = 0; + if (native == null) + return; + __Instance = new global::System.IntPtr(native); } public PreprocessedEntity() @@ -8491,8 +8711,8 @@ namespace CppSharp { __Instance = Marshal.AllocHGlobal(96); __ownsNativeInstance = true; - Internal.ctor_0(__Instance); NativeToManagedMap[__Instance] = this; + Internal.ctor_0((__Instance + __PointerAdjustment)); } public PreprocessedEntity(CppSharp.Parser.AST.PreprocessedEntity _0) @@ -8500,9 +8720,9 @@ namespace CppSharp { __Instance = Marshal.AllocHGlobal(96); __ownsNativeInstance = true; - var arg0 = ReferenceEquals(_0, null) ? global::System.IntPtr.Zero : _0.__Instance; - Internal.cctor_2(__Instance, arg0); NativeToManagedMap[__Instance] = this; + var arg0 = ReferenceEquals(_0, null) ? global::System.IntPtr.Zero : _0.__Instance; + Internal.cctor_2((__Instance + __PointerAdjustment), arg0); } public CppSharp.Parser.AST.MacroLocation MacroLocation @@ -8589,14 +8809,14 @@ namespace CppSharp internal static extern void setExpression_0(global::System.IntPtr instance, global::System.IntPtr s); } - public static new MacroDefinition __CreateInstance(global::System.IntPtr native, bool ownsNativeInstance = false) + public static new MacroDefinition __CreateInstance(global::System.IntPtr native, bool ownsNativeInstance = false, bool skipVTables = false) { - return new MacroDefinition((MacroDefinition.Internal*) native) { __ownsNativeInstance = ownsNativeInstance }; + return new MacroDefinition((MacroDefinition.Internal*) native, skipVTables) { __ownsNativeInstance = ownsNativeInstance }; } - public static MacroDefinition __CreateInstance(MacroDefinition.Internal native) + public static MacroDefinition __CreateInstance(MacroDefinition.Internal native, bool skipVTables = false) { - return new MacroDefinition(native); + return new MacroDefinition(native, skipVTables); } private static MacroDefinition.Internal* __CopyValue(MacroDefinition.Internal native) @@ -8606,16 +8826,20 @@ namespace CppSharp return (MacroDefinition.Internal*) ret; } - private MacroDefinition(MacroDefinition.Internal native) - : this(__CopyValue(native)) + private MacroDefinition(MacroDefinition.Internal native, bool skipVTables = false) + : this(__CopyValue(native), skipVTables) { __ownsNativeInstance = true; NativeToManagedMap[__Instance] = this; } - protected MacroDefinition(MacroDefinition.Internal* native, bool isInternalImpl = false) - : base((CppSharp.Parser.AST.PreprocessedEntity.Internal*) native) + protected MacroDefinition(MacroDefinition.Internal* native, bool skipVTables = false) + : base((CppSharp.Parser.AST.PreprocessedEntity.Internal*) null) { + __PointerAdjustment = 0; + if (native == null) + return; + __Instance = new global::System.IntPtr(native); } public MacroDefinition() @@ -8623,8 +8847,8 @@ namespace CppSharp { __Instance = Marshal.AllocHGlobal(108); __ownsNativeInstance = true; - Internal.ctor_0(__Instance); NativeToManagedMap[__Instance] = this; + Internal.ctor_0((__Instance + __PointerAdjustment)); } public MacroDefinition(CppSharp.Parser.AST.MacroDefinition _0) @@ -8632,23 +8856,23 @@ namespace CppSharp { __Instance = Marshal.AllocHGlobal(108); __ownsNativeInstance = true; - var arg0 = ReferenceEquals(_0, null) ? global::System.IntPtr.Zero : _0.__Instance; - Internal.cctor_2(__Instance, arg0); NativeToManagedMap[__Instance] = this; + var arg0 = ReferenceEquals(_0, null) ? global::System.IntPtr.Zero : _0.__Instance; + Internal.cctor_2((__Instance + __PointerAdjustment), arg0); } public string Expression { get { - var __ret = Internal.getExpression_0(__Instance); + var __ret = Internal.getExpression_0((__Instance + __PointerAdjustment)); return Marshal.PtrToStringAnsi(__ret); } set { var arg0 = Marshal.StringToHGlobalAnsi(value); - Internal.setExpression_0(__Instance, arg0); + Internal.setExpression_0((__Instance + __PointerAdjustment), arg0); Marshal.FreeHGlobal(arg0); } } @@ -8727,14 +8951,14 @@ namespace CppSharp internal static extern void setText_0(global::System.IntPtr instance, global::System.IntPtr s); } - public static new MacroExpansion __CreateInstance(global::System.IntPtr native, bool ownsNativeInstance = false) + public static new MacroExpansion __CreateInstance(global::System.IntPtr native, bool ownsNativeInstance = false, bool skipVTables = false) { - return new MacroExpansion((MacroExpansion.Internal*) native) { __ownsNativeInstance = ownsNativeInstance }; + return new MacroExpansion((MacroExpansion.Internal*) native, skipVTables) { __ownsNativeInstance = ownsNativeInstance }; } - public static MacroExpansion __CreateInstance(MacroExpansion.Internal native) + public static MacroExpansion __CreateInstance(MacroExpansion.Internal native, bool skipVTables = false) { - return new MacroExpansion(native); + return new MacroExpansion(native, skipVTables); } private static MacroExpansion.Internal* __CopyValue(MacroExpansion.Internal native) @@ -8744,16 +8968,20 @@ namespace CppSharp return (MacroExpansion.Internal*) ret; } - private MacroExpansion(MacroExpansion.Internal native) - : this(__CopyValue(native)) + private MacroExpansion(MacroExpansion.Internal native, bool skipVTables = false) + : this(__CopyValue(native), skipVTables) { __ownsNativeInstance = true; NativeToManagedMap[__Instance] = this; } - protected MacroExpansion(MacroExpansion.Internal* native, bool isInternalImpl = false) - : base((CppSharp.Parser.AST.PreprocessedEntity.Internal*) native) + protected MacroExpansion(MacroExpansion.Internal* native, bool skipVTables = false) + : base((CppSharp.Parser.AST.PreprocessedEntity.Internal*) null) { + __PointerAdjustment = 0; + if (native == null) + return; + __Instance = new global::System.IntPtr(native); } public MacroExpansion() @@ -8761,8 +8989,8 @@ namespace CppSharp { __Instance = Marshal.AllocHGlobal(112); __ownsNativeInstance = true; - Internal.ctor_0(__Instance); NativeToManagedMap[__Instance] = this; + Internal.ctor_0((__Instance + __PointerAdjustment)); } public MacroExpansion(CppSharp.Parser.AST.MacroExpansion _0) @@ -8770,23 +8998,23 @@ namespace CppSharp { __Instance = Marshal.AllocHGlobal(112); __ownsNativeInstance = true; - var arg0 = ReferenceEquals(_0, null) ? global::System.IntPtr.Zero : _0.__Instance; - Internal.cctor_2(__Instance, arg0); NativeToManagedMap[__Instance] = this; + var arg0 = ReferenceEquals(_0, null) ? global::System.IntPtr.Zero : _0.__Instance; + Internal.cctor_2((__Instance + __PointerAdjustment), arg0); } public string Text { get { - var __ret = Internal.getText_0(__Instance); + var __ret = Internal.getText_0((__Instance + __PointerAdjustment)); return Marshal.PtrToStringAnsi(__ret); } set { var arg0 = Marshal.StringToHGlobalAnsi(value); - Internal.setText_0(__Instance, arg0); + Internal.setText_0((__Instance + __PointerAdjustment), arg0); Marshal.FreeHGlobal(arg0); } } @@ -8906,14 +9134,14 @@ namespace CppSharp internal static extern uint getMacrosCount_0(global::System.IntPtr instance); } - public static new TranslationUnit __CreateInstance(global::System.IntPtr native, bool ownsNativeInstance = false) + public static new TranslationUnit __CreateInstance(global::System.IntPtr native, bool ownsNativeInstance = false, bool skipVTables = false) { - return new TranslationUnit((TranslationUnit.Internal*) native) { __ownsNativeInstance = ownsNativeInstance }; + return new TranslationUnit((TranslationUnit.Internal*) native, skipVTables) { __ownsNativeInstance = ownsNativeInstance }; } - public static TranslationUnit __CreateInstance(TranslationUnit.Internal native) + public static TranslationUnit __CreateInstance(TranslationUnit.Internal native, bool skipVTables = false) { - return new TranslationUnit(native); + return new TranslationUnit(native, skipVTables); } private static TranslationUnit.Internal* __CopyValue(TranslationUnit.Internal native) @@ -8923,16 +9151,20 @@ namespace CppSharp return (TranslationUnit.Internal*) ret; } - private TranslationUnit(TranslationUnit.Internal native) - : this(__CopyValue(native)) + private TranslationUnit(TranslationUnit.Internal native, bool skipVTables = false) + : this(__CopyValue(native), skipVTables) { __ownsNativeInstance = true; NativeToManagedMap[__Instance] = this; } - protected TranslationUnit(TranslationUnit.Internal* native, bool isInternalImpl = false) - : base((CppSharp.Parser.AST.Namespace.Internal*) native) + protected TranslationUnit(TranslationUnit.Internal* native, bool skipVTables = false) + : base((CppSharp.Parser.AST.Namespace.Internal*) null) { + __PointerAdjustment = 0; + if (native == null) + return; + __Instance = new global::System.IntPtr(native); } public TranslationUnit() @@ -8940,8 +9172,8 @@ namespace CppSharp { __Instance = Marshal.AllocHGlobal(232); __ownsNativeInstance = true; - Internal.ctor_0(__Instance); NativeToManagedMap[__Instance] = this; + Internal.ctor_0((__Instance + __PointerAdjustment)); } public TranslationUnit(CppSharp.Parser.AST.TranslationUnit _0) @@ -8949,14 +9181,14 @@ namespace CppSharp { __Instance = Marshal.AllocHGlobal(232); __ownsNativeInstance = true; - var arg0 = ReferenceEquals(_0, null) ? global::System.IntPtr.Zero : _0.__Instance; - Internal.cctor_2(__Instance, arg0); NativeToManagedMap[__Instance] = this; + var arg0 = ReferenceEquals(_0, null) ? global::System.IntPtr.Zero : _0.__Instance; + Internal.cctor_2((__Instance + __PointerAdjustment), arg0); } public CppSharp.Parser.AST.MacroDefinition getMacros(uint i) { - var __ret = Internal.getMacros_0(__Instance, i); + var __ret = Internal.getMacros_0((__Instance + __PointerAdjustment), i); CppSharp.Parser.AST.MacroDefinition __result0; if (__ret == IntPtr.Zero) __result0 = null; else if (CppSharp.Parser.AST.MacroDefinition.NativeToManagedMap.ContainsKey(__ret)) @@ -8968,26 +9200,26 @@ namespace CppSharp public void addMacros(CppSharp.Parser.AST.MacroDefinition s) { var arg0 = ReferenceEquals(s, null) ? global::System.IntPtr.Zero : s.__Instance; - Internal.addMacros_0(__Instance, arg0); + Internal.addMacros_0((__Instance + __PointerAdjustment), arg0); } public void clearMacros() { - Internal.clearMacros_0(__Instance); + Internal.clearMacros_0((__Instance + __PointerAdjustment)); } public string FileName { get { - var __ret = Internal.getFileName_0(__Instance); + var __ret = Internal.getFileName_0((__Instance + __PointerAdjustment)); return Marshal.PtrToStringAnsi(__ret); } set { var arg0 = Marshal.StringToHGlobalAnsi(value); - Internal.setFileName_0(__Instance, arg0); + Internal.setFileName_0((__Instance + __PointerAdjustment), arg0); Marshal.FreeHGlobal(arg0); } } @@ -8996,7 +9228,7 @@ namespace CppSharp { get { - var __ret = Internal.getMacrosCount_0(__Instance); + var __ret = Internal.getMacrosCount_0((__Instance + __PointerAdjustment)); return __ret; } } @@ -9090,19 +9322,21 @@ namespace CppSharp } public global::System.IntPtr __Instance { get; protected set; } + + protected int __PointerAdjustment; public static readonly System.Collections.Concurrent.ConcurrentDictionary NativeToManagedMap = new System.Collections.Concurrent.ConcurrentDictionary(); protected void*[] __OriginalVTables; protected bool __ownsNativeInstance; - public static NativeLibrary __CreateInstance(global::System.IntPtr native, bool ownsNativeInstance = false) + public static NativeLibrary __CreateInstance(global::System.IntPtr native, bool ownsNativeInstance = false, bool skipVTables = false) { - return new NativeLibrary((NativeLibrary.Internal*) native) { __ownsNativeInstance = ownsNativeInstance }; + return new NativeLibrary((NativeLibrary.Internal*) native, skipVTables) { __ownsNativeInstance = ownsNativeInstance }; } - public static NativeLibrary __CreateInstance(NativeLibrary.Internal native) + public static NativeLibrary __CreateInstance(NativeLibrary.Internal native, bool skipVTables = false) { - return new NativeLibrary(native); + return new NativeLibrary(native, skipVTables); } private static NativeLibrary.Internal* __CopyValue(NativeLibrary.Internal native) @@ -9112,15 +9346,17 @@ namespace CppSharp return (NativeLibrary.Internal*) ret; } - private NativeLibrary(NativeLibrary.Internal native) - : this(__CopyValue(native)) + private NativeLibrary(NativeLibrary.Internal native, bool skipVTables = false) + : this(__CopyValue(native), skipVTables) { __ownsNativeInstance = true; NativeToManagedMap[__Instance] = this; } - protected NativeLibrary(NativeLibrary.Internal* native, bool isInternalImpl = false) + protected NativeLibrary(NativeLibrary.Internal* native, bool skipVTables = false) { + if (native == null) + return; __Instance = new global::System.IntPtr(native); } @@ -9128,17 +9364,17 @@ namespace CppSharp { __Instance = Marshal.AllocHGlobal(40); __ownsNativeInstance = true; - Internal.ctor_0(__Instance); NativeToManagedMap[__Instance] = this; + Internal.ctor_0((__Instance + __PointerAdjustment)); } public NativeLibrary(CppSharp.Parser.AST.NativeLibrary _0) { __Instance = Marshal.AllocHGlobal(40); __ownsNativeInstance = true; - var arg0 = ReferenceEquals(_0, null) ? global::System.IntPtr.Zero : _0.__Instance; - Internal.cctor_2(__Instance, arg0); NativeToManagedMap[__Instance] = this; + var arg0 = ReferenceEquals(_0, null) ? global::System.IntPtr.Zero : _0.__Instance; + Internal.cctor_2((__Instance + __PointerAdjustment), arg0); } public void Dispose() @@ -9152,58 +9388,59 @@ namespace CppSharp throw new global::System.InvalidOperationException("Managed instances owned by native code cannot be disposed of."); CppSharp.Parser.AST.NativeLibrary __dummy; NativeToManagedMap.TryRemove(__Instance, out __dummy); - Internal.dtor_0(__Instance); - Marshal.FreeHGlobal(__Instance); + Internal.dtor_0((__Instance + __PointerAdjustment)); + if (__ownsNativeInstance) + Marshal.FreeHGlobal(__Instance); } public string getSymbols(uint i) { - var __ret = Internal.getSymbols_0(__Instance, i); + var __ret = Internal.getSymbols_0((__Instance + __PointerAdjustment), i); return Marshal.PtrToStringAnsi(__ret); } public void addSymbols(string s) { var arg0 = Marshal.StringToHGlobalAnsi(s); - Internal.addSymbols_0(__Instance, arg0); + Internal.addSymbols_0((__Instance + __PointerAdjustment), arg0); Marshal.FreeHGlobal(arg0); } public void clearSymbols() { - Internal.clearSymbols_0(__Instance); + Internal.clearSymbols_0((__Instance + __PointerAdjustment)); } public string getDependencies(uint i) { - var __ret = Internal.getDependencies_0(__Instance, i); + var __ret = Internal.getDependencies_0((__Instance + __PointerAdjustment), i); return Marshal.PtrToStringAnsi(__ret); } public void addDependencies(string s) { var arg0 = Marshal.StringToHGlobalAnsi(s); - Internal.addDependencies_0(__Instance, arg0); + Internal.addDependencies_0((__Instance + __PointerAdjustment), arg0); Marshal.FreeHGlobal(arg0); } public void clearDependencies() { - Internal.clearDependencies_0(__Instance); + Internal.clearDependencies_0((__Instance + __PointerAdjustment)); } public string FileName { get { - var __ret = Internal.getFileName_0(__Instance); + var __ret = Internal.getFileName_0((__Instance + __PointerAdjustment)); return Marshal.PtrToStringAnsi(__ret); } set { var arg0 = Marshal.StringToHGlobalAnsi(value); - Internal.setFileName_0(__Instance, arg0); + Internal.setFileName_0((__Instance + __PointerAdjustment), arg0); Marshal.FreeHGlobal(arg0); } } @@ -9212,7 +9449,7 @@ namespace CppSharp { get { - var __ret = Internal.getSymbolsCount_0(__Instance); + var __ret = Internal.getSymbolsCount_0((__Instance + __PointerAdjustment)); return __ret; } } @@ -9221,7 +9458,7 @@ namespace CppSharp { get { - var __ret = Internal.getDependenciesCount_0(__Instance); + var __ret = Internal.getDependenciesCount_0((__Instance + __PointerAdjustment)); return __ret; } } @@ -9282,19 +9519,21 @@ namespace CppSharp } public global::System.IntPtr __Instance { get; protected set; } + + protected int __PointerAdjustment; public static readonly System.Collections.Concurrent.ConcurrentDictionary NativeToManagedMap = new System.Collections.Concurrent.ConcurrentDictionary(); protected void*[] __OriginalVTables; protected bool __ownsNativeInstance; - public static ASTContext __CreateInstance(global::System.IntPtr native, bool ownsNativeInstance = false) + public static ASTContext __CreateInstance(global::System.IntPtr native, bool ownsNativeInstance = false, bool skipVTables = false) { - return new ASTContext((ASTContext.Internal*) native) { __ownsNativeInstance = ownsNativeInstance }; + return new ASTContext((ASTContext.Internal*) native, skipVTables) { __ownsNativeInstance = ownsNativeInstance }; } - public static ASTContext __CreateInstance(ASTContext.Internal native) + public static ASTContext __CreateInstance(ASTContext.Internal native, bool skipVTables = false) { - return new ASTContext(native); + return new ASTContext(native, skipVTables); } private static ASTContext.Internal* __CopyValue(ASTContext.Internal native) @@ -9304,15 +9543,17 @@ namespace CppSharp return (ASTContext.Internal*) ret; } - private ASTContext(ASTContext.Internal native) - : this(__CopyValue(native)) + private ASTContext(ASTContext.Internal native, bool skipVTables = false) + : this(__CopyValue(native), skipVTables) { __ownsNativeInstance = true; NativeToManagedMap[__Instance] = this; } - protected ASTContext(ASTContext.Internal* native, bool isInternalImpl = false) + protected ASTContext(ASTContext.Internal* native, bool skipVTables = false) { + if (native == null) + return; __Instance = new global::System.IntPtr(native); } @@ -9320,17 +9561,17 @@ namespace CppSharp { __Instance = Marshal.AllocHGlobal(12); __ownsNativeInstance = true; - Internal.ctor_0(__Instance); NativeToManagedMap[__Instance] = this; + Internal.ctor_0((__Instance + __PointerAdjustment)); } public ASTContext(CppSharp.Parser.AST.ASTContext _0) { __Instance = Marshal.AllocHGlobal(12); __ownsNativeInstance = true; - var arg0 = ReferenceEquals(_0, null) ? global::System.IntPtr.Zero : _0.__Instance; - Internal.cctor_2(__Instance, arg0); NativeToManagedMap[__Instance] = this; + var arg0 = ReferenceEquals(_0, null) ? global::System.IntPtr.Zero : _0.__Instance; + Internal.cctor_2((__Instance + __PointerAdjustment), arg0); } public void Dispose() @@ -9344,13 +9585,14 @@ namespace CppSharp throw new global::System.InvalidOperationException("Managed instances owned by native code cannot be disposed of."); CppSharp.Parser.AST.ASTContext __dummy; NativeToManagedMap.TryRemove(__Instance, out __dummy); - Internal.dtor_0(__Instance); - Marshal.FreeHGlobal(__Instance); + Internal.dtor_0((__Instance + __PointerAdjustment)); + if (__ownsNativeInstance) + Marshal.FreeHGlobal(__Instance); } public CppSharp.Parser.AST.TranslationUnit getTranslationUnits(uint i) { - var __ret = Internal.getTranslationUnits_0(__Instance, i); + var __ret = Internal.getTranslationUnits_0((__Instance + __PointerAdjustment), i); CppSharp.Parser.AST.TranslationUnit __result0; if (__ret == IntPtr.Zero) __result0 = null; else if (CppSharp.Parser.AST.TranslationUnit.NativeToManagedMap.ContainsKey(__ret)) @@ -9362,19 +9604,19 @@ namespace CppSharp public void addTranslationUnits(CppSharp.Parser.AST.TranslationUnit s) { var arg0 = ReferenceEquals(s, null) ? global::System.IntPtr.Zero : s.__Instance; - Internal.addTranslationUnits_0(__Instance, arg0); + Internal.addTranslationUnits_0((__Instance + __PointerAdjustment), arg0); } public void clearTranslationUnits() { - Internal.clearTranslationUnits_0(__Instance); + Internal.clearTranslationUnits_0((__Instance + __PointerAdjustment)); } public uint TranslationUnitsCount { get { - var __ret = Internal.getTranslationUnitsCount_0(__Instance); + var __ret = Internal.getTranslationUnitsCount_0((__Instance + __PointerAdjustment)); return __ret; } } @@ -9400,19 +9642,21 @@ namespace CppSharp } public global::System.IntPtr __Instance { get; protected set; } + + protected int __PointerAdjustment; public static readonly System.Collections.Concurrent.ConcurrentDictionary NativeToManagedMap = new System.Collections.Concurrent.ConcurrentDictionary(); protected void*[] __OriginalVTables; protected bool __ownsNativeInstance; - public static Comment __CreateInstance(global::System.IntPtr native, bool ownsNativeInstance = false) + public static Comment __CreateInstance(global::System.IntPtr native, bool ownsNativeInstance = false, bool skipVTables = false) { - return new Comment((Comment.Internal*) native) { __ownsNativeInstance = ownsNativeInstance }; + return new Comment((Comment.Internal*) native, skipVTables) { __ownsNativeInstance = ownsNativeInstance }; } - public static Comment __CreateInstance(Comment.Internal native) + public static Comment __CreateInstance(Comment.Internal native, bool skipVTables = false) { - return new Comment(native); + return new Comment(native, skipVTables); } private static Comment.Internal* __CopyValue(Comment.Internal native) @@ -9422,15 +9666,17 @@ namespace CppSharp return ret; } - private Comment(Comment.Internal native) - : this(__CopyValue(native)) + private Comment(Comment.Internal native, bool skipVTables = false) + : this(__CopyValue(native), skipVTables) { __ownsNativeInstance = true; NativeToManagedMap[__Instance] = this; } - protected Comment(Comment.Internal* native, bool isInternalImpl = false) + protected Comment(Comment.Internal* native, bool skipVTables = false) { + if (native == null) + return; __Instance = new global::System.IntPtr(native); } @@ -9438,17 +9684,17 @@ namespace CppSharp { __Instance = Marshal.AllocHGlobal(4); __ownsNativeInstance = true; - var arg0 = kind; - Internal.ctor_0(__Instance, arg0); NativeToManagedMap[__Instance] = this; + var arg0 = kind; + Internal.ctor_0((__Instance + __PointerAdjustment), arg0); } public Comment(CppSharp.Parser.AST.Comment _0) { __Instance = Marshal.AllocHGlobal(4); __ownsNativeInstance = true; - *((Comment.Internal*) __Instance) = *((Comment.Internal*) _0.__Instance); NativeToManagedMap[__Instance] = this; + *((Comment.Internal*) __Instance) = *((Comment.Internal*) _0.__Instance); } public void Dispose() @@ -9462,7 +9708,8 @@ namespace CppSharp throw new global::System.InvalidOperationException("Managed instances owned by native code cannot be disposed of."); CppSharp.Parser.AST.Comment __dummy; NativeToManagedMap.TryRemove(__Instance, out __dummy); - Marshal.FreeHGlobal(__Instance); + if (__ownsNativeInstance) + Marshal.FreeHGlobal(__Instance); } public CppSharp.Parser.AST.CommentKind Kind @@ -9503,14 +9750,14 @@ namespace CppSharp internal static extern void cctor_2(global::System.IntPtr instance, global::System.IntPtr _0); } - public static new BlockContentComment __CreateInstance(global::System.IntPtr native, bool ownsNativeInstance = false) + public static new BlockContentComment __CreateInstance(global::System.IntPtr native, bool ownsNativeInstance = false, bool skipVTables = false) { - return new BlockContentComment((BlockContentComment.Internal*) native) { __ownsNativeInstance = ownsNativeInstance }; + return new BlockContentComment((BlockContentComment.Internal*) native, skipVTables) { __ownsNativeInstance = ownsNativeInstance }; } - public static BlockContentComment __CreateInstance(BlockContentComment.Internal native) + public static BlockContentComment __CreateInstance(BlockContentComment.Internal native, bool skipVTables = false) { - return new BlockContentComment(native); + return new BlockContentComment(native, skipVTables); } private static BlockContentComment.Internal* __CopyValue(BlockContentComment.Internal native) @@ -9520,16 +9767,20 @@ namespace CppSharp return ret; } - private BlockContentComment(BlockContentComment.Internal native) - : this(__CopyValue(native)) + private BlockContentComment(BlockContentComment.Internal native, bool skipVTables = false) + : this(__CopyValue(native), skipVTables) { __ownsNativeInstance = true; NativeToManagedMap[__Instance] = this; } - protected BlockContentComment(BlockContentComment.Internal* native, bool isInternalImpl = false) - : base((CppSharp.Parser.AST.Comment.Internal*) native) + protected BlockContentComment(BlockContentComment.Internal* native, bool skipVTables = false) + : base((CppSharp.Parser.AST.Comment.Internal*) null) { + __PointerAdjustment = 0; + if (native == null) + return; + __Instance = new global::System.IntPtr(native); } public BlockContentComment() @@ -9537,8 +9788,8 @@ namespace CppSharp { __Instance = Marshal.AllocHGlobal(4); __ownsNativeInstance = true; - Internal.ctor_0(__Instance); NativeToManagedMap[__Instance] = this; + Internal.ctor_0((__Instance + __PointerAdjustment)); } public BlockContentComment(CppSharp.Parser.AST.CommentKind Kind) @@ -9546,9 +9797,9 @@ namespace CppSharp { __Instance = Marshal.AllocHGlobal(4); __ownsNativeInstance = true; - var arg0 = Kind; - Internal.ctor_1(__Instance, arg0); NativeToManagedMap[__Instance] = this; + var arg0 = Kind; + Internal.ctor_1((__Instance + __PointerAdjustment), arg0); } public BlockContentComment(CppSharp.Parser.AST.BlockContentComment _0) @@ -9556,8 +9807,8 @@ namespace CppSharp { __Instance = Marshal.AllocHGlobal(4); __ownsNativeInstance = true; - *((BlockContentComment.Internal*) __Instance) = *((BlockContentComment.Internal*) _0.__Instance); NativeToManagedMap[__Instance] = this; + *((BlockContentComment.Internal*) __Instance) = *((BlockContentComment.Internal*) _0.__Instance); } } @@ -9605,14 +9856,14 @@ namespace CppSharp internal static extern uint getBlocksCount_0(global::System.IntPtr instance); } - public static new FullComment __CreateInstance(global::System.IntPtr native, bool ownsNativeInstance = false) + public static new FullComment __CreateInstance(global::System.IntPtr native, bool ownsNativeInstance = false, bool skipVTables = false) { - return new FullComment((FullComment.Internal*) native) { __ownsNativeInstance = ownsNativeInstance }; + return new FullComment((FullComment.Internal*) native, skipVTables) { __ownsNativeInstance = ownsNativeInstance }; } - public static FullComment __CreateInstance(FullComment.Internal native) + public static FullComment __CreateInstance(FullComment.Internal native, bool skipVTables = false) { - return new FullComment(native); + return new FullComment(native, skipVTables); } private static FullComment.Internal* __CopyValue(FullComment.Internal native) @@ -9622,16 +9873,20 @@ namespace CppSharp return (FullComment.Internal*) ret; } - private FullComment(FullComment.Internal native) - : this(__CopyValue(native)) + private FullComment(FullComment.Internal native, bool skipVTables = false) + : this(__CopyValue(native), skipVTables) { __ownsNativeInstance = true; NativeToManagedMap[__Instance] = this; } - protected FullComment(FullComment.Internal* native, bool isInternalImpl = false) - : base((CppSharp.Parser.AST.Comment.Internal*) native) + protected FullComment(FullComment.Internal* native, bool skipVTables = false) + : base((CppSharp.Parser.AST.Comment.Internal*) null) { + __PointerAdjustment = 0; + if (native == null) + return; + __Instance = new global::System.IntPtr(native); } public FullComment() @@ -9639,8 +9894,8 @@ namespace CppSharp { __Instance = Marshal.AllocHGlobal(16); __ownsNativeInstance = true; - Internal.ctor_0(__Instance); NativeToManagedMap[__Instance] = this; + Internal.ctor_0((__Instance + __PointerAdjustment)); } public FullComment(CppSharp.Parser.AST.FullComment _0) @@ -9648,14 +9903,14 @@ namespace CppSharp { __Instance = Marshal.AllocHGlobal(16); __ownsNativeInstance = true; - var arg0 = ReferenceEquals(_0, null) ? global::System.IntPtr.Zero : _0.__Instance; - Internal.cctor_2(__Instance, arg0); NativeToManagedMap[__Instance] = this; + var arg0 = ReferenceEquals(_0, null) ? global::System.IntPtr.Zero : _0.__Instance; + Internal.cctor_2((__Instance + __PointerAdjustment), arg0); } public CppSharp.Parser.AST.BlockContentComment getBlocks(uint i) { - var __ret = Internal.getBlocks_0(__Instance, i); + var __ret = Internal.getBlocks_0((__Instance + __PointerAdjustment), i); CppSharp.Parser.AST.BlockContentComment __result0; if (__ret == IntPtr.Zero) __result0 = null; else if (CppSharp.Parser.AST.BlockContentComment.NativeToManagedMap.ContainsKey(__ret)) @@ -9667,19 +9922,19 @@ namespace CppSharp public void addBlocks(CppSharp.Parser.AST.BlockContentComment s) { var arg0 = ReferenceEquals(s, null) ? global::System.IntPtr.Zero : s.__Instance; - Internal.addBlocks_0(__Instance, arg0); + Internal.addBlocks_0((__Instance + __PointerAdjustment), arg0); } public void clearBlocks() { - Internal.clearBlocks_0(__Instance); + Internal.clearBlocks_0((__Instance + __PointerAdjustment)); } public uint BlocksCount { get { - var __ret = Internal.getBlocksCount_0(__Instance); + var __ret = Internal.getBlocksCount_0((__Instance + __PointerAdjustment)); return __ret; } } @@ -9769,19 +10024,21 @@ namespace CppSharp } public global::System.IntPtr __Instance { get; protected set; } + + protected int __PointerAdjustment; public static readonly System.Collections.Concurrent.ConcurrentDictionary NativeToManagedMap = new System.Collections.Concurrent.ConcurrentDictionary(); protected void*[] __OriginalVTables; protected bool __ownsNativeInstance; - public static Argument __CreateInstance(global::System.IntPtr native, bool ownsNativeInstance = false) + public static Argument __CreateInstance(global::System.IntPtr native, bool ownsNativeInstance = false, bool skipVTables = false) { - return new Argument((Argument.Internal*) native) { __ownsNativeInstance = ownsNativeInstance }; + return new Argument((Argument.Internal*) native, skipVTables) { __ownsNativeInstance = ownsNativeInstance }; } - public static Argument __CreateInstance(Argument.Internal native) + public static Argument __CreateInstance(Argument.Internal native, bool skipVTables = false) { - return new Argument(native); + return new Argument(native, skipVTables); } private static Argument.Internal* __CopyValue(Argument.Internal native) @@ -9791,15 +10048,17 @@ namespace CppSharp return (Argument.Internal*) ret; } - private Argument(Argument.Internal native) - : this(__CopyValue(native)) + private Argument(Argument.Internal native, bool skipVTables = false) + : this(__CopyValue(native), skipVTables) { __ownsNativeInstance = true; NativeToManagedMap[__Instance] = this; } - protected Argument(Argument.Internal* native, bool isInternalImpl = false) + protected Argument(Argument.Internal* native, bool skipVTables = false) { + if (native == null) + return; __Instance = new global::System.IntPtr(native); } @@ -9807,17 +10066,17 @@ namespace CppSharp { __Instance = Marshal.AllocHGlobal(12); __ownsNativeInstance = true; - Internal.ctor_0(__Instance); NativeToManagedMap[__Instance] = this; + Internal.ctor_0((__Instance + __PointerAdjustment)); } public Argument(CppSharp.Parser.AST.BlockCommandComment.Argument _0) { __Instance = Marshal.AllocHGlobal(12); __ownsNativeInstance = true; - var arg0 = ReferenceEquals(_0, null) ? global::System.IntPtr.Zero : _0.__Instance; - Internal.cctor_2(__Instance, arg0); NativeToManagedMap[__Instance] = this; + var arg0 = ReferenceEquals(_0, null) ? global::System.IntPtr.Zero : _0.__Instance; + Internal.cctor_2((__Instance + __PointerAdjustment), arg0); } public void Dispose() @@ -9831,35 +10090,36 @@ namespace CppSharp throw new global::System.InvalidOperationException("Managed instances owned by native code cannot be disposed of."); CppSharp.Parser.AST.BlockCommandComment.Argument __dummy; NativeToManagedMap.TryRemove(__Instance, out __dummy); - Internal.dtor_0(__Instance); - Marshal.FreeHGlobal(__Instance); + Internal.dtor_0((__Instance + __PointerAdjustment)); + if (__ownsNativeInstance) + Marshal.FreeHGlobal(__Instance); } public string Text { get { - var __ret = Internal.getText_0(__Instance); + var __ret = Internal.getText_0((__Instance + __PointerAdjustment)); return Marshal.PtrToStringAnsi(__ret); } set { var arg0 = Marshal.StringToHGlobalAnsi(value); - Internal.setText_0(__Instance, arg0); + Internal.setText_0((__Instance + __PointerAdjustment), arg0); Marshal.FreeHGlobal(arg0); } } } - public static new BlockCommandComment __CreateInstance(global::System.IntPtr native, bool ownsNativeInstance = false) + public static new BlockCommandComment __CreateInstance(global::System.IntPtr native, bool ownsNativeInstance = false, bool skipVTables = false) { - return new BlockCommandComment((BlockCommandComment.Internal*) native) { __ownsNativeInstance = ownsNativeInstance }; + return new BlockCommandComment((BlockCommandComment.Internal*) native, skipVTables) { __ownsNativeInstance = ownsNativeInstance }; } - public static BlockCommandComment __CreateInstance(BlockCommandComment.Internal native) + public static BlockCommandComment __CreateInstance(BlockCommandComment.Internal native, bool skipVTables = false) { - return new BlockCommandComment(native); + return new BlockCommandComment(native, skipVTables); } private static BlockCommandComment.Internal* __CopyValue(BlockCommandComment.Internal native) @@ -9869,16 +10129,20 @@ namespace CppSharp return (BlockCommandComment.Internal*) ret; } - private BlockCommandComment(BlockCommandComment.Internal native) - : this(__CopyValue(native)) + private BlockCommandComment(BlockCommandComment.Internal native, bool skipVTables = false) + : this(__CopyValue(native), skipVTables) { __ownsNativeInstance = true; NativeToManagedMap[__Instance] = this; } - protected BlockCommandComment(BlockCommandComment.Internal* native, bool isInternalImpl = false) - : base((CppSharp.Parser.AST.BlockContentComment.Internal*) native) + protected BlockCommandComment(BlockCommandComment.Internal* native, bool skipVTables = false) + : base((CppSharp.Parser.AST.BlockContentComment.Internal*) null) { + __PointerAdjustment = 0; + if (native == null) + return; + __Instance = new global::System.IntPtr(native); } public BlockCommandComment() @@ -9886,8 +10150,8 @@ namespace CppSharp { __Instance = Marshal.AllocHGlobal(20); __ownsNativeInstance = true; - Internal.ctor_0(__Instance); NativeToManagedMap[__Instance] = this; + Internal.ctor_0((__Instance + __PointerAdjustment)); } public BlockCommandComment(CppSharp.Parser.AST.CommentKind Kind) @@ -9895,9 +10159,9 @@ namespace CppSharp { __Instance = Marshal.AllocHGlobal(20); __ownsNativeInstance = true; - var arg0 = Kind; - Internal.ctor_1(__Instance, arg0); NativeToManagedMap[__Instance] = this; + var arg0 = Kind; + Internal.ctor_1((__Instance + __PointerAdjustment), arg0); } public BlockCommandComment(CppSharp.Parser.AST.BlockCommandComment _0) @@ -9905,34 +10169,34 @@ namespace CppSharp { __Instance = Marshal.AllocHGlobal(20); __ownsNativeInstance = true; - var arg0 = ReferenceEquals(_0, null) ? global::System.IntPtr.Zero : _0.__Instance; - Internal.cctor_3(__Instance, arg0); NativeToManagedMap[__Instance] = this; + var arg0 = ReferenceEquals(_0, null) ? global::System.IntPtr.Zero : _0.__Instance; + Internal.cctor_3((__Instance + __PointerAdjustment), arg0); } public CppSharp.Parser.AST.BlockCommandComment.Argument getArguments(uint i) { var __ret = new CppSharp.Parser.AST.BlockCommandComment.Argument.Internal(); - Internal.getArguments_0(new IntPtr(&__ret), __Instance, i); + Internal.getArguments_0(new IntPtr(&__ret), (__Instance + __PointerAdjustment), i); return CppSharp.Parser.AST.BlockCommandComment.Argument.__CreateInstance(__ret); } public void addArguments(CppSharp.Parser.AST.BlockCommandComment.Argument s) { var arg0 = ReferenceEquals(s, null) ? global::System.IntPtr.Zero : s.__Instance; - Internal.addArguments_0(__Instance, arg0); + Internal.addArguments_0((__Instance + __PointerAdjustment), arg0); } public void clearArguments() { - Internal.clearArguments_0(__Instance); + Internal.clearArguments_0((__Instance + __PointerAdjustment)); } public uint ArgumentsCount { get { - var __ret = Internal.getArgumentsCount_0(__Instance); + var __ret = Internal.getArgumentsCount_0((__Instance + __PointerAdjustment)); return __ret; } } @@ -9991,14 +10255,14 @@ namespace CppSharp InOut = 2 } - public static new ParamCommandComment __CreateInstance(global::System.IntPtr native, bool ownsNativeInstance = false) + public static new ParamCommandComment __CreateInstance(global::System.IntPtr native, bool ownsNativeInstance = false, bool skipVTables = false) { - return new ParamCommandComment((ParamCommandComment.Internal*) native) { __ownsNativeInstance = ownsNativeInstance }; + return new ParamCommandComment((ParamCommandComment.Internal*) native, skipVTables) { __ownsNativeInstance = ownsNativeInstance }; } - public static ParamCommandComment __CreateInstance(ParamCommandComment.Internal native) + public static ParamCommandComment __CreateInstance(ParamCommandComment.Internal native, bool skipVTables = false) { - return new ParamCommandComment(native); + return new ParamCommandComment(native, skipVTables); } private static ParamCommandComment.Internal* __CopyValue(ParamCommandComment.Internal native) @@ -10008,16 +10272,20 @@ namespace CppSharp return (ParamCommandComment.Internal*) ret; } - private ParamCommandComment(ParamCommandComment.Internal native) - : this(__CopyValue(native)) + private ParamCommandComment(ParamCommandComment.Internal native, bool skipVTables = false) + : this(__CopyValue(native), skipVTables) { __ownsNativeInstance = true; NativeToManagedMap[__Instance] = this; } - protected ParamCommandComment(ParamCommandComment.Internal* native, bool isInternalImpl = false) - : base((CppSharp.Parser.AST.BlockCommandComment.Internal*) native) + protected ParamCommandComment(ParamCommandComment.Internal* native, bool skipVTables = false) + : base((CppSharp.Parser.AST.BlockCommandComment.Internal*) null) { + __PointerAdjustment = 0; + if (native == null) + return; + __Instance = new global::System.IntPtr(native); } public ParamCommandComment() @@ -10025,8 +10293,8 @@ namespace CppSharp { __Instance = Marshal.AllocHGlobal(28); __ownsNativeInstance = true; - Internal.ctor_0(__Instance); NativeToManagedMap[__Instance] = this; + Internal.ctor_0((__Instance + __PointerAdjustment)); } public ParamCommandComment(CppSharp.Parser.AST.ParamCommandComment _0) @@ -10034,9 +10302,9 @@ namespace CppSharp { __Instance = Marshal.AllocHGlobal(28); __ownsNativeInstance = true; - var arg0 = ReferenceEquals(_0, null) ? global::System.IntPtr.Zero : _0.__Instance; - Internal.cctor_1(__Instance, arg0); NativeToManagedMap[__Instance] = this; + var arg0 = ReferenceEquals(_0, null) ? global::System.IntPtr.Zero : _0.__Instance; + Internal.cctor_1((__Instance + __PointerAdjustment), arg0); } public CppSharp.Parser.AST.ParamCommandComment.PassDirection Direction @@ -10113,14 +10381,14 @@ namespace CppSharp internal static extern uint getPositionCount_0(global::System.IntPtr instance); } - public static new TParamCommandComment __CreateInstance(global::System.IntPtr native, bool ownsNativeInstance = false) + public static new TParamCommandComment __CreateInstance(global::System.IntPtr native, bool ownsNativeInstance = false, bool skipVTables = false) { - return new TParamCommandComment((TParamCommandComment.Internal*) native) { __ownsNativeInstance = ownsNativeInstance }; + return new TParamCommandComment((TParamCommandComment.Internal*) native, skipVTables) { __ownsNativeInstance = ownsNativeInstance }; } - public static TParamCommandComment __CreateInstance(TParamCommandComment.Internal native) + public static TParamCommandComment __CreateInstance(TParamCommandComment.Internal native, bool skipVTables = false) { - return new TParamCommandComment(native); + return new TParamCommandComment(native, skipVTables); } private static TParamCommandComment.Internal* __CopyValue(TParamCommandComment.Internal native) @@ -10130,16 +10398,20 @@ namespace CppSharp return (TParamCommandComment.Internal*) ret; } - private TParamCommandComment(TParamCommandComment.Internal native) - : this(__CopyValue(native)) + private TParamCommandComment(TParamCommandComment.Internal native, bool skipVTables = false) + : this(__CopyValue(native), skipVTables) { __ownsNativeInstance = true; NativeToManagedMap[__Instance] = this; } - protected TParamCommandComment(TParamCommandComment.Internal* native, bool isInternalImpl = false) - : base((CppSharp.Parser.AST.BlockCommandComment.Internal*) native) + protected TParamCommandComment(TParamCommandComment.Internal* native, bool skipVTables = false) + : base((CppSharp.Parser.AST.BlockCommandComment.Internal*) null) { + __PointerAdjustment = 0; + if (native == null) + return; + __Instance = new global::System.IntPtr(native); } public TParamCommandComment() @@ -10147,8 +10419,8 @@ namespace CppSharp { __Instance = Marshal.AllocHGlobal(32); __ownsNativeInstance = true; - Internal.ctor_0(__Instance); NativeToManagedMap[__Instance] = this; + Internal.ctor_0((__Instance + __PointerAdjustment)); } public TParamCommandComment(CppSharp.Parser.AST.TParamCommandComment _0) @@ -10156,35 +10428,36 @@ namespace CppSharp { __Instance = Marshal.AllocHGlobal(32); __ownsNativeInstance = true; - var arg0 = ReferenceEquals(_0, null) ? global::System.IntPtr.Zero : _0.__Instance; - Internal.cctor_2(__Instance, arg0); NativeToManagedMap[__Instance] = this; + var arg0 = ReferenceEquals(_0, null) ? global::System.IntPtr.Zero : _0.__Instance; + Internal.cctor_2((__Instance + __PointerAdjustment), arg0); } public uint getPosition(uint i) { - var __ret = Internal.getPosition_0(__Instance, i); + var __ret = Internal.getPosition_0((__Instance + __PointerAdjustment), i); return __ret; } public void addPosition(ref uint s) { - fixed (uint* arg0 = &s) + fixed (uint* __refParamPtr0 = &s) { - Internal.addPosition_0(__Instance, arg0); + var arg0 = __refParamPtr0; + Internal.addPosition_0((__Instance + __PointerAdjustment), arg0); } } public void clearPosition() { - Internal.clearPosition_0(__Instance); + Internal.clearPosition_0((__Instance + __PointerAdjustment)); } public uint PositionCount { get { - var __ret = Internal.getPositionCount_0(__Instance); + var __ret = Internal.getPositionCount_0((__Instance + __PointerAdjustment)); return __ret; } } @@ -10224,14 +10497,14 @@ namespace CppSharp internal static extern void setText_0(global::System.IntPtr instance, global::System.IntPtr s); } - public static new VerbatimBlockLineComment __CreateInstance(global::System.IntPtr native, bool ownsNativeInstance = false) + public static new VerbatimBlockLineComment __CreateInstance(global::System.IntPtr native, bool ownsNativeInstance = false, bool skipVTables = false) { - return new VerbatimBlockLineComment((VerbatimBlockLineComment.Internal*) native) { __ownsNativeInstance = ownsNativeInstance }; + return new VerbatimBlockLineComment((VerbatimBlockLineComment.Internal*) native, skipVTables) { __ownsNativeInstance = ownsNativeInstance }; } - public static VerbatimBlockLineComment __CreateInstance(VerbatimBlockLineComment.Internal native) + public static VerbatimBlockLineComment __CreateInstance(VerbatimBlockLineComment.Internal native, bool skipVTables = false) { - return new VerbatimBlockLineComment(native); + return new VerbatimBlockLineComment(native, skipVTables); } private static VerbatimBlockLineComment.Internal* __CopyValue(VerbatimBlockLineComment.Internal native) @@ -10241,16 +10514,20 @@ namespace CppSharp return (VerbatimBlockLineComment.Internal*) ret; } - private VerbatimBlockLineComment(VerbatimBlockLineComment.Internal native) - : this(__CopyValue(native)) + private VerbatimBlockLineComment(VerbatimBlockLineComment.Internal native, bool skipVTables = false) + : this(__CopyValue(native), skipVTables) { __ownsNativeInstance = true; NativeToManagedMap[__Instance] = this; } - protected VerbatimBlockLineComment(VerbatimBlockLineComment.Internal* native, bool isInternalImpl = false) - : base((CppSharp.Parser.AST.Comment.Internal*) native) + protected VerbatimBlockLineComment(VerbatimBlockLineComment.Internal* native, bool skipVTables = false) + : base((CppSharp.Parser.AST.Comment.Internal*) null) { + __PointerAdjustment = 0; + if (native == null) + return; + __Instance = new global::System.IntPtr(native); } public VerbatimBlockLineComment() @@ -10258,8 +10535,8 @@ namespace CppSharp { __Instance = Marshal.AllocHGlobal(16); __ownsNativeInstance = true; - Internal.ctor_0(__Instance); NativeToManagedMap[__Instance] = this; + Internal.ctor_0((__Instance + __PointerAdjustment)); } public VerbatimBlockLineComment(CppSharp.Parser.AST.VerbatimBlockLineComment _0) @@ -10267,23 +10544,23 @@ namespace CppSharp { __Instance = Marshal.AllocHGlobal(16); __ownsNativeInstance = true; - var arg0 = ReferenceEquals(_0, null) ? global::System.IntPtr.Zero : _0.__Instance; - Internal.cctor_2(__Instance, arg0); NativeToManagedMap[__Instance] = this; + var arg0 = ReferenceEquals(_0, null) ? global::System.IntPtr.Zero : _0.__Instance; + Internal.cctor_2((__Instance + __PointerAdjustment), arg0); } public string Text { get { - var __ret = Internal.getText_0(__Instance); + var __ret = Internal.getText_0((__Instance + __PointerAdjustment)); return Marshal.PtrToStringAnsi(__ret); } set { var arg0 = Marshal.StringToHGlobalAnsi(value); - Internal.setText_0(__Instance, arg0); + Internal.setText_0((__Instance + __PointerAdjustment), arg0); Marshal.FreeHGlobal(arg0); } } @@ -10336,14 +10613,14 @@ namespace CppSharp internal static extern uint getLinesCount_0(global::System.IntPtr instance); } - public static new VerbatimBlockComment __CreateInstance(global::System.IntPtr native, bool ownsNativeInstance = false) + public static new VerbatimBlockComment __CreateInstance(global::System.IntPtr native, bool ownsNativeInstance = false, bool skipVTables = false) { - return new VerbatimBlockComment((VerbatimBlockComment.Internal*) native) { __ownsNativeInstance = ownsNativeInstance }; + return new VerbatimBlockComment((VerbatimBlockComment.Internal*) native, skipVTables) { __ownsNativeInstance = ownsNativeInstance }; } - public static VerbatimBlockComment __CreateInstance(VerbatimBlockComment.Internal native) + public static VerbatimBlockComment __CreateInstance(VerbatimBlockComment.Internal native, bool skipVTables = false) { - return new VerbatimBlockComment(native); + return new VerbatimBlockComment(native, skipVTables); } private static VerbatimBlockComment.Internal* __CopyValue(VerbatimBlockComment.Internal native) @@ -10353,16 +10630,20 @@ namespace CppSharp return (VerbatimBlockComment.Internal*) ret; } - private VerbatimBlockComment(VerbatimBlockComment.Internal native) - : this(__CopyValue(native)) + private VerbatimBlockComment(VerbatimBlockComment.Internal native, bool skipVTables = false) + : this(__CopyValue(native), skipVTables) { __ownsNativeInstance = true; NativeToManagedMap[__Instance] = this; } - protected VerbatimBlockComment(VerbatimBlockComment.Internal* native, bool isInternalImpl = false) - : base((CppSharp.Parser.AST.BlockCommandComment.Internal*) native) + protected VerbatimBlockComment(VerbatimBlockComment.Internal* native, bool skipVTables = false) + : base((CppSharp.Parser.AST.BlockCommandComment.Internal*) null) { + __PointerAdjustment = 0; + if (native == null) + return; + __Instance = new global::System.IntPtr(native); } public VerbatimBlockComment() @@ -10370,8 +10651,8 @@ namespace CppSharp { __Instance = Marshal.AllocHGlobal(32); __ownsNativeInstance = true; - Internal.ctor_0(__Instance); NativeToManagedMap[__Instance] = this; + Internal.ctor_0((__Instance + __PointerAdjustment)); } public VerbatimBlockComment(CppSharp.Parser.AST.VerbatimBlockComment _0) @@ -10379,14 +10660,14 @@ namespace CppSharp { __Instance = Marshal.AllocHGlobal(32); __ownsNativeInstance = true; - var arg0 = ReferenceEquals(_0, null) ? global::System.IntPtr.Zero : _0.__Instance; - Internal.cctor_2(__Instance, arg0); NativeToManagedMap[__Instance] = this; + var arg0 = ReferenceEquals(_0, null) ? global::System.IntPtr.Zero : _0.__Instance; + Internal.cctor_2((__Instance + __PointerAdjustment), arg0); } public CppSharp.Parser.AST.VerbatimBlockLineComment getLines(uint i) { - var __ret = Internal.getLines_0(__Instance, i); + var __ret = Internal.getLines_0((__Instance + __PointerAdjustment), i); CppSharp.Parser.AST.VerbatimBlockLineComment __result0; if (__ret == IntPtr.Zero) __result0 = null; else if (CppSharp.Parser.AST.VerbatimBlockLineComment.NativeToManagedMap.ContainsKey(__ret)) @@ -10398,19 +10679,19 @@ namespace CppSharp public void addLines(CppSharp.Parser.AST.VerbatimBlockLineComment s) { var arg0 = ReferenceEquals(s, null) ? global::System.IntPtr.Zero : s.__Instance; - Internal.addLines_0(__Instance, arg0); + Internal.addLines_0((__Instance + __PointerAdjustment), arg0); } public void clearLines() { - Internal.clearLines_0(__Instance); + Internal.clearLines_0((__Instance + __PointerAdjustment)); } public uint LinesCount { get { - var __ret = Internal.getLinesCount_0(__Instance); + var __ret = Internal.getLinesCount_0((__Instance + __PointerAdjustment)); return __ret; } } @@ -10453,14 +10734,14 @@ namespace CppSharp internal static extern void setText_0(global::System.IntPtr instance, global::System.IntPtr s); } - public static new VerbatimLineComment __CreateInstance(global::System.IntPtr native, bool ownsNativeInstance = false) + public static new VerbatimLineComment __CreateInstance(global::System.IntPtr native, bool ownsNativeInstance = false, bool skipVTables = false) { - return new VerbatimLineComment((VerbatimLineComment.Internal*) native) { __ownsNativeInstance = ownsNativeInstance }; + return new VerbatimLineComment((VerbatimLineComment.Internal*) native, skipVTables) { __ownsNativeInstance = ownsNativeInstance }; } - public static VerbatimLineComment __CreateInstance(VerbatimLineComment.Internal native) + public static VerbatimLineComment __CreateInstance(VerbatimLineComment.Internal native, bool skipVTables = false) { - return new VerbatimLineComment(native); + return new VerbatimLineComment(native, skipVTables); } private static VerbatimLineComment.Internal* __CopyValue(VerbatimLineComment.Internal native) @@ -10470,16 +10751,20 @@ namespace CppSharp return (VerbatimLineComment.Internal*) ret; } - private VerbatimLineComment(VerbatimLineComment.Internal native) - : this(__CopyValue(native)) + private VerbatimLineComment(VerbatimLineComment.Internal native, bool skipVTables = false) + : this(__CopyValue(native), skipVTables) { __ownsNativeInstance = true; NativeToManagedMap[__Instance] = this; } - protected VerbatimLineComment(VerbatimLineComment.Internal* native, bool isInternalImpl = false) - : base((CppSharp.Parser.AST.BlockCommandComment.Internal*) native) + protected VerbatimLineComment(VerbatimLineComment.Internal* native, bool skipVTables = false) + : base((CppSharp.Parser.AST.BlockCommandComment.Internal*) null) { + __PointerAdjustment = 0; + if (native == null) + return; + __Instance = new global::System.IntPtr(native); } public VerbatimLineComment() @@ -10487,8 +10772,8 @@ namespace CppSharp { __Instance = Marshal.AllocHGlobal(32); __ownsNativeInstance = true; - Internal.ctor_0(__Instance); NativeToManagedMap[__Instance] = this; + Internal.ctor_0((__Instance + __PointerAdjustment)); } public VerbatimLineComment(CppSharp.Parser.AST.VerbatimLineComment _0) @@ -10496,23 +10781,23 @@ namespace CppSharp { __Instance = Marshal.AllocHGlobal(32); __ownsNativeInstance = true; - var arg0 = ReferenceEquals(_0, null) ? global::System.IntPtr.Zero : _0.__Instance; - Internal.cctor_2(__Instance, arg0); NativeToManagedMap[__Instance] = this; + var arg0 = ReferenceEquals(_0, null) ? global::System.IntPtr.Zero : _0.__Instance; + Internal.cctor_2((__Instance + __PointerAdjustment), arg0); } public string Text { get { - var __ret = Internal.getText_0(__Instance); + var __ret = Internal.getText_0((__Instance + __PointerAdjustment)); return Marshal.PtrToStringAnsi(__ret); } set { var arg0 = Marshal.StringToHGlobalAnsi(value); - Internal.setText_0(__Instance, arg0); + Internal.setText_0((__Instance + __PointerAdjustment), arg0); Marshal.FreeHGlobal(arg0); } } @@ -10542,14 +10827,14 @@ namespace CppSharp internal static extern void cctor_2(global::System.IntPtr instance, global::System.IntPtr _0); } - public static new InlineContentComment __CreateInstance(global::System.IntPtr native, bool ownsNativeInstance = false) + public static new InlineContentComment __CreateInstance(global::System.IntPtr native, bool ownsNativeInstance = false, bool skipVTables = false) { - return new InlineContentComment((InlineContentComment.Internal*) native) { __ownsNativeInstance = ownsNativeInstance }; + return new InlineContentComment((InlineContentComment.Internal*) native, skipVTables) { __ownsNativeInstance = ownsNativeInstance }; } - public static InlineContentComment __CreateInstance(InlineContentComment.Internal native) + public static InlineContentComment __CreateInstance(InlineContentComment.Internal native, bool skipVTables = false) { - return new InlineContentComment(native); + return new InlineContentComment(native, skipVTables); } private static InlineContentComment.Internal* __CopyValue(InlineContentComment.Internal native) @@ -10559,16 +10844,20 @@ namespace CppSharp return ret; } - private InlineContentComment(InlineContentComment.Internal native) - : this(__CopyValue(native)) + private InlineContentComment(InlineContentComment.Internal native, bool skipVTables = false) + : this(__CopyValue(native), skipVTables) { __ownsNativeInstance = true; NativeToManagedMap[__Instance] = this; } - protected InlineContentComment(InlineContentComment.Internal* native, bool isInternalImpl = false) - : base((CppSharp.Parser.AST.Comment.Internal*) native) + protected InlineContentComment(InlineContentComment.Internal* native, bool skipVTables = false) + : base((CppSharp.Parser.AST.Comment.Internal*) null) { + __PointerAdjustment = 0; + if (native == null) + return; + __Instance = new global::System.IntPtr(native); } public InlineContentComment() @@ -10576,8 +10865,8 @@ namespace CppSharp { __Instance = Marshal.AllocHGlobal(4); __ownsNativeInstance = true; - Internal.ctor_0(__Instance); NativeToManagedMap[__Instance] = this; + Internal.ctor_0((__Instance + __PointerAdjustment)); } public InlineContentComment(CppSharp.Parser.AST.CommentKind Kind) @@ -10585,9 +10874,9 @@ namespace CppSharp { __Instance = Marshal.AllocHGlobal(4); __ownsNativeInstance = true; - var arg0 = Kind; - Internal.ctor_1(__Instance, arg0); NativeToManagedMap[__Instance] = this; + var arg0 = Kind; + Internal.ctor_1((__Instance + __PointerAdjustment), arg0); } public InlineContentComment(CppSharp.Parser.AST.InlineContentComment _0) @@ -10595,8 +10884,8 @@ namespace CppSharp { __Instance = Marshal.AllocHGlobal(4); __ownsNativeInstance = true; - *((InlineContentComment.Internal*) __Instance) = *((InlineContentComment.Internal*) _0.__Instance); NativeToManagedMap[__Instance] = this; + *((InlineContentComment.Internal*) __Instance) = *((InlineContentComment.Internal*) _0.__Instance); } } @@ -10647,14 +10936,14 @@ namespace CppSharp internal static extern uint getContentCount_0(global::System.IntPtr instance); } - public static new ParagraphComment __CreateInstance(global::System.IntPtr native, bool ownsNativeInstance = false) + public static new ParagraphComment __CreateInstance(global::System.IntPtr native, bool ownsNativeInstance = false, bool skipVTables = false) { - return new ParagraphComment((ParagraphComment.Internal*) native) { __ownsNativeInstance = ownsNativeInstance }; + return new ParagraphComment((ParagraphComment.Internal*) native, skipVTables) { __ownsNativeInstance = ownsNativeInstance }; } - public static ParagraphComment __CreateInstance(ParagraphComment.Internal native) + public static ParagraphComment __CreateInstance(ParagraphComment.Internal native, bool skipVTables = false) { - return new ParagraphComment(native); + return new ParagraphComment(native, skipVTables); } private static ParagraphComment.Internal* __CopyValue(ParagraphComment.Internal native) @@ -10664,16 +10953,20 @@ namespace CppSharp return (ParagraphComment.Internal*) ret; } - private ParagraphComment(ParagraphComment.Internal native) - : this(__CopyValue(native)) + private ParagraphComment(ParagraphComment.Internal native, bool skipVTables = false) + : this(__CopyValue(native), skipVTables) { __ownsNativeInstance = true; NativeToManagedMap[__Instance] = this; } - protected ParagraphComment(ParagraphComment.Internal* native, bool isInternalImpl = false) - : base((CppSharp.Parser.AST.BlockContentComment.Internal*) native) + protected ParagraphComment(ParagraphComment.Internal* native, bool skipVTables = false) + : base((CppSharp.Parser.AST.BlockContentComment.Internal*) null) { + __PointerAdjustment = 0; + if (native == null) + return; + __Instance = new global::System.IntPtr(native); } public ParagraphComment() @@ -10681,8 +10974,8 @@ namespace CppSharp { __Instance = Marshal.AllocHGlobal(20); __ownsNativeInstance = true; - Internal.ctor_0(__Instance); NativeToManagedMap[__Instance] = this; + Internal.ctor_0((__Instance + __PointerAdjustment)); } public ParagraphComment(CppSharp.Parser.AST.ParagraphComment _0) @@ -10690,14 +10983,14 @@ namespace CppSharp { __Instance = Marshal.AllocHGlobal(20); __ownsNativeInstance = true; - var arg0 = ReferenceEquals(_0, null) ? global::System.IntPtr.Zero : _0.__Instance; - Internal.cctor_2(__Instance, arg0); NativeToManagedMap[__Instance] = this; + var arg0 = ReferenceEquals(_0, null) ? global::System.IntPtr.Zero : _0.__Instance; + Internal.cctor_2((__Instance + __PointerAdjustment), arg0); } public CppSharp.Parser.AST.InlineContentComment getContent(uint i) { - var __ret = Internal.getContent_0(__Instance, i); + var __ret = Internal.getContent_0((__Instance + __PointerAdjustment), i); CppSharp.Parser.AST.InlineContentComment __result0; if (__ret == IntPtr.Zero) __result0 = null; else if (CppSharp.Parser.AST.InlineContentComment.NativeToManagedMap.ContainsKey(__ret)) @@ -10709,19 +11002,19 @@ namespace CppSharp public void addContent(CppSharp.Parser.AST.InlineContentComment s) { var arg0 = ReferenceEquals(s, null) ? global::System.IntPtr.Zero : s.__Instance; - Internal.addContent_0(__Instance, arg0); + Internal.addContent_0((__Instance + __PointerAdjustment), arg0); } public void clearContent() { - Internal.clearContent_0(__Instance); + Internal.clearContent_0((__Instance + __PointerAdjustment)); } public uint ContentCount { get { - var __ret = Internal.getContentCount_0(__Instance); + var __ret = Internal.getContentCount_0((__Instance + __PointerAdjustment)); return __ret; } } @@ -10827,19 +11120,21 @@ namespace CppSharp } public global::System.IntPtr __Instance { get; protected set; } + + protected int __PointerAdjustment; public static readonly System.Collections.Concurrent.ConcurrentDictionary NativeToManagedMap = new System.Collections.Concurrent.ConcurrentDictionary(); protected void*[] __OriginalVTables; protected bool __ownsNativeInstance; - public static Argument __CreateInstance(global::System.IntPtr native, bool ownsNativeInstance = false) + public static Argument __CreateInstance(global::System.IntPtr native, bool ownsNativeInstance = false, bool skipVTables = false) { - return new Argument((Argument.Internal*) native) { __ownsNativeInstance = ownsNativeInstance }; + return new Argument((Argument.Internal*) native, skipVTables) { __ownsNativeInstance = ownsNativeInstance }; } - public static Argument __CreateInstance(Argument.Internal native) + public static Argument __CreateInstance(Argument.Internal native, bool skipVTables = false) { - return new Argument(native); + return new Argument(native, skipVTables); } private static Argument.Internal* __CopyValue(Argument.Internal native) @@ -10849,15 +11144,17 @@ namespace CppSharp return (Argument.Internal*) ret; } - private Argument(Argument.Internal native) - : this(__CopyValue(native)) + private Argument(Argument.Internal native, bool skipVTables = false) + : this(__CopyValue(native), skipVTables) { __ownsNativeInstance = true; NativeToManagedMap[__Instance] = this; } - protected Argument(Argument.Internal* native, bool isInternalImpl = false) + protected Argument(Argument.Internal* native, bool skipVTables = false) { + if (native == null) + return; __Instance = new global::System.IntPtr(native); } @@ -10865,17 +11162,17 @@ namespace CppSharp { __Instance = Marshal.AllocHGlobal(12); __ownsNativeInstance = true; - Internal.ctor_0(__Instance); NativeToManagedMap[__Instance] = this; + Internal.ctor_0((__Instance + __PointerAdjustment)); } public Argument(CppSharp.Parser.AST.InlineCommandComment.Argument _0) { __Instance = Marshal.AllocHGlobal(12); __ownsNativeInstance = true; - var arg0 = ReferenceEquals(_0, null) ? global::System.IntPtr.Zero : _0.__Instance; - Internal.cctor_2(__Instance, arg0); NativeToManagedMap[__Instance] = this; + var arg0 = ReferenceEquals(_0, null) ? global::System.IntPtr.Zero : _0.__Instance; + Internal.cctor_2((__Instance + __PointerAdjustment), arg0); } public void Dispose() @@ -10889,35 +11186,36 @@ namespace CppSharp throw new global::System.InvalidOperationException("Managed instances owned by native code cannot be disposed of."); CppSharp.Parser.AST.InlineCommandComment.Argument __dummy; NativeToManagedMap.TryRemove(__Instance, out __dummy); - Internal.dtor_0(__Instance); - Marshal.FreeHGlobal(__Instance); + Internal.dtor_0((__Instance + __PointerAdjustment)); + if (__ownsNativeInstance) + Marshal.FreeHGlobal(__Instance); } public string Text { get { - var __ret = Internal.getText_0(__Instance); + var __ret = Internal.getText_0((__Instance + __PointerAdjustment)); return Marshal.PtrToStringAnsi(__ret); } set { var arg0 = Marshal.StringToHGlobalAnsi(value); - Internal.setText_0(__Instance, arg0); + Internal.setText_0((__Instance + __PointerAdjustment), arg0); Marshal.FreeHGlobal(arg0); } } } - public static new InlineCommandComment __CreateInstance(global::System.IntPtr native, bool ownsNativeInstance = false) + public static new InlineCommandComment __CreateInstance(global::System.IntPtr native, bool ownsNativeInstance = false, bool skipVTables = false) { - return new InlineCommandComment((InlineCommandComment.Internal*) native) { __ownsNativeInstance = ownsNativeInstance }; + return new InlineCommandComment((InlineCommandComment.Internal*) native, skipVTables) { __ownsNativeInstance = ownsNativeInstance }; } - public static InlineCommandComment __CreateInstance(InlineCommandComment.Internal native) + public static InlineCommandComment __CreateInstance(InlineCommandComment.Internal native, bool skipVTables = false) { - return new InlineCommandComment(native); + return new InlineCommandComment(native, skipVTables); } private static InlineCommandComment.Internal* __CopyValue(InlineCommandComment.Internal native) @@ -10927,16 +11225,20 @@ namespace CppSharp return (InlineCommandComment.Internal*) ret; } - private InlineCommandComment(InlineCommandComment.Internal native) - : this(__CopyValue(native)) + private InlineCommandComment(InlineCommandComment.Internal native, bool skipVTables = false) + : this(__CopyValue(native), skipVTables) { __ownsNativeInstance = true; NativeToManagedMap[__Instance] = this; } - protected InlineCommandComment(InlineCommandComment.Internal* native, bool isInternalImpl = false) - : base((CppSharp.Parser.AST.InlineContentComment.Internal*) native) + protected InlineCommandComment(InlineCommandComment.Internal* native, bool skipVTables = false) + : base((CppSharp.Parser.AST.InlineContentComment.Internal*) null) { + __PointerAdjustment = 0; + if (native == null) + return; + __Instance = new global::System.IntPtr(native); } public InlineCommandComment() @@ -10944,8 +11246,8 @@ namespace CppSharp { __Instance = Marshal.AllocHGlobal(20); __ownsNativeInstance = true; - Internal.ctor_0(__Instance); NativeToManagedMap[__Instance] = this; + Internal.ctor_0((__Instance + __PointerAdjustment)); } public InlineCommandComment(CppSharp.Parser.AST.InlineCommandComment _0) @@ -10953,34 +11255,34 @@ namespace CppSharp { __Instance = Marshal.AllocHGlobal(20); __ownsNativeInstance = true; - var arg0 = ReferenceEquals(_0, null) ? global::System.IntPtr.Zero : _0.__Instance; - Internal.cctor_2(__Instance, arg0); NativeToManagedMap[__Instance] = this; + var arg0 = ReferenceEquals(_0, null) ? global::System.IntPtr.Zero : _0.__Instance; + Internal.cctor_2((__Instance + __PointerAdjustment), arg0); } public CppSharp.Parser.AST.InlineCommandComment.Argument getArguments(uint i) { var __ret = new CppSharp.Parser.AST.InlineCommandComment.Argument.Internal(); - Internal.getArguments_0(new IntPtr(&__ret), __Instance, i); + Internal.getArguments_0(new IntPtr(&__ret), (__Instance + __PointerAdjustment), i); return CppSharp.Parser.AST.InlineCommandComment.Argument.__CreateInstance(__ret); } public void addArguments(CppSharp.Parser.AST.InlineCommandComment.Argument s) { var arg0 = ReferenceEquals(s, null) ? global::System.IntPtr.Zero : s.__Instance; - Internal.addArguments_0(__Instance, arg0); + Internal.addArguments_0((__Instance + __PointerAdjustment), arg0); } public void clearArguments() { - Internal.clearArguments_0(__Instance); + Internal.clearArguments_0((__Instance + __PointerAdjustment)); } public uint ArgumentsCount { get { - var __ret = Internal.getArgumentsCount_0(__Instance); + var __ret = Internal.getArgumentsCount_0((__Instance + __PointerAdjustment)); return __ret; } } @@ -11023,14 +11325,14 @@ namespace CppSharp internal static extern void cctor_2(global::System.IntPtr instance, global::System.IntPtr _0); } - public static new HTMLTagComment __CreateInstance(global::System.IntPtr native, bool ownsNativeInstance = false) + public static new HTMLTagComment __CreateInstance(global::System.IntPtr native, bool ownsNativeInstance = false, bool skipVTables = false) { - return new HTMLTagComment((HTMLTagComment.Internal*) native) { __ownsNativeInstance = ownsNativeInstance }; + return new HTMLTagComment((HTMLTagComment.Internal*) native, skipVTables) { __ownsNativeInstance = ownsNativeInstance }; } - public static HTMLTagComment __CreateInstance(HTMLTagComment.Internal native) + public static HTMLTagComment __CreateInstance(HTMLTagComment.Internal native, bool skipVTables = false) { - return new HTMLTagComment(native); + return new HTMLTagComment(native, skipVTables); } private static HTMLTagComment.Internal* __CopyValue(HTMLTagComment.Internal native) @@ -11040,16 +11342,20 @@ namespace CppSharp return ret; } - private HTMLTagComment(HTMLTagComment.Internal native) - : this(__CopyValue(native)) + private HTMLTagComment(HTMLTagComment.Internal native, bool skipVTables = false) + : this(__CopyValue(native), skipVTables) { __ownsNativeInstance = true; NativeToManagedMap[__Instance] = this; } - protected HTMLTagComment(HTMLTagComment.Internal* native, bool isInternalImpl = false) - : base((CppSharp.Parser.AST.InlineContentComment.Internal*) native) + protected HTMLTagComment(HTMLTagComment.Internal* native, bool skipVTables = false) + : base((CppSharp.Parser.AST.InlineContentComment.Internal*) null) { + __PointerAdjustment = 0; + if (native == null) + return; + __Instance = new global::System.IntPtr(native); } public HTMLTagComment() @@ -11057,8 +11363,8 @@ namespace CppSharp { __Instance = Marshal.AllocHGlobal(4); __ownsNativeInstance = true; - Internal.ctor_0(__Instance); NativeToManagedMap[__Instance] = this; + Internal.ctor_0((__Instance + __PointerAdjustment)); } public HTMLTagComment(CppSharp.Parser.AST.CommentKind Kind) @@ -11066,9 +11372,9 @@ namespace CppSharp { __Instance = Marshal.AllocHGlobal(4); __ownsNativeInstance = true; - var arg0 = Kind; - Internal.ctor_1(__Instance, arg0); NativeToManagedMap[__Instance] = this; + var arg0 = Kind; + Internal.ctor_1((__Instance + __PointerAdjustment), arg0); } public HTMLTagComment(CppSharp.Parser.AST.HTMLTagComment _0) @@ -11076,8 +11382,8 @@ namespace CppSharp { __Instance = Marshal.AllocHGlobal(4); __ownsNativeInstance = true; - *((HTMLTagComment.Internal*) __Instance) = *((HTMLTagComment.Internal*) _0.__Instance); NativeToManagedMap[__Instance] = this; + *((HTMLTagComment.Internal*) __Instance) = *((HTMLTagComment.Internal*) _0.__Instance); } } @@ -11177,19 +11483,21 @@ namespace CppSharp } public global::System.IntPtr __Instance { get; protected set; } + + protected int __PointerAdjustment; public static readonly System.Collections.Concurrent.ConcurrentDictionary NativeToManagedMap = new System.Collections.Concurrent.ConcurrentDictionary(); protected void*[] __OriginalVTables; protected bool __ownsNativeInstance; - public static Attribute __CreateInstance(global::System.IntPtr native, bool ownsNativeInstance = false) + public static Attribute __CreateInstance(global::System.IntPtr native, bool ownsNativeInstance = false, bool skipVTables = false) { - return new Attribute((Attribute.Internal*) native) { __ownsNativeInstance = ownsNativeInstance }; + return new Attribute((Attribute.Internal*) native, skipVTables) { __ownsNativeInstance = ownsNativeInstance }; } - public static Attribute __CreateInstance(Attribute.Internal native) + public static Attribute __CreateInstance(Attribute.Internal native, bool skipVTables = false) { - return new Attribute(native); + return new Attribute(native, skipVTables); } private static Attribute.Internal* __CopyValue(Attribute.Internal native) @@ -11199,15 +11507,17 @@ namespace CppSharp return (Attribute.Internal*) ret; } - private Attribute(Attribute.Internal native) - : this(__CopyValue(native)) + private Attribute(Attribute.Internal native, bool skipVTables = false) + : this(__CopyValue(native), skipVTables) { __ownsNativeInstance = true; NativeToManagedMap[__Instance] = this; } - protected Attribute(Attribute.Internal* native, bool isInternalImpl = false) + protected Attribute(Attribute.Internal* native, bool skipVTables = false) { + if (native == null) + return; __Instance = new global::System.IntPtr(native); } @@ -11215,17 +11525,17 @@ namespace CppSharp { __Instance = Marshal.AllocHGlobal(24); __ownsNativeInstance = true; - Internal.ctor_0(__Instance); NativeToManagedMap[__Instance] = this; + Internal.ctor_0((__Instance + __PointerAdjustment)); } public Attribute(CppSharp.Parser.AST.HTMLStartTagComment.Attribute _0) { __Instance = Marshal.AllocHGlobal(24); __ownsNativeInstance = true; - var arg0 = ReferenceEquals(_0, null) ? global::System.IntPtr.Zero : _0.__Instance; - Internal.cctor_2(__Instance, arg0); NativeToManagedMap[__Instance] = this; + var arg0 = ReferenceEquals(_0, null) ? global::System.IntPtr.Zero : _0.__Instance; + Internal.cctor_2((__Instance + __PointerAdjustment), arg0); } public void Dispose() @@ -11239,22 +11549,23 @@ namespace CppSharp throw new global::System.InvalidOperationException("Managed instances owned by native code cannot be disposed of."); CppSharp.Parser.AST.HTMLStartTagComment.Attribute __dummy; NativeToManagedMap.TryRemove(__Instance, out __dummy); - Internal.dtor_0(__Instance); - Marshal.FreeHGlobal(__Instance); + Internal.dtor_0((__Instance + __PointerAdjustment)); + if (__ownsNativeInstance) + Marshal.FreeHGlobal(__Instance); } public string Name { get { - var __ret = Internal.getName_0(__Instance); + var __ret = Internal.getName_0((__Instance + __PointerAdjustment)); return Marshal.PtrToStringAnsi(__ret); } set { var arg0 = Marshal.StringToHGlobalAnsi(value); - Internal.setName_0(__Instance, arg0); + Internal.setName_0((__Instance + __PointerAdjustment), arg0); Marshal.FreeHGlobal(arg0); } } @@ -11263,27 +11574,27 @@ namespace CppSharp { get { - var __ret = Internal.getValue_0(__Instance); + var __ret = Internal.getValue_0((__Instance + __PointerAdjustment)); return Marshal.PtrToStringAnsi(__ret); } set { var arg0 = Marshal.StringToHGlobalAnsi(value); - Internal.setValue_0(__Instance, arg0); + Internal.setValue_0((__Instance + __PointerAdjustment), arg0); Marshal.FreeHGlobal(arg0); } } } - public static new HTMLStartTagComment __CreateInstance(global::System.IntPtr native, bool ownsNativeInstance = false) + public static new HTMLStartTagComment __CreateInstance(global::System.IntPtr native, bool ownsNativeInstance = false, bool skipVTables = false) { - return new HTMLStartTagComment((HTMLStartTagComment.Internal*) native) { __ownsNativeInstance = ownsNativeInstance }; + return new HTMLStartTagComment((HTMLStartTagComment.Internal*) native, skipVTables) { __ownsNativeInstance = ownsNativeInstance }; } - public static HTMLStartTagComment __CreateInstance(HTMLStartTagComment.Internal native) + public static HTMLStartTagComment __CreateInstance(HTMLStartTagComment.Internal native, bool skipVTables = false) { - return new HTMLStartTagComment(native); + return new HTMLStartTagComment(native, skipVTables); } private static HTMLStartTagComment.Internal* __CopyValue(HTMLStartTagComment.Internal native) @@ -11293,16 +11604,20 @@ namespace CppSharp return (HTMLStartTagComment.Internal*) ret; } - private HTMLStartTagComment(HTMLStartTagComment.Internal native) - : this(__CopyValue(native)) + private HTMLStartTagComment(HTMLStartTagComment.Internal native, bool skipVTables = false) + : this(__CopyValue(native), skipVTables) { __ownsNativeInstance = true; NativeToManagedMap[__Instance] = this; } - protected HTMLStartTagComment(HTMLStartTagComment.Internal* native, bool isInternalImpl = false) - : base((CppSharp.Parser.AST.HTMLTagComment.Internal*) native) + protected HTMLStartTagComment(HTMLStartTagComment.Internal* native, bool skipVTables = false) + : base((CppSharp.Parser.AST.HTMLTagComment.Internal*) null) { + __PointerAdjustment = 0; + if (native == null) + return; + __Instance = new global::System.IntPtr(native); } public HTMLStartTagComment() @@ -11310,8 +11625,8 @@ namespace CppSharp { __Instance = Marshal.AllocHGlobal(28); __ownsNativeInstance = true; - Internal.ctor_0(__Instance); NativeToManagedMap[__Instance] = this; + Internal.ctor_0((__Instance + __PointerAdjustment)); } public HTMLStartTagComment(CppSharp.Parser.AST.HTMLStartTagComment _0) @@ -11319,41 +11634,41 @@ namespace CppSharp { __Instance = Marshal.AllocHGlobal(28); __ownsNativeInstance = true; - var arg0 = ReferenceEquals(_0, null) ? global::System.IntPtr.Zero : _0.__Instance; - Internal.cctor_2(__Instance, arg0); NativeToManagedMap[__Instance] = this; + var arg0 = ReferenceEquals(_0, null) ? global::System.IntPtr.Zero : _0.__Instance; + Internal.cctor_2((__Instance + __PointerAdjustment), arg0); } public CppSharp.Parser.AST.HTMLStartTagComment.Attribute getAttributes(uint i) { var __ret = new CppSharp.Parser.AST.HTMLStartTagComment.Attribute.Internal(); - Internal.getAttributes_0(new IntPtr(&__ret), __Instance, i); + Internal.getAttributes_0(new IntPtr(&__ret), (__Instance + __PointerAdjustment), i); return CppSharp.Parser.AST.HTMLStartTagComment.Attribute.__CreateInstance(__ret); } public void addAttributes(CppSharp.Parser.AST.HTMLStartTagComment.Attribute s) { var arg0 = ReferenceEquals(s, null) ? global::System.IntPtr.Zero : s.__Instance; - Internal.addAttributes_0(__Instance, arg0); + Internal.addAttributes_0((__Instance + __PointerAdjustment), arg0); } public void clearAttributes() { - Internal.clearAttributes_0(__Instance); + Internal.clearAttributes_0((__Instance + __PointerAdjustment)); } public string TagName { get { - var __ret = Internal.getTagName_0(__Instance); + var __ret = Internal.getTagName_0((__Instance + __PointerAdjustment)); return Marshal.PtrToStringAnsi(__ret); } set { var arg0 = Marshal.StringToHGlobalAnsi(value); - Internal.setTagName_0(__Instance, arg0); + Internal.setTagName_0((__Instance + __PointerAdjustment), arg0); Marshal.FreeHGlobal(arg0); } } @@ -11362,7 +11677,7 @@ namespace CppSharp { get { - var __ret = Internal.getAttributesCount_0(__Instance); + var __ret = Internal.getAttributesCount_0((__Instance + __PointerAdjustment)); return __ret; } } @@ -11402,14 +11717,14 @@ namespace CppSharp internal static extern void setTagName_0(global::System.IntPtr instance, global::System.IntPtr s); } - public static new HTMLEndTagComment __CreateInstance(global::System.IntPtr native, bool ownsNativeInstance = false) + public static new HTMLEndTagComment __CreateInstance(global::System.IntPtr native, bool ownsNativeInstance = false, bool skipVTables = false) { - return new HTMLEndTagComment((HTMLEndTagComment.Internal*) native) { __ownsNativeInstance = ownsNativeInstance }; + return new HTMLEndTagComment((HTMLEndTagComment.Internal*) native, skipVTables) { __ownsNativeInstance = ownsNativeInstance }; } - public static HTMLEndTagComment __CreateInstance(HTMLEndTagComment.Internal native) + public static HTMLEndTagComment __CreateInstance(HTMLEndTagComment.Internal native, bool skipVTables = false) { - return new HTMLEndTagComment(native); + return new HTMLEndTagComment(native, skipVTables); } private static HTMLEndTagComment.Internal* __CopyValue(HTMLEndTagComment.Internal native) @@ -11419,16 +11734,20 @@ namespace CppSharp return (HTMLEndTagComment.Internal*) ret; } - private HTMLEndTagComment(HTMLEndTagComment.Internal native) - : this(__CopyValue(native)) + private HTMLEndTagComment(HTMLEndTagComment.Internal native, bool skipVTables = false) + : this(__CopyValue(native), skipVTables) { __ownsNativeInstance = true; NativeToManagedMap[__Instance] = this; } - protected HTMLEndTagComment(HTMLEndTagComment.Internal* native, bool isInternalImpl = false) - : base((CppSharp.Parser.AST.HTMLTagComment.Internal*) native) + protected HTMLEndTagComment(HTMLEndTagComment.Internal* native, bool skipVTables = false) + : base((CppSharp.Parser.AST.HTMLTagComment.Internal*) null) { + __PointerAdjustment = 0; + if (native == null) + return; + __Instance = new global::System.IntPtr(native); } public HTMLEndTagComment() @@ -11436,8 +11755,8 @@ namespace CppSharp { __Instance = Marshal.AllocHGlobal(16); __ownsNativeInstance = true; - Internal.ctor_0(__Instance); NativeToManagedMap[__Instance] = this; + Internal.ctor_0((__Instance + __PointerAdjustment)); } public HTMLEndTagComment(CppSharp.Parser.AST.HTMLEndTagComment _0) @@ -11445,23 +11764,23 @@ namespace CppSharp { __Instance = Marshal.AllocHGlobal(16); __ownsNativeInstance = true; - var arg0 = ReferenceEquals(_0, null) ? global::System.IntPtr.Zero : _0.__Instance; - Internal.cctor_2(__Instance, arg0); NativeToManagedMap[__Instance] = this; + var arg0 = ReferenceEquals(_0, null) ? global::System.IntPtr.Zero : _0.__Instance; + Internal.cctor_2((__Instance + __PointerAdjustment), arg0); } public string TagName { get { - var __ret = Internal.getTagName_0(__Instance); + var __ret = Internal.getTagName_0((__Instance + __PointerAdjustment)); return Marshal.PtrToStringAnsi(__ret); } set { var arg0 = Marshal.StringToHGlobalAnsi(value); - Internal.setTagName_0(__Instance, arg0); + Internal.setTagName_0((__Instance + __PointerAdjustment), arg0); Marshal.FreeHGlobal(arg0); } } @@ -11501,14 +11820,14 @@ namespace CppSharp internal static extern void setText_0(global::System.IntPtr instance, global::System.IntPtr s); } - public static new TextComment __CreateInstance(global::System.IntPtr native, bool ownsNativeInstance = false) + public static new TextComment __CreateInstance(global::System.IntPtr native, bool ownsNativeInstance = false, bool skipVTables = false) { - return new TextComment((TextComment.Internal*) native) { __ownsNativeInstance = ownsNativeInstance }; + return new TextComment((TextComment.Internal*) native, skipVTables) { __ownsNativeInstance = ownsNativeInstance }; } - public static TextComment __CreateInstance(TextComment.Internal native) + public static TextComment __CreateInstance(TextComment.Internal native, bool skipVTables = false) { - return new TextComment(native); + return new TextComment(native, skipVTables); } private static TextComment.Internal* __CopyValue(TextComment.Internal native) @@ -11518,16 +11837,20 @@ namespace CppSharp return (TextComment.Internal*) ret; } - private TextComment(TextComment.Internal native) - : this(__CopyValue(native)) + private TextComment(TextComment.Internal native, bool skipVTables = false) + : this(__CopyValue(native), skipVTables) { __ownsNativeInstance = true; NativeToManagedMap[__Instance] = this; } - protected TextComment(TextComment.Internal* native, bool isInternalImpl = false) - : base((CppSharp.Parser.AST.InlineContentComment.Internal*) native) + protected TextComment(TextComment.Internal* native, bool skipVTables = false) + : base((CppSharp.Parser.AST.InlineContentComment.Internal*) null) { + __PointerAdjustment = 0; + if (native == null) + return; + __Instance = new global::System.IntPtr(native); } public TextComment() @@ -11535,8 +11858,8 @@ namespace CppSharp { __Instance = Marshal.AllocHGlobal(16); __ownsNativeInstance = true; - Internal.ctor_0(__Instance); NativeToManagedMap[__Instance] = this; + Internal.ctor_0((__Instance + __PointerAdjustment)); } public TextComment(CppSharp.Parser.AST.TextComment _0) @@ -11544,23 +11867,23 @@ namespace CppSharp { __Instance = Marshal.AllocHGlobal(16); __ownsNativeInstance = true; - var arg0 = ReferenceEquals(_0, null) ? global::System.IntPtr.Zero : _0.__Instance; - Internal.cctor_2(__Instance, arg0); NativeToManagedMap[__Instance] = this; + var arg0 = ReferenceEquals(_0, null) ? global::System.IntPtr.Zero : _0.__Instance; + Internal.cctor_2((__Instance + __PointerAdjustment), arg0); } public string Text { get { - var __ret = Internal.getText_0(__Instance); + var __ret = Internal.getText_0((__Instance + __PointerAdjustment)); return Marshal.PtrToStringAnsi(__ret); } set { var arg0 = Marshal.StringToHGlobalAnsi(value); - Internal.setText_0(__Instance, arg0); + Internal.setText_0((__Instance + __PointerAdjustment), arg0); Marshal.FreeHGlobal(arg0); } } @@ -11614,19 +11937,21 @@ namespace CppSharp } public global::System.IntPtr __Instance { get; protected set; } + + protected int __PointerAdjustment; public static readonly System.Collections.Concurrent.ConcurrentDictionary NativeToManagedMap = new System.Collections.Concurrent.ConcurrentDictionary(); protected void*[] __OriginalVTables; protected bool __ownsNativeInstance; - public static RawComment __CreateInstance(global::System.IntPtr native, bool ownsNativeInstance = false) + public static RawComment __CreateInstance(global::System.IntPtr native, bool ownsNativeInstance = false, bool skipVTables = false) { - return new RawComment((RawComment.Internal*) native) { __ownsNativeInstance = ownsNativeInstance }; + return new RawComment((RawComment.Internal*) native, skipVTables) { __ownsNativeInstance = ownsNativeInstance }; } - public static RawComment __CreateInstance(RawComment.Internal native) + public static RawComment __CreateInstance(RawComment.Internal native, bool skipVTables = false) { - return new RawComment(native); + return new RawComment(native, skipVTables); } private static RawComment.Internal* __CopyValue(RawComment.Internal native) @@ -11636,15 +11961,17 @@ namespace CppSharp return (RawComment.Internal*) ret; } - private RawComment(RawComment.Internal native) - : this(__CopyValue(native)) + private RawComment(RawComment.Internal native, bool skipVTables = false) + : this(__CopyValue(native), skipVTables) { __ownsNativeInstance = true; NativeToManagedMap[__Instance] = this; } - protected RawComment(RawComment.Internal* native, bool isInternalImpl = false) + protected RawComment(RawComment.Internal* native, bool skipVTables = false) { + if (native == null) + return; __Instance = new global::System.IntPtr(native); } @@ -11652,17 +11979,17 @@ namespace CppSharp { __Instance = Marshal.AllocHGlobal(32); __ownsNativeInstance = true; - Internal.ctor_0(__Instance); NativeToManagedMap[__Instance] = this; + Internal.ctor_0((__Instance + __PointerAdjustment)); } public RawComment(CppSharp.Parser.AST.RawComment _0) { __Instance = Marshal.AllocHGlobal(32); __ownsNativeInstance = true; - var arg0 = ReferenceEquals(_0, null) ? global::System.IntPtr.Zero : _0.__Instance; - Internal.cctor_2(__Instance, arg0); NativeToManagedMap[__Instance] = this; + var arg0 = ReferenceEquals(_0, null) ? global::System.IntPtr.Zero : _0.__Instance; + Internal.cctor_2((__Instance + __PointerAdjustment), arg0); } public void Dispose() @@ -11676,22 +12003,23 @@ namespace CppSharp throw new global::System.InvalidOperationException("Managed instances owned by native code cannot be disposed of."); CppSharp.Parser.AST.RawComment __dummy; NativeToManagedMap.TryRemove(__Instance, out __dummy); - Internal.dtor_0(__Instance); - Marshal.FreeHGlobal(__Instance); + Internal.dtor_0((__Instance + __PointerAdjustment)); + if (__ownsNativeInstance) + Marshal.FreeHGlobal(__Instance); } public string Text { get { - var __ret = Internal.getText_0(__Instance); + var __ret = Internal.getText_0((__Instance + __PointerAdjustment)); return Marshal.PtrToStringAnsi(__ret); } set { var arg0 = Marshal.StringToHGlobalAnsi(value); - Internal.setText_0(__Instance, arg0); + Internal.setText_0((__Instance + __PointerAdjustment), arg0); Marshal.FreeHGlobal(arg0); } } @@ -11700,14 +12028,14 @@ namespace CppSharp { get { - var __ret = Internal.getBriefText_0(__Instance); + var __ret = Internal.getBriefText_0((__Instance + __PointerAdjustment)); return Marshal.PtrToStringAnsi(__ret); } set { var arg0 = Marshal.StringToHGlobalAnsi(value); - Internal.setBriefText_0(__Instance, arg0); + Internal.setBriefText_0((__Instance + __PointerAdjustment), arg0); Marshal.FreeHGlobal(arg0); } } diff --git a/src/CppParser/Bindings/CSharp/i686-apple-darwin12.4.0/CppParser.cs b/src/CppParser/Bindings/CSharp/i686-apple-darwin12.4.0/CppParser.cs index a994353e..35a34e5d 100644 --- a/src/CppParser/Bindings/CSharp/i686-apple-darwin12.4.0/CppParser.cs +++ b/src/CppParser/Bindings/CSharp/i686-apple-darwin12.4.0/CppParser.cs @@ -234,19 +234,21 @@ namespace CppSharp } public global::System.IntPtr __Instance { get; protected set; } + + protected int __PointerAdjustment; public static readonly System.Collections.Concurrent.ConcurrentDictionary NativeToManagedMap = new System.Collections.Concurrent.ConcurrentDictionary(); protected void*[] __OriginalVTables; protected bool __ownsNativeInstance; - public static ParserOptions __CreateInstance(global::System.IntPtr native, bool ownsNativeInstance = false) + public static ParserOptions __CreateInstance(global::System.IntPtr native, bool ownsNativeInstance = false, bool skipVTables = false) { - return new ParserOptions((ParserOptions.Internal*) native) { __ownsNativeInstance = ownsNativeInstance }; + return new ParserOptions((ParserOptions.Internal*) native, skipVTables) { __ownsNativeInstance = ownsNativeInstance }; } - public static ParserOptions __CreateInstance(ParserOptions.Internal native) + public static ParserOptions __CreateInstance(ParserOptions.Internal native, bool skipVTables = false) { - return new ParserOptions(native); + return new ParserOptions(native, skipVTables); } private static ParserOptions.Internal* __CopyValue(ParserOptions.Internal native) @@ -256,15 +258,17 @@ namespace CppSharp return (ParserOptions.Internal*) ret; } - private ParserOptions(ParserOptions.Internal native) - : this(__CopyValue(native)) + private ParserOptions(ParserOptions.Internal native, bool skipVTables = false) + : this(__CopyValue(native), skipVTables) { __ownsNativeInstance = true; NativeToManagedMap[__Instance] = this; } - protected ParserOptions(ParserOptions.Internal* native, bool isInternalImpl = false) + protected ParserOptions(ParserOptions.Internal* native, bool skipVTables = false) { + if (native == null) + return; __Instance = new global::System.IntPtr(native); } @@ -272,17 +276,17 @@ namespace CppSharp { __Instance = Marshal.AllocHGlobal(120); __ownsNativeInstance = true; - Internal.ctor_0(__Instance); NativeToManagedMap[__Instance] = this; + Internal.ctor_0((__Instance + __PointerAdjustment)); } public ParserOptions(CppSharp.Parser.ParserOptions _0) { __Instance = Marshal.AllocHGlobal(120); __ownsNativeInstance = true; - var arg0 = ReferenceEquals(_0, null) ? global::System.IntPtr.Zero : _0.__Instance; - Internal.cctor_2(__Instance, arg0); NativeToManagedMap[__Instance] = this; + var arg0 = ReferenceEquals(_0, null) ? global::System.IntPtr.Zero : _0.__Instance; + Internal.cctor_2((__Instance + __PointerAdjustment), arg0); } public void Dispose() @@ -296,123 +300,124 @@ namespace CppSharp throw new global::System.InvalidOperationException("Managed instances owned by native code cannot be disposed of."); CppSharp.Parser.ParserOptions __dummy; NativeToManagedMap.TryRemove(__Instance, out __dummy); - Internal.dtor_0(__Instance); - Marshal.FreeHGlobal(__Instance); + Internal.dtor_0((__Instance + __PointerAdjustment)); + if (__ownsNativeInstance) + Marshal.FreeHGlobal(__Instance); } public string getArguments(uint i) { - var __ret = Internal.getArguments_0(__Instance, i); + var __ret = Internal.getArguments_0((__Instance + __PointerAdjustment), i); return Marshal.PtrToStringAnsi(__ret); } public void addArguments(string s) { var arg0 = Marshal.StringToHGlobalAnsi(s); - Internal.addArguments_0(__Instance, arg0); + Internal.addArguments_0((__Instance + __PointerAdjustment), arg0); Marshal.FreeHGlobal(arg0); } public void clearArguments() { - Internal.clearArguments_0(__Instance); + Internal.clearArguments_0((__Instance + __PointerAdjustment)); } public string getIncludeDirs(uint i) { - var __ret = Internal.getIncludeDirs_0(__Instance, i); + var __ret = Internal.getIncludeDirs_0((__Instance + __PointerAdjustment), i); return Marshal.PtrToStringAnsi(__ret); } public void addIncludeDirs(string s) { var arg0 = Marshal.StringToHGlobalAnsi(s); - Internal.addIncludeDirs_0(__Instance, arg0); + Internal.addIncludeDirs_0((__Instance + __PointerAdjustment), arg0); Marshal.FreeHGlobal(arg0); } public void clearIncludeDirs() { - Internal.clearIncludeDirs_0(__Instance); + Internal.clearIncludeDirs_0((__Instance + __PointerAdjustment)); } public string getSystemIncludeDirs(uint i) { - var __ret = Internal.getSystemIncludeDirs_0(__Instance, i); + var __ret = Internal.getSystemIncludeDirs_0((__Instance + __PointerAdjustment), i); return Marshal.PtrToStringAnsi(__ret); } public void addSystemIncludeDirs(string s) { var arg0 = Marshal.StringToHGlobalAnsi(s); - Internal.addSystemIncludeDirs_0(__Instance, arg0); + Internal.addSystemIncludeDirs_0((__Instance + __PointerAdjustment), arg0); Marshal.FreeHGlobal(arg0); } public void clearSystemIncludeDirs() { - Internal.clearSystemIncludeDirs_0(__Instance); + Internal.clearSystemIncludeDirs_0((__Instance + __PointerAdjustment)); } public string getDefines(uint i) { - var __ret = Internal.getDefines_0(__Instance, i); + var __ret = Internal.getDefines_0((__Instance + __PointerAdjustment), i); return Marshal.PtrToStringAnsi(__ret); } public void addDefines(string s) { var arg0 = Marshal.StringToHGlobalAnsi(s); - Internal.addDefines_0(__Instance, arg0); + Internal.addDefines_0((__Instance + __PointerAdjustment), arg0); Marshal.FreeHGlobal(arg0); } public void clearDefines() { - Internal.clearDefines_0(__Instance); + Internal.clearDefines_0((__Instance + __PointerAdjustment)); } public string getUndefines(uint i) { - var __ret = Internal.getUndefines_0(__Instance, i); + var __ret = Internal.getUndefines_0((__Instance + __PointerAdjustment), i); return Marshal.PtrToStringAnsi(__ret); } public void addUndefines(string s) { var arg0 = Marshal.StringToHGlobalAnsi(s); - Internal.addUndefines_0(__Instance, arg0); + Internal.addUndefines_0((__Instance + __PointerAdjustment), arg0); Marshal.FreeHGlobal(arg0); } public void clearUndefines() { - Internal.clearUndefines_0(__Instance); + Internal.clearUndefines_0((__Instance + __PointerAdjustment)); } public string getLibraryDirs(uint i) { - var __ret = Internal.getLibraryDirs_0(__Instance, i); + var __ret = Internal.getLibraryDirs_0((__Instance + __PointerAdjustment), i); return Marshal.PtrToStringAnsi(__ret); } public void addLibraryDirs(string s) { var arg0 = Marshal.StringToHGlobalAnsi(s); - Internal.addLibraryDirs_0(__Instance, arg0); + Internal.addLibraryDirs_0((__Instance + __PointerAdjustment), arg0); Marshal.FreeHGlobal(arg0); } public void clearLibraryDirs() { - Internal.clearLibraryDirs_0(__Instance); + Internal.clearLibraryDirs_0((__Instance + __PointerAdjustment)); } public uint ArgumentsCount { get { - var __ret = Internal.getArgumentsCount_0(__Instance); + var __ret = Internal.getArgumentsCount_0((__Instance + __PointerAdjustment)); return __ret; } } @@ -421,14 +426,14 @@ namespace CppSharp { get { - var __ret = Internal.getFileName_0(__Instance); + var __ret = Internal.getFileName_0((__Instance + __PointerAdjustment)); return Marshal.PtrToStringAnsi(__ret); } set { var arg0 = Marshal.StringToHGlobalAnsi(value); - Internal.setFileName_0(__Instance, arg0); + Internal.setFileName_0((__Instance + __PointerAdjustment), arg0); Marshal.FreeHGlobal(arg0); } } @@ -437,7 +442,7 @@ namespace CppSharp { get { - var __ret = Internal.getIncludeDirsCount_0(__Instance); + var __ret = Internal.getIncludeDirsCount_0((__Instance + __PointerAdjustment)); return __ret; } } @@ -446,7 +451,7 @@ namespace CppSharp { get { - var __ret = Internal.getSystemIncludeDirsCount_0(__Instance); + var __ret = Internal.getSystemIncludeDirsCount_0((__Instance + __PointerAdjustment)); return __ret; } } @@ -455,7 +460,7 @@ namespace CppSharp { get { - var __ret = Internal.getDefinesCount_0(__Instance); + var __ret = Internal.getDefinesCount_0((__Instance + __PointerAdjustment)); return __ret; } } @@ -464,7 +469,7 @@ namespace CppSharp { get { - var __ret = Internal.getUndefinesCount_0(__Instance); + var __ret = Internal.getUndefinesCount_0((__Instance + __PointerAdjustment)); return __ret; } } @@ -473,7 +478,7 @@ namespace CppSharp { get { - var __ret = Internal.getLibraryDirsCount_0(__Instance); + var __ret = Internal.getLibraryDirsCount_0((__Instance + __PointerAdjustment)); return __ret; } } @@ -482,14 +487,14 @@ namespace CppSharp { get { - var __ret = Internal.getTargetTriple_0(__Instance); + var __ret = Internal.getTargetTriple_0((__Instance + __PointerAdjustment)); return Marshal.PtrToStringAnsi(__ret); } set { var arg0 = Marshal.StringToHGlobalAnsi(value); - Internal.setTargetTriple_0(__Instance, arg0); + Internal.setTargetTriple_0((__Instance + __PointerAdjustment), arg0); Marshal.FreeHGlobal(arg0); } } @@ -673,19 +678,21 @@ namespace CppSharp } public global::System.IntPtr __Instance { get; protected set; } + + protected int __PointerAdjustment; public static readonly System.Collections.Concurrent.ConcurrentDictionary NativeToManagedMap = new System.Collections.Concurrent.ConcurrentDictionary(); protected void*[] __OriginalVTables; protected bool __ownsNativeInstance; - public static ParserDiagnostic __CreateInstance(global::System.IntPtr native, bool ownsNativeInstance = false) + public static ParserDiagnostic __CreateInstance(global::System.IntPtr native, bool ownsNativeInstance = false, bool skipVTables = false) { - return new ParserDiagnostic((ParserDiagnostic.Internal*) native) { __ownsNativeInstance = ownsNativeInstance }; + return new ParserDiagnostic((ParserDiagnostic.Internal*) native, skipVTables) { __ownsNativeInstance = ownsNativeInstance }; } - public static ParserDiagnostic __CreateInstance(ParserDiagnostic.Internal native) + public static ParserDiagnostic __CreateInstance(ParserDiagnostic.Internal native, bool skipVTables = false) { - return new ParserDiagnostic(native); + return new ParserDiagnostic(native, skipVTables); } private static ParserDiagnostic.Internal* __CopyValue(ParserDiagnostic.Internal native) @@ -695,15 +702,17 @@ namespace CppSharp return (ParserDiagnostic.Internal*) ret; } - private ParserDiagnostic(ParserDiagnostic.Internal native) - : this(__CopyValue(native)) + private ParserDiagnostic(ParserDiagnostic.Internal native, bool skipVTables = false) + : this(__CopyValue(native), skipVTables) { __ownsNativeInstance = true; NativeToManagedMap[__Instance] = this; } - protected ParserDiagnostic(ParserDiagnostic.Internal* native, bool isInternalImpl = false) + protected ParserDiagnostic(ParserDiagnostic.Internal* native, bool skipVTables = false) { + if (native == null) + return; __Instance = new global::System.IntPtr(native); } @@ -711,17 +720,17 @@ namespace CppSharp { __Instance = Marshal.AllocHGlobal(36); __ownsNativeInstance = true; - Internal.ctor_0(__Instance); NativeToManagedMap[__Instance] = this; + Internal.ctor_0((__Instance + __PointerAdjustment)); } public ParserDiagnostic(CppSharp.Parser.ParserDiagnostic _0) { __Instance = Marshal.AllocHGlobal(36); __ownsNativeInstance = true; - var arg0 = ReferenceEquals(_0, null) ? global::System.IntPtr.Zero : _0.__Instance; - Internal.cctor_1(__Instance, arg0); NativeToManagedMap[__Instance] = this; + var arg0 = ReferenceEquals(_0, null) ? global::System.IntPtr.Zero : _0.__Instance; + Internal.cctor_1((__Instance + __PointerAdjustment), arg0); } public void Dispose() @@ -735,22 +744,23 @@ namespace CppSharp throw new global::System.InvalidOperationException("Managed instances owned by native code cannot be disposed of."); CppSharp.Parser.ParserDiagnostic __dummy; NativeToManagedMap.TryRemove(__Instance, out __dummy); - Internal.dtor_0(__Instance); - Marshal.FreeHGlobal(__Instance); + Internal.dtor_0((__Instance + __PointerAdjustment)); + if (__ownsNativeInstance) + Marshal.FreeHGlobal(__Instance); } public string FileName { get { - var __ret = Internal.getFileName_0(__Instance); + var __ret = Internal.getFileName_0((__Instance + __PointerAdjustment)); return Marshal.PtrToStringAnsi(__ret); } set { var arg0 = Marshal.StringToHGlobalAnsi(value); - Internal.setFileName_0(__Instance, arg0); + Internal.setFileName_0((__Instance + __PointerAdjustment), arg0); Marshal.FreeHGlobal(arg0); } } @@ -759,14 +769,14 @@ namespace CppSharp { get { - var __ret = Internal.getMessage_0(__Instance); + var __ret = Internal.getMessage_0((__Instance + __PointerAdjustment)); return Marshal.PtrToStringAnsi(__ret); } set { var arg0 = Marshal.StringToHGlobalAnsi(value); - Internal.setMessage_0(__Instance, arg0); + Internal.setMessage_0((__Instance + __PointerAdjustment), arg0); Marshal.FreeHGlobal(arg0); } } @@ -865,19 +875,21 @@ namespace CppSharp } public global::System.IntPtr __Instance { get; protected set; } + + protected int __PointerAdjustment; public static readonly System.Collections.Concurrent.ConcurrentDictionary NativeToManagedMap = new System.Collections.Concurrent.ConcurrentDictionary(); protected void*[] __OriginalVTables; protected bool __ownsNativeInstance; - public static ParserResult __CreateInstance(global::System.IntPtr native, bool ownsNativeInstance = false) + public static ParserResult __CreateInstance(global::System.IntPtr native, bool ownsNativeInstance = false, bool skipVTables = false) { - return new ParserResult((ParserResult.Internal*) native) { __ownsNativeInstance = ownsNativeInstance }; + return new ParserResult((ParserResult.Internal*) native, skipVTables) { __ownsNativeInstance = ownsNativeInstance }; } - public static ParserResult __CreateInstance(ParserResult.Internal native) + public static ParserResult __CreateInstance(ParserResult.Internal native, bool skipVTables = false) { - return new ParserResult(native); + return new ParserResult(native, skipVTables); } private static ParserResult.Internal* __CopyValue(ParserResult.Internal native) @@ -887,15 +899,17 @@ namespace CppSharp return (ParserResult.Internal*) ret; } - private ParserResult(ParserResult.Internal native) - : this(__CopyValue(native)) + private ParserResult(ParserResult.Internal native, bool skipVTables = false) + : this(__CopyValue(native), skipVTables) { __ownsNativeInstance = true; NativeToManagedMap[__Instance] = this; } - protected ParserResult(ParserResult.Internal* native, bool isInternalImpl = false) + protected ParserResult(ParserResult.Internal* native, bool skipVTables = false) { + if (native == null) + return; __Instance = new global::System.IntPtr(native); } @@ -903,17 +917,17 @@ namespace CppSharp { __Instance = Marshal.AllocHGlobal(28); __ownsNativeInstance = true; - Internal.ctor_0(__Instance); NativeToManagedMap[__Instance] = this; + Internal.ctor_0((__Instance + __PointerAdjustment)); } public ParserResult(CppSharp.Parser.ParserResult _0) { __Instance = Marshal.AllocHGlobal(28); __ownsNativeInstance = true; - var arg0 = ReferenceEquals(_0, null) ? global::System.IntPtr.Zero : _0.__Instance; - Internal.cctor_1(__Instance, arg0); NativeToManagedMap[__Instance] = this; + var arg0 = ReferenceEquals(_0, null) ? global::System.IntPtr.Zero : _0.__Instance; + Internal.cctor_1((__Instance + __PointerAdjustment), arg0); } public void Dispose() @@ -927,33 +941,34 @@ namespace CppSharp throw new global::System.InvalidOperationException("Managed instances owned by native code cannot be disposed of."); CppSharp.Parser.ParserResult __dummy; NativeToManagedMap.TryRemove(__Instance, out __dummy); - Internal.dtor_0(__Instance); - Marshal.FreeHGlobal(__Instance); + Internal.dtor_0((__Instance + __PointerAdjustment)); + if (__ownsNativeInstance) + Marshal.FreeHGlobal(__Instance); } public CppSharp.Parser.ParserDiagnostic getDiagnostics(uint i) { var __ret = new CppSharp.Parser.ParserDiagnostic.Internal(); - Internal.getDiagnostics_0(new IntPtr(&__ret), __Instance, i); + Internal.getDiagnostics_0(new IntPtr(&__ret), (__Instance + __PointerAdjustment), i); return CppSharp.Parser.ParserDiagnostic.__CreateInstance(__ret); } public void addDiagnostics(CppSharp.Parser.ParserDiagnostic s) { var arg0 = ReferenceEquals(s, null) ? global::System.IntPtr.Zero : s.__Instance; - Internal.addDiagnostics_0(__Instance, arg0); + Internal.addDiagnostics_0((__Instance + __PointerAdjustment), arg0); } public void clearDiagnostics() { - Internal.clearDiagnostics_0(__Instance); + Internal.clearDiagnostics_0((__Instance + __PointerAdjustment)); } public uint DiagnosticsCount { get { - var __ret = Internal.getDiagnosticsCount_0(__Instance); + var __ret = Internal.getDiagnosticsCount_0((__Instance + __PointerAdjustment)); return __ret; } } @@ -1035,19 +1050,21 @@ namespace CppSharp } public global::System.IntPtr __Instance { get; protected set; } + + protected int __PointerAdjustment; public static readonly System.Collections.Concurrent.ConcurrentDictionary NativeToManagedMap = new System.Collections.Concurrent.ConcurrentDictionary(); protected void*[] __OriginalVTables; protected bool __ownsNativeInstance; - public static ClangParser __CreateInstance(global::System.IntPtr native, bool ownsNativeInstance = false) + public static ClangParser __CreateInstance(global::System.IntPtr native, bool ownsNativeInstance = false, bool skipVTables = false) { - return new ClangParser((ClangParser.Internal*) native) { __ownsNativeInstance = ownsNativeInstance }; + return new ClangParser((ClangParser.Internal*) native, skipVTables) { __ownsNativeInstance = ownsNativeInstance }; } - public static ClangParser __CreateInstance(ClangParser.Internal native) + public static ClangParser __CreateInstance(ClangParser.Internal native, bool skipVTables = false) { - return new ClangParser(native); + return new ClangParser(native, skipVTables); } private static ClangParser.Internal* __CopyValue(ClangParser.Internal native) @@ -1057,15 +1074,17 @@ namespace CppSharp return ret; } - private ClangParser(ClangParser.Internal native) - : this(__CopyValue(native)) + private ClangParser(ClangParser.Internal native, bool skipVTables = false) + : this(__CopyValue(native), skipVTables) { __ownsNativeInstance = true; NativeToManagedMap[__Instance] = this; } - protected ClangParser(ClangParser.Internal* native, bool isInternalImpl = false) + protected ClangParser(ClangParser.Internal* native, bool skipVTables = false) { + if (native == null) + return; __Instance = new global::System.IntPtr(native); } @@ -1080,8 +1099,8 @@ namespace CppSharp { __Instance = Marshal.AllocHGlobal(0); __ownsNativeInstance = true; - *((ClangParser.Internal*) __Instance) = *((ClangParser.Internal*) _0.__Instance); NativeToManagedMap[__Instance] = this; + *((ClangParser.Internal*) __Instance) = *((ClangParser.Internal*) _0.__Instance); } public void Dispose() @@ -1095,7 +1114,8 @@ namespace CppSharp throw new global::System.InvalidOperationException("Managed instances owned by native code cannot be disposed of."); CppSharp.Parser.ClangParser __dummy; NativeToManagedMap.TryRemove(__Instance, out __dummy); - Marshal.FreeHGlobal(__Instance); + if (__ownsNativeInstance) + Marshal.FreeHGlobal(__Instance); } public static CppSharp.Parser.ParserResult ParseHeader(CppSharp.Parser.ParserOptions Opts) diff --git a/src/CppParser/Bindings/CSharp/i686-apple-darwin12.4.0/Sources.cs b/src/CppParser/Bindings/CSharp/i686-apple-darwin12.4.0/Sources.cs index 7693db9c..a24bbc0c 100644 --- a/src/CppParser/Bindings/CSharp/i686-apple-darwin12.4.0/Sources.cs +++ b/src/CppParser/Bindings/CSharp/i686-apple-darwin12.4.0/Sources.cs @@ -37,23 +37,23 @@ namespace CppSharp private SourceLocation.Internal __instance; public SourceLocation.Internal __Instance { get { return __instance; } } - public static SourceLocation __CreateInstance(global::System.IntPtr native) + public static SourceLocation __CreateInstance(global::System.IntPtr native, bool skipVTables = false) { - return new SourceLocation((SourceLocation.Internal*) native); + return new SourceLocation((SourceLocation.Internal*) native, skipVTables); } - public static SourceLocation __CreateInstance(SourceLocation.Internal native) + public static SourceLocation __CreateInstance(SourceLocation.Internal native, bool skipVTables = false) { - return new SourceLocation(native); + return new SourceLocation(native, skipVTables); } - private SourceLocation(SourceLocation.Internal native) + private SourceLocation(SourceLocation.Internal native, bool skipVTables = false) : this() { __instance = native; } - private SourceLocation(SourceLocation.Internal* native, bool isInternalImpl = false) : this() + private SourceLocation(SourceLocation.Internal* native, bool skipVTables = false) : this() { __instance = *native; } diff --git a/src/CppParser/Bindings/CSharp/i686-apple-darwin12.4.0/Target.cs b/src/CppParser/Bindings/CSharp/i686-apple-darwin12.4.0/Target.cs index a0d5ea1b..fa095288 100644 --- a/src/CppParser/Bindings/CSharp/i686-apple-darwin12.4.0/Target.cs +++ b/src/CppParser/Bindings/CSharp/i686-apple-darwin12.4.0/Target.cs @@ -171,19 +171,21 @@ namespace CppSharp } public global::System.IntPtr __Instance { get; protected set; } + + protected int __PointerAdjustment; public static readonly System.Collections.Concurrent.ConcurrentDictionary NativeToManagedMap = new System.Collections.Concurrent.ConcurrentDictionary(); protected void*[] __OriginalVTables; protected bool __ownsNativeInstance; - public static ParserTargetInfo __CreateInstance(global::System.IntPtr native, bool ownsNativeInstance = false) + public static ParserTargetInfo __CreateInstance(global::System.IntPtr native, bool ownsNativeInstance = false, bool skipVTables = false) { - return new ParserTargetInfo((ParserTargetInfo.Internal*) native) { __ownsNativeInstance = ownsNativeInstance }; + return new ParserTargetInfo((ParserTargetInfo.Internal*) native, skipVTables) { __ownsNativeInstance = ownsNativeInstance }; } - public static ParserTargetInfo __CreateInstance(ParserTargetInfo.Internal native) + public static ParserTargetInfo __CreateInstance(ParserTargetInfo.Internal native, bool skipVTables = false) { - return new ParserTargetInfo(native); + return new ParserTargetInfo(native, skipVTables); } private static ParserTargetInfo.Internal* __CopyValue(ParserTargetInfo.Internal native) @@ -193,15 +195,17 @@ namespace CppSharp return (ParserTargetInfo.Internal*) ret; } - private ParserTargetInfo(ParserTargetInfo.Internal native) - : this(__CopyValue(native)) + private ParserTargetInfo(ParserTargetInfo.Internal native, bool skipVTables = false) + : this(__CopyValue(native), skipVTables) { __ownsNativeInstance = true; NativeToManagedMap[__Instance] = this; } - protected ParserTargetInfo(ParserTargetInfo.Internal* native, bool isInternalImpl = false) + protected ParserTargetInfo(ParserTargetInfo.Internal* native, bool skipVTables = false) { + if (native == null) + return; __Instance = new global::System.IntPtr(native); } @@ -209,17 +213,17 @@ namespace CppSharp { __Instance = Marshal.AllocHGlobal(164); __ownsNativeInstance = true; - Internal.ctor_0(__Instance); NativeToManagedMap[__Instance] = this; + Internal.ctor_0((__Instance + __PointerAdjustment)); } public ParserTargetInfo(CppSharp.Parser.ParserTargetInfo _0) { __Instance = Marshal.AllocHGlobal(164); __ownsNativeInstance = true; - var arg0 = ReferenceEquals(_0, null) ? global::System.IntPtr.Zero : _0.__Instance; - Internal.cctor_2(__Instance, arg0); NativeToManagedMap[__Instance] = this; + var arg0 = ReferenceEquals(_0, null) ? global::System.IntPtr.Zero : _0.__Instance; + Internal.cctor_2((__Instance + __PointerAdjustment), arg0); } public void Dispose() @@ -233,22 +237,23 @@ namespace CppSharp throw new global::System.InvalidOperationException("Managed instances owned by native code cannot be disposed of."); CppSharp.Parser.ParserTargetInfo __dummy; NativeToManagedMap.TryRemove(__Instance, out __dummy); - Internal.dtor_0(__Instance); - Marshal.FreeHGlobal(__Instance); + Internal.dtor_0((__Instance + __PointerAdjustment)); + if (__ownsNativeInstance) + Marshal.FreeHGlobal(__Instance); } public string ABI { get { - var __ret = Internal.getABI_0(__Instance); + var __ret = Internal.getABI_0((__Instance + __PointerAdjustment)); return Marshal.PtrToStringAnsi(__ret); } set { var arg0 = Marshal.StringToHGlobalAnsi(value); - Internal.setABI_0(__Instance, arg0); + Internal.setABI_0((__Instance + __PointerAdjustment), arg0); Marshal.FreeHGlobal(arg0); } } diff --git a/src/CppParser/Bindings/CSharp/i686-pc-win32-msvc/AST.cs b/src/CppParser/Bindings/CSharp/i686-pc-win32-msvc/AST.cs index e1207e7b..2658cfe9 100644 --- a/src/CppParser/Bindings/CSharp/i686-pc-win32-msvc/AST.cs +++ b/src/CppParser/Bindings/CSharp/i686-pc-win32-msvc/AST.cs @@ -265,6 +265,8 @@ namespace CppSharp } public global::System.IntPtr __Instance { get; protected set; } + + protected int __PointerAdjustment; public static readonly System.Collections.Concurrent.ConcurrentDictionary NativeToManagedMap = new System.Collections.Concurrent.ConcurrentDictionary(); protected void*[] __OriginalVTables; @@ -307,7 +309,7 @@ namespace CppSharp __ownsNativeInstance = true; NativeToManagedMap[__Instance] = this; var arg0 = kind; - Internal.ctor_0(__Instance, arg0); + Internal.ctor_0((__Instance + __PointerAdjustment), arg0); } public Type(CppSharp.Parser.AST.Type _0) @@ -316,7 +318,7 @@ namespace CppSharp __ownsNativeInstance = true; NativeToManagedMap[__Instance] = this; var arg0 = ReferenceEquals(_0, null) ? global::System.IntPtr.Zero : _0.__Instance; - Internal.cctor_1(__Instance, arg0); + Internal.cctor_1((__Instance + __PointerAdjustment), arg0); } public void Dispose() @@ -330,7 +332,8 @@ namespace CppSharp throw new global::System.InvalidOperationException("Managed instances owned by native code cannot be disposed of."); CppSharp.Parser.AST.Type __dummy; NativeToManagedMap.TryRemove(__Instance, out __dummy); - Marshal.FreeHGlobal(__Instance); + if (__ownsNativeInstance) + Marshal.FreeHGlobal(__Instance); } public CppSharp.Parser.AST.TypeKind Kind @@ -381,6 +384,8 @@ namespace CppSharp } public global::System.IntPtr __Instance { get; protected set; } + + protected int __PointerAdjustment; public static readonly System.Collections.Concurrent.ConcurrentDictionary NativeToManagedMap = new System.Collections.Concurrent.ConcurrentDictionary(); protected void*[] __OriginalVTables; @@ -443,7 +448,8 @@ namespace CppSharp throw new global::System.InvalidOperationException("Managed instances owned by native code cannot be disposed of."); CppSharp.Parser.AST.TypeQualifiers __dummy; NativeToManagedMap.TryRemove(__Instance, out __dummy); - Marshal.FreeHGlobal(__Instance); + if (__ownsNativeInstance) + Marshal.FreeHGlobal(__Instance); } public bool IsConst @@ -509,6 +515,8 @@ namespace CppSharp } public global::System.IntPtr __Instance { get; protected set; } + + protected int __PointerAdjustment; public static readonly System.Collections.Concurrent.ConcurrentDictionary NativeToManagedMap = new System.Collections.Concurrent.ConcurrentDictionary(); protected void*[] __OriginalVTables; @@ -550,7 +558,7 @@ namespace CppSharp __Instance = Marshal.AllocHGlobal(8); __ownsNativeInstance = true; NativeToManagedMap[__Instance] = this; - Internal.ctor_0(__Instance); + Internal.ctor_0((__Instance + __PointerAdjustment)); } public QualifiedType(CppSharp.Parser.AST.QualifiedType _0) @@ -572,7 +580,8 @@ namespace CppSharp throw new global::System.InvalidOperationException("Managed instances owned by native code cannot be disposed of."); CppSharp.Parser.AST.QualifiedType __dummy; NativeToManagedMap.TryRemove(__Instance, out __dummy); - Marshal.FreeHGlobal(__Instance); + if (__ownsNativeInstance) + Marshal.FreeHGlobal(__Instance); } public CppSharp.Parser.AST.Type Type @@ -659,6 +668,7 @@ namespace CppSharp protected TagType(TagType.Internal* native, bool skipVTables = false) : base((CppSharp.Parser.AST.Type.Internal*) null) { + __PointerAdjustment = 0; if (native == null) return; __Instance = new global::System.IntPtr(native); @@ -670,7 +680,7 @@ namespace CppSharp __Instance = Marshal.AllocHGlobal(12); __ownsNativeInstance = true; NativeToManagedMap[__Instance] = this; - Internal.ctor_0(__Instance); + Internal.ctor_0((__Instance + __PointerAdjustment)); } public TagType(CppSharp.Parser.AST.TagType _0) @@ -680,7 +690,7 @@ namespace CppSharp __ownsNativeInstance = true; NativeToManagedMap[__Instance] = this; var arg0 = ReferenceEquals(_0, null) ? global::System.IntPtr.Zero : _0.__Instance; - Internal.cctor_2(__Instance, arg0); + Internal.cctor_2((__Instance + __PointerAdjustment), arg0); } public CppSharp.Parser.AST.Declaration Declaration @@ -771,6 +781,7 @@ namespace CppSharp protected ArrayType(ArrayType.Internal* native, bool skipVTables = false) : base((CppSharp.Parser.AST.Type.Internal*) null) { + __PointerAdjustment = 0; if (native == null) return; __Instance = new global::System.IntPtr(native); @@ -782,7 +793,7 @@ namespace CppSharp __Instance = Marshal.AllocHGlobal(28); __ownsNativeInstance = true; NativeToManagedMap[__Instance] = this; - Internal.ctor_0(__Instance); + Internal.ctor_0((__Instance + __PointerAdjustment)); } public ArrayType(CppSharp.Parser.AST.ArrayType _0) @@ -792,7 +803,7 @@ namespace CppSharp __ownsNativeInstance = true; NativeToManagedMap[__Instance] = this; var arg0 = ReferenceEquals(_0, null) ? global::System.IntPtr.Zero : _0.__Instance; - Internal.cctor_2(__Instance, arg0); + Internal.cctor_2((__Instance + __PointerAdjustment), arg0); } public CppSharp.Parser.AST.QualifiedType QualifiedType @@ -928,6 +939,7 @@ namespace CppSharp protected FunctionType(FunctionType.Internal* native, bool skipVTables = false) : base((CppSharp.Parser.AST.Type.Internal*) null) { + __PointerAdjustment = 0; if (native == null) return; __Instance = new global::System.IntPtr(native); @@ -939,7 +951,7 @@ namespace CppSharp __Instance = Marshal.AllocHGlobal(32); __ownsNativeInstance = true; NativeToManagedMap[__Instance] = this; - Internal.ctor_0(__Instance); + Internal.ctor_0((__Instance + __PointerAdjustment)); } public FunctionType(CppSharp.Parser.AST.FunctionType _0) @@ -949,12 +961,12 @@ namespace CppSharp __ownsNativeInstance = true; NativeToManagedMap[__Instance] = this; var arg0 = ReferenceEquals(_0, null) ? global::System.IntPtr.Zero : _0.__Instance; - Internal.cctor_2(__Instance, arg0); + Internal.cctor_2((__Instance + __PointerAdjustment), arg0); } public CppSharp.Parser.AST.Parameter getParameters(uint i) { - var __ret = Internal.getParameters_0(__Instance, i); + var __ret = Internal.getParameters_0((__Instance + __PointerAdjustment), i); CppSharp.Parser.AST.Parameter __result0; if (__ret == IntPtr.Zero) __result0 = null; else if (CppSharp.Parser.AST.Parameter.NativeToManagedMap.ContainsKey(__ret)) @@ -966,19 +978,19 @@ namespace CppSharp public void addParameters(CppSharp.Parser.AST.Parameter s) { var arg0 = ReferenceEquals(s, null) ? global::System.IntPtr.Zero : s.__Instance; - Internal.addParameters_0(__Instance, arg0); + Internal.addParameters_0((__Instance + __PointerAdjustment), arg0); } public void clearParameters() { - Internal.clearParameters_0(__Instance); + Internal.clearParameters_0((__Instance + __PointerAdjustment)); } public uint ParametersCount { get { - var __ret = Internal.getParametersCount_0(__Instance); + var __ret = Internal.getParametersCount_0((__Instance + __PointerAdjustment)); return __ret; } } @@ -1073,6 +1085,7 @@ namespace CppSharp protected PointerType(PointerType.Internal* native, bool skipVTables = false) : base((CppSharp.Parser.AST.Type.Internal*) null) { + __PointerAdjustment = 0; if (native == null) return; __Instance = new global::System.IntPtr(native); @@ -1084,7 +1097,7 @@ namespace CppSharp __Instance = Marshal.AllocHGlobal(20); __ownsNativeInstance = true; NativeToManagedMap[__Instance] = this; - Internal.ctor_0(__Instance); + Internal.ctor_0((__Instance + __PointerAdjustment)); } public PointerType(CppSharp.Parser.AST.PointerType _0) @@ -1094,7 +1107,7 @@ namespace CppSharp __ownsNativeInstance = true; NativeToManagedMap[__Instance] = this; var arg0 = ReferenceEquals(_0, null) ? global::System.IntPtr.Zero : _0.__Instance; - Internal.cctor_2(__Instance, arg0); + Internal.cctor_2((__Instance + __PointerAdjustment), arg0); } public CppSharp.Parser.AST.QualifiedType QualifiedPointee @@ -1176,6 +1189,7 @@ namespace CppSharp protected MemberPointerType(MemberPointerType.Internal* native, bool skipVTables = false) : base((CppSharp.Parser.AST.Type.Internal*) null) { + __PointerAdjustment = 0; if (native == null) return; __Instance = new global::System.IntPtr(native); @@ -1187,7 +1201,7 @@ namespace CppSharp __Instance = Marshal.AllocHGlobal(16); __ownsNativeInstance = true; NativeToManagedMap[__Instance] = this; - Internal.ctor_0(__Instance); + Internal.ctor_0((__Instance + __PointerAdjustment)); } public MemberPointerType(CppSharp.Parser.AST.MemberPointerType _0) @@ -1197,7 +1211,7 @@ namespace CppSharp __ownsNativeInstance = true; NativeToManagedMap[__Instance] = this; var arg0 = ReferenceEquals(_0, null) ? global::System.IntPtr.Zero : _0.__Instance; - Internal.cctor_2(__Instance, arg0); + Internal.cctor_2((__Instance + __PointerAdjustment), arg0); } public CppSharp.Parser.AST.QualifiedType Pointee @@ -1266,6 +1280,7 @@ namespace CppSharp protected TypedefType(TypedefType.Internal* native, bool skipVTables = false) : base((CppSharp.Parser.AST.Type.Internal*) null) { + __PointerAdjustment = 0; if (native == null) return; __Instance = new global::System.IntPtr(native); @@ -1277,7 +1292,7 @@ namespace CppSharp __Instance = Marshal.AllocHGlobal(12); __ownsNativeInstance = true; NativeToManagedMap[__Instance] = this; - Internal.ctor_0(__Instance); + Internal.ctor_0((__Instance + __PointerAdjustment)); } public TypedefType(CppSharp.Parser.AST.TypedefType _0) @@ -1287,7 +1302,7 @@ namespace CppSharp __ownsNativeInstance = true; NativeToManagedMap[__Instance] = this; var arg0 = ReferenceEquals(_0, null) ? global::System.IntPtr.Zero : _0.__Instance; - Internal.cctor_2(__Instance, arg0); + Internal.cctor_2((__Instance + __PointerAdjustment), arg0); } public CppSharp.Parser.AST.TypedefDecl Declaration @@ -1364,6 +1379,7 @@ namespace CppSharp protected AttributedType(AttributedType.Internal* native, bool skipVTables = false) : base((CppSharp.Parser.AST.Type.Internal*) null) { + __PointerAdjustment = 0; if (native == null) return; __Instance = new global::System.IntPtr(native); @@ -1375,7 +1391,7 @@ namespace CppSharp __Instance = Marshal.AllocHGlobal(24); __ownsNativeInstance = true; NativeToManagedMap[__Instance] = this; - Internal.ctor_0(__Instance); + Internal.ctor_0((__Instance + __PointerAdjustment)); } public AttributedType(CppSharp.Parser.AST.AttributedType _0) @@ -1385,7 +1401,7 @@ namespace CppSharp __ownsNativeInstance = true; NativeToManagedMap[__Instance] = this; var arg0 = ReferenceEquals(_0, null) ? global::System.IntPtr.Zero : _0.__Instance; - Internal.cctor_2(__Instance, arg0); + Internal.cctor_2((__Instance + __PointerAdjustment), arg0); } public CppSharp.Parser.AST.QualifiedType Modified @@ -1473,6 +1489,7 @@ namespace CppSharp protected DecayedType(DecayedType.Internal* native, bool skipVTables = false) : base((CppSharp.Parser.AST.Type.Internal*) null) { + __PointerAdjustment = 0; if (native == null) return; __Instance = new global::System.IntPtr(native); @@ -1484,7 +1501,7 @@ namespace CppSharp __Instance = Marshal.AllocHGlobal(32); __ownsNativeInstance = true; NativeToManagedMap[__Instance] = this; - Internal.ctor_0(__Instance); + Internal.ctor_0((__Instance + __PointerAdjustment)); } public DecayedType(CppSharp.Parser.AST.DecayedType _0) @@ -1494,7 +1511,7 @@ namespace CppSharp __ownsNativeInstance = true; NativeToManagedMap[__Instance] = this; var arg0 = ReferenceEquals(_0, null) ? global::System.IntPtr.Zero : _0.__Instance; - Internal.cctor_2(__Instance, arg0); + Internal.cctor_2((__Instance + __PointerAdjustment), arg0); } public CppSharp.Parser.AST.QualifiedType Decayed @@ -1578,6 +1595,8 @@ namespace CppSharp } public global::System.IntPtr __Instance { get; protected set; } + + protected int __PointerAdjustment; public static readonly System.Collections.Concurrent.ConcurrentDictionary NativeToManagedMap = new System.Collections.Concurrent.ConcurrentDictionary(); protected void*[] __OriginalVTables; @@ -1619,7 +1638,7 @@ namespace CppSharp __Instance = Marshal.AllocHGlobal(20); __ownsNativeInstance = true; NativeToManagedMap[__Instance] = this; - Internal.ctor_0(__Instance); + Internal.ctor_0((__Instance + __PointerAdjustment)); } public TemplateArgument(CppSharp.Parser.AST.TemplateArgument _0) @@ -1641,7 +1660,8 @@ namespace CppSharp throw new global::System.InvalidOperationException("Managed instances owned by native code cannot be disposed of."); CppSharp.Parser.AST.TemplateArgument __dummy; NativeToManagedMap.TryRemove(__Instance, out __dummy); - Marshal.FreeHGlobal(__Instance); + if (__ownsNativeInstance) + Marshal.FreeHGlobal(__Instance); } public CppSharp.Parser.AST.TemplateArgument.ArgumentKind Kind @@ -1782,6 +1802,7 @@ namespace CppSharp protected TemplateSpecializationType(TemplateSpecializationType.Internal* native, bool skipVTables = false) : base((CppSharp.Parser.AST.Type.Internal*) null) { + __PointerAdjustment = 0; if (native == null) return; __Instance = new global::System.IntPtr(native); @@ -1793,7 +1814,7 @@ namespace CppSharp __Instance = Marshal.AllocHGlobal(28); __ownsNativeInstance = true; NativeToManagedMap[__Instance] = this; - Internal.ctor_0(__Instance); + Internal.ctor_0((__Instance + __PointerAdjustment)); } public TemplateSpecializationType(CppSharp.Parser.AST.TemplateSpecializationType _0) @@ -1803,32 +1824,32 @@ namespace CppSharp __ownsNativeInstance = true; NativeToManagedMap[__Instance] = this; var arg0 = ReferenceEquals(_0, null) ? global::System.IntPtr.Zero : _0.__Instance; - Internal.cctor_1(__Instance, arg0); + Internal.cctor_1((__Instance + __PointerAdjustment), arg0); } public CppSharp.Parser.AST.TemplateArgument getArguments(uint i) { var __ret = new CppSharp.Parser.AST.TemplateArgument.Internal(); - Internal.getArguments_0(__Instance, new IntPtr(&__ret), i); + Internal.getArguments_0((__Instance + __PointerAdjustment), new IntPtr(&__ret), i); return CppSharp.Parser.AST.TemplateArgument.__CreateInstance(__ret); } public void addArguments(CppSharp.Parser.AST.TemplateArgument s) { var arg0 = ReferenceEquals(s, null) ? global::System.IntPtr.Zero : s.__Instance; - Internal.addArguments_0(__Instance, arg0); + Internal.addArguments_0((__Instance + __PointerAdjustment), arg0); } public void clearArguments() { - Internal.clearArguments_0(__Instance); + Internal.clearArguments_0((__Instance + __PointerAdjustment)); } public uint ArgumentsCount { get { - var __ret = Internal.getArgumentsCount_0(__Instance); + var __ret = Internal.getArgumentsCount_0((__Instance + __PointerAdjustment)); return __ret; } } @@ -1897,7 +1918,7 @@ namespace CppSharp [DllImport("CppSharp.CppParser.dll", CallingConvention = global::System.Runtime.InteropServices.CallingConvention.ThisCall, EntryPoint="??8TemplateParameter@AST@CppParser@CppSharp@@QBE_NABV0123@@Z")] [return: MarshalAsAttribute(UnmanagedType.I1)] - internal static extern byte OperatorEqualEqual_0(global::System.IntPtr instance, global::System.IntPtr param); + internal static extern bool OperatorEqualEqual_0(global::System.IntPtr instance, global::System.IntPtr param); [SuppressUnmanagedCodeSecurity] [DllImport("CppSharp.CppParser.dll", CallingConvention = global::System.Runtime.InteropServices.CallingConvention.ThisCall, @@ -1911,6 +1932,8 @@ namespace CppSharp } public global::System.IntPtr __Instance { get; protected set; } + + protected int __PointerAdjustment; public static readonly System.Collections.Concurrent.ConcurrentDictionary NativeToManagedMap = new System.Collections.Concurrent.ConcurrentDictionary(); protected void*[] __OriginalVTables; @@ -1952,7 +1975,7 @@ namespace CppSharp __Instance = Marshal.AllocHGlobal(28); __ownsNativeInstance = true; NativeToManagedMap[__Instance] = this; - Internal.ctor_0(__Instance); + Internal.ctor_0((__Instance + __PointerAdjustment)); } public TemplateParameter(CppSharp.Parser.AST.TemplateParameter _0) @@ -1961,7 +1984,7 @@ namespace CppSharp __ownsNativeInstance = true; NativeToManagedMap[__Instance] = this; var arg0 = ReferenceEquals(_0, null) ? global::System.IntPtr.Zero : _0.__Instance; - Internal.cctor_1(__Instance, arg0); + Internal.cctor_1((__Instance + __PointerAdjustment), arg0); } public void Dispose() @@ -1975,8 +1998,9 @@ namespace CppSharp throw new global::System.InvalidOperationException("Managed instances owned by native code cannot be disposed of."); CppSharp.Parser.AST.TemplateParameter __dummy; NativeToManagedMap.TryRemove(__Instance, out __dummy); - Internal.dtor_0(__Instance, 0); - Marshal.FreeHGlobal(__Instance); + Internal.dtor_0((__Instance + __PointerAdjustment), 0); + if (__ownsNativeInstance) + Marshal.FreeHGlobal(__Instance); } public static bool operator !=(CppSharp.Parser.AST.TemplateParameter __op, CppSharp.Parser.AST.TemplateParameter param) @@ -1993,7 +2017,7 @@ namespace CppSharp var arg0 = __op.__Instance; var arg1 = param.__Instance; var __ret = Internal.OperatorEqualEqual_0(arg0, arg1); - return __ret != 0; + return __ret; } public override bool Equals(object obj) @@ -2012,14 +2036,14 @@ namespace CppSharp { get { - var __ret = Internal.getName_0(__Instance); + var __ret = Internal.getName_0((__Instance + __PointerAdjustment)); return Marshal.PtrToStringAnsi(__ret); } set { var arg0 = Marshal.StringToHGlobalAnsi(value); - Internal.setName_0(__Instance, arg0); + Internal.setName_0((__Instance + __PointerAdjustment), arg0); Marshal.FreeHGlobal(arg0); } } @@ -2104,6 +2128,7 @@ namespace CppSharp protected TemplateParameterType(TemplateParameterType.Internal* native, bool skipVTables = false) : base((CppSharp.Parser.AST.Type.Internal*) null) { + __PointerAdjustment = 0; if (native == null) return; __Instance = new global::System.IntPtr(native); @@ -2115,7 +2140,7 @@ namespace CppSharp __Instance = Marshal.AllocHGlobal(48); __ownsNativeInstance = true; NativeToManagedMap[__Instance] = this; - Internal.ctor_0(__Instance); + Internal.ctor_0((__Instance + __PointerAdjustment)); } public TemplateParameterType(CppSharp.Parser.AST.TemplateParameterType _0) @@ -2125,7 +2150,7 @@ namespace CppSharp __ownsNativeInstance = true; NativeToManagedMap[__Instance] = this; var arg0 = ReferenceEquals(_0, null) ? global::System.IntPtr.Zero : _0.__Instance; - Internal.cctor_2(__Instance, arg0); + Internal.cctor_2((__Instance + __PointerAdjustment), arg0); } public CppSharp.Parser.AST.TemplateParameter Parameter @@ -2233,6 +2258,7 @@ namespace CppSharp protected TemplateParameterSubstitutionType(TemplateParameterSubstitutionType.Internal* native, bool skipVTables = false) : base((CppSharp.Parser.AST.Type.Internal*) null) { + __PointerAdjustment = 0; if (native == null) return; __Instance = new global::System.IntPtr(native); @@ -2244,7 +2270,7 @@ namespace CppSharp __Instance = Marshal.AllocHGlobal(16); __ownsNativeInstance = true; NativeToManagedMap[__Instance] = this; - Internal.ctor_0(__Instance); + Internal.ctor_0((__Instance + __PointerAdjustment)); } public TemplateParameterSubstitutionType(CppSharp.Parser.AST.TemplateParameterSubstitutionType _0) @@ -2254,7 +2280,7 @@ namespace CppSharp __ownsNativeInstance = true; NativeToManagedMap[__Instance] = this; var arg0 = ReferenceEquals(_0, null) ? global::System.IntPtr.Zero : _0.__Instance; - Internal.cctor_2(__Instance, arg0); + Internal.cctor_2((__Instance + __PointerAdjustment), arg0); } public CppSharp.Parser.AST.QualifiedType Replacement @@ -2326,6 +2352,7 @@ namespace CppSharp protected InjectedClassNameType(InjectedClassNameType.Internal* native, bool skipVTables = false) : base((CppSharp.Parser.AST.Type.Internal*) null) { + __PointerAdjustment = 0; if (native == null) return; __Instance = new global::System.IntPtr(native); @@ -2337,7 +2364,7 @@ namespace CppSharp __Instance = Marshal.AllocHGlobal(16); __ownsNativeInstance = true; NativeToManagedMap[__Instance] = this; - Internal.ctor_0(__Instance); + Internal.ctor_0((__Instance + __PointerAdjustment)); } public InjectedClassNameType(CppSharp.Parser.AST.InjectedClassNameType _0) @@ -2347,7 +2374,7 @@ namespace CppSharp __ownsNativeInstance = true; NativeToManagedMap[__Instance] = this; var arg0 = ReferenceEquals(_0, null) ? global::System.IntPtr.Zero : _0.__Instance; - Internal.cctor_2(__Instance, arg0); + Internal.cctor_2((__Instance + __PointerAdjustment), arg0); } public CppSharp.Parser.AST.TemplateSpecializationType TemplateSpecialization @@ -2436,6 +2463,7 @@ namespace CppSharp protected DependentNameType(DependentNameType.Internal* native, bool skipVTables = false) : base((CppSharp.Parser.AST.Type.Internal*) null) { + __PointerAdjustment = 0; if (native == null) return; __Instance = new global::System.IntPtr(native); @@ -2447,7 +2475,7 @@ namespace CppSharp __Instance = Marshal.AllocHGlobal(8); __ownsNativeInstance = true; NativeToManagedMap[__Instance] = this; - Internal.ctor_0(__Instance); + Internal.ctor_0((__Instance + __PointerAdjustment)); } public DependentNameType(CppSharp.Parser.AST.DependentNameType _0) @@ -2457,7 +2485,7 @@ namespace CppSharp __ownsNativeInstance = true; NativeToManagedMap[__Instance] = this; var arg0 = ReferenceEquals(_0, null) ? global::System.IntPtr.Zero : _0.__Instance; - Internal.cctor_2(__Instance, arg0); + Internal.cctor_2((__Instance + __PointerAdjustment), arg0); } } @@ -2510,6 +2538,7 @@ namespace CppSharp protected PackExpansionType(PackExpansionType.Internal* native, bool skipVTables = false) : base((CppSharp.Parser.AST.Type.Internal*) null) { + __PointerAdjustment = 0; if (native == null) return; __Instance = new global::System.IntPtr(native); @@ -2521,7 +2550,7 @@ namespace CppSharp __Instance = Marshal.AllocHGlobal(8); __ownsNativeInstance = true; NativeToManagedMap[__Instance] = this; - Internal.ctor_0(__Instance); + Internal.ctor_0((__Instance + __PointerAdjustment)); } public PackExpansionType(CppSharp.Parser.AST.PackExpansionType _0) @@ -2531,7 +2560,7 @@ namespace CppSharp __ownsNativeInstance = true; NativeToManagedMap[__Instance] = this; var arg0 = ReferenceEquals(_0, null) ? global::System.IntPtr.Zero : _0.__Instance; - Internal.cctor_2(__Instance, arg0); + Internal.cctor_2((__Instance + __PointerAdjustment), arg0); } } @@ -2587,6 +2616,7 @@ namespace CppSharp protected BuiltinType(BuiltinType.Internal* native, bool skipVTables = false) : base((CppSharp.Parser.AST.Type.Internal*) null) { + __PointerAdjustment = 0; if (native == null) return; __Instance = new global::System.IntPtr(native); @@ -2598,7 +2628,7 @@ namespace CppSharp __Instance = Marshal.AllocHGlobal(12); __ownsNativeInstance = true; NativeToManagedMap[__Instance] = this; - Internal.ctor_0(__Instance); + Internal.ctor_0((__Instance + __PointerAdjustment)); } public BuiltinType(CppSharp.Parser.AST.BuiltinType _0) @@ -2608,7 +2638,7 @@ namespace CppSharp __ownsNativeInstance = true; NativeToManagedMap[__Instance] = this; var arg0 = ReferenceEquals(_0, null) ? global::System.IntPtr.Zero : _0.__Instance; - Internal.cctor_2(__Instance, arg0); + Internal.cctor_2((__Instance + __PointerAdjustment), arg0); } public CppSharp.Parser.AST.PrimitiveType Type @@ -2651,6 +2681,8 @@ namespace CppSharp } public global::System.IntPtr __Instance { get; protected set; } + + protected int __PointerAdjustment; public static readonly System.Collections.Concurrent.ConcurrentDictionary NativeToManagedMap = new System.Collections.Concurrent.ConcurrentDictionary(); protected void*[] __OriginalVTables; @@ -2692,7 +2724,7 @@ namespace CppSharp __Instance = Marshal.AllocHGlobal(12); __ownsNativeInstance = true; NativeToManagedMap[__Instance] = this; - Internal.ctor_0(__Instance); + Internal.ctor_0((__Instance + __PointerAdjustment)); } public VTableComponent(CppSharp.Parser.AST.VTableComponent _0) @@ -2714,7 +2746,8 @@ namespace CppSharp throw new global::System.InvalidOperationException("Managed instances owned by native code cannot be disposed of."); CppSharp.Parser.AST.VTableComponent __dummy; NativeToManagedMap.TryRemove(__Instance, out __dummy); - Marshal.FreeHGlobal(__Instance); + if (__ownsNativeInstance) + Marshal.FreeHGlobal(__Instance); } public CppSharp.Parser.AST.VTableComponentKind Kind @@ -2804,6 +2837,8 @@ namespace CppSharp } public global::System.IntPtr __Instance { get; protected set; } + + protected int __PointerAdjustment; public static readonly System.Collections.Concurrent.ConcurrentDictionary NativeToManagedMap = new System.Collections.Concurrent.ConcurrentDictionary(); protected void*[] __OriginalVTables; @@ -2845,7 +2880,7 @@ namespace CppSharp __Instance = Marshal.AllocHGlobal(12); __ownsNativeInstance = true; NativeToManagedMap[__Instance] = this; - Internal.ctor_0(__Instance); + Internal.ctor_0((__Instance + __PointerAdjustment)); } public VTableLayout(CppSharp.Parser.AST.VTableLayout _0) @@ -2854,7 +2889,7 @@ namespace CppSharp __ownsNativeInstance = true; NativeToManagedMap[__Instance] = this; var arg0 = ReferenceEquals(_0, null) ? global::System.IntPtr.Zero : _0.__Instance; - Internal.cctor_1(__Instance, arg0); + Internal.cctor_1((__Instance + __PointerAdjustment), arg0); } public void Dispose() @@ -2868,33 +2903,34 @@ namespace CppSharp throw new global::System.InvalidOperationException("Managed instances owned by native code cannot be disposed of."); CppSharp.Parser.AST.VTableLayout __dummy; NativeToManagedMap.TryRemove(__Instance, out __dummy); - Internal.dtor_0(__Instance, 0); - Marshal.FreeHGlobal(__Instance); + Internal.dtor_0((__Instance + __PointerAdjustment), 0); + if (__ownsNativeInstance) + Marshal.FreeHGlobal(__Instance); } public CppSharp.Parser.AST.VTableComponent getComponents(uint i) { var __ret = new CppSharp.Parser.AST.VTableComponent.Internal(); - Internal.getComponents_0(__Instance, new IntPtr(&__ret), i); + Internal.getComponents_0((__Instance + __PointerAdjustment), new IntPtr(&__ret), i); return CppSharp.Parser.AST.VTableComponent.__CreateInstance(__ret); } public void addComponents(CppSharp.Parser.AST.VTableComponent s) { var arg0 = ReferenceEquals(s, null) ? global::System.IntPtr.Zero : s.__Instance; - Internal.addComponents_0(__Instance, arg0); + Internal.addComponents_0((__Instance + __PointerAdjustment), arg0); } public void clearComponents() { - Internal.clearComponents_0(__Instance); + Internal.clearComponents_0((__Instance + __PointerAdjustment)); } public uint ComponentsCount { get { - var __ret = Internal.getComponentsCount_0(__Instance); + var __ret = Internal.getComponentsCount_0((__Instance + __PointerAdjustment)); return __ret; } } @@ -2934,6 +2970,8 @@ namespace CppSharp } public global::System.IntPtr __Instance { get; protected set; } + + protected int __PointerAdjustment; public static readonly System.Collections.Concurrent.ConcurrentDictionary NativeToManagedMap = new System.Collections.Concurrent.ConcurrentDictionary(); protected void*[] __OriginalVTables; @@ -2975,7 +3013,7 @@ namespace CppSharp __Instance = Marshal.AllocHGlobal(32); __ownsNativeInstance = true; NativeToManagedMap[__Instance] = this; - Internal.ctor_0(__Instance); + Internal.ctor_0((__Instance + __PointerAdjustment)); } public VFTableInfo(CppSharp.Parser.AST.VFTableInfo _0) @@ -2984,7 +3022,7 @@ namespace CppSharp __ownsNativeInstance = true; NativeToManagedMap[__Instance] = this; var arg0 = ReferenceEquals(_0, null) ? global::System.IntPtr.Zero : _0.__Instance; - Internal.cctor_1(__Instance, arg0); + Internal.cctor_1((__Instance + __PointerAdjustment), arg0); } public void Dispose() @@ -2998,8 +3036,9 @@ namespace CppSharp throw new global::System.InvalidOperationException("Managed instances owned by native code cannot be disposed of."); CppSharp.Parser.AST.VFTableInfo __dummy; NativeToManagedMap.TryRemove(__Instance, out __dummy); - Internal.dtor_0(__Instance, 0); - Marshal.FreeHGlobal(__Instance); + Internal.dtor_0((__Instance + __PointerAdjustment), 0); + if (__ownsNativeInstance) + Marshal.FreeHGlobal(__Instance); } public ulong VBTableIndex @@ -3118,6 +3157,8 @@ namespace CppSharp } public global::System.IntPtr __Instance { get; protected set; } + + protected int __PointerAdjustment; public static readonly System.Collections.Concurrent.ConcurrentDictionary NativeToManagedMap = new System.Collections.Concurrent.ConcurrentDictionary(); protected void*[] __OriginalVTables; @@ -3159,7 +3200,7 @@ namespace CppSharp __Instance = Marshal.AllocHGlobal(48); __ownsNativeInstance = true; NativeToManagedMap[__Instance] = this; - Internal.ctor_0(__Instance); + Internal.ctor_0((__Instance + __PointerAdjustment)); } public ClassLayout(CppSharp.Parser.AST.ClassLayout _0) @@ -3168,7 +3209,7 @@ namespace CppSharp __ownsNativeInstance = true; NativeToManagedMap[__Instance] = this; var arg0 = ReferenceEquals(_0, null) ? global::System.IntPtr.Zero : _0.__Instance; - Internal.cctor_2(__Instance, arg0); + Internal.cctor_2((__Instance + __PointerAdjustment), arg0); } public void Dispose() @@ -3182,33 +3223,34 @@ namespace CppSharp throw new global::System.InvalidOperationException("Managed instances owned by native code cannot be disposed of."); CppSharp.Parser.AST.ClassLayout __dummy; NativeToManagedMap.TryRemove(__Instance, out __dummy); - Internal.dtor_0(__Instance, 0); - Marshal.FreeHGlobal(__Instance); + Internal.dtor_0((__Instance + __PointerAdjustment), 0); + if (__ownsNativeInstance) + Marshal.FreeHGlobal(__Instance); } public CppSharp.Parser.AST.VFTableInfo getVFTables(uint i) { var __ret = new CppSharp.Parser.AST.VFTableInfo.Internal(); - Internal.getVFTables_0(__Instance, new IntPtr(&__ret), i); + Internal.getVFTables_0((__Instance + __PointerAdjustment), new IntPtr(&__ret), i); return CppSharp.Parser.AST.VFTableInfo.__CreateInstance(__ret); } public void addVFTables(CppSharp.Parser.AST.VFTableInfo s) { var arg0 = ReferenceEquals(s, null) ? global::System.IntPtr.Zero : s.__Instance; - Internal.addVFTables_0(__Instance, arg0); + Internal.addVFTables_0((__Instance + __PointerAdjustment), arg0); } public void clearVFTables() { - Internal.clearVFTables_0(__Instance); + Internal.clearVFTables_0((__Instance + __PointerAdjustment)); } public uint VFTablesCount { get { - var __ret = Internal.getVFTablesCount_0(__Instance); + var __ret = Internal.getVFTablesCount_0((__Instance + __PointerAdjustment)); return __ret; } } @@ -3403,6 +3445,8 @@ namespace CppSharp } public global::System.IntPtr __Instance { get; protected set; } + + protected int __PointerAdjustment; public static readonly System.Collections.Concurrent.ConcurrentDictionary NativeToManagedMap = new System.Collections.Concurrent.ConcurrentDictionary(); protected void*[] __OriginalVTables; @@ -3445,7 +3489,7 @@ namespace CppSharp __ownsNativeInstance = true; NativeToManagedMap[__Instance] = this; var arg0 = kind; - Internal.ctor_0(__Instance, arg0); + Internal.ctor_0((__Instance + __PointerAdjustment), arg0); } public Declaration(CppSharp.Parser.AST.Declaration _0) @@ -3454,7 +3498,7 @@ namespace CppSharp __ownsNativeInstance = true; NativeToManagedMap[__Instance] = this; var arg0 = ReferenceEquals(_0, null) ? global::System.IntPtr.Zero : _0.__Instance; - Internal.cctor_1(__Instance, arg0); + Internal.cctor_1((__Instance + __PointerAdjustment), arg0); } public void Dispose() @@ -3468,13 +3512,14 @@ namespace CppSharp throw new global::System.InvalidOperationException("Managed instances owned by native code cannot be disposed of."); CppSharp.Parser.AST.Declaration __dummy; NativeToManagedMap.TryRemove(__Instance, out __dummy); - Internal.dtor_0(__Instance, 0); - Marshal.FreeHGlobal(__Instance); + Internal.dtor_0((__Instance + __PointerAdjustment), 0); + if (__ownsNativeInstance) + Marshal.FreeHGlobal(__Instance); } public CppSharp.Parser.AST.PreprocessedEntity getPreprocessedEntities(uint i) { - var __ret = Internal.getPreprocessedEntities_0(__Instance, i); + var __ret = Internal.getPreprocessedEntities_0((__Instance + __PointerAdjustment), i); CppSharp.Parser.AST.PreprocessedEntity __result0; if (__ret == IntPtr.Zero) __result0 = null; else if (CppSharp.Parser.AST.PreprocessedEntity.NativeToManagedMap.ContainsKey(__ret)) @@ -3486,26 +3531,26 @@ namespace CppSharp public void addPreprocessedEntities(CppSharp.Parser.AST.PreprocessedEntity s) { var arg0 = ReferenceEquals(s, null) ? global::System.IntPtr.Zero : s.__Instance; - Internal.addPreprocessedEntities_0(__Instance, arg0); + Internal.addPreprocessedEntities_0((__Instance + __PointerAdjustment), arg0); } public void clearPreprocessedEntities() { - Internal.clearPreprocessedEntities_0(__Instance); + Internal.clearPreprocessedEntities_0((__Instance + __PointerAdjustment)); } public string Name { get { - var __ret = Internal.getName_0(__Instance); + var __ret = Internal.getName_0((__Instance + __PointerAdjustment)); return Marshal.PtrToStringAnsi(__ret); } set { var arg0 = Marshal.StringToHGlobalAnsi(value); - Internal.setName_0(__Instance, arg0); + Internal.setName_0((__Instance + __PointerAdjustment), arg0); Marshal.FreeHGlobal(arg0); } } @@ -3514,14 +3559,14 @@ namespace CppSharp { get { - var __ret = Internal.getDebugText_0(__Instance); + var __ret = Internal.getDebugText_0((__Instance + __PointerAdjustment)); return Marshal.PtrToStringAnsi(__ret); } set { var arg0 = Marshal.StringToHGlobalAnsi(value); - Internal.setDebugText_0(__Instance, arg0); + Internal.setDebugText_0((__Instance + __PointerAdjustment), arg0); Marshal.FreeHGlobal(arg0); } } @@ -3530,7 +3575,7 @@ namespace CppSharp { get { - var __ret = Internal.getPreprocessedEntitiesCount_0(__Instance); + var __ret = Internal.getPreprocessedEntitiesCount_0((__Instance + __PointerAdjustment)); return __ret; } } @@ -3954,6 +3999,7 @@ namespace CppSharp protected DeclarationContext(DeclarationContext.Internal* native, bool skipVTables = false) : base((CppSharp.Parser.AST.Declaration.Internal*) null) { + __PointerAdjustment = 0; if (native == null) return; __Instance = new global::System.IntPtr(native); @@ -3966,7 +4012,7 @@ namespace CppSharp __ownsNativeInstance = true; NativeToManagedMap[__Instance] = this; var arg0 = kind; - Internal.ctor_0(__Instance, arg0); + Internal.ctor_0((__Instance + __PointerAdjustment), arg0); } public DeclarationContext(CppSharp.Parser.AST.DeclarationContext _0) @@ -3976,12 +4022,12 @@ namespace CppSharp __ownsNativeInstance = true; NativeToManagedMap[__Instance] = this; var arg0 = ReferenceEquals(_0, null) ? global::System.IntPtr.Zero : _0.__Instance; - Internal.cctor_2(__Instance, arg0); + Internal.cctor_2((__Instance + __PointerAdjustment), arg0); } public CppSharp.Parser.AST.Namespace getNamespaces(uint i) { - var __ret = Internal.getNamespaces_0(__Instance, i); + var __ret = Internal.getNamespaces_0((__Instance + __PointerAdjustment), i); CppSharp.Parser.AST.Namespace __result0; if (__ret == IntPtr.Zero) __result0 = null; else if (CppSharp.Parser.AST.Namespace.NativeToManagedMap.ContainsKey(__ret)) @@ -3993,17 +4039,17 @@ namespace CppSharp public void addNamespaces(CppSharp.Parser.AST.Namespace s) { var arg0 = ReferenceEquals(s, null) ? global::System.IntPtr.Zero : s.__Instance; - Internal.addNamespaces_0(__Instance, arg0); + Internal.addNamespaces_0((__Instance + __PointerAdjustment), arg0); } public void clearNamespaces() { - Internal.clearNamespaces_0(__Instance); + Internal.clearNamespaces_0((__Instance + __PointerAdjustment)); } public CppSharp.Parser.AST.Enumeration getEnums(uint i) { - var __ret = Internal.getEnums_0(__Instance, i); + var __ret = Internal.getEnums_0((__Instance + __PointerAdjustment), i); CppSharp.Parser.AST.Enumeration __result0; if (__ret == IntPtr.Zero) __result0 = null; else if (CppSharp.Parser.AST.Enumeration.NativeToManagedMap.ContainsKey(__ret)) @@ -4015,17 +4061,17 @@ namespace CppSharp public void addEnums(CppSharp.Parser.AST.Enumeration s) { var arg0 = ReferenceEquals(s, null) ? global::System.IntPtr.Zero : s.__Instance; - Internal.addEnums_0(__Instance, arg0); + Internal.addEnums_0((__Instance + __PointerAdjustment), arg0); } public void clearEnums() { - Internal.clearEnums_0(__Instance); + Internal.clearEnums_0((__Instance + __PointerAdjustment)); } public CppSharp.Parser.AST.Function getFunctions(uint i) { - var __ret = Internal.getFunctions_0(__Instance, i); + var __ret = Internal.getFunctions_0((__Instance + __PointerAdjustment), i); CppSharp.Parser.AST.Function __result0; if (__ret == IntPtr.Zero) __result0 = null; else if (CppSharp.Parser.AST.Function.NativeToManagedMap.ContainsKey(__ret)) @@ -4037,17 +4083,17 @@ namespace CppSharp public void addFunctions(CppSharp.Parser.AST.Function s) { var arg0 = ReferenceEquals(s, null) ? global::System.IntPtr.Zero : s.__Instance; - Internal.addFunctions_0(__Instance, arg0); + Internal.addFunctions_0((__Instance + __PointerAdjustment), arg0); } public void clearFunctions() { - Internal.clearFunctions_0(__Instance); + Internal.clearFunctions_0((__Instance + __PointerAdjustment)); } public CppSharp.Parser.AST.Class getClasses(uint i) { - var __ret = Internal.getClasses_0(__Instance, i); + var __ret = Internal.getClasses_0((__Instance + __PointerAdjustment), i); CppSharp.Parser.AST.Class __result0; if (__ret == IntPtr.Zero) __result0 = null; else if (CppSharp.Parser.AST.Class.NativeToManagedMap.ContainsKey(__ret)) @@ -4059,17 +4105,17 @@ namespace CppSharp public void addClasses(CppSharp.Parser.AST.Class s) { var arg0 = ReferenceEquals(s, null) ? global::System.IntPtr.Zero : s.__Instance; - Internal.addClasses_0(__Instance, arg0); + Internal.addClasses_0((__Instance + __PointerAdjustment), arg0); } public void clearClasses() { - Internal.clearClasses_0(__Instance); + Internal.clearClasses_0((__Instance + __PointerAdjustment)); } public CppSharp.Parser.AST.Template getTemplates(uint i) { - var __ret = Internal.getTemplates_0(__Instance, i); + var __ret = Internal.getTemplates_0((__Instance + __PointerAdjustment), i); CppSharp.Parser.AST.Template __result0; if (__ret == IntPtr.Zero) __result0 = null; else if (CppSharp.Parser.AST.Template.NativeToManagedMap.ContainsKey(__ret)) @@ -4081,17 +4127,17 @@ namespace CppSharp public void addTemplates(CppSharp.Parser.AST.Template s) { var arg0 = ReferenceEquals(s, null) ? global::System.IntPtr.Zero : s.__Instance; - Internal.addTemplates_0(__Instance, arg0); + Internal.addTemplates_0((__Instance + __PointerAdjustment), arg0); } public void clearTemplates() { - Internal.clearTemplates_0(__Instance); + Internal.clearTemplates_0((__Instance + __PointerAdjustment)); } public CppSharp.Parser.AST.TypedefDecl getTypedefs(uint i) { - var __ret = Internal.getTypedefs_0(__Instance, i); + var __ret = Internal.getTypedefs_0((__Instance + __PointerAdjustment), i); CppSharp.Parser.AST.TypedefDecl __result0; if (__ret == IntPtr.Zero) __result0 = null; else if (CppSharp.Parser.AST.TypedefDecl.NativeToManagedMap.ContainsKey(__ret)) @@ -4103,17 +4149,17 @@ namespace CppSharp public void addTypedefs(CppSharp.Parser.AST.TypedefDecl s) { var arg0 = ReferenceEquals(s, null) ? global::System.IntPtr.Zero : s.__Instance; - Internal.addTypedefs_0(__Instance, arg0); + Internal.addTypedefs_0((__Instance + __PointerAdjustment), arg0); } public void clearTypedefs() { - Internal.clearTypedefs_0(__Instance); + Internal.clearTypedefs_0((__Instance + __PointerAdjustment)); } public CppSharp.Parser.AST.Variable getVariables(uint i) { - var __ret = Internal.getVariables_0(__Instance, i); + var __ret = Internal.getVariables_0((__Instance + __PointerAdjustment), i); CppSharp.Parser.AST.Variable __result0; if (__ret == IntPtr.Zero) __result0 = null; else if (CppSharp.Parser.AST.Variable.NativeToManagedMap.ContainsKey(__ret)) @@ -4125,17 +4171,17 @@ namespace CppSharp public void addVariables(CppSharp.Parser.AST.Variable s) { var arg0 = ReferenceEquals(s, null) ? global::System.IntPtr.Zero : s.__Instance; - Internal.addVariables_0(__Instance, arg0); + Internal.addVariables_0((__Instance + __PointerAdjustment), arg0); } public void clearVariables() { - Internal.clearVariables_0(__Instance); + Internal.clearVariables_0((__Instance + __PointerAdjustment)); } public CppSharp.Parser.AST.Friend getFriends(uint i) { - var __ret = Internal.getFriends_0(__Instance, i); + var __ret = Internal.getFriends_0((__Instance + __PointerAdjustment), i); CppSharp.Parser.AST.Friend __result0; if (__ret == IntPtr.Zero) __result0 = null; else if (CppSharp.Parser.AST.Friend.NativeToManagedMap.ContainsKey(__ret)) @@ -4147,19 +4193,19 @@ namespace CppSharp public void addFriends(CppSharp.Parser.AST.Friend s) { var arg0 = ReferenceEquals(s, null) ? global::System.IntPtr.Zero : s.__Instance; - Internal.addFriends_0(__Instance, arg0); + Internal.addFriends_0((__Instance + __PointerAdjustment), arg0); } public void clearFriends() { - Internal.clearFriends_0(__Instance); + Internal.clearFriends_0((__Instance + __PointerAdjustment)); } public uint NamespacesCount { get { - var __ret = Internal.getNamespacesCount_0(__Instance); + var __ret = Internal.getNamespacesCount_0((__Instance + __PointerAdjustment)); return __ret; } } @@ -4168,7 +4214,7 @@ namespace CppSharp { get { - var __ret = Internal.getEnumsCount_0(__Instance); + var __ret = Internal.getEnumsCount_0((__Instance + __PointerAdjustment)); return __ret; } } @@ -4177,7 +4223,7 @@ namespace CppSharp { get { - var __ret = Internal.getFunctionsCount_0(__Instance); + var __ret = Internal.getFunctionsCount_0((__Instance + __PointerAdjustment)); return __ret; } } @@ -4186,7 +4232,7 @@ namespace CppSharp { get { - var __ret = Internal.getClassesCount_0(__Instance); + var __ret = Internal.getClassesCount_0((__Instance + __PointerAdjustment)); return __ret; } } @@ -4195,7 +4241,7 @@ namespace CppSharp { get { - var __ret = Internal.getTemplatesCount_0(__Instance); + var __ret = Internal.getTemplatesCount_0((__Instance + __PointerAdjustment)); return __ret; } } @@ -4204,7 +4250,7 @@ namespace CppSharp { get { - var __ret = Internal.getTypedefsCount_0(__Instance); + var __ret = Internal.getTypedefsCount_0((__Instance + __PointerAdjustment)); return __ret; } } @@ -4213,7 +4259,7 @@ namespace CppSharp { get { - var __ret = Internal.getVariablesCount_0(__Instance); + var __ret = Internal.getVariablesCount_0((__Instance + __PointerAdjustment)); return __ret; } } @@ -4222,7 +4268,7 @@ namespace CppSharp { get { - var __ret = Internal.getFriendsCount_0(__Instance); + var __ret = Internal.getFriendsCount_0((__Instance + __PointerAdjustment)); return __ret; } } @@ -4328,6 +4374,7 @@ namespace CppSharp protected TypedefDecl(TypedefDecl.Internal* native, bool skipVTables = false) : base((CppSharp.Parser.AST.Declaration.Internal*) null) { + __PointerAdjustment = 0; if (native == null) return; __Instance = new global::System.IntPtr(native); @@ -4339,7 +4386,7 @@ namespace CppSharp __Instance = Marshal.AllocHGlobal(136); __ownsNativeInstance = true; NativeToManagedMap[__Instance] = this; - Internal.ctor_0(__Instance); + Internal.ctor_0((__Instance + __PointerAdjustment)); } public TypedefDecl(CppSharp.Parser.AST.TypedefDecl _0) @@ -4349,7 +4396,7 @@ namespace CppSharp __ownsNativeInstance = true; NativeToManagedMap[__Instance] = this; var arg0 = ReferenceEquals(_0, null) ? global::System.IntPtr.Zero : _0.__Instance; - Internal.cctor_2(__Instance, arg0); + Internal.cctor_2((__Instance + __PointerAdjustment), arg0); } public CppSharp.Parser.AST.QualifiedType QualifiedType @@ -4453,6 +4500,7 @@ namespace CppSharp protected Friend(Friend.Internal* native, bool skipVTables = false) : base((CppSharp.Parser.AST.Declaration.Internal*) null) { + __PointerAdjustment = 0; if (native == null) return; __Instance = new global::System.IntPtr(native); @@ -4464,7 +4512,7 @@ namespace CppSharp __Instance = Marshal.AllocHGlobal(132); __ownsNativeInstance = true; NativeToManagedMap[__Instance] = this; - Internal.ctor_0(__Instance); + Internal.ctor_0((__Instance + __PointerAdjustment)); } public Friend(CppSharp.Parser.AST.Friend _0) @@ -4474,7 +4522,7 @@ namespace CppSharp __ownsNativeInstance = true; NativeToManagedMap[__Instance] = this; var arg0 = ReferenceEquals(_0, null) ? global::System.IntPtr.Zero : _0.__Instance; - Internal.cctor_2(__Instance, arg0); + Internal.cctor_2((__Instance + __PointerAdjustment), arg0); } public CppSharp.Parser.AST.Declaration Declaration @@ -4529,6 +4577,8 @@ namespace CppSharp } public global::System.IntPtr __Instance { get; protected set; } + + protected int __PointerAdjustment; public static readonly System.Collections.Concurrent.ConcurrentDictionary NativeToManagedMap = new System.Collections.Concurrent.ConcurrentDictionary(); protected void*[] __OriginalVTables; @@ -4571,7 +4621,7 @@ namespace CppSharp __ownsNativeInstance = true; NativeToManagedMap[__Instance] = this; var arg0 = ReferenceEquals(_0, null) ? global::System.IntPtr.Zero : _0.__Instance; - Internal.cctor_2(__Instance, arg0); + Internal.cctor_2((__Instance + __PointerAdjustment), arg0); } public void Dispose() @@ -4585,22 +4635,23 @@ namespace CppSharp throw new global::System.InvalidOperationException("Managed instances owned by native code cannot be disposed of."); CppSharp.Parser.AST.Statement __dummy; NativeToManagedMap.TryRemove(__Instance, out __dummy); - Internal.dtor_0(__Instance, 0); - Marshal.FreeHGlobal(__Instance); + Internal.dtor_0((__Instance + __PointerAdjustment), 0); + if (__ownsNativeInstance) + Marshal.FreeHGlobal(__Instance); } public string String { get { - var __ret = Internal.getString_0(__Instance); + var __ret = Internal.getString_0((__Instance + __PointerAdjustment)); return Marshal.PtrToStringAnsi(__ret); } set { var arg0 = Marshal.StringToHGlobalAnsi(value); - Internal.setString_0(__Instance, arg0); + Internal.setString_0((__Instance + __PointerAdjustment), arg0); Marshal.FreeHGlobal(arg0); } } @@ -4686,6 +4737,7 @@ namespace CppSharp protected Expression(Expression.Internal* native, bool skipVTables = false) : base((CppSharp.Parser.AST.Statement.Internal*) null) { + __PointerAdjustment = 0; if (native == null) return; __Instance = new global::System.IntPtr(native); @@ -4698,7 +4750,7 @@ namespace CppSharp __ownsNativeInstance = true; NativeToManagedMap[__Instance] = this; var arg0 = ReferenceEquals(_0, null) ? global::System.IntPtr.Zero : _0.__Instance; - Internal.cctor_1(__Instance, arg0); + Internal.cctor_1((__Instance + __PointerAdjustment), arg0); } } @@ -4767,6 +4819,7 @@ namespace CppSharp protected BinaryOperator(BinaryOperator.Internal* native, bool skipVTables = false) : base((CppSharp.Parser.AST.Expression.Internal*) null) { + __PointerAdjustment = 0; if (native == null) return; __Instance = new global::System.IntPtr(native); @@ -4779,21 +4832,21 @@ namespace CppSharp __ownsNativeInstance = true; NativeToManagedMap[__Instance] = this; var arg0 = ReferenceEquals(_0, null) ? global::System.IntPtr.Zero : _0.__Instance; - Internal.cctor_2(__Instance, arg0); + Internal.cctor_2((__Instance + __PointerAdjustment), arg0); } public string OpcodeStr { get { - var __ret = Internal.getOpcodeStr_0(__Instance); + var __ret = Internal.getOpcodeStr_0((__Instance + __PointerAdjustment)); return Marshal.PtrToStringAnsi(__ret); } set { var arg0 = Marshal.StringToHGlobalAnsi(value); - Internal.setOpcodeStr_0(__Instance, arg0); + Internal.setOpcodeStr_0((__Instance + __PointerAdjustment), arg0); Marshal.FreeHGlobal(arg0); } } @@ -4904,6 +4957,7 @@ namespace CppSharp protected CXXConstructExpr(CXXConstructExpr.Internal* native, bool skipVTables = false) : base((CppSharp.Parser.AST.Expression.Internal*) null) { + __PointerAdjustment = 0; if (native == null) return; __Instance = new global::System.IntPtr(native); @@ -4916,12 +4970,12 @@ namespace CppSharp __ownsNativeInstance = true; NativeToManagedMap[__Instance] = this; var arg0 = ReferenceEquals(_0, null) ? global::System.IntPtr.Zero : _0.__Instance; - Internal.cctor_2(__Instance, arg0); + Internal.cctor_2((__Instance + __PointerAdjustment), arg0); } public CppSharp.Parser.AST.Expression getArguments(uint i) { - var __ret = Internal.getArguments_0(__Instance, i); + var __ret = Internal.getArguments_0((__Instance + __PointerAdjustment), i); CppSharp.Parser.AST.Expression __result0; if (__ret == IntPtr.Zero) __result0 = null; else if (CppSharp.Parser.AST.Expression.NativeToManagedMap.ContainsKey(__ret)) @@ -4933,19 +4987,19 @@ namespace CppSharp public void addArguments(CppSharp.Parser.AST.Expression s) { var arg0 = ReferenceEquals(s, null) ? global::System.IntPtr.Zero : s.__Instance; - Internal.addArguments_0(__Instance, arg0); + Internal.addArguments_0((__Instance + __PointerAdjustment), arg0); } public void clearArguments() { - Internal.clearArguments_0(__Instance); + Internal.clearArguments_0((__Instance + __PointerAdjustment)); } public uint ArgumentsCount { get { - var __ret = Internal.getArgumentsCount_0(__Instance); + var __ret = Internal.getArgumentsCount_0((__Instance + __PointerAdjustment)); return __ret; } } @@ -5050,6 +5104,7 @@ namespace CppSharp protected Parameter(Parameter.Internal* native, bool skipVTables = false) : base((CppSharp.Parser.AST.Declaration.Internal*) null) { + __PointerAdjustment = 0; if (native == null) return; __Instance = new global::System.IntPtr(native); @@ -5061,7 +5116,7 @@ namespace CppSharp __Instance = Marshal.AllocHGlobal(148); __ownsNativeInstance = true; NativeToManagedMap[__Instance] = this; - Internal.ctor_0(__Instance); + Internal.ctor_0((__Instance + __PointerAdjustment)); } public Parameter(CppSharp.Parser.AST.Parameter _0) @@ -5071,7 +5126,7 @@ namespace CppSharp __ownsNativeInstance = true; NativeToManagedMap[__Instance] = this; var arg0 = ReferenceEquals(_0, null) ? global::System.IntPtr.Zero : _0.__Instance; - Internal.cctor_1(__Instance, arg0); + Internal.cctor_1((__Instance + __PointerAdjustment), arg0); } public CppSharp.Parser.AST.QualifiedType QualifiedType @@ -5299,6 +5354,7 @@ namespace CppSharp protected Function(Function.Internal* native, bool skipVTables = false) : base((CppSharp.Parser.AST.Declaration.Internal*) null) { + __PointerAdjustment = 0; if (native == null) return; __Instance = new global::System.IntPtr(native); @@ -5310,7 +5366,7 @@ namespace CppSharp __Instance = Marshal.AllocHGlobal(216); __ownsNativeInstance = true; NativeToManagedMap[__Instance] = this; - Internal.ctor_0(__Instance); + Internal.ctor_0((__Instance + __PointerAdjustment)); } public Function(CppSharp.Parser.AST.Function _0) @@ -5320,12 +5376,12 @@ namespace CppSharp __ownsNativeInstance = true; NativeToManagedMap[__Instance] = this; var arg0 = ReferenceEquals(_0, null) ? global::System.IntPtr.Zero : _0.__Instance; - Internal.cctor_2(__Instance, arg0); + Internal.cctor_2((__Instance + __PointerAdjustment), arg0); } public CppSharp.Parser.AST.Parameter getParameters(uint i) { - var __ret = Internal.getParameters_0(__Instance, i); + var __ret = Internal.getParameters_0((__Instance + __PointerAdjustment), i); CppSharp.Parser.AST.Parameter __result0; if (__ret == IntPtr.Zero) __result0 = null; else if (CppSharp.Parser.AST.Parameter.NativeToManagedMap.ContainsKey(__ret)) @@ -5337,26 +5393,26 @@ namespace CppSharp public void addParameters(CppSharp.Parser.AST.Parameter s) { var arg0 = ReferenceEquals(s, null) ? global::System.IntPtr.Zero : s.__Instance; - Internal.addParameters_0(__Instance, arg0); + Internal.addParameters_0((__Instance + __PointerAdjustment), arg0); } public void clearParameters() { - Internal.clearParameters_0(__Instance); + Internal.clearParameters_0((__Instance + __PointerAdjustment)); } public string Mangled { get { - var __ret = Internal.getMangled_0(__Instance); + var __ret = Internal.getMangled_0((__Instance + __PointerAdjustment)); return Marshal.PtrToStringAnsi(__ret); } set { var arg0 = Marshal.StringToHGlobalAnsi(value); - Internal.setMangled_0(__Instance, arg0); + Internal.setMangled_0((__Instance + __PointerAdjustment), arg0); Marshal.FreeHGlobal(arg0); } } @@ -5365,14 +5421,14 @@ namespace CppSharp { get { - var __ret = Internal.getSignature_0(__Instance); + var __ret = Internal.getSignature_0((__Instance + __PointerAdjustment)); return Marshal.PtrToStringAnsi(__ret); } set { var arg0 = Marshal.StringToHGlobalAnsi(value); - Internal.setSignature_0(__Instance, arg0); + Internal.setSignature_0((__Instance + __PointerAdjustment), arg0); Marshal.FreeHGlobal(arg0); } } @@ -5381,7 +5437,7 @@ namespace CppSharp { get { - var __ret = Internal.getParametersCount_0(__Instance); + var __ret = Internal.getParametersCount_0((__Instance + __PointerAdjustment)); return __ret; } } @@ -5672,6 +5728,7 @@ namespace CppSharp protected Method(Method.Internal* native, bool skipVTables = false) : base((CppSharp.Parser.AST.Function.Internal*) null) { + __PointerAdjustment = 0; if (native == null) return; __Instance = new global::System.IntPtr(native); @@ -5683,7 +5740,7 @@ namespace CppSharp __Instance = Marshal.AllocHGlobal(244); __ownsNativeInstance = true; NativeToManagedMap[__Instance] = this; - Internal.ctor_0(__Instance); + Internal.ctor_0((__Instance + __PointerAdjustment)); } public Method(CppSharp.Parser.AST.Method _0) @@ -5693,7 +5750,7 @@ namespace CppSharp __ownsNativeInstance = true; NativeToManagedMap[__Instance] = this; var arg0 = ReferenceEquals(_0, null) ? global::System.IntPtr.Zero : _0.__Instance; - Internal.cctor_1(__Instance, arg0); + Internal.cctor_1((__Instance + __PointerAdjustment), arg0); } public CppSharp.Parser.AST.AccessSpecifierDecl AccessDecl @@ -6052,6 +6109,7 @@ namespace CppSharp protected Item(Item.Internal* native, bool skipVTables = false) : base((CppSharp.Parser.AST.Declaration.Internal*) null) { + __PointerAdjustment = 0; if (native == null) return; __Instance = new global::System.IntPtr(native); @@ -6063,7 +6121,7 @@ namespace CppSharp __Instance = Marshal.AllocHGlobal(160); __ownsNativeInstance = true; NativeToManagedMap[__Instance] = this; - Internal.ctor_0(__Instance); + Internal.ctor_0((__Instance + __PointerAdjustment)); } public Item(CppSharp.Parser.AST.Enumeration.Item _0) @@ -6073,21 +6131,21 @@ namespace CppSharp __ownsNativeInstance = true; NativeToManagedMap[__Instance] = this; var arg0 = ReferenceEquals(_0, null) ? global::System.IntPtr.Zero : _0.__Instance; - Internal.cctor_1(__Instance, arg0); + Internal.cctor_1((__Instance + __PointerAdjustment), arg0); } public string Expression { get { - var __ret = Internal.getExpression_0(__Instance); + var __ret = Internal.getExpression_0((__Instance + __PointerAdjustment)); return Marshal.PtrToStringAnsi(__ret); } set { var arg0 = Marshal.StringToHGlobalAnsi(value); - Internal.setExpression_0(__Instance, arg0); + Internal.setExpression_0((__Instance + __PointerAdjustment), arg0); Marshal.FreeHGlobal(arg0); } } @@ -6133,6 +6191,7 @@ namespace CppSharp protected Enumeration(Enumeration.Internal* native, bool skipVTables = false) : base((CppSharp.Parser.AST.DeclarationContext.Internal*) null) { + __PointerAdjustment = 0; if (native == null) return; __Instance = new global::System.IntPtr(native); @@ -6144,7 +6203,7 @@ namespace CppSharp __Instance = Marshal.AllocHGlobal(260); __ownsNativeInstance = true; NativeToManagedMap[__Instance] = this; - Internal.ctor_0(__Instance); + Internal.ctor_0((__Instance + __PointerAdjustment)); } public Enumeration(CppSharp.Parser.AST.Enumeration _0) @@ -6154,32 +6213,32 @@ namespace CppSharp __ownsNativeInstance = true; NativeToManagedMap[__Instance] = this; var arg0 = ReferenceEquals(_0, null) ? global::System.IntPtr.Zero : _0.__Instance; - Internal.cctor_2(__Instance, arg0); + Internal.cctor_2((__Instance + __PointerAdjustment), arg0); } public CppSharp.Parser.AST.Enumeration.Item getItems(uint i) { var __ret = new CppSharp.Parser.AST.Enumeration.Item.Internal(); - Internal.getItems_0(__Instance, new IntPtr(&__ret), i); + Internal.getItems_0((__Instance + __PointerAdjustment), new IntPtr(&__ret), i); return CppSharp.Parser.AST.Enumeration.Item.__CreateInstance(__ret); } public void addItems(CppSharp.Parser.AST.Enumeration.Item s) { var arg0 = ReferenceEquals(s, null) ? global::System.IntPtr.Zero : s.__Instance; - Internal.addItems_0(__Instance, arg0); + Internal.addItems_0((__Instance + __PointerAdjustment), arg0); } public void clearItems() { - Internal.clearItems_0(__Instance); + Internal.clearItems_0((__Instance + __PointerAdjustment)); } public uint ItemsCount { get { - var __ret = Internal.getItemsCount_0(__Instance); + var __ret = Internal.getItemsCount_0((__Instance + __PointerAdjustment)); return __ret; } } @@ -6331,6 +6390,7 @@ namespace CppSharp protected Variable(Variable.Internal* native, bool skipVTables = false) : base((CppSharp.Parser.AST.Declaration.Internal*) null) { + __PointerAdjustment = 0; if (native == null) return; __Instance = new global::System.IntPtr(native); @@ -6342,7 +6402,7 @@ namespace CppSharp __Instance = Marshal.AllocHGlobal(160); __ownsNativeInstance = true; NativeToManagedMap[__Instance] = this; - Internal.ctor_0(__Instance); + Internal.ctor_0((__Instance + __PointerAdjustment)); } public Variable(CppSharp.Parser.AST.Variable _0) @@ -6352,21 +6412,21 @@ namespace CppSharp __ownsNativeInstance = true; NativeToManagedMap[__Instance] = this; var arg0 = ReferenceEquals(_0, null) ? global::System.IntPtr.Zero : _0.__Instance; - Internal.cctor_2(__Instance, arg0); + Internal.cctor_2((__Instance + __PointerAdjustment), arg0); } public string Mangled { get { - var __ret = Internal.getMangled_0(__Instance); + var __ret = Internal.getMangled_0((__Instance + __PointerAdjustment)); return Marshal.PtrToStringAnsi(__ret); } set { var arg0 = Marshal.StringToHGlobalAnsi(value); - Internal.setMangled_0(__Instance, arg0); + Internal.setMangled_0((__Instance + __PointerAdjustment), arg0); Marshal.FreeHGlobal(arg0); } } @@ -6414,6 +6474,8 @@ namespace CppSharp } public global::System.IntPtr __Instance { get; protected set; } + + protected int __PointerAdjustment; public static readonly System.Collections.Concurrent.ConcurrentDictionary NativeToManagedMap = new System.Collections.Concurrent.ConcurrentDictionary(); protected void*[] __OriginalVTables; @@ -6455,7 +6517,7 @@ namespace CppSharp __Instance = Marshal.AllocHGlobal(16); __ownsNativeInstance = true; NativeToManagedMap[__Instance] = this; - Internal.ctor_0(__Instance); + Internal.ctor_0((__Instance + __PointerAdjustment)); } public BaseClassSpecifier(CppSharp.Parser.AST.BaseClassSpecifier _0) @@ -6477,7 +6539,8 @@ namespace CppSharp throw new global::System.InvalidOperationException("Managed instances owned by native code cannot be disposed of."); CppSharp.Parser.AST.BaseClassSpecifier __dummy; NativeToManagedMap.TryRemove(__Instance, out __dummy); - Marshal.FreeHGlobal(__Instance); + if (__ownsNativeInstance) + Marshal.FreeHGlobal(__Instance); } public CppSharp.Parser.AST.AccessSpecifier Access @@ -6637,6 +6700,7 @@ namespace CppSharp protected Field(Field.Internal* native, bool skipVTables = false) : base((CppSharp.Parser.AST.Declaration.Internal*) null) { + __PointerAdjustment = 0; if (native == null) return; __Instance = new global::System.IntPtr(native); @@ -6648,7 +6712,7 @@ namespace CppSharp __Instance = Marshal.AllocHGlobal(152); __ownsNativeInstance = true; NativeToManagedMap[__Instance] = this; - Internal.ctor_0(__Instance); + Internal.ctor_0((__Instance + __PointerAdjustment)); } public Field(CppSharp.Parser.AST.Field _0) @@ -6658,7 +6722,7 @@ namespace CppSharp __ownsNativeInstance = true; NativeToManagedMap[__Instance] = this; var arg0 = ReferenceEquals(_0, null) ? global::System.IntPtr.Zero : _0.__Instance; - Internal.cctor_2(__Instance, arg0); + Internal.cctor_2((__Instance + __PointerAdjustment), arg0); } public CppSharp.Parser.AST.QualifiedType QualifiedType @@ -6816,6 +6880,7 @@ namespace CppSharp protected AccessSpecifierDecl(AccessSpecifierDecl.Internal* native, bool skipVTables = false) : base((CppSharp.Parser.AST.Declaration.Internal*) null) { + __PointerAdjustment = 0; if (native == null) return; __Instance = new global::System.IntPtr(native); @@ -6827,7 +6892,7 @@ namespace CppSharp __Instance = Marshal.AllocHGlobal(128); __ownsNativeInstance = true; NativeToManagedMap[__Instance] = this; - Internal.ctor_0(__Instance); + Internal.ctor_0((__Instance + __PointerAdjustment)); } public AccessSpecifierDecl(CppSharp.Parser.AST.AccessSpecifierDecl _0) @@ -6837,7 +6902,7 @@ namespace CppSharp __ownsNativeInstance = true; NativeToManagedMap[__Instance] = this; var arg0 = ReferenceEquals(_0, null) ? global::System.IntPtr.Zero : _0.__Instance; - Internal.cctor_2(__Instance, arg0); + Internal.cctor_2((__Instance + __PointerAdjustment), arg0); } } @@ -7038,6 +7103,7 @@ namespace CppSharp protected Class(Class.Internal* native, bool skipVTables = false) : base((CppSharp.Parser.AST.DeclarationContext.Internal*) null) { + __PointerAdjustment = 0; if (native == null) return; __Instance = new global::System.IntPtr(native); @@ -7049,7 +7115,7 @@ namespace CppSharp __Instance = Marshal.AllocHGlobal(300); __ownsNativeInstance = true; NativeToManagedMap[__Instance] = this; - Internal.ctor_0(__Instance); + Internal.ctor_0((__Instance + __PointerAdjustment)); } public Class(CppSharp.Parser.AST.Class _0) @@ -7059,12 +7125,12 @@ namespace CppSharp __ownsNativeInstance = true; NativeToManagedMap[__Instance] = this; var arg0 = ReferenceEquals(_0, null) ? global::System.IntPtr.Zero : _0.__Instance; - Internal.cctor_1(__Instance, arg0); + Internal.cctor_1((__Instance + __PointerAdjustment), arg0); } public CppSharp.Parser.AST.BaseClassSpecifier getBases(uint i) { - var __ret = Internal.getBases_0(__Instance, i); + var __ret = Internal.getBases_0((__Instance + __PointerAdjustment), i); CppSharp.Parser.AST.BaseClassSpecifier __result0; if (__ret == IntPtr.Zero) __result0 = null; else if (CppSharp.Parser.AST.BaseClassSpecifier.NativeToManagedMap.ContainsKey(__ret)) @@ -7076,17 +7142,17 @@ namespace CppSharp public void addBases(CppSharp.Parser.AST.BaseClassSpecifier s) { var arg0 = ReferenceEquals(s, null) ? global::System.IntPtr.Zero : s.__Instance; - Internal.addBases_0(__Instance, arg0); + Internal.addBases_0((__Instance + __PointerAdjustment), arg0); } public void clearBases() { - Internal.clearBases_0(__Instance); + Internal.clearBases_0((__Instance + __PointerAdjustment)); } public CppSharp.Parser.AST.Field getFields(uint i) { - var __ret = Internal.getFields_0(__Instance, i); + var __ret = Internal.getFields_0((__Instance + __PointerAdjustment), i); CppSharp.Parser.AST.Field __result0; if (__ret == IntPtr.Zero) __result0 = null; else if (CppSharp.Parser.AST.Field.NativeToManagedMap.ContainsKey(__ret)) @@ -7098,17 +7164,17 @@ namespace CppSharp public void addFields(CppSharp.Parser.AST.Field s) { var arg0 = ReferenceEquals(s, null) ? global::System.IntPtr.Zero : s.__Instance; - Internal.addFields_0(__Instance, arg0); + Internal.addFields_0((__Instance + __PointerAdjustment), arg0); } public void clearFields() { - Internal.clearFields_0(__Instance); + Internal.clearFields_0((__Instance + __PointerAdjustment)); } public CppSharp.Parser.AST.Method getMethods(uint i) { - var __ret = Internal.getMethods_0(__Instance, i); + var __ret = Internal.getMethods_0((__Instance + __PointerAdjustment), i); CppSharp.Parser.AST.Method __result0; if (__ret == IntPtr.Zero) __result0 = null; else if (CppSharp.Parser.AST.Method.NativeToManagedMap.ContainsKey(__ret)) @@ -7120,17 +7186,17 @@ namespace CppSharp public void addMethods(CppSharp.Parser.AST.Method s) { var arg0 = ReferenceEquals(s, null) ? global::System.IntPtr.Zero : s.__Instance; - Internal.addMethods_0(__Instance, arg0); + Internal.addMethods_0((__Instance + __PointerAdjustment), arg0); } public void clearMethods() { - Internal.clearMethods_0(__Instance); + Internal.clearMethods_0((__Instance + __PointerAdjustment)); } public CppSharp.Parser.AST.AccessSpecifierDecl getSpecifiers(uint i) { - var __ret = Internal.getSpecifiers_0(__Instance, i); + var __ret = Internal.getSpecifiers_0((__Instance + __PointerAdjustment), i); CppSharp.Parser.AST.AccessSpecifierDecl __result0; if (__ret == IntPtr.Zero) __result0 = null; else if (CppSharp.Parser.AST.AccessSpecifierDecl.NativeToManagedMap.ContainsKey(__ret)) @@ -7142,19 +7208,19 @@ namespace CppSharp public void addSpecifiers(CppSharp.Parser.AST.AccessSpecifierDecl s) { var arg0 = ReferenceEquals(s, null) ? global::System.IntPtr.Zero : s.__Instance; - Internal.addSpecifiers_0(__Instance, arg0); + Internal.addSpecifiers_0((__Instance + __PointerAdjustment), arg0); } public void clearSpecifiers() { - Internal.clearSpecifiers_0(__Instance); + Internal.clearSpecifiers_0((__Instance + __PointerAdjustment)); } public uint BasesCount { get { - var __ret = Internal.getBasesCount_0(__Instance); + var __ret = Internal.getBasesCount_0((__Instance + __PointerAdjustment)); return __ret; } } @@ -7163,7 +7229,7 @@ namespace CppSharp { get { - var __ret = Internal.getFieldsCount_0(__Instance); + var __ret = Internal.getFieldsCount_0((__Instance + __PointerAdjustment)); return __ret; } } @@ -7172,7 +7238,7 @@ namespace CppSharp { get { - var __ret = Internal.getMethodsCount_0(__Instance); + var __ret = Internal.getMethodsCount_0((__Instance + __PointerAdjustment)); return __ret; } } @@ -7181,7 +7247,7 @@ namespace CppSharp { get { - var __ret = Internal.getSpecifiersCount_0(__Instance); + var __ret = Internal.getSpecifiersCount_0((__Instance + __PointerAdjustment)); return __ret; } } @@ -7434,6 +7500,7 @@ namespace CppSharp protected Template(Template.Internal* native, bool skipVTables = false) : base((CppSharp.Parser.AST.Declaration.Internal*) null) { + __PointerAdjustment = 0; if (native == null) return; __Instance = new global::System.IntPtr(native); @@ -7446,7 +7513,7 @@ namespace CppSharp __ownsNativeInstance = true; NativeToManagedMap[__Instance] = this; var arg0 = kind; - Internal.ctor_0(__Instance, arg0); + Internal.ctor_0((__Instance + __PointerAdjustment), arg0); } public Template() @@ -7455,7 +7522,7 @@ namespace CppSharp __Instance = Marshal.AllocHGlobal(144); __ownsNativeInstance = true; NativeToManagedMap[__Instance] = this; - Internal.ctor_1(__Instance); + Internal.ctor_1((__Instance + __PointerAdjustment)); } public Template(CppSharp.Parser.AST.Template _0) @@ -7465,32 +7532,32 @@ namespace CppSharp __ownsNativeInstance = true; NativeToManagedMap[__Instance] = this; var arg0 = ReferenceEquals(_0, null) ? global::System.IntPtr.Zero : _0.__Instance; - Internal.cctor_3(__Instance, arg0); + Internal.cctor_3((__Instance + __PointerAdjustment), arg0); } public CppSharp.Parser.AST.TemplateParameter getParameters(uint i) { var __ret = new CppSharp.Parser.AST.TemplateParameter.Internal(); - Internal.getParameters_0(__Instance, new IntPtr(&__ret), i); + Internal.getParameters_0((__Instance + __PointerAdjustment), new IntPtr(&__ret), i); return CppSharp.Parser.AST.TemplateParameter.__CreateInstance(__ret); } public void addParameters(CppSharp.Parser.AST.TemplateParameter s) { var arg0 = ReferenceEquals(s, null) ? global::System.IntPtr.Zero : s.__Instance; - Internal.addParameters_0(__Instance, arg0); + Internal.addParameters_0((__Instance + __PointerAdjustment), arg0); } public void clearParameters() { - Internal.clearParameters_0(__Instance); + Internal.clearParameters_0((__Instance + __PointerAdjustment)); } public uint ParametersCount { get { - var __ret = Internal.getParametersCount_0(__Instance); + var __ret = Internal.getParametersCount_0((__Instance + __PointerAdjustment)); return __ret; } } @@ -7621,6 +7688,7 @@ namespace CppSharp protected ClassTemplate(ClassTemplate.Internal* native, bool skipVTables = false) : base((CppSharp.Parser.AST.Template.Internal*) null) { + __PointerAdjustment = 0; if (native == null) return; __Instance = new global::System.IntPtr(native); @@ -7632,7 +7700,7 @@ namespace CppSharp __Instance = Marshal.AllocHGlobal(156); __ownsNativeInstance = true; NativeToManagedMap[__Instance] = this; - Internal.ctor_0(__Instance); + Internal.ctor_0((__Instance + __PointerAdjustment)); } public ClassTemplate(CppSharp.Parser.AST.ClassTemplate _0) @@ -7642,12 +7710,12 @@ namespace CppSharp __ownsNativeInstance = true; NativeToManagedMap[__Instance] = this; var arg0 = ReferenceEquals(_0, null) ? global::System.IntPtr.Zero : _0.__Instance; - Internal.cctor_2(__Instance, arg0); + Internal.cctor_2((__Instance + __PointerAdjustment), arg0); } public CppSharp.Parser.AST.ClassTemplateSpecialization getSpecializations(uint i) { - var __ret = Internal.getSpecializations_0(__Instance, i); + var __ret = Internal.getSpecializations_0((__Instance + __PointerAdjustment), i); CppSharp.Parser.AST.ClassTemplateSpecialization __result0; if (__ret == IntPtr.Zero) __result0 = null; else if (CppSharp.Parser.AST.ClassTemplateSpecialization.NativeToManagedMap.ContainsKey(__ret)) @@ -7659,19 +7727,19 @@ namespace CppSharp public void addSpecializations(CppSharp.Parser.AST.ClassTemplateSpecialization s) { var arg0 = ReferenceEquals(s, null) ? global::System.IntPtr.Zero : s.__Instance; - Internal.addSpecializations_0(__Instance, arg0); + Internal.addSpecializations_0((__Instance + __PointerAdjustment), arg0); } public void clearSpecializations() { - Internal.clearSpecializations_0(__Instance); + Internal.clearSpecializations_0((__Instance + __PointerAdjustment)); } public uint SpecializationsCount { get { - var __ret = Internal.getSpecializationsCount_0(__Instance); + var __ret = Internal.getSpecializationsCount_0((__Instance + __PointerAdjustment)); return __ret; } } @@ -7820,6 +7888,7 @@ namespace CppSharp protected ClassTemplateSpecialization(ClassTemplateSpecialization.Internal* native, bool skipVTables = false) : base((CppSharp.Parser.AST.Class.Internal*) null) { + __PointerAdjustment = 0; if (native == null) return; __Instance = new global::System.IntPtr(native); @@ -7831,7 +7900,7 @@ namespace CppSharp __Instance = Marshal.AllocHGlobal(320); __ownsNativeInstance = true; NativeToManagedMap[__Instance] = this; - Internal.ctor_0(__Instance); + Internal.ctor_0((__Instance + __PointerAdjustment)); } public ClassTemplateSpecialization(CppSharp.Parser.AST.ClassTemplateSpecialization _0) @@ -7841,32 +7910,32 @@ namespace CppSharp __ownsNativeInstance = true; NativeToManagedMap[__Instance] = this; var arg0 = ReferenceEquals(_0, null) ? global::System.IntPtr.Zero : _0.__Instance; - Internal.cctor_2(__Instance, arg0); + Internal.cctor_2((__Instance + __PointerAdjustment), arg0); } public CppSharp.Parser.AST.TemplateArgument getArguments(uint i) { var __ret = new CppSharp.Parser.AST.TemplateArgument.Internal(); - Internal.getArguments_0(__Instance, new IntPtr(&__ret), i); + Internal.getArguments_0((__Instance + __PointerAdjustment), new IntPtr(&__ret), i); return CppSharp.Parser.AST.TemplateArgument.__CreateInstance(__ret); } public void addArguments(CppSharp.Parser.AST.TemplateArgument s) { var arg0 = ReferenceEquals(s, null) ? global::System.IntPtr.Zero : s.__Instance; - Internal.addArguments_0(__Instance, arg0); + Internal.addArguments_0((__Instance + __PointerAdjustment), arg0); } public void clearArguments() { - Internal.clearArguments_0(__Instance); + Internal.clearArguments_0((__Instance + __PointerAdjustment)); } public uint ArgumentsCount { get { - var __ret = Internal.getArgumentsCount_0(__Instance); + var __ret = Internal.getArgumentsCount_0((__Instance + __PointerAdjustment)); return __ret; } } @@ -8026,6 +8095,7 @@ namespace CppSharp protected ClassTemplatePartialSpecialization(ClassTemplatePartialSpecialization.Internal* native, bool skipVTables = false) : base((CppSharp.Parser.AST.ClassTemplateSpecialization.Internal*) null) { + __PointerAdjustment = 0; if (native == null) return; __Instance = new global::System.IntPtr(native); @@ -8037,7 +8107,7 @@ namespace CppSharp __Instance = Marshal.AllocHGlobal(320); __ownsNativeInstance = true; NativeToManagedMap[__Instance] = this; - Internal.ctor_0(__Instance); + Internal.ctor_0((__Instance + __PointerAdjustment)); } public ClassTemplatePartialSpecialization(CppSharp.Parser.AST.ClassTemplatePartialSpecialization _0) @@ -8047,7 +8117,7 @@ namespace CppSharp __ownsNativeInstance = true; NativeToManagedMap[__Instance] = this; var arg0 = ReferenceEquals(_0, null) ? global::System.IntPtr.Zero : _0.__Instance; - Internal.cctor_1(__Instance, arg0); + Internal.cctor_1((__Instance + __PointerAdjustment), arg0); } } @@ -8158,6 +8228,7 @@ namespace CppSharp protected FunctionTemplate(FunctionTemplate.Internal* native, bool skipVTables = false) : base((CppSharp.Parser.AST.Template.Internal*) null) { + __PointerAdjustment = 0; if (native == null) return; __Instance = new global::System.IntPtr(native); @@ -8169,7 +8240,7 @@ namespace CppSharp __Instance = Marshal.AllocHGlobal(156); __ownsNativeInstance = true; NativeToManagedMap[__Instance] = this; - Internal.ctor_0(__Instance); + Internal.ctor_0((__Instance + __PointerAdjustment)); } public FunctionTemplate(CppSharp.Parser.AST.FunctionTemplate _0) @@ -8179,12 +8250,12 @@ namespace CppSharp __ownsNativeInstance = true; NativeToManagedMap[__Instance] = this; var arg0 = ReferenceEquals(_0, null) ? global::System.IntPtr.Zero : _0.__Instance; - Internal.cctor_2(__Instance, arg0); + Internal.cctor_2((__Instance + __PointerAdjustment), arg0); } public CppSharp.Parser.AST.FunctionTemplateSpecialization getSpecializations(uint i) { - var __ret = Internal.getSpecializations_0(__Instance, i); + var __ret = Internal.getSpecializations_0((__Instance + __PointerAdjustment), i); CppSharp.Parser.AST.FunctionTemplateSpecialization __result0; if (__ret == IntPtr.Zero) __result0 = null; else if (CppSharp.Parser.AST.FunctionTemplateSpecialization.NativeToManagedMap.ContainsKey(__ret)) @@ -8196,19 +8267,19 @@ namespace CppSharp public void addSpecializations(CppSharp.Parser.AST.FunctionTemplateSpecialization s) { var arg0 = ReferenceEquals(s, null) ? global::System.IntPtr.Zero : s.__Instance; - Internal.addSpecializations_0(__Instance, arg0); + Internal.addSpecializations_0((__Instance + __PointerAdjustment), arg0); } public void clearSpecializations() { - Internal.clearSpecializations_0(__Instance); + Internal.clearSpecializations_0((__Instance + __PointerAdjustment)); } public uint SpecializationsCount { get { - var __ret = Internal.getSpecializationsCount_0(__Instance); + var __ret = Internal.getSpecializationsCount_0((__Instance + __PointerAdjustment)); return __ret; } } @@ -8265,6 +8336,8 @@ namespace CppSharp } public global::System.IntPtr __Instance { get; protected set; } + + protected int __PointerAdjustment; public static readonly System.Collections.Concurrent.ConcurrentDictionary NativeToManagedMap = new System.Collections.Concurrent.ConcurrentDictionary(); protected void*[] __OriginalVTables; @@ -8306,7 +8379,7 @@ namespace CppSharp __Instance = Marshal.AllocHGlobal(24); __ownsNativeInstance = true; NativeToManagedMap[__Instance] = this; - Internal.ctor_0(__Instance); + Internal.ctor_0((__Instance + __PointerAdjustment)); } public FunctionTemplateSpecialization(CppSharp.Parser.AST.FunctionTemplateSpecialization _0) @@ -8315,7 +8388,7 @@ namespace CppSharp __ownsNativeInstance = true; NativeToManagedMap[__Instance] = this; var arg0 = ReferenceEquals(_0, null) ? global::System.IntPtr.Zero : _0.__Instance; - Internal.cctor_2(__Instance, arg0); + Internal.cctor_2((__Instance + __PointerAdjustment), arg0); } public void Dispose() @@ -8329,33 +8402,34 @@ namespace CppSharp throw new global::System.InvalidOperationException("Managed instances owned by native code cannot be disposed of."); CppSharp.Parser.AST.FunctionTemplateSpecialization __dummy; NativeToManagedMap.TryRemove(__Instance, out __dummy); - Internal.dtor_0(__Instance, 0); - Marshal.FreeHGlobal(__Instance); + Internal.dtor_0((__Instance + __PointerAdjustment), 0); + if (__ownsNativeInstance) + Marshal.FreeHGlobal(__Instance); } public CppSharp.Parser.AST.TemplateArgument getArguments(uint i) { var __ret = new CppSharp.Parser.AST.TemplateArgument.Internal(); - Internal.getArguments_0(__Instance, new IntPtr(&__ret), i); + Internal.getArguments_0((__Instance + __PointerAdjustment), new IntPtr(&__ret), i); return CppSharp.Parser.AST.TemplateArgument.__CreateInstance(__ret); } public void addArguments(CppSharp.Parser.AST.TemplateArgument s) { var arg0 = ReferenceEquals(s, null) ? global::System.IntPtr.Zero : s.__Instance; - Internal.addArguments_0(__Instance, arg0); + Internal.addArguments_0((__Instance + __PointerAdjustment), arg0); } public void clearArguments() { - Internal.clearArguments_0(__Instance); + Internal.clearArguments_0((__Instance + __PointerAdjustment)); } public uint ArgumentsCount { get { - var __ret = Internal.getArgumentsCount_0(__Instance); + var __ret = Internal.getArgumentsCount_0((__Instance + __PointerAdjustment)); return __ret; } } @@ -8500,6 +8574,7 @@ namespace CppSharp protected Namespace(Namespace.Internal* native, bool skipVTables = false) : base((CppSharp.Parser.AST.DeclarationContext.Internal*) null) { + __PointerAdjustment = 0; if (native == null) return; __Instance = new global::System.IntPtr(native); @@ -8511,7 +8586,7 @@ namespace CppSharp __Instance = Marshal.AllocHGlobal(240); __ownsNativeInstance = true; NativeToManagedMap[__Instance] = this; - Internal.ctor_0(__Instance); + Internal.ctor_0((__Instance + __PointerAdjustment)); } public Namespace(CppSharp.Parser.AST.Namespace _0) @@ -8521,7 +8596,7 @@ namespace CppSharp __ownsNativeInstance = true; NativeToManagedMap[__Instance] = this; var arg0 = ReferenceEquals(_0, null) ? global::System.IntPtr.Zero : _0.__Instance; - Internal.cctor_1(__Instance, arg0); + Internal.cctor_1((__Instance + __PointerAdjustment), arg0); } public bool IsInline @@ -8625,6 +8700,7 @@ namespace CppSharp protected PreprocessedEntity(PreprocessedEntity.Internal* native, bool skipVTables = false) : base((CppSharp.Parser.AST.Declaration.Internal*) null) { + __PointerAdjustment = 0; if (native == null) return; __Instance = new global::System.IntPtr(native); @@ -8636,7 +8712,7 @@ namespace CppSharp __Instance = Marshal.AllocHGlobal(132); __ownsNativeInstance = true; NativeToManagedMap[__Instance] = this; - Internal.ctor_0(__Instance); + Internal.ctor_0((__Instance + __PointerAdjustment)); } public PreprocessedEntity(CppSharp.Parser.AST.PreprocessedEntity _0) @@ -8646,7 +8722,7 @@ namespace CppSharp __ownsNativeInstance = true; NativeToManagedMap[__Instance] = this; var arg0 = ReferenceEquals(_0, null) ? global::System.IntPtr.Zero : _0.__Instance; - Internal.cctor_2(__Instance, arg0); + Internal.cctor_2((__Instance + __PointerAdjustment), arg0); } public CppSharp.Parser.AST.MacroLocation MacroLocation @@ -8760,6 +8836,7 @@ namespace CppSharp protected MacroDefinition(MacroDefinition.Internal* native, bool skipVTables = false) : base((CppSharp.Parser.AST.PreprocessedEntity.Internal*) null) { + __PointerAdjustment = 0; if (native == null) return; __Instance = new global::System.IntPtr(native); @@ -8771,7 +8848,7 @@ namespace CppSharp __Instance = Marshal.AllocHGlobal(156); __ownsNativeInstance = true; NativeToManagedMap[__Instance] = this; - Internal.ctor_0(__Instance); + Internal.ctor_0((__Instance + __PointerAdjustment)); } public MacroDefinition(CppSharp.Parser.AST.MacroDefinition _0) @@ -8781,21 +8858,21 @@ namespace CppSharp __ownsNativeInstance = true; NativeToManagedMap[__Instance] = this; var arg0 = ReferenceEquals(_0, null) ? global::System.IntPtr.Zero : _0.__Instance; - Internal.cctor_2(__Instance, arg0); + Internal.cctor_2((__Instance + __PointerAdjustment), arg0); } public string Expression { get { - var __ret = Internal.getExpression_0(__Instance); + var __ret = Internal.getExpression_0((__Instance + __PointerAdjustment)); return Marshal.PtrToStringAnsi(__ret); } set { var arg0 = Marshal.StringToHGlobalAnsi(value); - Internal.setExpression_0(__Instance, arg0); + Internal.setExpression_0((__Instance + __PointerAdjustment), arg0); Marshal.FreeHGlobal(arg0); } } @@ -8901,6 +8978,7 @@ namespace CppSharp protected MacroExpansion(MacroExpansion.Internal* native, bool skipVTables = false) : base((CppSharp.Parser.AST.PreprocessedEntity.Internal*) null) { + __PointerAdjustment = 0; if (native == null) return; __Instance = new global::System.IntPtr(native); @@ -8912,7 +8990,7 @@ namespace CppSharp __Instance = Marshal.AllocHGlobal(160); __ownsNativeInstance = true; NativeToManagedMap[__Instance] = this; - Internal.ctor_0(__Instance); + Internal.ctor_0((__Instance + __PointerAdjustment)); } public MacroExpansion(CppSharp.Parser.AST.MacroExpansion _0) @@ -8922,21 +9000,21 @@ namespace CppSharp __ownsNativeInstance = true; NativeToManagedMap[__Instance] = this; var arg0 = ReferenceEquals(_0, null) ? global::System.IntPtr.Zero : _0.__Instance; - Internal.cctor_2(__Instance, arg0); + Internal.cctor_2((__Instance + __PointerAdjustment), arg0); } public string Text { get { - var __ret = Internal.getText_0(__Instance); + var __ret = Internal.getText_0((__Instance + __PointerAdjustment)); return Marshal.PtrToStringAnsi(__ret); } set { var arg0 = Marshal.StringToHGlobalAnsi(value); - Internal.setText_0(__Instance, arg0); + Internal.setText_0((__Instance + __PointerAdjustment), arg0); Marshal.FreeHGlobal(arg0); } } @@ -9083,6 +9161,7 @@ namespace CppSharp protected TranslationUnit(TranslationUnit.Internal* native, bool skipVTables = false) : base((CppSharp.Parser.AST.Namespace.Internal*) null) { + __PointerAdjustment = 0; if (native == null) return; __Instance = new global::System.IntPtr(native); @@ -9094,7 +9173,7 @@ namespace CppSharp __Instance = Marshal.AllocHGlobal(280); __ownsNativeInstance = true; NativeToManagedMap[__Instance] = this; - Internal.ctor_0(__Instance); + Internal.ctor_0((__Instance + __PointerAdjustment)); } public TranslationUnit(CppSharp.Parser.AST.TranslationUnit _0) @@ -9104,12 +9183,12 @@ namespace CppSharp __ownsNativeInstance = true; NativeToManagedMap[__Instance] = this; var arg0 = ReferenceEquals(_0, null) ? global::System.IntPtr.Zero : _0.__Instance; - Internal.cctor_2(__Instance, arg0); + Internal.cctor_2((__Instance + __PointerAdjustment), arg0); } public CppSharp.Parser.AST.MacroDefinition getMacros(uint i) { - var __ret = Internal.getMacros_0(__Instance, i); + var __ret = Internal.getMacros_0((__Instance + __PointerAdjustment), i); CppSharp.Parser.AST.MacroDefinition __result0; if (__ret == IntPtr.Zero) __result0 = null; else if (CppSharp.Parser.AST.MacroDefinition.NativeToManagedMap.ContainsKey(__ret)) @@ -9121,26 +9200,26 @@ namespace CppSharp public void addMacros(CppSharp.Parser.AST.MacroDefinition s) { var arg0 = ReferenceEquals(s, null) ? global::System.IntPtr.Zero : s.__Instance; - Internal.addMacros_0(__Instance, arg0); + Internal.addMacros_0((__Instance + __PointerAdjustment), arg0); } public void clearMacros() { - Internal.clearMacros_0(__Instance); + Internal.clearMacros_0((__Instance + __PointerAdjustment)); } public string FileName { get { - var __ret = Internal.getFileName_0(__Instance); + var __ret = Internal.getFileName_0((__Instance + __PointerAdjustment)); return Marshal.PtrToStringAnsi(__ret); } set { var arg0 = Marshal.StringToHGlobalAnsi(value); - Internal.setFileName_0(__Instance, arg0); + Internal.setFileName_0((__Instance + __PointerAdjustment), arg0); Marshal.FreeHGlobal(arg0); } } @@ -9149,7 +9228,7 @@ namespace CppSharp { get { - var __ret = Internal.getMacrosCount_0(__Instance); + var __ret = Internal.getMacrosCount_0((__Instance + __PointerAdjustment)); return __ret; } } @@ -9243,6 +9322,8 @@ namespace CppSharp } public global::System.IntPtr __Instance { get; protected set; } + + protected int __PointerAdjustment; public static readonly System.Collections.Concurrent.ConcurrentDictionary NativeToManagedMap = new System.Collections.Concurrent.ConcurrentDictionary(); protected void*[] __OriginalVTables; @@ -9284,7 +9365,7 @@ namespace CppSharp __Instance = Marshal.AllocHGlobal(52); __ownsNativeInstance = true; NativeToManagedMap[__Instance] = this; - Internal.ctor_0(__Instance); + Internal.ctor_0((__Instance + __PointerAdjustment)); } public NativeLibrary(CppSharp.Parser.AST.NativeLibrary _0) @@ -9293,7 +9374,7 @@ namespace CppSharp __ownsNativeInstance = true; NativeToManagedMap[__Instance] = this; var arg0 = ReferenceEquals(_0, null) ? global::System.IntPtr.Zero : _0.__Instance; - Internal.cctor_2(__Instance, arg0); + Internal.cctor_2((__Instance + __PointerAdjustment), arg0); } public void Dispose() @@ -9307,58 +9388,59 @@ namespace CppSharp throw new global::System.InvalidOperationException("Managed instances owned by native code cannot be disposed of."); CppSharp.Parser.AST.NativeLibrary __dummy; NativeToManagedMap.TryRemove(__Instance, out __dummy); - Internal.dtor_0(__Instance, 0); - Marshal.FreeHGlobal(__Instance); + Internal.dtor_0((__Instance + __PointerAdjustment), 0); + if (__ownsNativeInstance) + Marshal.FreeHGlobal(__Instance); } public string getSymbols(uint i) { - var __ret = Internal.getSymbols_0(__Instance, i); + var __ret = Internal.getSymbols_0((__Instance + __PointerAdjustment), i); return Marshal.PtrToStringAnsi(__ret); } public void addSymbols(string s) { var arg0 = Marshal.StringToHGlobalAnsi(s); - Internal.addSymbols_0(__Instance, arg0); + Internal.addSymbols_0((__Instance + __PointerAdjustment), arg0); Marshal.FreeHGlobal(arg0); } public void clearSymbols() { - Internal.clearSymbols_0(__Instance); + Internal.clearSymbols_0((__Instance + __PointerAdjustment)); } public string getDependencies(uint i) { - var __ret = Internal.getDependencies_0(__Instance, i); + var __ret = Internal.getDependencies_0((__Instance + __PointerAdjustment), i); return Marshal.PtrToStringAnsi(__ret); } public void addDependencies(string s) { var arg0 = Marshal.StringToHGlobalAnsi(s); - Internal.addDependencies_0(__Instance, arg0); + Internal.addDependencies_0((__Instance + __PointerAdjustment), arg0); Marshal.FreeHGlobal(arg0); } public void clearDependencies() { - Internal.clearDependencies_0(__Instance); + Internal.clearDependencies_0((__Instance + __PointerAdjustment)); } public string FileName { get { - var __ret = Internal.getFileName_0(__Instance); + var __ret = Internal.getFileName_0((__Instance + __PointerAdjustment)); return Marshal.PtrToStringAnsi(__ret); } set { var arg0 = Marshal.StringToHGlobalAnsi(value); - Internal.setFileName_0(__Instance, arg0); + Internal.setFileName_0((__Instance + __PointerAdjustment), arg0); Marshal.FreeHGlobal(arg0); } } @@ -9367,7 +9449,7 @@ namespace CppSharp { get { - var __ret = Internal.getSymbolsCount_0(__Instance); + var __ret = Internal.getSymbolsCount_0((__Instance + __PointerAdjustment)); return __ret; } } @@ -9376,7 +9458,7 @@ namespace CppSharp { get { - var __ret = Internal.getDependenciesCount_0(__Instance); + var __ret = Internal.getDependenciesCount_0((__Instance + __PointerAdjustment)); return __ret; } } @@ -9437,6 +9519,8 @@ namespace CppSharp } public global::System.IntPtr __Instance { get; protected set; } + + protected int __PointerAdjustment; public static readonly System.Collections.Concurrent.ConcurrentDictionary NativeToManagedMap = new System.Collections.Concurrent.ConcurrentDictionary(); protected void*[] __OriginalVTables; @@ -9478,7 +9562,7 @@ namespace CppSharp __Instance = Marshal.AllocHGlobal(12); __ownsNativeInstance = true; NativeToManagedMap[__Instance] = this; - Internal.ctor_0(__Instance); + Internal.ctor_0((__Instance + __PointerAdjustment)); } public ASTContext(CppSharp.Parser.AST.ASTContext _0) @@ -9487,7 +9571,7 @@ namespace CppSharp __ownsNativeInstance = true; NativeToManagedMap[__Instance] = this; var arg0 = ReferenceEquals(_0, null) ? global::System.IntPtr.Zero : _0.__Instance; - Internal.cctor_2(__Instance, arg0); + Internal.cctor_2((__Instance + __PointerAdjustment), arg0); } public void Dispose() @@ -9501,13 +9585,14 @@ namespace CppSharp throw new global::System.InvalidOperationException("Managed instances owned by native code cannot be disposed of."); CppSharp.Parser.AST.ASTContext __dummy; NativeToManagedMap.TryRemove(__Instance, out __dummy); - Internal.dtor_0(__Instance, 0); - Marshal.FreeHGlobal(__Instance); + Internal.dtor_0((__Instance + __PointerAdjustment), 0); + if (__ownsNativeInstance) + Marshal.FreeHGlobal(__Instance); } public CppSharp.Parser.AST.TranslationUnit getTranslationUnits(uint i) { - var __ret = Internal.getTranslationUnits_0(__Instance, i); + var __ret = Internal.getTranslationUnits_0((__Instance + __PointerAdjustment), i); CppSharp.Parser.AST.TranslationUnit __result0; if (__ret == IntPtr.Zero) __result0 = null; else if (CppSharp.Parser.AST.TranslationUnit.NativeToManagedMap.ContainsKey(__ret)) @@ -9519,19 +9604,19 @@ namespace CppSharp public void addTranslationUnits(CppSharp.Parser.AST.TranslationUnit s) { var arg0 = ReferenceEquals(s, null) ? global::System.IntPtr.Zero : s.__Instance; - Internal.addTranslationUnits_0(__Instance, arg0); + Internal.addTranslationUnits_0((__Instance + __PointerAdjustment), arg0); } public void clearTranslationUnits() { - Internal.clearTranslationUnits_0(__Instance); + Internal.clearTranslationUnits_0((__Instance + __PointerAdjustment)); } public uint TranslationUnitsCount { get { - var __ret = Internal.getTranslationUnitsCount_0(__Instance); + var __ret = Internal.getTranslationUnitsCount_0((__Instance + __PointerAdjustment)); return __ret; } } @@ -9557,6 +9642,8 @@ namespace CppSharp } public global::System.IntPtr __Instance { get; protected set; } + + protected int __PointerAdjustment; public static readonly System.Collections.Concurrent.ConcurrentDictionary NativeToManagedMap = new System.Collections.Concurrent.ConcurrentDictionary(); protected void*[] __OriginalVTables; @@ -9599,7 +9686,7 @@ namespace CppSharp __ownsNativeInstance = true; NativeToManagedMap[__Instance] = this; var arg0 = kind; - Internal.ctor_0(__Instance, arg0); + Internal.ctor_0((__Instance + __PointerAdjustment), arg0); } public Comment(CppSharp.Parser.AST.Comment _0) @@ -9621,7 +9708,8 @@ namespace CppSharp throw new global::System.InvalidOperationException("Managed instances owned by native code cannot be disposed of."); CppSharp.Parser.AST.Comment __dummy; NativeToManagedMap.TryRemove(__Instance, out __dummy); - Marshal.FreeHGlobal(__Instance); + if (__ownsNativeInstance) + Marshal.FreeHGlobal(__Instance); } public CppSharp.Parser.AST.CommentKind Kind @@ -9689,6 +9777,7 @@ namespace CppSharp protected BlockContentComment(BlockContentComment.Internal* native, bool skipVTables = false) : base((CppSharp.Parser.AST.Comment.Internal*) null) { + __PointerAdjustment = 0; if (native == null) return; __Instance = new global::System.IntPtr(native); @@ -9700,7 +9789,7 @@ namespace CppSharp __Instance = Marshal.AllocHGlobal(4); __ownsNativeInstance = true; NativeToManagedMap[__Instance] = this; - Internal.ctor_0(__Instance); + Internal.ctor_0((__Instance + __PointerAdjustment)); } public BlockContentComment(CppSharp.Parser.AST.CommentKind Kind) @@ -9710,7 +9799,7 @@ namespace CppSharp __ownsNativeInstance = true; NativeToManagedMap[__Instance] = this; var arg0 = Kind; - Internal.ctor_1(__Instance, arg0); + Internal.ctor_1((__Instance + __PointerAdjustment), arg0); } public BlockContentComment(CppSharp.Parser.AST.BlockContentComment _0) @@ -9794,6 +9883,7 @@ namespace CppSharp protected FullComment(FullComment.Internal* native, bool skipVTables = false) : base((CppSharp.Parser.AST.Comment.Internal*) null) { + __PointerAdjustment = 0; if (native == null) return; __Instance = new global::System.IntPtr(native); @@ -9805,7 +9895,7 @@ namespace CppSharp __Instance = Marshal.AllocHGlobal(16); __ownsNativeInstance = true; NativeToManagedMap[__Instance] = this; - Internal.ctor_0(__Instance); + Internal.ctor_0((__Instance + __PointerAdjustment)); } public FullComment(CppSharp.Parser.AST.FullComment _0) @@ -9815,12 +9905,12 @@ namespace CppSharp __ownsNativeInstance = true; NativeToManagedMap[__Instance] = this; var arg0 = ReferenceEquals(_0, null) ? global::System.IntPtr.Zero : _0.__Instance; - Internal.cctor_2(__Instance, arg0); + Internal.cctor_2((__Instance + __PointerAdjustment), arg0); } public CppSharp.Parser.AST.BlockContentComment getBlocks(uint i) { - var __ret = Internal.getBlocks_0(__Instance, i); + var __ret = Internal.getBlocks_0((__Instance + __PointerAdjustment), i); CppSharp.Parser.AST.BlockContentComment __result0; if (__ret == IntPtr.Zero) __result0 = null; else if (CppSharp.Parser.AST.BlockContentComment.NativeToManagedMap.ContainsKey(__ret)) @@ -9832,19 +9922,19 @@ namespace CppSharp public void addBlocks(CppSharp.Parser.AST.BlockContentComment s) { var arg0 = ReferenceEquals(s, null) ? global::System.IntPtr.Zero : s.__Instance; - Internal.addBlocks_0(__Instance, arg0); + Internal.addBlocks_0((__Instance + __PointerAdjustment), arg0); } public void clearBlocks() { - Internal.clearBlocks_0(__Instance); + Internal.clearBlocks_0((__Instance + __PointerAdjustment)); } public uint BlocksCount { get { - var __ret = Internal.getBlocksCount_0(__Instance); + var __ret = Internal.getBlocksCount_0((__Instance + __PointerAdjustment)); return __ret; } } @@ -9934,6 +10024,8 @@ namespace CppSharp } public global::System.IntPtr __Instance { get; protected set; } + + protected int __PointerAdjustment; public static readonly System.Collections.Concurrent.ConcurrentDictionary NativeToManagedMap = new System.Collections.Concurrent.ConcurrentDictionary(); protected void*[] __OriginalVTables; @@ -9975,7 +10067,7 @@ namespace CppSharp __Instance = Marshal.AllocHGlobal(24); __ownsNativeInstance = true; NativeToManagedMap[__Instance] = this; - Internal.ctor_0(__Instance); + Internal.ctor_0((__Instance + __PointerAdjustment)); } public Argument(CppSharp.Parser.AST.BlockCommandComment.Argument _0) @@ -9984,7 +10076,7 @@ namespace CppSharp __ownsNativeInstance = true; NativeToManagedMap[__Instance] = this; var arg0 = ReferenceEquals(_0, null) ? global::System.IntPtr.Zero : _0.__Instance; - Internal.cctor_2(__Instance, arg0); + Internal.cctor_2((__Instance + __PointerAdjustment), arg0); } public void Dispose() @@ -9998,22 +10090,23 @@ namespace CppSharp throw new global::System.InvalidOperationException("Managed instances owned by native code cannot be disposed of."); CppSharp.Parser.AST.BlockCommandComment.Argument __dummy; NativeToManagedMap.TryRemove(__Instance, out __dummy); - Internal.dtor_0(__Instance, 0); - Marshal.FreeHGlobal(__Instance); + Internal.dtor_0((__Instance + __PointerAdjustment), 0); + if (__ownsNativeInstance) + Marshal.FreeHGlobal(__Instance); } public string Text { get { - var __ret = Internal.getText_0(__Instance); + var __ret = Internal.getText_0((__Instance + __PointerAdjustment)); return Marshal.PtrToStringAnsi(__ret); } set { var arg0 = Marshal.StringToHGlobalAnsi(value); - Internal.setText_0(__Instance, arg0); + Internal.setText_0((__Instance + __PointerAdjustment), arg0); Marshal.FreeHGlobal(arg0); } } @@ -10046,6 +10139,7 @@ namespace CppSharp protected BlockCommandComment(BlockCommandComment.Internal* native, bool skipVTables = false) : base((CppSharp.Parser.AST.BlockContentComment.Internal*) null) { + __PointerAdjustment = 0; if (native == null) return; __Instance = new global::System.IntPtr(native); @@ -10057,7 +10151,7 @@ namespace CppSharp __Instance = Marshal.AllocHGlobal(20); __ownsNativeInstance = true; NativeToManagedMap[__Instance] = this; - Internal.ctor_0(__Instance); + Internal.ctor_0((__Instance + __PointerAdjustment)); } public BlockCommandComment(CppSharp.Parser.AST.CommentKind Kind) @@ -10067,7 +10161,7 @@ namespace CppSharp __ownsNativeInstance = true; NativeToManagedMap[__Instance] = this; var arg0 = Kind; - Internal.ctor_1(__Instance, arg0); + Internal.ctor_1((__Instance + __PointerAdjustment), arg0); } public BlockCommandComment(CppSharp.Parser.AST.BlockCommandComment _0) @@ -10077,32 +10171,32 @@ namespace CppSharp __ownsNativeInstance = true; NativeToManagedMap[__Instance] = this; var arg0 = ReferenceEquals(_0, null) ? global::System.IntPtr.Zero : _0.__Instance; - Internal.cctor_3(__Instance, arg0); + Internal.cctor_3((__Instance + __PointerAdjustment), arg0); } public CppSharp.Parser.AST.BlockCommandComment.Argument getArguments(uint i) { var __ret = new CppSharp.Parser.AST.BlockCommandComment.Argument.Internal(); - Internal.getArguments_0(__Instance, new IntPtr(&__ret), i); + Internal.getArguments_0((__Instance + __PointerAdjustment), new IntPtr(&__ret), i); return CppSharp.Parser.AST.BlockCommandComment.Argument.__CreateInstance(__ret); } public void addArguments(CppSharp.Parser.AST.BlockCommandComment.Argument s) { var arg0 = ReferenceEquals(s, null) ? global::System.IntPtr.Zero : s.__Instance; - Internal.addArguments_0(__Instance, arg0); + Internal.addArguments_0((__Instance + __PointerAdjustment), arg0); } public void clearArguments() { - Internal.clearArguments_0(__Instance); + Internal.clearArguments_0((__Instance + __PointerAdjustment)); } public uint ArgumentsCount { get { - var __ret = Internal.getArgumentsCount_0(__Instance); + var __ret = Internal.getArgumentsCount_0((__Instance + __PointerAdjustment)); return __ret; } } @@ -10188,6 +10282,7 @@ namespace CppSharp protected ParamCommandComment(ParamCommandComment.Internal* native, bool skipVTables = false) : base((CppSharp.Parser.AST.BlockCommandComment.Internal*) null) { + __PointerAdjustment = 0; if (native == null) return; __Instance = new global::System.IntPtr(native); @@ -10199,7 +10294,7 @@ namespace CppSharp __Instance = Marshal.AllocHGlobal(28); __ownsNativeInstance = true; NativeToManagedMap[__Instance] = this; - Internal.ctor_0(__Instance); + Internal.ctor_0((__Instance + __PointerAdjustment)); } public ParamCommandComment(CppSharp.Parser.AST.ParamCommandComment _0) @@ -10209,7 +10304,7 @@ namespace CppSharp __ownsNativeInstance = true; NativeToManagedMap[__Instance] = this; var arg0 = ReferenceEquals(_0, null) ? global::System.IntPtr.Zero : _0.__Instance; - Internal.cctor_1(__Instance, arg0); + Internal.cctor_1((__Instance + __PointerAdjustment), arg0); } public CppSharp.Parser.AST.ParamCommandComment.PassDirection Direction @@ -10313,6 +10408,7 @@ namespace CppSharp protected TParamCommandComment(TParamCommandComment.Internal* native, bool skipVTables = false) : base((CppSharp.Parser.AST.BlockCommandComment.Internal*) null) { + __PointerAdjustment = 0; if (native == null) return; __Instance = new global::System.IntPtr(native); @@ -10324,7 +10420,7 @@ namespace CppSharp __Instance = Marshal.AllocHGlobal(32); __ownsNativeInstance = true; NativeToManagedMap[__Instance] = this; - Internal.ctor_0(__Instance); + Internal.ctor_0((__Instance + __PointerAdjustment)); } public TParamCommandComment(CppSharp.Parser.AST.TParamCommandComment _0) @@ -10334,12 +10430,12 @@ namespace CppSharp __ownsNativeInstance = true; NativeToManagedMap[__Instance] = this; var arg0 = ReferenceEquals(_0, null) ? global::System.IntPtr.Zero : _0.__Instance; - Internal.cctor_2(__Instance, arg0); + Internal.cctor_2((__Instance + __PointerAdjustment), arg0); } public uint getPosition(uint i) { - var __ret = Internal.getPosition_0(__Instance, i); + var __ret = Internal.getPosition_0((__Instance + __PointerAdjustment), i); return __ret; } @@ -10348,20 +10444,20 @@ namespace CppSharp fixed (uint* __refParamPtr0 = &s) { var arg0 = __refParamPtr0; - Internal.addPosition_0(__Instance, arg0); + Internal.addPosition_0((__Instance + __PointerAdjustment), arg0); } } public void clearPosition() { - Internal.clearPosition_0(__Instance); + Internal.clearPosition_0((__Instance + __PointerAdjustment)); } public uint PositionCount { get { - var __ret = Internal.getPositionCount_0(__Instance); + var __ret = Internal.getPositionCount_0((__Instance + __PointerAdjustment)); return __ret; } } @@ -10428,6 +10524,7 @@ namespace CppSharp protected VerbatimBlockLineComment(VerbatimBlockLineComment.Internal* native, bool skipVTables = false) : base((CppSharp.Parser.AST.Comment.Internal*) null) { + __PointerAdjustment = 0; if (native == null) return; __Instance = new global::System.IntPtr(native); @@ -10439,7 +10536,7 @@ namespace CppSharp __Instance = Marshal.AllocHGlobal(28); __ownsNativeInstance = true; NativeToManagedMap[__Instance] = this; - Internal.ctor_0(__Instance); + Internal.ctor_0((__Instance + __PointerAdjustment)); } public VerbatimBlockLineComment(CppSharp.Parser.AST.VerbatimBlockLineComment _0) @@ -10449,21 +10546,21 @@ namespace CppSharp __ownsNativeInstance = true; NativeToManagedMap[__Instance] = this; var arg0 = ReferenceEquals(_0, null) ? global::System.IntPtr.Zero : _0.__Instance; - Internal.cctor_2(__Instance, arg0); + Internal.cctor_2((__Instance + __PointerAdjustment), arg0); } public string Text { get { - var __ret = Internal.getText_0(__Instance); + var __ret = Internal.getText_0((__Instance + __PointerAdjustment)); return Marshal.PtrToStringAnsi(__ret); } set { var arg0 = Marshal.StringToHGlobalAnsi(value); - Internal.setText_0(__Instance, arg0); + Internal.setText_0((__Instance + __PointerAdjustment), arg0); Marshal.FreeHGlobal(arg0); } } @@ -10543,6 +10640,7 @@ namespace CppSharp protected VerbatimBlockComment(VerbatimBlockComment.Internal* native, bool skipVTables = false) : base((CppSharp.Parser.AST.BlockCommandComment.Internal*) null) { + __PointerAdjustment = 0; if (native == null) return; __Instance = new global::System.IntPtr(native); @@ -10554,7 +10652,7 @@ namespace CppSharp __Instance = Marshal.AllocHGlobal(32); __ownsNativeInstance = true; NativeToManagedMap[__Instance] = this; - Internal.ctor_0(__Instance); + Internal.ctor_0((__Instance + __PointerAdjustment)); } public VerbatimBlockComment(CppSharp.Parser.AST.VerbatimBlockComment _0) @@ -10564,12 +10662,12 @@ namespace CppSharp __ownsNativeInstance = true; NativeToManagedMap[__Instance] = this; var arg0 = ReferenceEquals(_0, null) ? global::System.IntPtr.Zero : _0.__Instance; - Internal.cctor_2(__Instance, arg0); + Internal.cctor_2((__Instance + __PointerAdjustment), arg0); } public CppSharp.Parser.AST.VerbatimBlockLineComment getLines(uint i) { - var __ret = Internal.getLines_0(__Instance, i); + var __ret = Internal.getLines_0((__Instance + __PointerAdjustment), i); CppSharp.Parser.AST.VerbatimBlockLineComment __result0; if (__ret == IntPtr.Zero) __result0 = null; else if (CppSharp.Parser.AST.VerbatimBlockLineComment.NativeToManagedMap.ContainsKey(__ret)) @@ -10581,19 +10679,19 @@ namespace CppSharp public void addLines(CppSharp.Parser.AST.VerbatimBlockLineComment s) { var arg0 = ReferenceEquals(s, null) ? global::System.IntPtr.Zero : s.__Instance; - Internal.addLines_0(__Instance, arg0); + Internal.addLines_0((__Instance + __PointerAdjustment), arg0); } public void clearLines() { - Internal.clearLines_0(__Instance); + Internal.clearLines_0((__Instance + __PointerAdjustment)); } public uint LinesCount { get { - var __ret = Internal.getLinesCount_0(__Instance); + var __ret = Internal.getLinesCount_0((__Instance + __PointerAdjustment)); return __ret; } } @@ -10663,6 +10761,7 @@ namespace CppSharp protected VerbatimLineComment(VerbatimLineComment.Internal* native, bool skipVTables = false) : base((CppSharp.Parser.AST.BlockCommandComment.Internal*) null) { + __PointerAdjustment = 0; if (native == null) return; __Instance = new global::System.IntPtr(native); @@ -10674,7 +10773,7 @@ namespace CppSharp __Instance = Marshal.AllocHGlobal(44); __ownsNativeInstance = true; NativeToManagedMap[__Instance] = this; - Internal.ctor_0(__Instance); + Internal.ctor_0((__Instance + __PointerAdjustment)); } public VerbatimLineComment(CppSharp.Parser.AST.VerbatimLineComment _0) @@ -10684,21 +10783,21 @@ namespace CppSharp __ownsNativeInstance = true; NativeToManagedMap[__Instance] = this; var arg0 = ReferenceEquals(_0, null) ? global::System.IntPtr.Zero : _0.__Instance; - Internal.cctor_2(__Instance, arg0); + Internal.cctor_2((__Instance + __PointerAdjustment), arg0); } public string Text { get { - var __ret = Internal.getText_0(__Instance); + var __ret = Internal.getText_0((__Instance + __PointerAdjustment)); return Marshal.PtrToStringAnsi(__ret); } set { var arg0 = Marshal.StringToHGlobalAnsi(value); - Internal.setText_0(__Instance, arg0); + Internal.setText_0((__Instance + __PointerAdjustment), arg0); Marshal.FreeHGlobal(arg0); } } @@ -10755,6 +10854,7 @@ namespace CppSharp protected InlineContentComment(InlineContentComment.Internal* native, bool skipVTables = false) : base((CppSharp.Parser.AST.Comment.Internal*) null) { + __PointerAdjustment = 0; if (native == null) return; __Instance = new global::System.IntPtr(native); @@ -10766,7 +10866,7 @@ namespace CppSharp __Instance = Marshal.AllocHGlobal(4); __ownsNativeInstance = true; NativeToManagedMap[__Instance] = this; - Internal.ctor_0(__Instance); + Internal.ctor_0((__Instance + __PointerAdjustment)); } public InlineContentComment(CppSharp.Parser.AST.CommentKind Kind) @@ -10776,7 +10876,7 @@ namespace CppSharp __ownsNativeInstance = true; NativeToManagedMap[__Instance] = this; var arg0 = Kind; - Internal.ctor_1(__Instance, arg0); + Internal.ctor_1((__Instance + __PointerAdjustment), arg0); } public InlineContentComment(CppSharp.Parser.AST.InlineContentComment _0) @@ -10863,6 +10963,7 @@ namespace CppSharp protected ParagraphComment(ParagraphComment.Internal* native, bool skipVTables = false) : base((CppSharp.Parser.AST.BlockContentComment.Internal*) null) { + __PointerAdjustment = 0; if (native == null) return; __Instance = new global::System.IntPtr(native); @@ -10874,7 +10975,7 @@ namespace CppSharp __Instance = Marshal.AllocHGlobal(20); __ownsNativeInstance = true; NativeToManagedMap[__Instance] = this; - Internal.ctor_0(__Instance); + Internal.ctor_0((__Instance + __PointerAdjustment)); } public ParagraphComment(CppSharp.Parser.AST.ParagraphComment _0) @@ -10884,12 +10985,12 @@ namespace CppSharp __ownsNativeInstance = true; NativeToManagedMap[__Instance] = this; var arg0 = ReferenceEquals(_0, null) ? global::System.IntPtr.Zero : _0.__Instance; - Internal.cctor_2(__Instance, arg0); + Internal.cctor_2((__Instance + __PointerAdjustment), arg0); } public CppSharp.Parser.AST.InlineContentComment getContent(uint i) { - var __ret = Internal.getContent_0(__Instance, i); + var __ret = Internal.getContent_0((__Instance + __PointerAdjustment), i); CppSharp.Parser.AST.InlineContentComment __result0; if (__ret == IntPtr.Zero) __result0 = null; else if (CppSharp.Parser.AST.InlineContentComment.NativeToManagedMap.ContainsKey(__ret)) @@ -10901,19 +11002,19 @@ namespace CppSharp public void addContent(CppSharp.Parser.AST.InlineContentComment s) { var arg0 = ReferenceEquals(s, null) ? global::System.IntPtr.Zero : s.__Instance; - Internal.addContent_0(__Instance, arg0); + Internal.addContent_0((__Instance + __PointerAdjustment), arg0); } public void clearContent() { - Internal.clearContent_0(__Instance); + Internal.clearContent_0((__Instance + __PointerAdjustment)); } public uint ContentCount { get { - var __ret = Internal.getContentCount_0(__Instance); + var __ret = Internal.getContentCount_0((__Instance + __PointerAdjustment)); return __ret; } } @@ -11019,6 +11120,8 @@ namespace CppSharp } public global::System.IntPtr __Instance { get; protected set; } + + protected int __PointerAdjustment; public static readonly System.Collections.Concurrent.ConcurrentDictionary NativeToManagedMap = new System.Collections.Concurrent.ConcurrentDictionary(); protected void*[] __OriginalVTables; @@ -11060,7 +11163,7 @@ namespace CppSharp __Instance = Marshal.AllocHGlobal(24); __ownsNativeInstance = true; NativeToManagedMap[__Instance] = this; - Internal.ctor_0(__Instance); + Internal.ctor_0((__Instance + __PointerAdjustment)); } public Argument(CppSharp.Parser.AST.InlineCommandComment.Argument _0) @@ -11069,7 +11172,7 @@ namespace CppSharp __ownsNativeInstance = true; NativeToManagedMap[__Instance] = this; var arg0 = ReferenceEquals(_0, null) ? global::System.IntPtr.Zero : _0.__Instance; - Internal.cctor_2(__Instance, arg0); + Internal.cctor_2((__Instance + __PointerAdjustment), arg0); } public void Dispose() @@ -11083,22 +11186,23 @@ namespace CppSharp throw new global::System.InvalidOperationException("Managed instances owned by native code cannot be disposed of."); CppSharp.Parser.AST.InlineCommandComment.Argument __dummy; NativeToManagedMap.TryRemove(__Instance, out __dummy); - Internal.dtor_0(__Instance, 0); - Marshal.FreeHGlobal(__Instance); + Internal.dtor_0((__Instance + __PointerAdjustment), 0); + if (__ownsNativeInstance) + Marshal.FreeHGlobal(__Instance); } public string Text { get { - var __ret = Internal.getText_0(__Instance); + var __ret = Internal.getText_0((__Instance + __PointerAdjustment)); return Marshal.PtrToStringAnsi(__ret); } set { var arg0 = Marshal.StringToHGlobalAnsi(value); - Internal.setText_0(__Instance, arg0); + Internal.setText_0((__Instance + __PointerAdjustment), arg0); Marshal.FreeHGlobal(arg0); } } @@ -11131,6 +11235,7 @@ namespace CppSharp protected InlineCommandComment(InlineCommandComment.Internal* native, bool skipVTables = false) : base((CppSharp.Parser.AST.InlineContentComment.Internal*) null) { + __PointerAdjustment = 0; if (native == null) return; __Instance = new global::System.IntPtr(native); @@ -11142,7 +11247,7 @@ namespace CppSharp __Instance = Marshal.AllocHGlobal(20); __ownsNativeInstance = true; NativeToManagedMap[__Instance] = this; - Internal.ctor_0(__Instance); + Internal.ctor_0((__Instance + __PointerAdjustment)); } public InlineCommandComment(CppSharp.Parser.AST.InlineCommandComment _0) @@ -11152,32 +11257,32 @@ namespace CppSharp __ownsNativeInstance = true; NativeToManagedMap[__Instance] = this; var arg0 = ReferenceEquals(_0, null) ? global::System.IntPtr.Zero : _0.__Instance; - Internal.cctor_2(__Instance, arg0); + Internal.cctor_2((__Instance + __PointerAdjustment), arg0); } public CppSharp.Parser.AST.InlineCommandComment.Argument getArguments(uint i) { var __ret = new CppSharp.Parser.AST.InlineCommandComment.Argument.Internal(); - Internal.getArguments_0(__Instance, new IntPtr(&__ret), i); + Internal.getArguments_0((__Instance + __PointerAdjustment), new IntPtr(&__ret), i); return CppSharp.Parser.AST.InlineCommandComment.Argument.__CreateInstance(__ret); } public void addArguments(CppSharp.Parser.AST.InlineCommandComment.Argument s) { var arg0 = ReferenceEquals(s, null) ? global::System.IntPtr.Zero : s.__Instance; - Internal.addArguments_0(__Instance, arg0); + Internal.addArguments_0((__Instance + __PointerAdjustment), arg0); } public void clearArguments() { - Internal.clearArguments_0(__Instance); + Internal.clearArguments_0((__Instance + __PointerAdjustment)); } public uint ArgumentsCount { get { - var __ret = Internal.getArgumentsCount_0(__Instance); + var __ret = Internal.getArgumentsCount_0((__Instance + __PointerAdjustment)); return __ret; } } @@ -11247,6 +11352,7 @@ namespace CppSharp protected HTMLTagComment(HTMLTagComment.Internal* native, bool skipVTables = false) : base((CppSharp.Parser.AST.InlineContentComment.Internal*) null) { + __PointerAdjustment = 0; if (native == null) return; __Instance = new global::System.IntPtr(native); @@ -11258,7 +11364,7 @@ namespace CppSharp __Instance = Marshal.AllocHGlobal(4); __ownsNativeInstance = true; NativeToManagedMap[__Instance] = this; - Internal.ctor_0(__Instance); + Internal.ctor_0((__Instance + __PointerAdjustment)); } public HTMLTagComment(CppSharp.Parser.AST.CommentKind Kind) @@ -11268,7 +11374,7 @@ namespace CppSharp __ownsNativeInstance = true; NativeToManagedMap[__Instance] = this; var arg0 = Kind; - Internal.ctor_1(__Instance, arg0); + Internal.ctor_1((__Instance + __PointerAdjustment), arg0); } public HTMLTagComment(CppSharp.Parser.AST.HTMLTagComment _0) @@ -11377,6 +11483,8 @@ namespace CppSharp } public global::System.IntPtr __Instance { get; protected set; } + + protected int __PointerAdjustment; public static readonly System.Collections.Concurrent.ConcurrentDictionary NativeToManagedMap = new System.Collections.Concurrent.ConcurrentDictionary(); protected void*[] __OriginalVTables; @@ -11418,7 +11526,7 @@ namespace CppSharp __Instance = Marshal.AllocHGlobal(48); __ownsNativeInstance = true; NativeToManagedMap[__Instance] = this; - Internal.ctor_0(__Instance); + Internal.ctor_0((__Instance + __PointerAdjustment)); } public Attribute(CppSharp.Parser.AST.HTMLStartTagComment.Attribute _0) @@ -11427,7 +11535,7 @@ namespace CppSharp __ownsNativeInstance = true; NativeToManagedMap[__Instance] = this; var arg0 = ReferenceEquals(_0, null) ? global::System.IntPtr.Zero : _0.__Instance; - Internal.cctor_2(__Instance, arg0); + Internal.cctor_2((__Instance + __PointerAdjustment), arg0); } public void Dispose() @@ -11441,22 +11549,23 @@ namespace CppSharp throw new global::System.InvalidOperationException("Managed instances owned by native code cannot be disposed of."); CppSharp.Parser.AST.HTMLStartTagComment.Attribute __dummy; NativeToManagedMap.TryRemove(__Instance, out __dummy); - Internal.dtor_0(__Instance, 0); - Marshal.FreeHGlobal(__Instance); + Internal.dtor_0((__Instance + __PointerAdjustment), 0); + if (__ownsNativeInstance) + Marshal.FreeHGlobal(__Instance); } public string Name { get { - var __ret = Internal.getName_0(__Instance); + var __ret = Internal.getName_0((__Instance + __PointerAdjustment)); return Marshal.PtrToStringAnsi(__ret); } set { var arg0 = Marshal.StringToHGlobalAnsi(value); - Internal.setName_0(__Instance, arg0); + Internal.setName_0((__Instance + __PointerAdjustment), arg0); Marshal.FreeHGlobal(arg0); } } @@ -11465,14 +11574,14 @@ namespace CppSharp { get { - var __ret = Internal.getValue_0(__Instance); + var __ret = Internal.getValue_0((__Instance + __PointerAdjustment)); return Marshal.PtrToStringAnsi(__ret); } set { var arg0 = Marshal.StringToHGlobalAnsi(value); - Internal.setValue_0(__Instance, arg0); + Internal.setValue_0((__Instance + __PointerAdjustment), arg0); Marshal.FreeHGlobal(arg0); } } @@ -11505,6 +11614,7 @@ namespace CppSharp protected HTMLStartTagComment(HTMLStartTagComment.Internal* native, bool skipVTables = false) : base((CppSharp.Parser.AST.HTMLTagComment.Internal*) null) { + __PointerAdjustment = 0; if (native == null) return; __Instance = new global::System.IntPtr(native); @@ -11516,7 +11626,7 @@ namespace CppSharp __Instance = Marshal.AllocHGlobal(40); __ownsNativeInstance = true; NativeToManagedMap[__Instance] = this; - Internal.ctor_0(__Instance); + Internal.ctor_0((__Instance + __PointerAdjustment)); } public HTMLStartTagComment(CppSharp.Parser.AST.HTMLStartTagComment _0) @@ -11526,39 +11636,39 @@ namespace CppSharp __ownsNativeInstance = true; NativeToManagedMap[__Instance] = this; var arg0 = ReferenceEquals(_0, null) ? global::System.IntPtr.Zero : _0.__Instance; - Internal.cctor_2(__Instance, arg0); + Internal.cctor_2((__Instance + __PointerAdjustment), arg0); } public CppSharp.Parser.AST.HTMLStartTagComment.Attribute getAttributes(uint i) { var __ret = new CppSharp.Parser.AST.HTMLStartTagComment.Attribute.Internal(); - Internal.getAttributes_0(__Instance, new IntPtr(&__ret), i); + Internal.getAttributes_0((__Instance + __PointerAdjustment), new IntPtr(&__ret), i); return CppSharp.Parser.AST.HTMLStartTagComment.Attribute.__CreateInstance(__ret); } public void addAttributes(CppSharp.Parser.AST.HTMLStartTagComment.Attribute s) { var arg0 = ReferenceEquals(s, null) ? global::System.IntPtr.Zero : s.__Instance; - Internal.addAttributes_0(__Instance, arg0); + Internal.addAttributes_0((__Instance + __PointerAdjustment), arg0); } public void clearAttributes() { - Internal.clearAttributes_0(__Instance); + Internal.clearAttributes_0((__Instance + __PointerAdjustment)); } public string TagName { get { - var __ret = Internal.getTagName_0(__Instance); + var __ret = Internal.getTagName_0((__Instance + __PointerAdjustment)); return Marshal.PtrToStringAnsi(__ret); } set { var arg0 = Marshal.StringToHGlobalAnsi(value); - Internal.setTagName_0(__Instance, arg0); + Internal.setTagName_0((__Instance + __PointerAdjustment), arg0); Marshal.FreeHGlobal(arg0); } } @@ -11567,7 +11677,7 @@ namespace CppSharp { get { - var __ret = Internal.getAttributesCount_0(__Instance); + var __ret = Internal.getAttributesCount_0((__Instance + __PointerAdjustment)); return __ret; } } @@ -11634,6 +11744,7 @@ namespace CppSharp protected HTMLEndTagComment(HTMLEndTagComment.Internal* native, bool skipVTables = false) : base((CppSharp.Parser.AST.HTMLTagComment.Internal*) null) { + __PointerAdjustment = 0; if (native == null) return; __Instance = new global::System.IntPtr(native); @@ -11645,7 +11756,7 @@ namespace CppSharp __Instance = Marshal.AllocHGlobal(28); __ownsNativeInstance = true; NativeToManagedMap[__Instance] = this; - Internal.ctor_0(__Instance); + Internal.ctor_0((__Instance + __PointerAdjustment)); } public HTMLEndTagComment(CppSharp.Parser.AST.HTMLEndTagComment _0) @@ -11655,21 +11766,21 @@ namespace CppSharp __ownsNativeInstance = true; NativeToManagedMap[__Instance] = this; var arg0 = ReferenceEquals(_0, null) ? global::System.IntPtr.Zero : _0.__Instance; - Internal.cctor_2(__Instance, arg0); + Internal.cctor_2((__Instance + __PointerAdjustment), arg0); } public string TagName { get { - var __ret = Internal.getTagName_0(__Instance); + var __ret = Internal.getTagName_0((__Instance + __PointerAdjustment)); return Marshal.PtrToStringAnsi(__ret); } set { var arg0 = Marshal.StringToHGlobalAnsi(value); - Internal.setTagName_0(__Instance, arg0); + Internal.setTagName_0((__Instance + __PointerAdjustment), arg0); Marshal.FreeHGlobal(arg0); } } @@ -11736,6 +11847,7 @@ namespace CppSharp protected TextComment(TextComment.Internal* native, bool skipVTables = false) : base((CppSharp.Parser.AST.InlineContentComment.Internal*) null) { + __PointerAdjustment = 0; if (native == null) return; __Instance = new global::System.IntPtr(native); @@ -11747,7 +11859,7 @@ namespace CppSharp __Instance = Marshal.AllocHGlobal(28); __ownsNativeInstance = true; NativeToManagedMap[__Instance] = this; - Internal.ctor_0(__Instance); + Internal.ctor_0((__Instance + __PointerAdjustment)); } public TextComment(CppSharp.Parser.AST.TextComment _0) @@ -11757,21 +11869,21 @@ namespace CppSharp __ownsNativeInstance = true; NativeToManagedMap[__Instance] = this; var arg0 = ReferenceEquals(_0, null) ? global::System.IntPtr.Zero : _0.__Instance; - Internal.cctor_2(__Instance, arg0); + Internal.cctor_2((__Instance + __PointerAdjustment), arg0); } public string Text { get { - var __ret = Internal.getText_0(__Instance); + var __ret = Internal.getText_0((__Instance + __PointerAdjustment)); return Marshal.PtrToStringAnsi(__ret); } set { var arg0 = Marshal.StringToHGlobalAnsi(value); - Internal.setText_0(__Instance, arg0); + Internal.setText_0((__Instance + __PointerAdjustment), arg0); Marshal.FreeHGlobal(arg0); } } @@ -11825,6 +11937,8 @@ namespace CppSharp } public global::System.IntPtr __Instance { get; protected set; } + + protected int __PointerAdjustment; public static readonly System.Collections.Concurrent.ConcurrentDictionary NativeToManagedMap = new System.Collections.Concurrent.ConcurrentDictionary(); protected void*[] __OriginalVTables; @@ -11866,7 +11980,7 @@ namespace CppSharp __Instance = Marshal.AllocHGlobal(56); __ownsNativeInstance = true; NativeToManagedMap[__Instance] = this; - Internal.ctor_0(__Instance); + Internal.ctor_0((__Instance + __PointerAdjustment)); } public RawComment(CppSharp.Parser.AST.RawComment _0) @@ -11875,7 +11989,7 @@ namespace CppSharp __ownsNativeInstance = true; NativeToManagedMap[__Instance] = this; var arg0 = ReferenceEquals(_0, null) ? global::System.IntPtr.Zero : _0.__Instance; - Internal.cctor_2(__Instance, arg0); + Internal.cctor_2((__Instance + __PointerAdjustment), arg0); } public void Dispose() @@ -11889,22 +12003,23 @@ namespace CppSharp throw new global::System.InvalidOperationException("Managed instances owned by native code cannot be disposed of."); CppSharp.Parser.AST.RawComment __dummy; NativeToManagedMap.TryRemove(__Instance, out __dummy); - Internal.dtor_0(__Instance, 0); - Marshal.FreeHGlobal(__Instance); + Internal.dtor_0((__Instance + __PointerAdjustment), 0); + if (__ownsNativeInstance) + Marshal.FreeHGlobal(__Instance); } public string Text { get { - var __ret = Internal.getText_0(__Instance); + var __ret = Internal.getText_0((__Instance + __PointerAdjustment)); return Marshal.PtrToStringAnsi(__ret); } set { var arg0 = Marshal.StringToHGlobalAnsi(value); - Internal.setText_0(__Instance, arg0); + Internal.setText_0((__Instance + __PointerAdjustment), arg0); Marshal.FreeHGlobal(arg0); } } @@ -11913,14 +12028,14 @@ namespace CppSharp { get { - var __ret = Internal.getBriefText_0(__Instance); + var __ret = Internal.getBriefText_0((__Instance + __PointerAdjustment)); return Marshal.PtrToStringAnsi(__ret); } set { var arg0 = Marshal.StringToHGlobalAnsi(value); - Internal.setBriefText_0(__Instance, arg0); + Internal.setBriefText_0((__Instance + __PointerAdjustment), arg0); Marshal.FreeHGlobal(arg0); } } diff --git a/src/CppParser/Bindings/CSharp/i686-pc-win32-msvc/CppParser.cs b/src/CppParser/Bindings/CSharp/i686-pc-win32-msvc/CppParser.cs index 4b80a2a7..76226562 100644 --- a/src/CppParser/Bindings/CSharp/i686-pc-win32-msvc/CppParser.cs +++ b/src/CppParser/Bindings/CSharp/i686-pc-win32-msvc/CppParser.cs @@ -234,6 +234,8 @@ namespace CppSharp } public global::System.IntPtr __Instance { get; protected set; } + + protected int __PointerAdjustment; public static readonly System.Collections.Concurrent.ConcurrentDictionary NativeToManagedMap = new System.Collections.Concurrent.ConcurrentDictionary(); protected void*[] __OriginalVTables; @@ -275,7 +277,7 @@ namespace CppSharp __Instance = Marshal.AllocHGlobal(144); __ownsNativeInstance = true; NativeToManagedMap[__Instance] = this; - Internal.ctor_0(__Instance); + Internal.ctor_0((__Instance + __PointerAdjustment)); } public ParserOptions(CppSharp.Parser.ParserOptions _0) @@ -284,7 +286,7 @@ namespace CppSharp __ownsNativeInstance = true; NativeToManagedMap[__Instance] = this; var arg0 = ReferenceEquals(_0, null) ? global::System.IntPtr.Zero : _0.__Instance; - Internal.cctor_2(__Instance, arg0); + Internal.cctor_2((__Instance + __PointerAdjustment), arg0); } public void Dispose() @@ -298,123 +300,124 @@ namespace CppSharp throw new global::System.InvalidOperationException("Managed instances owned by native code cannot be disposed of."); CppSharp.Parser.ParserOptions __dummy; NativeToManagedMap.TryRemove(__Instance, out __dummy); - Internal.dtor_0(__Instance, 0); - Marshal.FreeHGlobal(__Instance); + Internal.dtor_0((__Instance + __PointerAdjustment), 0); + if (__ownsNativeInstance) + Marshal.FreeHGlobal(__Instance); } public string getArguments(uint i) { - var __ret = Internal.getArguments_0(__Instance, i); + var __ret = Internal.getArguments_0((__Instance + __PointerAdjustment), i); return Marshal.PtrToStringAnsi(__ret); } public void addArguments(string s) { var arg0 = Marshal.StringToHGlobalAnsi(s); - Internal.addArguments_0(__Instance, arg0); + Internal.addArguments_0((__Instance + __PointerAdjustment), arg0); Marshal.FreeHGlobal(arg0); } public void clearArguments() { - Internal.clearArguments_0(__Instance); + Internal.clearArguments_0((__Instance + __PointerAdjustment)); } public string getIncludeDirs(uint i) { - var __ret = Internal.getIncludeDirs_0(__Instance, i); + var __ret = Internal.getIncludeDirs_0((__Instance + __PointerAdjustment), i); return Marshal.PtrToStringAnsi(__ret); } public void addIncludeDirs(string s) { var arg0 = Marshal.StringToHGlobalAnsi(s); - Internal.addIncludeDirs_0(__Instance, arg0); + Internal.addIncludeDirs_0((__Instance + __PointerAdjustment), arg0); Marshal.FreeHGlobal(arg0); } public void clearIncludeDirs() { - Internal.clearIncludeDirs_0(__Instance); + Internal.clearIncludeDirs_0((__Instance + __PointerAdjustment)); } public string getSystemIncludeDirs(uint i) { - var __ret = Internal.getSystemIncludeDirs_0(__Instance, i); + var __ret = Internal.getSystemIncludeDirs_0((__Instance + __PointerAdjustment), i); return Marshal.PtrToStringAnsi(__ret); } public void addSystemIncludeDirs(string s) { var arg0 = Marshal.StringToHGlobalAnsi(s); - Internal.addSystemIncludeDirs_0(__Instance, arg0); + Internal.addSystemIncludeDirs_0((__Instance + __PointerAdjustment), arg0); Marshal.FreeHGlobal(arg0); } public void clearSystemIncludeDirs() { - Internal.clearSystemIncludeDirs_0(__Instance); + Internal.clearSystemIncludeDirs_0((__Instance + __PointerAdjustment)); } public string getDefines(uint i) { - var __ret = Internal.getDefines_0(__Instance, i); + var __ret = Internal.getDefines_0((__Instance + __PointerAdjustment), i); return Marshal.PtrToStringAnsi(__ret); } public void addDefines(string s) { var arg0 = Marshal.StringToHGlobalAnsi(s); - Internal.addDefines_0(__Instance, arg0); + Internal.addDefines_0((__Instance + __PointerAdjustment), arg0); Marshal.FreeHGlobal(arg0); } public void clearDefines() { - Internal.clearDefines_0(__Instance); + Internal.clearDefines_0((__Instance + __PointerAdjustment)); } public string getUndefines(uint i) { - var __ret = Internal.getUndefines_0(__Instance, i); + var __ret = Internal.getUndefines_0((__Instance + __PointerAdjustment), i); return Marshal.PtrToStringAnsi(__ret); } public void addUndefines(string s) { var arg0 = Marshal.StringToHGlobalAnsi(s); - Internal.addUndefines_0(__Instance, arg0); + Internal.addUndefines_0((__Instance + __PointerAdjustment), arg0); Marshal.FreeHGlobal(arg0); } public void clearUndefines() { - Internal.clearUndefines_0(__Instance); + Internal.clearUndefines_0((__Instance + __PointerAdjustment)); } public string getLibraryDirs(uint i) { - var __ret = Internal.getLibraryDirs_0(__Instance, i); + var __ret = Internal.getLibraryDirs_0((__Instance + __PointerAdjustment), i); return Marshal.PtrToStringAnsi(__ret); } public void addLibraryDirs(string s) { var arg0 = Marshal.StringToHGlobalAnsi(s); - Internal.addLibraryDirs_0(__Instance, arg0); + Internal.addLibraryDirs_0((__Instance + __PointerAdjustment), arg0); Marshal.FreeHGlobal(arg0); } public void clearLibraryDirs() { - Internal.clearLibraryDirs_0(__Instance); + Internal.clearLibraryDirs_0((__Instance + __PointerAdjustment)); } public uint ArgumentsCount { get { - var __ret = Internal.getArgumentsCount_0(__Instance); + var __ret = Internal.getArgumentsCount_0((__Instance + __PointerAdjustment)); return __ret; } } @@ -423,14 +426,14 @@ namespace CppSharp { get { - var __ret = Internal.getFileName_0(__Instance); + var __ret = Internal.getFileName_0((__Instance + __PointerAdjustment)); return Marshal.PtrToStringAnsi(__ret); } set { var arg0 = Marshal.StringToHGlobalAnsi(value); - Internal.setFileName_0(__Instance, arg0); + Internal.setFileName_0((__Instance + __PointerAdjustment), arg0); Marshal.FreeHGlobal(arg0); } } @@ -439,7 +442,7 @@ namespace CppSharp { get { - var __ret = Internal.getIncludeDirsCount_0(__Instance); + var __ret = Internal.getIncludeDirsCount_0((__Instance + __PointerAdjustment)); return __ret; } } @@ -448,7 +451,7 @@ namespace CppSharp { get { - var __ret = Internal.getSystemIncludeDirsCount_0(__Instance); + var __ret = Internal.getSystemIncludeDirsCount_0((__Instance + __PointerAdjustment)); return __ret; } } @@ -457,7 +460,7 @@ namespace CppSharp { get { - var __ret = Internal.getDefinesCount_0(__Instance); + var __ret = Internal.getDefinesCount_0((__Instance + __PointerAdjustment)); return __ret; } } @@ -466,7 +469,7 @@ namespace CppSharp { get { - var __ret = Internal.getUndefinesCount_0(__Instance); + var __ret = Internal.getUndefinesCount_0((__Instance + __PointerAdjustment)); return __ret; } } @@ -475,7 +478,7 @@ namespace CppSharp { get { - var __ret = Internal.getLibraryDirsCount_0(__Instance); + var __ret = Internal.getLibraryDirsCount_0((__Instance + __PointerAdjustment)); return __ret; } } @@ -484,14 +487,14 @@ namespace CppSharp { get { - var __ret = Internal.getTargetTriple_0(__Instance); + var __ret = Internal.getTargetTriple_0((__Instance + __PointerAdjustment)); return Marshal.PtrToStringAnsi(__ret); } set { var arg0 = Marshal.StringToHGlobalAnsi(value); - Internal.setTargetTriple_0(__Instance, arg0); + Internal.setTargetTriple_0((__Instance + __PointerAdjustment), arg0); Marshal.FreeHGlobal(arg0); } } @@ -675,6 +678,8 @@ namespace CppSharp } public global::System.IntPtr __Instance { get; protected set; } + + protected int __PointerAdjustment; public static readonly System.Collections.Concurrent.ConcurrentDictionary NativeToManagedMap = new System.Collections.Concurrent.ConcurrentDictionary(); protected void*[] __OriginalVTables; @@ -716,7 +721,7 @@ namespace CppSharp __Instance = Marshal.AllocHGlobal(60); __ownsNativeInstance = true; NativeToManagedMap[__Instance] = this; - Internal.ctor_0(__Instance); + Internal.ctor_0((__Instance + __PointerAdjustment)); } public ParserDiagnostic(CppSharp.Parser.ParserDiagnostic _0) @@ -725,7 +730,7 @@ namespace CppSharp __ownsNativeInstance = true; NativeToManagedMap[__Instance] = this; var arg0 = ReferenceEquals(_0, null) ? global::System.IntPtr.Zero : _0.__Instance; - Internal.cctor_1(__Instance, arg0); + Internal.cctor_1((__Instance + __PointerAdjustment), arg0); } public void Dispose() @@ -739,22 +744,23 @@ namespace CppSharp throw new global::System.InvalidOperationException("Managed instances owned by native code cannot be disposed of."); CppSharp.Parser.ParserDiagnostic __dummy; NativeToManagedMap.TryRemove(__Instance, out __dummy); - Internal.dtor_0(__Instance, 0); - Marshal.FreeHGlobal(__Instance); + Internal.dtor_0((__Instance + __PointerAdjustment), 0); + if (__ownsNativeInstance) + Marshal.FreeHGlobal(__Instance); } public string FileName { get { - var __ret = Internal.getFileName_0(__Instance); + var __ret = Internal.getFileName_0((__Instance + __PointerAdjustment)); return Marshal.PtrToStringAnsi(__ret); } set { var arg0 = Marshal.StringToHGlobalAnsi(value); - Internal.setFileName_0(__Instance, arg0); + Internal.setFileName_0((__Instance + __PointerAdjustment), arg0); Marshal.FreeHGlobal(arg0); } } @@ -763,14 +769,14 @@ namespace CppSharp { get { - var __ret = Internal.getMessage_0(__Instance); + var __ret = Internal.getMessage_0((__Instance + __PointerAdjustment)); return Marshal.PtrToStringAnsi(__ret); } set { var arg0 = Marshal.StringToHGlobalAnsi(value); - Internal.setMessage_0(__Instance, arg0); + Internal.setMessage_0((__Instance + __PointerAdjustment), arg0); Marshal.FreeHGlobal(arg0); } } @@ -869,6 +875,8 @@ namespace CppSharp } public global::System.IntPtr __Instance { get; protected set; } + + protected int __PointerAdjustment; public static readonly System.Collections.Concurrent.ConcurrentDictionary NativeToManagedMap = new System.Collections.Concurrent.ConcurrentDictionary(); protected void*[] __OriginalVTables; @@ -910,7 +918,7 @@ namespace CppSharp __Instance = Marshal.AllocHGlobal(28); __ownsNativeInstance = true; NativeToManagedMap[__Instance] = this; - Internal.ctor_0(__Instance); + Internal.ctor_0((__Instance + __PointerAdjustment)); } public ParserResult(CppSharp.Parser.ParserResult _0) @@ -919,7 +927,7 @@ namespace CppSharp __ownsNativeInstance = true; NativeToManagedMap[__Instance] = this; var arg0 = ReferenceEquals(_0, null) ? global::System.IntPtr.Zero : _0.__Instance; - Internal.cctor_1(__Instance, arg0); + Internal.cctor_1((__Instance + __PointerAdjustment), arg0); } public void Dispose() @@ -933,33 +941,34 @@ namespace CppSharp throw new global::System.InvalidOperationException("Managed instances owned by native code cannot be disposed of."); CppSharp.Parser.ParserResult __dummy; NativeToManagedMap.TryRemove(__Instance, out __dummy); - Internal.dtor_0(__Instance, 0); - Marshal.FreeHGlobal(__Instance); + Internal.dtor_0((__Instance + __PointerAdjustment), 0); + if (__ownsNativeInstance) + Marshal.FreeHGlobal(__Instance); } public CppSharp.Parser.ParserDiagnostic getDiagnostics(uint i) { var __ret = new CppSharp.Parser.ParserDiagnostic.Internal(); - Internal.getDiagnostics_0(__Instance, new IntPtr(&__ret), i); + Internal.getDiagnostics_0((__Instance + __PointerAdjustment), new IntPtr(&__ret), i); return CppSharp.Parser.ParserDiagnostic.__CreateInstance(__ret); } public void addDiagnostics(CppSharp.Parser.ParserDiagnostic s) { var arg0 = ReferenceEquals(s, null) ? global::System.IntPtr.Zero : s.__Instance; - Internal.addDiagnostics_0(__Instance, arg0); + Internal.addDiagnostics_0((__Instance + __PointerAdjustment), arg0); } public void clearDiagnostics() { - Internal.clearDiagnostics_0(__Instance); + Internal.clearDiagnostics_0((__Instance + __PointerAdjustment)); } public uint DiagnosticsCount { get { - var __ret = Internal.getDiagnosticsCount_0(__Instance); + var __ret = Internal.getDiagnosticsCount_0((__Instance + __PointerAdjustment)); return __ret; } } @@ -1041,6 +1050,8 @@ namespace CppSharp } public global::System.IntPtr __Instance { get; protected set; } + + protected int __PointerAdjustment; public static readonly System.Collections.Concurrent.ConcurrentDictionary NativeToManagedMap = new System.Collections.Concurrent.ConcurrentDictionary(); protected void*[] __OriginalVTables; @@ -1103,7 +1114,8 @@ namespace CppSharp throw new global::System.InvalidOperationException("Managed instances owned by native code cannot be disposed of."); CppSharp.Parser.ClangParser __dummy; NativeToManagedMap.TryRemove(__Instance, out __dummy); - Marshal.FreeHGlobal(__Instance); + if (__ownsNativeInstance) + Marshal.FreeHGlobal(__Instance); } public static CppSharp.Parser.ParserResult ParseHeader(CppSharp.Parser.ParserOptions Opts) diff --git a/src/CppParser/Bindings/CSharp/i686-pc-win32-msvc/Target.cs b/src/CppParser/Bindings/CSharp/i686-pc-win32-msvc/Target.cs index d6ef9a1d..707a7abb 100644 --- a/src/CppParser/Bindings/CSharp/i686-pc-win32-msvc/Target.cs +++ b/src/CppParser/Bindings/CSharp/i686-pc-win32-msvc/Target.cs @@ -171,6 +171,8 @@ namespace CppSharp } public global::System.IntPtr __Instance { get; protected set; } + + protected int __PointerAdjustment; public static readonly System.Collections.Concurrent.ConcurrentDictionary NativeToManagedMap = new System.Collections.Concurrent.ConcurrentDictionary(); protected void*[] __OriginalVTables; @@ -212,7 +214,7 @@ namespace CppSharp __Instance = Marshal.AllocHGlobal(176); __ownsNativeInstance = true; NativeToManagedMap[__Instance] = this; - Internal.ctor_0(__Instance); + Internal.ctor_0((__Instance + __PointerAdjustment)); } public ParserTargetInfo(CppSharp.Parser.ParserTargetInfo _0) @@ -221,7 +223,7 @@ namespace CppSharp __ownsNativeInstance = true; NativeToManagedMap[__Instance] = this; var arg0 = ReferenceEquals(_0, null) ? global::System.IntPtr.Zero : _0.__Instance; - Internal.cctor_2(__Instance, arg0); + Internal.cctor_2((__Instance + __PointerAdjustment), arg0); } public void Dispose() @@ -235,22 +237,23 @@ namespace CppSharp throw new global::System.InvalidOperationException("Managed instances owned by native code cannot be disposed of."); CppSharp.Parser.ParserTargetInfo __dummy; NativeToManagedMap.TryRemove(__Instance, out __dummy); - Internal.dtor_0(__Instance, 0); - Marshal.FreeHGlobal(__Instance); + Internal.dtor_0((__Instance + __PointerAdjustment), 0); + if (__ownsNativeInstance) + Marshal.FreeHGlobal(__Instance); } public string ABI { get { - var __ret = Internal.getABI_0(__Instance); + var __ret = Internal.getABI_0((__Instance + __PointerAdjustment)); return Marshal.PtrToStringAnsi(__ret); } set { var arg0 = Marshal.StringToHGlobalAnsi(value); - Internal.setABI_0(__Instance, arg0); + Internal.setABI_0((__Instance + __PointerAdjustment), arg0); Marshal.FreeHGlobal(arg0); } } diff --git a/src/CppParser/Bindings/CSharp/x86_64-apple-darwin12.4.0/AST.cs b/src/CppParser/Bindings/CSharp/x86_64-apple-darwin12.4.0/AST.cs index 8c8588a5..148dffbd 100644 --- a/src/CppParser/Bindings/CSharp/x86_64-apple-darwin12.4.0/AST.cs +++ b/src/CppParser/Bindings/CSharp/x86_64-apple-darwin12.4.0/AST.cs @@ -265,19 +265,21 @@ namespace CppSharp } public global::System.IntPtr __Instance { get; protected set; } + + protected int __PointerAdjustment; public static readonly System.Collections.Concurrent.ConcurrentDictionary NativeToManagedMap = new System.Collections.Concurrent.ConcurrentDictionary(); protected void*[] __OriginalVTables; protected bool __ownsNativeInstance; - public static Type __CreateInstance(global::System.IntPtr native, bool ownsNativeInstance = false) + public static Type __CreateInstance(global::System.IntPtr native, bool ownsNativeInstance = false, bool skipVTables = false) { - return new Type((Type.Internal*) native) { __ownsNativeInstance = ownsNativeInstance }; + return new Type((Type.Internal*) native, skipVTables) { __ownsNativeInstance = ownsNativeInstance }; } - public static Type __CreateInstance(Type.Internal native) + public static Type __CreateInstance(Type.Internal native, bool skipVTables = false) { - return new Type(native); + return new Type(native, skipVTables); } private static Type.Internal* __CopyValue(Type.Internal native) @@ -287,15 +289,17 @@ namespace CppSharp return (Type.Internal*) ret; } - private Type(Type.Internal native) - : this(__CopyValue(native)) + private Type(Type.Internal native, bool skipVTables = false) + : this(__CopyValue(native), skipVTables) { __ownsNativeInstance = true; NativeToManagedMap[__Instance] = this; } - protected Type(Type.Internal* native, bool isInternalImpl = false) + protected Type(Type.Internal* native, bool skipVTables = false) { + if (native == null) + return; __Instance = new global::System.IntPtr(native); } @@ -303,18 +307,18 @@ namespace CppSharp { __Instance = Marshal.AllocHGlobal(8); __ownsNativeInstance = true; - var arg0 = kind; - Internal.ctor_0(__Instance, arg0); NativeToManagedMap[__Instance] = this; + var arg0 = kind; + Internal.ctor_0((__Instance + __PointerAdjustment), arg0); } public Type(CppSharp.Parser.AST.Type _0) { __Instance = Marshal.AllocHGlobal(8); __ownsNativeInstance = true; - var arg0 = ReferenceEquals(_0, null) ? global::System.IntPtr.Zero : _0.__Instance; - Internal.cctor_1(__Instance, arg0); NativeToManagedMap[__Instance] = this; + var arg0 = ReferenceEquals(_0, null) ? global::System.IntPtr.Zero : _0.__Instance; + Internal.cctor_1((__Instance + __PointerAdjustment), arg0); } public void Dispose() @@ -328,7 +332,8 @@ namespace CppSharp throw new global::System.InvalidOperationException("Managed instances owned by native code cannot be disposed of."); CppSharp.Parser.AST.Type __dummy; NativeToManagedMap.TryRemove(__Instance, out __dummy); - Marshal.FreeHGlobal(__Instance); + if (__ownsNativeInstance) + Marshal.FreeHGlobal(__Instance); } public CppSharp.Parser.AST.TypeKind Kind @@ -379,19 +384,21 @@ namespace CppSharp } public global::System.IntPtr __Instance { get; protected set; } + + protected int __PointerAdjustment; public static readonly System.Collections.Concurrent.ConcurrentDictionary NativeToManagedMap = new System.Collections.Concurrent.ConcurrentDictionary(); protected void*[] __OriginalVTables; protected bool __ownsNativeInstance; - public static TypeQualifiers __CreateInstance(global::System.IntPtr native, bool ownsNativeInstance = false) + public static TypeQualifiers __CreateInstance(global::System.IntPtr native, bool ownsNativeInstance = false, bool skipVTables = false) { - return new TypeQualifiers((TypeQualifiers.Internal*) native) { __ownsNativeInstance = ownsNativeInstance }; + return new TypeQualifiers((TypeQualifiers.Internal*) native, skipVTables) { __ownsNativeInstance = ownsNativeInstance }; } - public static TypeQualifiers __CreateInstance(TypeQualifiers.Internal native) + public static TypeQualifiers __CreateInstance(TypeQualifiers.Internal native, bool skipVTables = false) { - return new TypeQualifiers(native); + return new TypeQualifiers(native, skipVTables); } private static TypeQualifiers.Internal* __CopyValue(TypeQualifiers.Internal native) @@ -401,15 +408,17 @@ namespace CppSharp return ret; } - private TypeQualifiers(TypeQualifiers.Internal native) - : this(__CopyValue(native)) + private TypeQualifiers(TypeQualifiers.Internal native, bool skipVTables = false) + : this(__CopyValue(native), skipVTables) { __ownsNativeInstance = true; NativeToManagedMap[__Instance] = this; } - protected TypeQualifiers(TypeQualifiers.Internal* native, bool isInternalImpl = false) + protected TypeQualifiers(TypeQualifiers.Internal* native, bool skipVTables = false) { + if (native == null) + return; __Instance = new global::System.IntPtr(native); } @@ -417,8 +426,8 @@ namespace CppSharp { __Instance = Marshal.AllocHGlobal(3); __ownsNativeInstance = true; - *((TypeQualifiers.Internal*) __Instance) = *((TypeQualifiers.Internal*) _0.__Instance); NativeToManagedMap[__Instance] = this; + *((TypeQualifiers.Internal*) __Instance) = *((TypeQualifiers.Internal*) _0.__Instance); } public TypeQualifiers() @@ -439,7 +448,8 @@ namespace CppSharp throw new global::System.InvalidOperationException("Managed instances owned by native code cannot be disposed of."); CppSharp.Parser.AST.TypeQualifiers __dummy; NativeToManagedMap.TryRemove(__Instance, out __dummy); - Marshal.FreeHGlobal(__Instance); + if (__ownsNativeInstance) + Marshal.FreeHGlobal(__Instance); } public bool IsConst @@ -505,19 +515,21 @@ namespace CppSharp } public global::System.IntPtr __Instance { get; protected set; } + + protected int __PointerAdjustment; public static readonly System.Collections.Concurrent.ConcurrentDictionary NativeToManagedMap = new System.Collections.Concurrent.ConcurrentDictionary(); protected void*[] __OriginalVTables; protected bool __ownsNativeInstance; - public static QualifiedType __CreateInstance(global::System.IntPtr native, bool ownsNativeInstance = false) + public static QualifiedType __CreateInstance(global::System.IntPtr native, bool ownsNativeInstance = false, bool skipVTables = false) { - return new QualifiedType((QualifiedType.Internal*) native) { __ownsNativeInstance = ownsNativeInstance }; + return new QualifiedType((QualifiedType.Internal*) native, skipVTables) { __ownsNativeInstance = ownsNativeInstance }; } - public static QualifiedType __CreateInstance(QualifiedType.Internal native) + public static QualifiedType __CreateInstance(QualifiedType.Internal native, bool skipVTables = false) { - return new QualifiedType(native); + return new QualifiedType(native, skipVTables); } private static QualifiedType.Internal* __CopyValue(QualifiedType.Internal native) @@ -527,15 +539,17 @@ namespace CppSharp return ret; } - private QualifiedType(QualifiedType.Internal native) - : this(__CopyValue(native)) + private QualifiedType(QualifiedType.Internal native, bool skipVTables = false) + : this(__CopyValue(native), skipVTables) { __ownsNativeInstance = true; NativeToManagedMap[__Instance] = this; } - protected QualifiedType(QualifiedType.Internal* native, bool isInternalImpl = false) + protected QualifiedType(QualifiedType.Internal* native, bool skipVTables = false) { + if (native == null) + return; __Instance = new global::System.IntPtr(native); } @@ -543,16 +557,16 @@ namespace CppSharp { __Instance = Marshal.AllocHGlobal(16); __ownsNativeInstance = true; - Internal.ctor_0(__Instance); NativeToManagedMap[__Instance] = this; + Internal.ctor_0((__Instance + __PointerAdjustment)); } public QualifiedType(CppSharp.Parser.AST.QualifiedType _0) { __Instance = Marshal.AllocHGlobal(16); __ownsNativeInstance = true; - *((QualifiedType.Internal*) __Instance) = *((QualifiedType.Internal*) _0.__Instance); NativeToManagedMap[__Instance] = this; + *((QualifiedType.Internal*) __Instance) = *((QualifiedType.Internal*) _0.__Instance); } public void Dispose() @@ -566,7 +580,8 @@ namespace CppSharp throw new global::System.InvalidOperationException("Managed instances owned by native code cannot be disposed of."); CppSharp.Parser.AST.QualifiedType __dummy; NativeToManagedMap.TryRemove(__Instance, out __dummy); - Marshal.FreeHGlobal(__Instance); + if (__ownsNativeInstance) + Marshal.FreeHGlobal(__Instance); } public CppSharp.Parser.AST.Type Type @@ -626,14 +641,14 @@ namespace CppSharp internal static extern void cctor_2(global::System.IntPtr instance, global::System.IntPtr _0); } - public static new TagType __CreateInstance(global::System.IntPtr native, bool ownsNativeInstance = false) + public static new TagType __CreateInstance(global::System.IntPtr native, bool ownsNativeInstance = false, bool skipVTables = false) { - return new TagType((TagType.Internal*) native) { __ownsNativeInstance = ownsNativeInstance }; + return new TagType((TagType.Internal*) native, skipVTables) { __ownsNativeInstance = ownsNativeInstance }; } - public static TagType __CreateInstance(TagType.Internal native) + public static TagType __CreateInstance(TagType.Internal native, bool skipVTables = false) { - return new TagType(native); + return new TagType(native, skipVTables); } private static TagType.Internal* __CopyValue(TagType.Internal native) @@ -643,16 +658,20 @@ namespace CppSharp return (TagType.Internal*) ret; } - private TagType(TagType.Internal native) - : this(__CopyValue(native)) + private TagType(TagType.Internal native, bool skipVTables = false) + : this(__CopyValue(native), skipVTables) { __ownsNativeInstance = true; NativeToManagedMap[__Instance] = this; } - protected TagType(TagType.Internal* native, bool isInternalImpl = false) - : base((CppSharp.Parser.AST.Type.Internal*) native) + protected TagType(TagType.Internal* native, bool skipVTables = false) + : base((CppSharp.Parser.AST.Type.Internal*) null) { + __PointerAdjustment = 0; + if (native == null) + return; + __Instance = new global::System.IntPtr(native); } public TagType() @@ -660,8 +679,8 @@ namespace CppSharp { __Instance = Marshal.AllocHGlobal(16); __ownsNativeInstance = true; - Internal.ctor_0(__Instance); NativeToManagedMap[__Instance] = this; + Internal.ctor_0((__Instance + __PointerAdjustment)); } public TagType(CppSharp.Parser.AST.TagType _0) @@ -669,9 +688,9 @@ namespace CppSharp { __Instance = Marshal.AllocHGlobal(16); __ownsNativeInstance = true; - var arg0 = ReferenceEquals(_0, null) ? global::System.IntPtr.Zero : _0.__Instance; - Internal.cctor_2(__Instance, arg0); NativeToManagedMap[__Instance] = this; + var arg0 = ReferenceEquals(_0, null) ? global::System.IntPtr.Zero : _0.__Instance; + Internal.cctor_2((__Instance + __PointerAdjustment), arg0); } public CppSharp.Parser.AST.Declaration Declaration @@ -735,14 +754,14 @@ namespace CppSharp Incomplete = 3 } - public static new ArrayType __CreateInstance(global::System.IntPtr native, bool ownsNativeInstance = false) + public static new ArrayType __CreateInstance(global::System.IntPtr native, bool ownsNativeInstance = false, bool skipVTables = false) { - return new ArrayType((ArrayType.Internal*) native) { __ownsNativeInstance = ownsNativeInstance }; + return new ArrayType((ArrayType.Internal*) native, skipVTables) { __ownsNativeInstance = ownsNativeInstance }; } - public static ArrayType __CreateInstance(ArrayType.Internal native) + public static ArrayType __CreateInstance(ArrayType.Internal native, bool skipVTables = false) { - return new ArrayType(native); + return new ArrayType(native, skipVTables); } private static ArrayType.Internal* __CopyValue(ArrayType.Internal native) @@ -752,16 +771,20 @@ namespace CppSharp return (ArrayType.Internal*) ret; } - private ArrayType(ArrayType.Internal native) - : this(__CopyValue(native)) + private ArrayType(ArrayType.Internal native, bool skipVTables = false) + : this(__CopyValue(native), skipVTables) { __ownsNativeInstance = true; NativeToManagedMap[__Instance] = this; } - protected ArrayType(ArrayType.Internal* native, bool isInternalImpl = false) - : base((CppSharp.Parser.AST.Type.Internal*) native) + protected ArrayType(ArrayType.Internal* native, bool skipVTables = false) + : base((CppSharp.Parser.AST.Type.Internal*) null) { + __PointerAdjustment = 0; + if (native == null) + return; + __Instance = new global::System.IntPtr(native); } public ArrayType() @@ -769,8 +792,8 @@ namespace CppSharp { __Instance = Marshal.AllocHGlobal(48); __ownsNativeInstance = true; - Internal.ctor_0(__Instance); NativeToManagedMap[__Instance] = this; + Internal.ctor_0((__Instance + __PointerAdjustment)); } public ArrayType(CppSharp.Parser.AST.ArrayType _0) @@ -778,9 +801,9 @@ namespace CppSharp { __Instance = Marshal.AllocHGlobal(48); __ownsNativeInstance = true; - var arg0 = ReferenceEquals(_0, null) ? global::System.IntPtr.Zero : _0.__Instance; - Internal.cctor_2(__Instance, arg0); NativeToManagedMap[__Instance] = this; + var arg0 = ReferenceEquals(_0, null) ? global::System.IntPtr.Zero : _0.__Instance; + Internal.cctor_2((__Instance + __PointerAdjustment), arg0); } public CppSharp.Parser.AST.QualifiedType QualifiedType @@ -889,14 +912,14 @@ namespace CppSharp internal static extern uint getParametersCount_0(global::System.IntPtr instance); } - public static new FunctionType __CreateInstance(global::System.IntPtr native, bool ownsNativeInstance = false) + public static new FunctionType __CreateInstance(global::System.IntPtr native, bool ownsNativeInstance = false, bool skipVTables = false) { - return new FunctionType((FunctionType.Internal*) native) { __ownsNativeInstance = ownsNativeInstance }; + return new FunctionType((FunctionType.Internal*) native, skipVTables) { __ownsNativeInstance = ownsNativeInstance }; } - public static FunctionType __CreateInstance(FunctionType.Internal native) + public static FunctionType __CreateInstance(FunctionType.Internal native, bool skipVTables = false) { - return new FunctionType(native); + return new FunctionType(native, skipVTables); } private static FunctionType.Internal* __CopyValue(FunctionType.Internal native) @@ -906,16 +929,20 @@ namespace CppSharp return (FunctionType.Internal*) ret; } - private FunctionType(FunctionType.Internal native) - : this(__CopyValue(native)) + private FunctionType(FunctionType.Internal native, bool skipVTables = false) + : this(__CopyValue(native), skipVTables) { __ownsNativeInstance = true; NativeToManagedMap[__Instance] = this; } - protected FunctionType(FunctionType.Internal* native, bool isInternalImpl = false) - : base((CppSharp.Parser.AST.Type.Internal*) native) + protected FunctionType(FunctionType.Internal* native, bool skipVTables = false) + : base((CppSharp.Parser.AST.Type.Internal*) null) { + __PointerAdjustment = 0; + if (native == null) + return; + __Instance = new global::System.IntPtr(native); } public FunctionType() @@ -923,8 +950,8 @@ namespace CppSharp { __Instance = Marshal.AllocHGlobal(56); __ownsNativeInstance = true; - Internal.ctor_0(__Instance); NativeToManagedMap[__Instance] = this; + Internal.ctor_0((__Instance + __PointerAdjustment)); } public FunctionType(CppSharp.Parser.AST.FunctionType _0) @@ -932,14 +959,14 @@ namespace CppSharp { __Instance = Marshal.AllocHGlobal(56); __ownsNativeInstance = true; - var arg0 = ReferenceEquals(_0, null) ? global::System.IntPtr.Zero : _0.__Instance; - Internal.cctor_2(__Instance, arg0); NativeToManagedMap[__Instance] = this; + var arg0 = ReferenceEquals(_0, null) ? global::System.IntPtr.Zero : _0.__Instance; + Internal.cctor_2((__Instance + __PointerAdjustment), arg0); } public CppSharp.Parser.AST.Parameter getParameters(uint i) { - var __ret = Internal.getParameters_0(__Instance, i); + var __ret = Internal.getParameters_0((__Instance + __PointerAdjustment), i); CppSharp.Parser.AST.Parameter __result0; if (__ret == IntPtr.Zero) __result0 = null; else if (CppSharp.Parser.AST.Parameter.NativeToManagedMap.ContainsKey(__ret)) @@ -951,19 +978,19 @@ namespace CppSharp public void addParameters(CppSharp.Parser.AST.Parameter s) { var arg0 = ReferenceEquals(s, null) ? global::System.IntPtr.Zero : s.__Instance; - Internal.addParameters_0(__Instance, arg0); + Internal.addParameters_0((__Instance + __PointerAdjustment), arg0); } public void clearParameters() { - Internal.clearParameters_0(__Instance); + Internal.clearParameters_0((__Instance + __PointerAdjustment)); } public uint ParametersCount { get { - var __ret = Internal.getParametersCount_0(__Instance); + var __ret = Internal.getParametersCount_0((__Instance + __PointerAdjustment)); return __ret; } } @@ -1031,14 +1058,14 @@ namespace CppSharp RVReference = 3 } - public static new PointerType __CreateInstance(global::System.IntPtr native, bool ownsNativeInstance = false) + public static new PointerType __CreateInstance(global::System.IntPtr native, bool ownsNativeInstance = false, bool skipVTables = false) { - return new PointerType((PointerType.Internal*) native) { __ownsNativeInstance = ownsNativeInstance }; + return new PointerType((PointerType.Internal*) native, skipVTables) { __ownsNativeInstance = ownsNativeInstance }; } - public static PointerType __CreateInstance(PointerType.Internal native) + public static PointerType __CreateInstance(PointerType.Internal native, bool skipVTables = false) { - return new PointerType(native); + return new PointerType(native, skipVTables); } private static PointerType.Internal* __CopyValue(PointerType.Internal native) @@ -1048,16 +1075,20 @@ namespace CppSharp return (PointerType.Internal*) ret; } - private PointerType(PointerType.Internal native) - : this(__CopyValue(native)) + private PointerType(PointerType.Internal native, bool skipVTables = false) + : this(__CopyValue(native), skipVTables) { __ownsNativeInstance = true; NativeToManagedMap[__Instance] = this; } - protected PointerType(PointerType.Internal* native, bool isInternalImpl = false) - : base((CppSharp.Parser.AST.Type.Internal*) native) + protected PointerType(PointerType.Internal* native, bool skipVTables = false) + : base((CppSharp.Parser.AST.Type.Internal*) null) { + __PointerAdjustment = 0; + if (native == null) + return; + __Instance = new global::System.IntPtr(native); } public PointerType() @@ -1065,8 +1096,8 @@ namespace CppSharp { __Instance = Marshal.AllocHGlobal(32); __ownsNativeInstance = true; - Internal.ctor_0(__Instance); NativeToManagedMap[__Instance] = this; + Internal.ctor_0((__Instance + __PointerAdjustment)); } public PointerType(CppSharp.Parser.AST.PointerType _0) @@ -1074,9 +1105,9 @@ namespace CppSharp { __Instance = Marshal.AllocHGlobal(32); __ownsNativeInstance = true; - var arg0 = ReferenceEquals(_0, null) ? global::System.IntPtr.Zero : _0.__Instance; - Internal.cctor_2(__Instance, arg0); NativeToManagedMap[__Instance] = this; + var arg0 = ReferenceEquals(_0, null) ? global::System.IntPtr.Zero : _0.__Instance; + Internal.cctor_2((__Instance + __PointerAdjustment), arg0); } public CppSharp.Parser.AST.QualifiedType QualifiedPointee @@ -1131,14 +1162,14 @@ namespace CppSharp internal static extern void cctor_2(global::System.IntPtr instance, global::System.IntPtr _0); } - public static new MemberPointerType __CreateInstance(global::System.IntPtr native, bool ownsNativeInstance = false) + public static new MemberPointerType __CreateInstance(global::System.IntPtr native, bool ownsNativeInstance = false, bool skipVTables = false) { - return new MemberPointerType((MemberPointerType.Internal*) native) { __ownsNativeInstance = ownsNativeInstance }; + return new MemberPointerType((MemberPointerType.Internal*) native, skipVTables) { __ownsNativeInstance = ownsNativeInstance }; } - public static MemberPointerType __CreateInstance(MemberPointerType.Internal native) + public static MemberPointerType __CreateInstance(MemberPointerType.Internal native, bool skipVTables = false) { - return new MemberPointerType(native); + return new MemberPointerType(native, skipVTables); } private static MemberPointerType.Internal* __CopyValue(MemberPointerType.Internal native) @@ -1148,16 +1179,20 @@ namespace CppSharp return (MemberPointerType.Internal*) ret; } - private MemberPointerType(MemberPointerType.Internal native) - : this(__CopyValue(native)) + private MemberPointerType(MemberPointerType.Internal native, bool skipVTables = false) + : this(__CopyValue(native), skipVTables) { __ownsNativeInstance = true; NativeToManagedMap[__Instance] = this; } - protected MemberPointerType(MemberPointerType.Internal* native, bool isInternalImpl = false) - : base((CppSharp.Parser.AST.Type.Internal*) native) + protected MemberPointerType(MemberPointerType.Internal* native, bool skipVTables = false) + : base((CppSharp.Parser.AST.Type.Internal*) null) { + __PointerAdjustment = 0; + if (native == null) + return; + __Instance = new global::System.IntPtr(native); } public MemberPointerType() @@ -1165,8 +1200,8 @@ namespace CppSharp { __Instance = Marshal.AllocHGlobal(24); __ownsNativeInstance = true; - Internal.ctor_0(__Instance); NativeToManagedMap[__Instance] = this; + Internal.ctor_0((__Instance + __PointerAdjustment)); } public MemberPointerType(CppSharp.Parser.AST.MemberPointerType _0) @@ -1174,9 +1209,9 @@ namespace CppSharp { __Instance = Marshal.AllocHGlobal(24); __ownsNativeInstance = true; - var arg0 = ReferenceEquals(_0, null) ? global::System.IntPtr.Zero : _0.__Instance; - Internal.cctor_2(__Instance, arg0); NativeToManagedMap[__Instance] = this; + var arg0 = ReferenceEquals(_0, null) ? global::System.IntPtr.Zero : _0.__Instance; + Internal.cctor_2((__Instance + __PointerAdjustment), arg0); } public CppSharp.Parser.AST.QualifiedType Pointee @@ -1218,14 +1253,14 @@ namespace CppSharp internal static extern void cctor_2(global::System.IntPtr instance, global::System.IntPtr _0); } - public static new TypedefType __CreateInstance(global::System.IntPtr native, bool ownsNativeInstance = false) + public static new TypedefType __CreateInstance(global::System.IntPtr native, bool ownsNativeInstance = false, bool skipVTables = false) { - return new TypedefType((TypedefType.Internal*) native) { __ownsNativeInstance = ownsNativeInstance }; + return new TypedefType((TypedefType.Internal*) native, skipVTables) { __ownsNativeInstance = ownsNativeInstance }; } - public static TypedefType __CreateInstance(TypedefType.Internal native) + public static TypedefType __CreateInstance(TypedefType.Internal native, bool skipVTables = false) { - return new TypedefType(native); + return new TypedefType(native, skipVTables); } private static TypedefType.Internal* __CopyValue(TypedefType.Internal native) @@ -1235,16 +1270,20 @@ namespace CppSharp return (TypedefType.Internal*) ret; } - private TypedefType(TypedefType.Internal native) - : this(__CopyValue(native)) + private TypedefType(TypedefType.Internal native, bool skipVTables = false) + : this(__CopyValue(native), skipVTables) { __ownsNativeInstance = true; NativeToManagedMap[__Instance] = this; } - protected TypedefType(TypedefType.Internal* native, bool isInternalImpl = false) - : base((CppSharp.Parser.AST.Type.Internal*) native) + protected TypedefType(TypedefType.Internal* native, bool skipVTables = false) + : base((CppSharp.Parser.AST.Type.Internal*) null) { + __PointerAdjustment = 0; + if (native == null) + return; + __Instance = new global::System.IntPtr(native); } public TypedefType() @@ -1252,8 +1291,8 @@ namespace CppSharp { __Instance = Marshal.AllocHGlobal(16); __ownsNativeInstance = true; - Internal.ctor_0(__Instance); NativeToManagedMap[__Instance] = this; + Internal.ctor_0((__Instance + __PointerAdjustment)); } public TypedefType(CppSharp.Parser.AST.TypedefType _0) @@ -1261,9 +1300,9 @@ namespace CppSharp { __Instance = Marshal.AllocHGlobal(16); __ownsNativeInstance = true; - var arg0 = ReferenceEquals(_0, null) ? global::System.IntPtr.Zero : _0.__Instance; - Internal.cctor_2(__Instance, arg0); NativeToManagedMap[__Instance] = this; + var arg0 = ReferenceEquals(_0, null) ? global::System.IntPtr.Zero : _0.__Instance; + Internal.cctor_2((__Instance + __PointerAdjustment), arg0); } public CppSharp.Parser.AST.TypedefDecl Declaration @@ -1313,14 +1352,14 @@ namespace CppSharp internal static extern void cctor_2(global::System.IntPtr instance, global::System.IntPtr _0); } - public static new AttributedType __CreateInstance(global::System.IntPtr native, bool ownsNativeInstance = false) + public static new AttributedType __CreateInstance(global::System.IntPtr native, bool ownsNativeInstance = false, bool skipVTables = false) { - return new AttributedType((AttributedType.Internal*) native) { __ownsNativeInstance = ownsNativeInstance }; + return new AttributedType((AttributedType.Internal*) native, skipVTables) { __ownsNativeInstance = ownsNativeInstance }; } - public static AttributedType __CreateInstance(AttributedType.Internal native) + public static AttributedType __CreateInstance(AttributedType.Internal native, bool skipVTables = false) { - return new AttributedType(native); + return new AttributedType(native, skipVTables); } private static AttributedType.Internal* __CopyValue(AttributedType.Internal native) @@ -1330,16 +1369,20 @@ namespace CppSharp return (AttributedType.Internal*) ret; } - private AttributedType(AttributedType.Internal native) - : this(__CopyValue(native)) + private AttributedType(AttributedType.Internal native, bool skipVTables = false) + : this(__CopyValue(native), skipVTables) { __ownsNativeInstance = true; NativeToManagedMap[__Instance] = this; } - protected AttributedType(AttributedType.Internal* native, bool isInternalImpl = false) - : base((CppSharp.Parser.AST.Type.Internal*) native) + protected AttributedType(AttributedType.Internal* native, bool skipVTables = false) + : base((CppSharp.Parser.AST.Type.Internal*) null) { + __PointerAdjustment = 0; + if (native == null) + return; + __Instance = new global::System.IntPtr(native); } public AttributedType() @@ -1347,8 +1390,8 @@ namespace CppSharp { __Instance = Marshal.AllocHGlobal(40); __ownsNativeInstance = true; - Internal.ctor_0(__Instance); NativeToManagedMap[__Instance] = this; + Internal.ctor_0((__Instance + __PointerAdjustment)); } public AttributedType(CppSharp.Parser.AST.AttributedType _0) @@ -1356,9 +1399,9 @@ namespace CppSharp { __Instance = Marshal.AllocHGlobal(40); __ownsNativeInstance = true; - var arg0 = ReferenceEquals(_0, null) ? global::System.IntPtr.Zero : _0.__Instance; - Internal.cctor_2(__Instance, arg0); NativeToManagedMap[__Instance] = this; + var arg0 = ReferenceEquals(_0, null) ? global::System.IntPtr.Zero : _0.__Instance; + Internal.cctor_2((__Instance + __PointerAdjustment), arg0); } public CppSharp.Parser.AST.QualifiedType Modified @@ -1419,14 +1462,14 @@ namespace CppSharp internal static extern void cctor_2(global::System.IntPtr instance, global::System.IntPtr _0); } - public static new DecayedType __CreateInstance(global::System.IntPtr native, bool ownsNativeInstance = false) + public static new DecayedType __CreateInstance(global::System.IntPtr native, bool ownsNativeInstance = false, bool skipVTables = false) { - return new DecayedType((DecayedType.Internal*) native) { __ownsNativeInstance = ownsNativeInstance }; + return new DecayedType((DecayedType.Internal*) native, skipVTables) { __ownsNativeInstance = ownsNativeInstance }; } - public static DecayedType __CreateInstance(DecayedType.Internal native) + public static DecayedType __CreateInstance(DecayedType.Internal native, bool skipVTables = false) { - return new DecayedType(native); + return new DecayedType(native, skipVTables); } private static DecayedType.Internal* __CopyValue(DecayedType.Internal native) @@ -1436,16 +1479,20 @@ namespace CppSharp return (DecayedType.Internal*) ret; } - private DecayedType(DecayedType.Internal native) - : this(__CopyValue(native)) + private DecayedType(DecayedType.Internal native, bool skipVTables = false) + : this(__CopyValue(native), skipVTables) { __ownsNativeInstance = true; NativeToManagedMap[__Instance] = this; } - protected DecayedType(DecayedType.Internal* native, bool isInternalImpl = false) - : base((CppSharp.Parser.AST.Type.Internal*) native) + protected DecayedType(DecayedType.Internal* native, bool skipVTables = false) + : base((CppSharp.Parser.AST.Type.Internal*) null) { + __PointerAdjustment = 0; + if (native == null) + return; + __Instance = new global::System.IntPtr(native); } public DecayedType() @@ -1453,8 +1500,8 @@ namespace CppSharp { __Instance = Marshal.AllocHGlobal(56); __ownsNativeInstance = true; - Internal.ctor_0(__Instance); NativeToManagedMap[__Instance] = this; + Internal.ctor_0((__Instance + __PointerAdjustment)); } public DecayedType(CppSharp.Parser.AST.DecayedType _0) @@ -1462,9 +1509,9 @@ namespace CppSharp { __Instance = Marshal.AllocHGlobal(56); __ownsNativeInstance = true; - var arg0 = ReferenceEquals(_0, null) ? global::System.IntPtr.Zero : _0.__Instance; - Internal.cctor_2(__Instance, arg0); NativeToManagedMap[__Instance] = this; + var arg0 = ReferenceEquals(_0, null) ? global::System.IntPtr.Zero : _0.__Instance; + Internal.cctor_2((__Instance + __PointerAdjustment), arg0); } public CppSharp.Parser.AST.QualifiedType Decayed @@ -1548,19 +1595,21 @@ namespace CppSharp } public global::System.IntPtr __Instance { get; protected set; } + + protected int __PointerAdjustment; public static readonly System.Collections.Concurrent.ConcurrentDictionary NativeToManagedMap = new System.Collections.Concurrent.ConcurrentDictionary(); protected void*[] __OriginalVTables; protected bool __ownsNativeInstance; - public static TemplateArgument __CreateInstance(global::System.IntPtr native, bool ownsNativeInstance = false) + public static TemplateArgument __CreateInstance(global::System.IntPtr native, bool ownsNativeInstance = false, bool skipVTables = false) { - return new TemplateArgument((TemplateArgument.Internal*) native) { __ownsNativeInstance = ownsNativeInstance }; + return new TemplateArgument((TemplateArgument.Internal*) native, skipVTables) { __ownsNativeInstance = ownsNativeInstance }; } - public static TemplateArgument __CreateInstance(TemplateArgument.Internal native) + public static TemplateArgument __CreateInstance(TemplateArgument.Internal native, bool skipVTables = false) { - return new TemplateArgument(native); + return new TemplateArgument(native, skipVTables); } private static TemplateArgument.Internal* __CopyValue(TemplateArgument.Internal native) @@ -1570,15 +1619,17 @@ namespace CppSharp return ret; } - private TemplateArgument(TemplateArgument.Internal native) - : this(__CopyValue(native)) + private TemplateArgument(TemplateArgument.Internal native, bool skipVTables = false) + : this(__CopyValue(native), skipVTables) { __ownsNativeInstance = true; NativeToManagedMap[__Instance] = this; } - protected TemplateArgument(TemplateArgument.Internal* native, bool isInternalImpl = false) + protected TemplateArgument(TemplateArgument.Internal* native, bool skipVTables = false) { + if (native == null) + return; __Instance = new global::System.IntPtr(native); } @@ -1586,16 +1637,16 @@ namespace CppSharp { __Instance = Marshal.AllocHGlobal(40); __ownsNativeInstance = true; - Internal.ctor_0(__Instance); NativeToManagedMap[__Instance] = this; + Internal.ctor_0((__Instance + __PointerAdjustment)); } public TemplateArgument(CppSharp.Parser.AST.TemplateArgument _0) { __Instance = Marshal.AllocHGlobal(40); __ownsNativeInstance = true; - *((TemplateArgument.Internal*) __Instance) = *((TemplateArgument.Internal*) _0.__Instance); NativeToManagedMap[__Instance] = this; + *((TemplateArgument.Internal*) __Instance) = *((TemplateArgument.Internal*) _0.__Instance); } public void Dispose() @@ -1609,7 +1660,8 @@ namespace CppSharp throw new global::System.InvalidOperationException("Managed instances owned by native code cannot be disposed of."); CppSharp.Parser.AST.TemplateArgument __dummy; NativeToManagedMap.TryRemove(__Instance, out __dummy); - Marshal.FreeHGlobal(__Instance); + if (__ownsNativeInstance) + Marshal.FreeHGlobal(__Instance); } public CppSharp.Parser.AST.TemplateArgument.ArgumentKind Kind @@ -1723,14 +1775,14 @@ namespace CppSharp internal static extern uint getArgumentsCount_0(global::System.IntPtr instance); } - public static new TemplateSpecializationType __CreateInstance(global::System.IntPtr native, bool ownsNativeInstance = false) + public static new TemplateSpecializationType __CreateInstance(global::System.IntPtr native, bool ownsNativeInstance = false, bool skipVTables = false) { - return new TemplateSpecializationType((TemplateSpecializationType.Internal*) native) { __ownsNativeInstance = ownsNativeInstance }; + return new TemplateSpecializationType((TemplateSpecializationType.Internal*) native, skipVTables) { __ownsNativeInstance = ownsNativeInstance }; } - public static TemplateSpecializationType __CreateInstance(TemplateSpecializationType.Internal native) + public static TemplateSpecializationType __CreateInstance(TemplateSpecializationType.Internal native, bool skipVTables = false) { - return new TemplateSpecializationType(native); + return new TemplateSpecializationType(native, skipVTables); } private static TemplateSpecializationType.Internal* __CopyValue(TemplateSpecializationType.Internal native) @@ -1740,16 +1792,20 @@ namespace CppSharp return (TemplateSpecializationType.Internal*) ret; } - private TemplateSpecializationType(TemplateSpecializationType.Internal native) - : this(__CopyValue(native)) + private TemplateSpecializationType(TemplateSpecializationType.Internal native, bool skipVTables = false) + : this(__CopyValue(native), skipVTables) { __ownsNativeInstance = true; NativeToManagedMap[__Instance] = this; } - protected TemplateSpecializationType(TemplateSpecializationType.Internal* native, bool isInternalImpl = false) - : base((CppSharp.Parser.AST.Type.Internal*) native) + protected TemplateSpecializationType(TemplateSpecializationType.Internal* native, bool skipVTables = false) + : base((CppSharp.Parser.AST.Type.Internal*) null) { + __PointerAdjustment = 0; + if (native == null) + return; + __Instance = new global::System.IntPtr(native); } public TemplateSpecializationType() @@ -1757,8 +1813,8 @@ namespace CppSharp { __Instance = Marshal.AllocHGlobal(48); __ownsNativeInstance = true; - Internal.ctor_0(__Instance); NativeToManagedMap[__Instance] = this; + Internal.ctor_0((__Instance + __PointerAdjustment)); } public TemplateSpecializationType(CppSharp.Parser.AST.TemplateSpecializationType _0) @@ -1766,34 +1822,34 @@ namespace CppSharp { __Instance = Marshal.AllocHGlobal(48); __ownsNativeInstance = true; - var arg0 = ReferenceEquals(_0, null) ? global::System.IntPtr.Zero : _0.__Instance; - Internal.cctor_1(__Instance, arg0); NativeToManagedMap[__Instance] = this; + var arg0 = ReferenceEquals(_0, null) ? global::System.IntPtr.Zero : _0.__Instance; + Internal.cctor_1((__Instance + __PointerAdjustment), arg0); } public CppSharp.Parser.AST.TemplateArgument getArguments(uint i) { var __ret = new CppSharp.Parser.AST.TemplateArgument.Internal(); - Internal.getArguments_0(new IntPtr(&__ret), __Instance, i); + Internal.getArguments_0(new IntPtr(&__ret), (__Instance + __PointerAdjustment), i); return CppSharp.Parser.AST.TemplateArgument.__CreateInstance(__ret); } public void addArguments(CppSharp.Parser.AST.TemplateArgument s) { var arg0 = ReferenceEquals(s, null) ? global::System.IntPtr.Zero : s.__Instance; - Internal.addArguments_0(__Instance, arg0); + Internal.addArguments_0((__Instance + __PointerAdjustment), arg0); } public void clearArguments() { - Internal.clearArguments_0(__Instance); + Internal.clearArguments_0((__Instance + __PointerAdjustment)); } public uint ArgumentsCount { get { - var __ret = Internal.getArgumentsCount_0(__Instance); + var __ret = Internal.getArgumentsCount_0((__Instance + __PointerAdjustment)); return __ret; } } @@ -1862,7 +1918,7 @@ namespace CppSharp [DllImport("CppSharp.CppParser.dll", CallingConvention = global::System.Runtime.InteropServices.CallingConvention.Cdecl, EntryPoint="_ZNK8CppSharp9CppParser3AST17TemplateParametereqERKS2_")] [return: MarshalAsAttribute(UnmanagedType.I1)] - internal static extern byte OperatorEqualEqual_0(global::System.IntPtr instance, global::System.IntPtr param); + internal static extern bool OperatorEqualEqual_0(global::System.IntPtr instance, global::System.IntPtr param); [SuppressUnmanagedCodeSecurity] [DllImport("CppSharp.CppParser.dll", CallingConvention = global::System.Runtime.InteropServices.CallingConvention.Cdecl, @@ -1876,19 +1932,21 @@ namespace CppSharp } public global::System.IntPtr __Instance { get; protected set; } + + protected int __PointerAdjustment; public static readonly System.Collections.Concurrent.ConcurrentDictionary NativeToManagedMap = new System.Collections.Concurrent.ConcurrentDictionary(); protected void*[] __OriginalVTables; protected bool __ownsNativeInstance; - public static TemplateParameter __CreateInstance(global::System.IntPtr native, bool ownsNativeInstance = false) + public static TemplateParameter __CreateInstance(global::System.IntPtr native, bool ownsNativeInstance = false, bool skipVTables = false) { - return new TemplateParameter((TemplateParameter.Internal*) native) { __ownsNativeInstance = ownsNativeInstance }; + return new TemplateParameter((TemplateParameter.Internal*) native, skipVTables) { __ownsNativeInstance = ownsNativeInstance }; } - public static TemplateParameter __CreateInstance(TemplateParameter.Internal native) + public static TemplateParameter __CreateInstance(TemplateParameter.Internal native, bool skipVTables = false) { - return new TemplateParameter(native); + return new TemplateParameter(native, skipVTables); } private static TemplateParameter.Internal* __CopyValue(TemplateParameter.Internal native) @@ -1898,15 +1956,17 @@ namespace CppSharp return (TemplateParameter.Internal*) ret; } - private TemplateParameter(TemplateParameter.Internal native) - : this(__CopyValue(native)) + private TemplateParameter(TemplateParameter.Internal native, bool skipVTables = false) + : this(__CopyValue(native), skipVTables) { __ownsNativeInstance = true; NativeToManagedMap[__Instance] = this; } - protected TemplateParameter(TemplateParameter.Internal* native, bool isInternalImpl = false) + protected TemplateParameter(TemplateParameter.Internal* native, bool skipVTables = false) { + if (native == null) + return; __Instance = new global::System.IntPtr(native); } @@ -1914,17 +1974,17 @@ namespace CppSharp { __Instance = Marshal.AllocHGlobal(32); __ownsNativeInstance = true; - Internal.ctor_0(__Instance); NativeToManagedMap[__Instance] = this; + Internal.ctor_0((__Instance + __PointerAdjustment)); } public TemplateParameter(CppSharp.Parser.AST.TemplateParameter _0) { __Instance = Marshal.AllocHGlobal(32); __ownsNativeInstance = true; - var arg0 = ReferenceEquals(_0, null) ? global::System.IntPtr.Zero : _0.__Instance; - Internal.cctor_1(__Instance, arg0); NativeToManagedMap[__Instance] = this; + var arg0 = ReferenceEquals(_0, null) ? global::System.IntPtr.Zero : _0.__Instance; + Internal.cctor_1((__Instance + __PointerAdjustment), arg0); } public void Dispose() @@ -1938,8 +1998,9 @@ namespace CppSharp throw new global::System.InvalidOperationException("Managed instances owned by native code cannot be disposed of."); CppSharp.Parser.AST.TemplateParameter __dummy; NativeToManagedMap.TryRemove(__Instance, out __dummy); - Internal.dtor_0(__Instance); - Marshal.FreeHGlobal(__Instance); + Internal.dtor_0((__Instance + __PointerAdjustment)); + if (__ownsNativeInstance) + Marshal.FreeHGlobal(__Instance); } public static bool operator !=(CppSharp.Parser.AST.TemplateParameter __op, CppSharp.Parser.AST.TemplateParameter param) @@ -1956,7 +2017,7 @@ namespace CppSharp var arg0 = __op.__Instance; var arg1 = param.__Instance; var __ret = Internal.OperatorEqualEqual_0(arg0, arg1); - return __ret != 0; + return __ret; } public override bool Equals(object obj) @@ -1964,18 +2025,25 @@ namespace CppSharp return this == obj as TemplateParameter; } + public override int GetHashCode() + { + if (__Instance == global::System.IntPtr.Zero) + return global::System.IntPtr.Zero.GetHashCode(); + return (*(Internal*) __Instance).GetHashCode(); + } + public string Name { get { - var __ret = Internal.getName_0(__Instance); + var __ret = Internal.getName_0((__Instance + __PointerAdjustment)); return Marshal.PtrToStringAnsi(__ret); } set { var arg0 = Marshal.StringToHGlobalAnsi(value); - Internal.setName_0(__Instance, arg0); + Internal.setName_0((__Instance + __PointerAdjustment), arg0); Marshal.FreeHGlobal(arg0); } } @@ -2033,14 +2101,14 @@ namespace CppSharp internal static extern void dtor_0(global::System.IntPtr instance); } - public static new TemplateParameterType __CreateInstance(global::System.IntPtr native, bool ownsNativeInstance = false) + public static new TemplateParameterType __CreateInstance(global::System.IntPtr native, bool ownsNativeInstance = false, bool skipVTables = false) { - return new TemplateParameterType((TemplateParameterType.Internal*) native) { __ownsNativeInstance = ownsNativeInstance }; + return new TemplateParameterType((TemplateParameterType.Internal*) native, skipVTables) { __ownsNativeInstance = ownsNativeInstance }; } - public static TemplateParameterType __CreateInstance(TemplateParameterType.Internal native) + public static TemplateParameterType __CreateInstance(TemplateParameterType.Internal native, bool skipVTables = false) { - return new TemplateParameterType(native); + return new TemplateParameterType(native, skipVTables); } private static TemplateParameterType.Internal* __CopyValue(TemplateParameterType.Internal native) @@ -2050,16 +2118,20 @@ namespace CppSharp return (TemplateParameterType.Internal*) ret; } - private TemplateParameterType(TemplateParameterType.Internal native) - : this(__CopyValue(native)) + private TemplateParameterType(TemplateParameterType.Internal native, bool skipVTables = false) + : this(__CopyValue(native), skipVTables) { __ownsNativeInstance = true; NativeToManagedMap[__Instance] = this; } - protected TemplateParameterType(TemplateParameterType.Internal* native, bool isInternalImpl = false) - : base((CppSharp.Parser.AST.Type.Internal*) native) + protected TemplateParameterType(TemplateParameterType.Internal* native, bool skipVTables = false) + : base((CppSharp.Parser.AST.Type.Internal*) null) { + __PointerAdjustment = 0; + if (native == null) + return; + __Instance = new global::System.IntPtr(native); } public TemplateParameterType() @@ -2067,8 +2139,8 @@ namespace CppSharp { __Instance = Marshal.AllocHGlobal(56); __ownsNativeInstance = true; - Internal.ctor_0(__Instance); NativeToManagedMap[__Instance] = this; + Internal.ctor_0((__Instance + __PointerAdjustment)); } public TemplateParameterType(CppSharp.Parser.AST.TemplateParameterType _0) @@ -2076,9 +2148,9 @@ namespace CppSharp { __Instance = Marshal.AllocHGlobal(56); __ownsNativeInstance = true; - var arg0 = ReferenceEquals(_0, null) ? global::System.IntPtr.Zero : _0.__Instance; - Internal.cctor_2(__Instance, arg0); NativeToManagedMap[__Instance] = this; + var arg0 = ReferenceEquals(_0, null) ? global::System.IntPtr.Zero : _0.__Instance; + Internal.cctor_2((__Instance + __PointerAdjustment), arg0); } public CppSharp.Parser.AST.TemplateParameter Parameter @@ -2159,14 +2231,14 @@ namespace CppSharp internal static extern void cctor_2(global::System.IntPtr instance, global::System.IntPtr _0); } - public static new TemplateParameterSubstitutionType __CreateInstance(global::System.IntPtr native, bool ownsNativeInstance = false) + public static new TemplateParameterSubstitutionType __CreateInstance(global::System.IntPtr native, bool ownsNativeInstance = false, bool skipVTables = false) { - return new TemplateParameterSubstitutionType((TemplateParameterSubstitutionType.Internal*) native) { __ownsNativeInstance = ownsNativeInstance }; + return new TemplateParameterSubstitutionType((TemplateParameterSubstitutionType.Internal*) native, skipVTables) { __ownsNativeInstance = ownsNativeInstance }; } - public static TemplateParameterSubstitutionType __CreateInstance(TemplateParameterSubstitutionType.Internal native) + public static TemplateParameterSubstitutionType __CreateInstance(TemplateParameterSubstitutionType.Internal native, bool skipVTables = false) { - return new TemplateParameterSubstitutionType(native); + return new TemplateParameterSubstitutionType(native, skipVTables); } private static TemplateParameterSubstitutionType.Internal* __CopyValue(TemplateParameterSubstitutionType.Internal native) @@ -2176,16 +2248,20 @@ namespace CppSharp return (TemplateParameterSubstitutionType.Internal*) ret; } - private TemplateParameterSubstitutionType(TemplateParameterSubstitutionType.Internal native) - : this(__CopyValue(native)) + private TemplateParameterSubstitutionType(TemplateParameterSubstitutionType.Internal native, bool skipVTables = false) + : this(__CopyValue(native), skipVTables) { __ownsNativeInstance = true; NativeToManagedMap[__Instance] = this; } - protected TemplateParameterSubstitutionType(TemplateParameterSubstitutionType.Internal* native, bool isInternalImpl = false) - : base((CppSharp.Parser.AST.Type.Internal*) native) + protected TemplateParameterSubstitutionType(TemplateParameterSubstitutionType.Internal* native, bool skipVTables = false) + : base((CppSharp.Parser.AST.Type.Internal*) null) { + __PointerAdjustment = 0; + if (native == null) + return; + __Instance = new global::System.IntPtr(native); } public TemplateParameterSubstitutionType() @@ -2193,8 +2269,8 @@ namespace CppSharp { __Instance = Marshal.AllocHGlobal(24); __ownsNativeInstance = true; - Internal.ctor_0(__Instance); NativeToManagedMap[__Instance] = this; + Internal.ctor_0((__Instance + __PointerAdjustment)); } public TemplateParameterSubstitutionType(CppSharp.Parser.AST.TemplateParameterSubstitutionType _0) @@ -2202,9 +2278,9 @@ namespace CppSharp { __Instance = Marshal.AllocHGlobal(24); __ownsNativeInstance = true; - var arg0 = ReferenceEquals(_0, null) ? global::System.IntPtr.Zero : _0.__Instance; - Internal.cctor_2(__Instance, arg0); NativeToManagedMap[__Instance] = this; + var arg0 = ReferenceEquals(_0, null) ? global::System.IntPtr.Zero : _0.__Instance; + Internal.cctor_2((__Instance + __PointerAdjustment), arg0); } public CppSharp.Parser.AST.QualifiedType Replacement @@ -2249,14 +2325,14 @@ namespace CppSharp internal static extern void cctor_2(global::System.IntPtr instance, global::System.IntPtr _0); } - public static new InjectedClassNameType __CreateInstance(global::System.IntPtr native, bool ownsNativeInstance = false) + public static new InjectedClassNameType __CreateInstance(global::System.IntPtr native, bool ownsNativeInstance = false, bool skipVTables = false) { - return new InjectedClassNameType((InjectedClassNameType.Internal*) native) { __ownsNativeInstance = ownsNativeInstance }; + return new InjectedClassNameType((InjectedClassNameType.Internal*) native, skipVTables) { __ownsNativeInstance = ownsNativeInstance }; } - public static InjectedClassNameType __CreateInstance(InjectedClassNameType.Internal native) + public static InjectedClassNameType __CreateInstance(InjectedClassNameType.Internal native, bool skipVTables = false) { - return new InjectedClassNameType(native); + return new InjectedClassNameType(native, skipVTables); } private static InjectedClassNameType.Internal* __CopyValue(InjectedClassNameType.Internal native) @@ -2266,16 +2342,20 @@ namespace CppSharp return (InjectedClassNameType.Internal*) ret; } - private InjectedClassNameType(InjectedClassNameType.Internal native) - : this(__CopyValue(native)) + private InjectedClassNameType(InjectedClassNameType.Internal native, bool skipVTables = false) + : this(__CopyValue(native), skipVTables) { __ownsNativeInstance = true; NativeToManagedMap[__Instance] = this; } - protected InjectedClassNameType(InjectedClassNameType.Internal* native, bool isInternalImpl = false) - : base((CppSharp.Parser.AST.Type.Internal*) native) + protected InjectedClassNameType(InjectedClassNameType.Internal* native, bool skipVTables = false) + : base((CppSharp.Parser.AST.Type.Internal*) null) { + __PointerAdjustment = 0; + if (native == null) + return; + __Instance = new global::System.IntPtr(native); } public InjectedClassNameType() @@ -2283,8 +2363,8 @@ namespace CppSharp { __Instance = Marshal.AllocHGlobal(24); __ownsNativeInstance = true; - Internal.ctor_0(__Instance); NativeToManagedMap[__Instance] = this; + Internal.ctor_0((__Instance + __PointerAdjustment)); } public InjectedClassNameType(CppSharp.Parser.AST.InjectedClassNameType _0) @@ -2292,9 +2372,9 @@ namespace CppSharp { __Instance = Marshal.AllocHGlobal(24); __ownsNativeInstance = true; - var arg0 = ReferenceEquals(_0, null) ? global::System.IntPtr.Zero : _0.__Instance; - Internal.cctor_2(__Instance, arg0); NativeToManagedMap[__Instance] = this; + var arg0 = ReferenceEquals(_0, null) ? global::System.IntPtr.Zero : _0.__Instance; + Internal.cctor_2((__Instance + __PointerAdjustment), arg0); } public CppSharp.Parser.AST.TemplateSpecializationType TemplateSpecialization @@ -2356,14 +2436,14 @@ namespace CppSharp internal static extern void cctor_2(global::System.IntPtr instance, global::System.IntPtr _0); } - public static new DependentNameType __CreateInstance(global::System.IntPtr native, bool ownsNativeInstance = false) + public static new DependentNameType __CreateInstance(global::System.IntPtr native, bool ownsNativeInstance = false, bool skipVTables = false) { - return new DependentNameType((DependentNameType.Internal*) native) { __ownsNativeInstance = ownsNativeInstance }; + return new DependentNameType((DependentNameType.Internal*) native, skipVTables) { __ownsNativeInstance = ownsNativeInstance }; } - public static DependentNameType __CreateInstance(DependentNameType.Internal native) + public static DependentNameType __CreateInstance(DependentNameType.Internal native, bool skipVTables = false) { - return new DependentNameType(native); + return new DependentNameType(native, skipVTables); } private static DependentNameType.Internal* __CopyValue(DependentNameType.Internal native) @@ -2373,16 +2453,20 @@ namespace CppSharp return (DependentNameType.Internal*) ret; } - private DependentNameType(DependentNameType.Internal native) - : this(__CopyValue(native)) + private DependentNameType(DependentNameType.Internal native, bool skipVTables = false) + : this(__CopyValue(native), skipVTables) { __ownsNativeInstance = true; NativeToManagedMap[__Instance] = this; } - protected DependentNameType(DependentNameType.Internal* native, bool isInternalImpl = false) - : base((CppSharp.Parser.AST.Type.Internal*) native) + protected DependentNameType(DependentNameType.Internal* native, bool skipVTables = false) + : base((CppSharp.Parser.AST.Type.Internal*) null) { + __PointerAdjustment = 0; + if (native == null) + return; + __Instance = new global::System.IntPtr(native); } public DependentNameType() @@ -2390,8 +2474,8 @@ namespace CppSharp { __Instance = Marshal.AllocHGlobal(8); __ownsNativeInstance = true; - Internal.ctor_0(__Instance); NativeToManagedMap[__Instance] = this; + Internal.ctor_0((__Instance + __PointerAdjustment)); } public DependentNameType(CppSharp.Parser.AST.DependentNameType _0) @@ -2399,9 +2483,9 @@ namespace CppSharp { __Instance = Marshal.AllocHGlobal(8); __ownsNativeInstance = true; - var arg0 = ReferenceEquals(_0, null) ? global::System.IntPtr.Zero : _0.__Instance; - Internal.cctor_2(__Instance, arg0); NativeToManagedMap[__Instance] = this; + var arg0 = ReferenceEquals(_0, null) ? global::System.IntPtr.Zero : _0.__Instance; + Internal.cctor_2((__Instance + __PointerAdjustment), arg0); } } @@ -2427,14 +2511,14 @@ namespace CppSharp internal static extern void cctor_2(global::System.IntPtr instance, global::System.IntPtr _0); } - public static new PackExpansionType __CreateInstance(global::System.IntPtr native, bool ownsNativeInstance = false) + public static new PackExpansionType __CreateInstance(global::System.IntPtr native, bool ownsNativeInstance = false, bool skipVTables = false) { - return new PackExpansionType((PackExpansionType.Internal*) native) { __ownsNativeInstance = ownsNativeInstance }; + return new PackExpansionType((PackExpansionType.Internal*) native, skipVTables) { __ownsNativeInstance = ownsNativeInstance }; } - public static PackExpansionType __CreateInstance(PackExpansionType.Internal native) + public static PackExpansionType __CreateInstance(PackExpansionType.Internal native, bool skipVTables = false) { - return new PackExpansionType(native); + return new PackExpansionType(native, skipVTables); } private static PackExpansionType.Internal* __CopyValue(PackExpansionType.Internal native) @@ -2444,16 +2528,20 @@ namespace CppSharp return (PackExpansionType.Internal*) ret; } - private PackExpansionType(PackExpansionType.Internal native) - : this(__CopyValue(native)) + private PackExpansionType(PackExpansionType.Internal native, bool skipVTables = false) + : this(__CopyValue(native), skipVTables) { __ownsNativeInstance = true; NativeToManagedMap[__Instance] = this; } - protected PackExpansionType(PackExpansionType.Internal* native, bool isInternalImpl = false) - : base((CppSharp.Parser.AST.Type.Internal*) native) + protected PackExpansionType(PackExpansionType.Internal* native, bool skipVTables = false) + : base((CppSharp.Parser.AST.Type.Internal*) null) { + __PointerAdjustment = 0; + if (native == null) + return; + __Instance = new global::System.IntPtr(native); } public PackExpansionType() @@ -2461,8 +2549,8 @@ namespace CppSharp { __Instance = Marshal.AllocHGlobal(8); __ownsNativeInstance = true; - Internal.ctor_0(__Instance); NativeToManagedMap[__Instance] = this; + Internal.ctor_0((__Instance + __PointerAdjustment)); } public PackExpansionType(CppSharp.Parser.AST.PackExpansionType _0) @@ -2470,9 +2558,9 @@ namespace CppSharp { __Instance = Marshal.AllocHGlobal(8); __ownsNativeInstance = true; - var arg0 = ReferenceEquals(_0, null) ? global::System.IntPtr.Zero : _0.__Instance; - Internal.cctor_2(__Instance, arg0); NativeToManagedMap[__Instance] = this; + var arg0 = ReferenceEquals(_0, null) ? global::System.IntPtr.Zero : _0.__Instance; + Internal.cctor_2((__Instance + __PointerAdjustment), arg0); } } @@ -2501,14 +2589,14 @@ namespace CppSharp internal static extern void cctor_2(global::System.IntPtr instance, global::System.IntPtr _0); } - public static new BuiltinType __CreateInstance(global::System.IntPtr native, bool ownsNativeInstance = false) + public static new BuiltinType __CreateInstance(global::System.IntPtr native, bool ownsNativeInstance = false, bool skipVTables = false) { - return new BuiltinType((BuiltinType.Internal*) native) { __ownsNativeInstance = ownsNativeInstance }; + return new BuiltinType((BuiltinType.Internal*) native, skipVTables) { __ownsNativeInstance = ownsNativeInstance }; } - public static BuiltinType __CreateInstance(BuiltinType.Internal native) + public static BuiltinType __CreateInstance(BuiltinType.Internal native, bool skipVTables = false) { - return new BuiltinType(native); + return new BuiltinType(native, skipVTables); } private static BuiltinType.Internal* __CopyValue(BuiltinType.Internal native) @@ -2518,16 +2606,20 @@ namespace CppSharp return (BuiltinType.Internal*) ret; } - private BuiltinType(BuiltinType.Internal native) - : this(__CopyValue(native)) + private BuiltinType(BuiltinType.Internal native, bool skipVTables = false) + : this(__CopyValue(native), skipVTables) { __ownsNativeInstance = true; NativeToManagedMap[__Instance] = this; } - protected BuiltinType(BuiltinType.Internal* native, bool isInternalImpl = false) - : base((CppSharp.Parser.AST.Type.Internal*) native) + protected BuiltinType(BuiltinType.Internal* native, bool skipVTables = false) + : base((CppSharp.Parser.AST.Type.Internal*) null) { + __PointerAdjustment = 0; + if (native == null) + return; + __Instance = new global::System.IntPtr(native); } public BuiltinType() @@ -2535,8 +2627,8 @@ namespace CppSharp { __Instance = Marshal.AllocHGlobal(12); __ownsNativeInstance = true; - Internal.ctor_0(__Instance); NativeToManagedMap[__Instance] = this; + Internal.ctor_0((__Instance + __PointerAdjustment)); } public BuiltinType(CppSharp.Parser.AST.BuiltinType _0) @@ -2544,9 +2636,9 @@ namespace CppSharp { __Instance = Marshal.AllocHGlobal(12); __ownsNativeInstance = true; - var arg0 = ReferenceEquals(_0, null) ? global::System.IntPtr.Zero : _0.__Instance; - Internal.cctor_2(__Instance, arg0); NativeToManagedMap[__Instance] = this; + var arg0 = ReferenceEquals(_0, null) ? global::System.IntPtr.Zero : _0.__Instance; + Internal.cctor_2((__Instance + __PointerAdjustment), arg0); } public CppSharp.Parser.AST.PrimitiveType Type @@ -2589,19 +2681,21 @@ namespace CppSharp } public global::System.IntPtr __Instance { get; protected set; } + + protected int __PointerAdjustment; public static readonly System.Collections.Concurrent.ConcurrentDictionary NativeToManagedMap = new System.Collections.Concurrent.ConcurrentDictionary(); protected void*[] __OriginalVTables; protected bool __ownsNativeInstance; - public static VTableComponent __CreateInstance(global::System.IntPtr native, bool ownsNativeInstance = false) + public static VTableComponent __CreateInstance(global::System.IntPtr native, bool ownsNativeInstance = false, bool skipVTables = false) { - return new VTableComponent((VTableComponent.Internal*) native) { __ownsNativeInstance = ownsNativeInstance }; + return new VTableComponent((VTableComponent.Internal*) native, skipVTables) { __ownsNativeInstance = ownsNativeInstance }; } - public static VTableComponent __CreateInstance(VTableComponent.Internal native) + public static VTableComponent __CreateInstance(VTableComponent.Internal native, bool skipVTables = false) { - return new VTableComponent(native); + return new VTableComponent(native, skipVTables); } private static VTableComponent.Internal* __CopyValue(VTableComponent.Internal native) @@ -2611,15 +2705,17 @@ namespace CppSharp return ret; } - private VTableComponent(VTableComponent.Internal native) - : this(__CopyValue(native)) + private VTableComponent(VTableComponent.Internal native, bool skipVTables = false) + : this(__CopyValue(native), skipVTables) { __ownsNativeInstance = true; NativeToManagedMap[__Instance] = this; } - protected VTableComponent(VTableComponent.Internal* native, bool isInternalImpl = false) + protected VTableComponent(VTableComponent.Internal* native, bool skipVTables = false) { + if (native == null) + return; __Instance = new global::System.IntPtr(native); } @@ -2627,16 +2723,16 @@ namespace CppSharp { __Instance = Marshal.AllocHGlobal(16); __ownsNativeInstance = true; - Internal.ctor_0(__Instance); NativeToManagedMap[__Instance] = this; + Internal.ctor_0((__Instance + __PointerAdjustment)); } public VTableComponent(CppSharp.Parser.AST.VTableComponent _0) { __Instance = Marshal.AllocHGlobal(16); __ownsNativeInstance = true; - *((VTableComponent.Internal*) __Instance) = *((VTableComponent.Internal*) _0.__Instance); NativeToManagedMap[__Instance] = this; + *((VTableComponent.Internal*) __Instance) = *((VTableComponent.Internal*) _0.__Instance); } public void Dispose() @@ -2650,7 +2746,8 @@ namespace CppSharp throw new global::System.InvalidOperationException("Managed instances owned by native code cannot be disposed of."); CppSharp.Parser.AST.VTableComponent __dummy; NativeToManagedMap.TryRemove(__Instance, out __dummy); - Marshal.FreeHGlobal(__Instance); + if (__ownsNativeInstance) + Marshal.FreeHGlobal(__Instance); } public CppSharp.Parser.AST.VTableComponentKind Kind @@ -2740,19 +2837,21 @@ namespace CppSharp } public global::System.IntPtr __Instance { get; protected set; } + + protected int __PointerAdjustment; public static readonly System.Collections.Concurrent.ConcurrentDictionary NativeToManagedMap = new System.Collections.Concurrent.ConcurrentDictionary(); protected void*[] __OriginalVTables; protected bool __ownsNativeInstance; - public static VTableLayout __CreateInstance(global::System.IntPtr native, bool ownsNativeInstance = false) + public static VTableLayout __CreateInstance(global::System.IntPtr native, bool ownsNativeInstance = false, bool skipVTables = false) { - return new VTableLayout((VTableLayout.Internal*) native) { __ownsNativeInstance = ownsNativeInstance }; + return new VTableLayout((VTableLayout.Internal*) native, skipVTables) { __ownsNativeInstance = ownsNativeInstance }; } - public static VTableLayout __CreateInstance(VTableLayout.Internal native) + public static VTableLayout __CreateInstance(VTableLayout.Internal native, bool skipVTables = false) { - return new VTableLayout(native); + return new VTableLayout(native, skipVTables); } private static VTableLayout.Internal* __CopyValue(VTableLayout.Internal native) @@ -2762,15 +2861,17 @@ namespace CppSharp return (VTableLayout.Internal*) ret; } - private VTableLayout(VTableLayout.Internal native) - : this(__CopyValue(native)) + private VTableLayout(VTableLayout.Internal native, bool skipVTables = false) + : this(__CopyValue(native), skipVTables) { __ownsNativeInstance = true; NativeToManagedMap[__Instance] = this; } - protected VTableLayout(VTableLayout.Internal* native, bool isInternalImpl = false) + protected VTableLayout(VTableLayout.Internal* native, bool skipVTables = false) { + if (native == null) + return; __Instance = new global::System.IntPtr(native); } @@ -2778,17 +2879,17 @@ namespace CppSharp { __Instance = Marshal.AllocHGlobal(24); __ownsNativeInstance = true; - Internal.ctor_0(__Instance); NativeToManagedMap[__Instance] = this; + Internal.ctor_0((__Instance + __PointerAdjustment)); } public VTableLayout(CppSharp.Parser.AST.VTableLayout _0) { __Instance = Marshal.AllocHGlobal(24); __ownsNativeInstance = true; - var arg0 = ReferenceEquals(_0, null) ? global::System.IntPtr.Zero : _0.__Instance; - Internal.cctor_1(__Instance, arg0); NativeToManagedMap[__Instance] = this; + var arg0 = ReferenceEquals(_0, null) ? global::System.IntPtr.Zero : _0.__Instance; + Internal.cctor_1((__Instance + __PointerAdjustment), arg0); } public void Dispose() @@ -2802,32 +2903,33 @@ namespace CppSharp throw new global::System.InvalidOperationException("Managed instances owned by native code cannot be disposed of."); CppSharp.Parser.AST.VTableLayout __dummy; NativeToManagedMap.TryRemove(__Instance, out __dummy); - Internal.dtor_0(__Instance); - Marshal.FreeHGlobal(__Instance); + Internal.dtor_0((__Instance + __PointerAdjustment)); + if (__ownsNativeInstance) + Marshal.FreeHGlobal(__Instance); } public CppSharp.Parser.AST.VTableComponent getComponents(uint i) { - var __ret = Internal.getComponents_0(__Instance, i); + var __ret = Internal.getComponents_0((__Instance + __PointerAdjustment), i); return CppSharp.Parser.AST.VTableComponent.__CreateInstance(__ret); } public void addComponents(CppSharp.Parser.AST.VTableComponent s) { var arg0 = ReferenceEquals(s, null) ? global::System.IntPtr.Zero : s.__Instance; - Internal.addComponents_0(__Instance, arg0); + Internal.addComponents_0((__Instance + __PointerAdjustment), arg0); } public void clearComponents() { - Internal.clearComponents_0(__Instance); + Internal.clearComponents_0((__Instance + __PointerAdjustment)); } public uint ComponentsCount { get { - var __ret = Internal.getComponentsCount_0(__Instance); + var __ret = Internal.getComponentsCount_0((__Instance + __PointerAdjustment)); return __ret; } } @@ -2867,19 +2969,21 @@ namespace CppSharp } public global::System.IntPtr __Instance { get; protected set; } + + protected int __PointerAdjustment; public static readonly System.Collections.Concurrent.ConcurrentDictionary NativeToManagedMap = new System.Collections.Concurrent.ConcurrentDictionary(); protected void*[] __OriginalVTables; protected bool __ownsNativeInstance; - public static VFTableInfo __CreateInstance(global::System.IntPtr native, bool ownsNativeInstance = false) + public static VFTableInfo __CreateInstance(global::System.IntPtr native, bool ownsNativeInstance = false, bool skipVTables = false) { - return new VFTableInfo((VFTableInfo.Internal*) native) { __ownsNativeInstance = ownsNativeInstance }; + return new VFTableInfo((VFTableInfo.Internal*) native, skipVTables) { __ownsNativeInstance = ownsNativeInstance }; } - public static VFTableInfo __CreateInstance(VFTableInfo.Internal native) + public static VFTableInfo __CreateInstance(VFTableInfo.Internal native, bool skipVTables = false) { - return new VFTableInfo(native); + return new VFTableInfo(native, skipVTables); } private static VFTableInfo.Internal* __CopyValue(VFTableInfo.Internal native) @@ -2889,15 +2993,17 @@ namespace CppSharp return (VFTableInfo.Internal*) ret; } - private VFTableInfo(VFTableInfo.Internal native) - : this(__CopyValue(native)) + private VFTableInfo(VFTableInfo.Internal native, bool skipVTables = false) + : this(__CopyValue(native), skipVTables) { __ownsNativeInstance = true; NativeToManagedMap[__Instance] = this; } - protected VFTableInfo(VFTableInfo.Internal* native, bool isInternalImpl = false) + protected VFTableInfo(VFTableInfo.Internal* native, bool skipVTables = false) { + if (native == null) + return; __Instance = new global::System.IntPtr(native); } @@ -2905,17 +3011,17 @@ namespace CppSharp { __Instance = Marshal.AllocHGlobal(40); __ownsNativeInstance = true; - Internal.ctor_0(__Instance); NativeToManagedMap[__Instance] = this; + Internal.ctor_0((__Instance + __PointerAdjustment)); } public VFTableInfo(CppSharp.Parser.AST.VFTableInfo _0) { __Instance = Marshal.AllocHGlobal(40); __ownsNativeInstance = true; - var arg0 = ReferenceEquals(_0, null) ? global::System.IntPtr.Zero : _0.__Instance; - Internal.cctor_1(__Instance, arg0); NativeToManagedMap[__Instance] = this; + var arg0 = ReferenceEquals(_0, null) ? global::System.IntPtr.Zero : _0.__Instance; + Internal.cctor_1((__Instance + __PointerAdjustment), arg0); } public void Dispose() @@ -2929,8 +3035,9 @@ namespace CppSharp throw new global::System.InvalidOperationException("Managed instances owned by native code cannot be disposed of."); CppSharp.Parser.AST.VFTableInfo __dummy; NativeToManagedMap.TryRemove(__Instance, out __dummy); - Internal.dtor_0(__Instance); - Marshal.FreeHGlobal(__Instance); + Internal.dtor_0((__Instance + __PointerAdjustment)); + if (__ownsNativeInstance) + Marshal.FreeHGlobal(__Instance); } public ulong VBTableIndex @@ -3049,19 +3156,21 @@ namespace CppSharp } public global::System.IntPtr __Instance { get; protected set; } + + protected int __PointerAdjustment; public static readonly System.Collections.Concurrent.ConcurrentDictionary NativeToManagedMap = new System.Collections.Concurrent.ConcurrentDictionary(); protected void*[] __OriginalVTables; protected bool __ownsNativeInstance; - public static ClassLayout __CreateInstance(global::System.IntPtr native, bool ownsNativeInstance = false) + public static ClassLayout __CreateInstance(global::System.IntPtr native, bool ownsNativeInstance = false, bool skipVTables = false) { - return new ClassLayout((ClassLayout.Internal*) native) { __ownsNativeInstance = ownsNativeInstance }; + return new ClassLayout((ClassLayout.Internal*) native, skipVTables) { __ownsNativeInstance = ownsNativeInstance }; } - public static ClassLayout __CreateInstance(ClassLayout.Internal native) + public static ClassLayout __CreateInstance(ClassLayout.Internal native, bool skipVTables = false) { - return new ClassLayout(native); + return new ClassLayout(native, skipVTables); } private static ClassLayout.Internal* __CopyValue(ClassLayout.Internal native) @@ -3071,15 +3180,17 @@ namespace CppSharp return (ClassLayout.Internal*) ret; } - private ClassLayout(ClassLayout.Internal native) - : this(__CopyValue(native)) + private ClassLayout(ClassLayout.Internal native, bool skipVTables = false) + : this(__CopyValue(native), skipVTables) { __ownsNativeInstance = true; NativeToManagedMap[__Instance] = this; } - protected ClassLayout(ClassLayout.Internal* native, bool isInternalImpl = false) + protected ClassLayout(ClassLayout.Internal* native, bool skipVTables = false) { + if (native == null) + return; __Instance = new global::System.IntPtr(native); } @@ -3087,17 +3198,17 @@ namespace CppSharp { __Instance = Marshal.AllocHGlobal(88); __ownsNativeInstance = true; - Internal.ctor_0(__Instance); NativeToManagedMap[__Instance] = this; + Internal.ctor_0((__Instance + __PointerAdjustment)); } public ClassLayout(CppSharp.Parser.AST.ClassLayout _0) { __Instance = Marshal.AllocHGlobal(88); __ownsNativeInstance = true; - var arg0 = ReferenceEquals(_0, null) ? global::System.IntPtr.Zero : _0.__Instance; - Internal.cctor_2(__Instance, arg0); NativeToManagedMap[__Instance] = this; + var arg0 = ReferenceEquals(_0, null) ? global::System.IntPtr.Zero : _0.__Instance; + Internal.cctor_2((__Instance + __PointerAdjustment), arg0); } public void Dispose() @@ -3111,33 +3222,34 @@ namespace CppSharp throw new global::System.InvalidOperationException("Managed instances owned by native code cannot be disposed of."); CppSharp.Parser.AST.ClassLayout __dummy; NativeToManagedMap.TryRemove(__Instance, out __dummy); - Internal.dtor_0(__Instance); - Marshal.FreeHGlobal(__Instance); + Internal.dtor_0((__Instance + __PointerAdjustment)); + if (__ownsNativeInstance) + Marshal.FreeHGlobal(__Instance); } public CppSharp.Parser.AST.VFTableInfo getVFTables(uint i) { var __ret = new CppSharp.Parser.AST.VFTableInfo.Internal(); - Internal.getVFTables_0(new IntPtr(&__ret), __Instance, i); + Internal.getVFTables_0(new IntPtr(&__ret), (__Instance + __PointerAdjustment), i); return CppSharp.Parser.AST.VFTableInfo.__CreateInstance(__ret); } public void addVFTables(CppSharp.Parser.AST.VFTableInfo s) { var arg0 = ReferenceEquals(s, null) ? global::System.IntPtr.Zero : s.__Instance; - Internal.addVFTables_0(__Instance, arg0); + Internal.addVFTables_0((__Instance + __PointerAdjustment), arg0); } public void clearVFTables() { - Internal.clearVFTables_0(__Instance); + Internal.clearVFTables_0((__Instance + __PointerAdjustment)); } public uint VFTablesCount { get { - var __ret = Internal.getVFTablesCount_0(__Instance); + var __ret = Internal.getVFTablesCount_0((__Instance + __PointerAdjustment)); return __ret; } } @@ -3332,19 +3444,21 @@ namespace CppSharp } public global::System.IntPtr __Instance { get; protected set; } + + protected int __PointerAdjustment; public static readonly System.Collections.Concurrent.ConcurrentDictionary NativeToManagedMap = new System.Collections.Concurrent.ConcurrentDictionary(); protected void*[] __OriginalVTables; protected bool __ownsNativeInstance; - public static Declaration __CreateInstance(global::System.IntPtr native, bool ownsNativeInstance = false) + public static Declaration __CreateInstance(global::System.IntPtr native, bool ownsNativeInstance = false, bool skipVTables = false) { - return new Declaration((Declaration.Internal*) native) { __ownsNativeInstance = ownsNativeInstance }; + return new Declaration((Declaration.Internal*) native, skipVTables) { __ownsNativeInstance = ownsNativeInstance }; } - public static Declaration __CreateInstance(Declaration.Internal native) + public static Declaration __CreateInstance(Declaration.Internal native, bool skipVTables = false) { - return new Declaration(native); + return new Declaration(native, skipVTables); } private static Declaration.Internal* __CopyValue(Declaration.Internal native) @@ -3354,15 +3468,17 @@ namespace CppSharp return (Declaration.Internal*) ret; } - private Declaration(Declaration.Internal native) - : this(__CopyValue(native)) + private Declaration(Declaration.Internal native, bool skipVTables = false) + : this(__CopyValue(native), skipVTables) { __ownsNativeInstance = true; NativeToManagedMap[__Instance] = this; } - protected Declaration(Declaration.Internal* native, bool isInternalImpl = false) + protected Declaration(Declaration.Internal* native, bool skipVTables = false) { + if (native == null) + return; __Instance = new global::System.IntPtr(native); } @@ -3370,18 +3486,18 @@ namespace CppSharp { __Instance = Marshal.AllocHGlobal(168); __ownsNativeInstance = true; - var arg0 = kind; - Internal.ctor_0(__Instance, arg0); NativeToManagedMap[__Instance] = this; + var arg0 = kind; + Internal.ctor_0((__Instance + __PointerAdjustment), arg0); } public Declaration(CppSharp.Parser.AST.Declaration _0) { __Instance = Marshal.AllocHGlobal(168); __ownsNativeInstance = true; - var arg0 = ReferenceEquals(_0, null) ? global::System.IntPtr.Zero : _0.__Instance; - Internal.cctor_1(__Instance, arg0); NativeToManagedMap[__Instance] = this; + var arg0 = ReferenceEquals(_0, null) ? global::System.IntPtr.Zero : _0.__Instance; + Internal.cctor_1((__Instance + __PointerAdjustment), arg0); } public void Dispose() @@ -3395,13 +3511,14 @@ namespace CppSharp throw new global::System.InvalidOperationException("Managed instances owned by native code cannot be disposed of."); CppSharp.Parser.AST.Declaration __dummy; NativeToManagedMap.TryRemove(__Instance, out __dummy); - Internal.dtor_0(__Instance); - Marshal.FreeHGlobal(__Instance); + Internal.dtor_0((__Instance + __PointerAdjustment)); + if (__ownsNativeInstance) + Marshal.FreeHGlobal(__Instance); } public CppSharp.Parser.AST.PreprocessedEntity getPreprocessedEntities(uint i) { - var __ret = Internal.getPreprocessedEntities_0(__Instance, i); + var __ret = Internal.getPreprocessedEntities_0((__Instance + __PointerAdjustment), i); CppSharp.Parser.AST.PreprocessedEntity __result0; if (__ret == IntPtr.Zero) __result0 = null; else if (CppSharp.Parser.AST.PreprocessedEntity.NativeToManagedMap.ContainsKey(__ret)) @@ -3413,26 +3530,26 @@ namespace CppSharp public void addPreprocessedEntities(CppSharp.Parser.AST.PreprocessedEntity s) { var arg0 = ReferenceEquals(s, null) ? global::System.IntPtr.Zero : s.__Instance; - Internal.addPreprocessedEntities_0(__Instance, arg0); + Internal.addPreprocessedEntities_0((__Instance + __PointerAdjustment), arg0); } public void clearPreprocessedEntities() { - Internal.clearPreprocessedEntities_0(__Instance); + Internal.clearPreprocessedEntities_0((__Instance + __PointerAdjustment)); } public string Name { get { - var __ret = Internal.getName_0(__Instance); + var __ret = Internal.getName_0((__Instance + __PointerAdjustment)); return Marshal.PtrToStringAnsi(__ret); } set { var arg0 = Marshal.StringToHGlobalAnsi(value); - Internal.setName_0(__Instance, arg0); + Internal.setName_0((__Instance + __PointerAdjustment), arg0); Marshal.FreeHGlobal(arg0); } } @@ -3441,14 +3558,14 @@ namespace CppSharp { get { - var __ret = Internal.getDebugText_0(__Instance); + var __ret = Internal.getDebugText_0((__Instance + __PointerAdjustment)); return Marshal.PtrToStringAnsi(__ret); } set { var arg0 = Marshal.StringToHGlobalAnsi(value); - Internal.setDebugText_0(__Instance, arg0); + Internal.setDebugText_0((__Instance + __PointerAdjustment), arg0); Marshal.FreeHGlobal(arg0); } } @@ -3457,7 +3574,7 @@ namespace CppSharp { get { - var __ret = Internal.getPreprocessedEntitiesCount_0(__Instance); + var __ret = Internal.getPreprocessedEntitiesCount_0((__Instance + __PointerAdjustment)); return __ret; } } @@ -3854,14 +3971,14 @@ namespace CppSharp internal static extern uint getFriendsCount_0(global::System.IntPtr instance); } - public static new DeclarationContext __CreateInstance(global::System.IntPtr native, bool ownsNativeInstance = false) + public static new DeclarationContext __CreateInstance(global::System.IntPtr native, bool ownsNativeInstance = false, bool skipVTables = false) { - return new DeclarationContext((DeclarationContext.Internal*) native) { __ownsNativeInstance = ownsNativeInstance }; + return new DeclarationContext((DeclarationContext.Internal*) native, skipVTables) { __ownsNativeInstance = ownsNativeInstance }; } - public static DeclarationContext __CreateInstance(DeclarationContext.Internal native) + public static DeclarationContext __CreateInstance(DeclarationContext.Internal native, bool skipVTables = false) { - return new DeclarationContext(native); + return new DeclarationContext(native, skipVTables); } private static DeclarationContext.Internal* __CopyValue(DeclarationContext.Internal native) @@ -3871,16 +3988,20 @@ namespace CppSharp return (DeclarationContext.Internal*) ret; } - private DeclarationContext(DeclarationContext.Internal native) - : this(__CopyValue(native)) + private DeclarationContext(DeclarationContext.Internal native, bool skipVTables = false) + : this(__CopyValue(native), skipVTables) { __ownsNativeInstance = true; NativeToManagedMap[__Instance] = this; } - protected DeclarationContext(DeclarationContext.Internal* native, bool isInternalImpl = false) - : base((CppSharp.Parser.AST.Declaration.Internal*) native) + protected DeclarationContext(DeclarationContext.Internal* native, bool skipVTables = false) + : base((CppSharp.Parser.AST.Declaration.Internal*) null) { + __PointerAdjustment = 0; + if (native == null) + return; + __Instance = new global::System.IntPtr(native); } public DeclarationContext(CppSharp.Parser.AST.DeclarationKind kind) @@ -3888,9 +4009,9 @@ namespace CppSharp { __Instance = Marshal.AllocHGlobal(392); __ownsNativeInstance = true; - var arg0 = kind; - Internal.ctor_0(__Instance, arg0); NativeToManagedMap[__Instance] = this; + var arg0 = kind; + Internal.ctor_0((__Instance + __PointerAdjustment), arg0); } public DeclarationContext(CppSharp.Parser.AST.DeclarationContext _0) @@ -3898,14 +4019,14 @@ namespace CppSharp { __Instance = Marshal.AllocHGlobal(392); __ownsNativeInstance = true; - var arg0 = ReferenceEquals(_0, null) ? global::System.IntPtr.Zero : _0.__Instance; - Internal.cctor_2(__Instance, arg0); NativeToManagedMap[__Instance] = this; + var arg0 = ReferenceEquals(_0, null) ? global::System.IntPtr.Zero : _0.__Instance; + Internal.cctor_2((__Instance + __PointerAdjustment), arg0); } public CppSharp.Parser.AST.Namespace getNamespaces(uint i) { - var __ret = Internal.getNamespaces_0(__Instance, i); + var __ret = Internal.getNamespaces_0((__Instance + __PointerAdjustment), i); CppSharp.Parser.AST.Namespace __result0; if (__ret == IntPtr.Zero) __result0 = null; else if (CppSharp.Parser.AST.Namespace.NativeToManagedMap.ContainsKey(__ret)) @@ -3917,17 +4038,17 @@ namespace CppSharp public void addNamespaces(CppSharp.Parser.AST.Namespace s) { var arg0 = ReferenceEquals(s, null) ? global::System.IntPtr.Zero : s.__Instance; - Internal.addNamespaces_0(__Instance, arg0); + Internal.addNamespaces_0((__Instance + __PointerAdjustment), arg0); } public void clearNamespaces() { - Internal.clearNamespaces_0(__Instance); + Internal.clearNamespaces_0((__Instance + __PointerAdjustment)); } public CppSharp.Parser.AST.Enumeration getEnums(uint i) { - var __ret = Internal.getEnums_0(__Instance, i); + var __ret = Internal.getEnums_0((__Instance + __PointerAdjustment), i); CppSharp.Parser.AST.Enumeration __result0; if (__ret == IntPtr.Zero) __result0 = null; else if (CppSharp.Parser.AST.Enumeration.NativeToManagedMap.ContainsKey(__ret)) @@ -3939,17 +4060,17 @@ namespace CppSharp public void addEnums(CppSharp.Parser.AST.Enumeration s) { var arg0 = ReferenceEquals(s, null) ? global::System.IntPtr.Zero : s.__Instance; - Internal.addEnums_0(__Instance, arg0); + Internal.addEnums_0((__Instance + __PointerAdjustment), arg0); } public void clearEnums() { - Internal.clearEnums_0(__Instance); + Internal.clearEnums_0((__Instance + __PointerAdjustment)); } public CppSharp.Parser.AST.Function getFunctions(uint i) { - var __ret = Internal.getFunctions_0(__Instance, i); + var __ret = Internal.getFunctions_0((__Instance + __PointerAdjustment), i); CppSharp.Parser.AST.Function __result0; if (__ret == IntPtr.Zero) __result0 = null; else if (CppSharp.Parser.AST.Function.NativeToManagedMap.ContainsKey(__ret)) @@ -3961,17 +4082,17 @@ namespace CppSharp public void addFunctions(CppSharp.Parser.AST.Function s) { var arg0 = ReferenceEquals(s, null) ? global::System.IntPtr.Zero : s.__Instance; - Internal.addFunctions_0(__Instance, arg0); + Internal.addFunctions_0((__Instance + __PointerAdjustment), arg0); } public void clearFunctions() { - Internal.clearFunctions_0(__Instance); + Internal.clearFunctions_0((__Instance + __PointerAdjustment)); } public CppSharp.Parser.AST.Class getClasses(uint i) { - var __ret = Internal.getClasses_0(__Instance, i); + var __ret = Internal.getClasses_0((__Instance + __PointerAdjustment), i); CppSharp.Parser.AST.Class __result0; if (__ret == IntPtr.Zero) __result0 = null; else if (CppSharp.Parser.AST.Class.NativeToManagedMap.ContainsKey(__ret)) @@ -3983,17 +4104,17 @@ namespace CppSharp public void addClasses(CppSharp.Parser.AST.Class s) { var arg0 = ReferenceEquals(s, null) ? global::System.IntPtr.Zero : s.__Instance; - Internal.addClasses_0(__Instance, arg0); + Internal.addClasses_0((__Instance + __PointerAdjustment), arg0); } public void clearClasses() { - Internal.clearClasses_0(__Instance); + Internal.clearClasses_0((__Instance + __PointerAdjustment)); } public CppSharp.Parser.AST.Template getTemplates(uint i) { - var __ret = Internal.getTemplates_0(__Instance, i); + var __ret = Internal.getTemplates_0((__Instance + __PointerAdjustment), i); CppSharp.Parser.AST.Template __result0; if (__ret == IntPtr.Zero) __result0 = null; else if (CppSharp.Parser.AST.Template.NativeToManagedMap.ContainsKey(__ret)) @@ -4005,17 +4126,17 @@ namespace CppSharp public void addTemplates(CppSharp.Parser.AST.Template s) { var arg0 = ReferenceEquals(s, null) ? global::System.IntPtr.Zero : s.__Instance; - Internal.addTemplates_0(__Instance, arg0); + Internal.addTemplates_0((__Instance + __PointerAdjustment), arg0); } public void clearTemplates() { - Internal.clearTemplates_0(__Instance); + Internal.clearTemplates_0((__Instance + __PointerAdjustment)); } public CppSharp.Parser.AST.TypedefDecl getTypedefs(uint i) { - var __ret = Internal.getTypedefs_0(__Instance, i); + var __ret = Internal.getTypedefs_0((__Instance + __PointerAdjustment), i); CppSharp.Parser.AST.TypedefDecl __result0; if (__ret == IntPtr.Zero) __result0 = null; else if (CppSharp.Parser.AST.TypedefDecl.NativeToManagedMap.ContainsKey(__ret)) @@ -4027,17 +4148,17 @@ namespace CppSharp public void addTypedefs(CppSharp.Parser.AST.TypedefDecl s) { var arg0 = ReferenceEquals(s, null) ? global::System.IntPtr.Zero : s.__Instance; - Internal.addTypedefs_0(__Instance, arg0); + Internal.addTypedefs_0((__Instance + __PointerAdjustment), arg0); } public void clearTypedefs() { - Internal.clearTypedefs_0(__Instance); + Internal.clearTypedefs_0((__Instance + __PointerAdjustment)); } public CppSharp.Parser.AST.Variable getVariables(uint i) { - var __ret = Internal.getVariables_0(__Instance, i); + var __ret = Internal.getVariables_0((__Instance + __PointerAdjustment), i); CppSharp.Parser.AST.Variable __result0; if (__ret == IntPtr.Zero) __result0 = null; else if (CppSharp.Parser.AST.Variable.NativeToManagedMap.ContainsKey(__ret)) @@ -4049,17 +4170,17 @@ namespace CppSharp public void addVariables(CppSharp.Parser.AST.Variable s) { var arg0 = ReferenceEquals(s, null) ? global::System.IntPtr.Zero : s.__Instance; - Internal.addVariables_0(__Instance, arg0); + Internal.addVariables_0((__Instance + __PointerAdjustment), arg0); } public void clearVariables() { - Internal.clearVariables_0(__Instance); + Internal.clearVariables_0((__Instance + __PointerAdjustment)); } public CppSharp.Parser.AST.Friend getFriends(uint i) { - var __ret = Internal.getFriends_0(__Instance, i); + var __ret = Internal.getFriends_0((__Instance + __PointerAdjustment), i); CppSharp.Parser.AST.Friend __result0; if (__ret == IntPtr.Zero) __result0 = null; else if (CppSharp.Parser.AST.Friend.NativeToManagedMap.ContainsKey(__ret)) @@ -4071,19 +4192,19 @@ namespace CppSharp public void addFriends(CppSharp.Parser.AST.Friend s) { var arg0 = ReferenceEquals(s, null) ? global::System.IntPtr.Zero : s.__Instance; - Internal.addFriends_0(__Instance, arg0); + Internal.addFriends_0((__Instance + __PointerAdjustment), arg0); } public void clearFriends() { - Internal.clearFriends_0(__Instance); + Internal.clearFriends_0((__Instance + __PointerAdjustment)); } public uint NamespacesCount { get { - var __ret = Internal.getNamespacesCount_0(__Instance); + var __ret = Internal.getNamespacesCount_0((__Instance + __PointerAdjustment)); return __ret; } } @@ -4092,7 +4213,7 @@ namespace CppSharp { get { - var __ret = Internal.getEnumsCount_0(__Instance); + var __ret = Internal.getEnumsCount_0((__Instance + __PointerAdjustment)); return __ret; } } @@ -4101,7 +4222,7 @@ namespace CppSharp { get { - var __ret = Internal.getFunctionsCount_0(__Instance); + var __ret = Internal.getFunctionsCount_0((__Instance + __PointerAdjustment)); return __ret; } } @@ -4110,7 +4231,7 @@ namespace CppSharp { get { - var __ret = Internal.getClassesCount_0(__Instance); + var __ret = Internal.getClassesCount_0((__Instance + __PointerAdjustment)); return __ret; } } @@ -4119,7 +4240,7 @@ namespace CppSharp { get { - var __ret = Internal.getTemplatesCount_0(__Instance); + var __ret = Internal.getTemplatesCount_0((__Instance + __PointerAdjustment)); return __ret; } } @@ -4128,7 +4249,7 @@ namespace CppSharp { get { - var __ret = Internal.getTypedefsCount_0(__Instance); + var __ret = Internal.getTypedefsCount_0((__Instance + __PointerAdjustment)); return __ret; } } @@ -4137,7 +4258,7 @@ namespace CppSharp { get { - var __ret = Internal.getVariablesCount_0(__Instance); + var __ret = Internal.getVariablesCount_0((__Instance + __PointerAdjustment)); return __ret; } } @@ -4146,7 +4267,7 @@ namespace CppSharp { get { - var __ret = Internal.getFriendsCount_0(__Instance); + var __ret = Internal.getFriendsCount_0((__Instance + __PointerAdjustment)); return __ret; } } @@ -4225,14 +4346,14 @@ namespace CppSharp internal static extern void dtor_0(global::System.IntPtr instance); } - public static new TypedefDecl __CreateInstance(global::System.IntPtr native, bool ownsNativeInstance = false) + public static new TypedefDecl __CreateInstance(global::System.IntPtr native, bool ownsNativeInstance = false, bool skipVTables = false) { - return new TypedefDecl((TypedefDecl.Internal*) native) { __ownsNativeInstance = ownsNativeInstance }; + return new TypedefDecl((TypedefDecl.Internal*) native, skipVTables) { __ownsNativeInstance = ownsNativeInstance }; } - public static TypedefDecl __CreateInstance(TypedefDecl.Internal native) + public static TypedefDecl __CreateInstance(TypedefDecl.Internal native, bool skipVTables = false) { - return new TypedefDecl(native); + return new TypedefDecl(native, skipVTables); } private static TypedefDecl.Internal* __CopyValue(TypedefDecl.Internal native) @@ -4242,16 +4363,20 @@ namespace CppSharp return (TypedefDecl.Internal*) ret; } - private TypedefDecl(TypedefDecl.Internal native) - : this(__CopyValue(native)) + private TypedefDecl(TypedefDecl.Internal native, bool skipVTables = false) + : this(__CopyValue(native), skipVTables) { __ownsNativeInstance = true; NativeToManagedMap[__Instance] = this; } - protected TypedefDecl(TypedefDecl.Internal* native, bool isInternalImpl = false) - : base((CppSharp.Parser.AST.Declaration.Internal*) native) + protected TypedefDecl(TypedefDecl.Internal* native, bool skipVTables = false) + : base((CppSharp.Parser.AST.Declaration.Internal*) null) { + __PointerAdjustment = 0; + if (native == null) + return; + __Instance = new global::System.IntPtr(native); } public TypedefDecl() @@ -4259,8 +4384,8 @@ namespace CppSharp { __Instance = Marshal.AllocHGlobal(184); __ownsNativeInstance = true; - Internal.ctor_0(__Instance); NativeToManagedMap[__Instance] = this; + Internal.ctor_0((__Instance + __PointerAdjustment)); } public TypedefDecl(CppSharp.Parser.AST.TypedefDecl _0) @@ -4268,9 +4393,9 @@ namespace CppSharp { __Instance = Marshal.AllocHGlobal(184); __ownsNativeInstance = true; - var arg0 = ReferenceEquals(_0, null) ? global::System.IntPtr.Zero : _0.__Instance; - Internal.cctor_2(__Instance, arg0); NativeToManagedMap[__Instance] = this; + var arg0 = ReferenceEquals(_0, null) ? global::System.IntPtr.Zero : _0.__Instance; + Internal.cctor_2((__Instance + __PointerAdjustment), arg0); } public CppSharp.Parser.AST.QualifiedType QualifiedType @@ -4347,14 +4472,14 @@ namespace CppSharp internal static extern void dtor_0(global::System.IntPtr instance); } - public static new Friend __CreateInstance(global::System.IntPtr native, bool ownsNativeInstance = false) + public static new Friend __CreateInstance(global::System.IntPtr native, bool ownsNativeInstance = false, bool skipVTables = false) { - return new Friend((Friend.Internal*) native) { __ownsNativeInstance = ownsNativeInstance }; + return new Friend((Friend.Internal*) native, skipVTables) { __ownsNativeInstance = ownsNativeInstance }; } - public static Friend __CreateInstance(Friend.Internal native) + public static Friend __CreateInstance(Friend.Internal native, bool skipVTables = false) { - return new Friend(native); + return new Friend(native, skipVTables); } private static Friend.Internal* __CopyValue(Friend.Internal native) @@ -4364,16 +4489,20 @@ namespace CppSharp return (Friend.Internal*) ret; } - private Friend(Friend.Internal native) - : this(__CopyValue(native)) + private Friend(Friend.Internal native, bool skipVTables = false) + : this(__CopyValue(native), skipVTables) { __ownsNativeInstance = true; NativeToManagedMap[__Instance] = this; } - protected Friend(Friend.Internal* native, bool isInternalImpl = false) - : base((CppSharp.Parser.AST.Declaration.Internal*) native) + protected Friend(Friend.Internal* native, bool skipVTables = false) + : base((CppSharp.Parser.AST.Declaration.Internal*) null) { + __PointerAdjustment = 0; + if (native == null) + return; + __Instance = new global::System.IntPtr(native); } public Friend() @@ -4381,8 +4510,8 @@ namespace CppSharp { __Instance = Marshal.AllocHGlobal(176); __ownsNativeInstance = true; - Internal.ctor_0(__Instance); NativeToManagedMap[__Instance] = this; + Internal.ctor_0((__Instance + __PointerAdjustment)); } public Friend(CppSharp.Parser.AST.Friend _0) @@ -4390,9 +4519,9 @@ namespace CppSharp { __Instance = Marshal.AllocHGlobal(176); __ownsNativeInstance = true; - var arg0 = ReferenceEquals(_0, null) ? global::System.IntPtr.Zero : _0.__Instance; - Internal.cctor_2(__Instance, arg0); NativeToManagedMap[__Instance] = this; + var arg0 = ReferenceEquals(_0, null) ? global::System.IntPtr.Zero : _0.__Instance; + Internal.cctor_2((__Instance + __PointerAdjustment), arg0); } public CppSharp.Parser.AST.Declaration Declaration @@ -4447,19 +4576,21 @@ namespace CppSharp } public global::System.IntPtr __Instance { get; protected set; } + + protected int __PointerAdjustment; public static readonly System.Collections.Concurrent.ConcurrentDictionary NativeToManagedMap = new System.Collections.Concurrent.ConcurrentDictionary(); protected void*[] __OriginalVTables; protected bool __ownsNativeInstance; - public static Statement __CreateInstance(global::System.IntPtr native, bool ownsNativeInstance = false) + public static Statement __CreateInstance(global::System.IntPtr native, bool ownsNativeInstance = false, bool skipVTables = false) { - return new Statement((Statement.Internal*) native) { __ownsNativeInstance = ownsNativeInstance }; + return new Statement((Statement.Internal*) native, skipVTables) { __ownsNativeInstance = ownsNativeInstance }; } - public static Statement __CreateInstance(Statement.Internal native) + public static Statement __CreateInstance(Statement.Internal native, bool skipVTables = false) { - return new Statement(native); + return new Statement(native, skipVTables); } private static Statement.Internal* __CopyValue(Statement.Internal native) @@ -4469,15 +4600,17 @@ namespace CppSharp return (Statement.Internal*) ret; } - private Statement(Statement.Internal native) - : this(__CopyValue(native)) + private Statement(Statement.Internal native, bool skipVTables = false) + : this(__CopyValue(native), skipVTables) { __ownsNativeInstance = true; NativeToManagedMap[__Instance] = this; } - protected Statement(Statement.Internal* native, bool isInternalImpl = false) + protected Statement(Statement.Internal* native, bool skipVTables = false) { + if (native == null) + return; __Instance = new global::System.IntPtr(native); } @@ -4485,9 +4618,9 @@ namespace CppSharp { __Instance = Marshal.AllocHGlobal(40); __ownsNativeInstance = true; - var arg0 = ReferenceEquals(_0, null) ? global::System.IntPtr.Zero : _0.__Instance; - Internal.cctor_2(__Instance, arg0); NativeToManagedMap[__Instance] = this; + var arg0 = ReferenceEquals(_0, null) ? global::System.IntPtr.Zero : _0.__Instance; + Internal.cctor_2((__Instance + __PointerAdjustment), arg0); } public void Dispose() @@ -4501,22 +4634,23 @@ namespace CppSharp throw new global::System.InvalidOperationException("Managed instances owned by native code cannot be disposed of."); CppSharp.Parser.AST.Statement __dummy; NativeToManagedMap.TryRemove(__Instance, out __dummy); - Internal.dtor_0(__Instance); - Marshal.FreeHGlobal(__Instance); + Internal.dtor_0((__Instance + __PointerAdjustment)); + if (__ownsNativeInstance) + Marshal.FreeHGlobal(__Instance); } public string String { get { - var __ret = Internal.getString_0(__Instance); + var __ret = Internal.getString_0((__Instance + __PointerAdjustment)); return Marshal.PtrToStringAnsi(__ret); } set { var arg0 = Marshal.StringToHGlobalAnsi(value); - Internal.setString_0(__Instance, arg0); + Internal.setString_0((__Instance + __PointerAdjustment), arg0); Marshal.FreeHGlobal(arg0); } } @@ -4575,14 +4709,14 @@ namespace CppSharp internal static extern void dtor_0(global::System.IntPtr instance); } - public static new Expression __CreateInstance(global::System.IntPtr native, bool ownsNativeInstance = false) + public static new Expression __CreateInstance(global::System.IntPtr native, bool ownsNativeInstance = false, bool skipVTables = false) { - return new Expression((Expression.Internal*) native) { __ownsNativeInstance = ownsNativeInstance }; + return new Expression((Expression.Internal*) native, skipVTables) { __ownsNativeInstance = ownsNativeInstance }; } - public static Expression __CreateInstance(Expression.Internal native) + public static Expression __CreateInstance(Expression.Internal native, bool skipVTables = false) { - return new Expression(native); + return new Expression(native, skipVTables); } private static Expression.Internal* __CopyValue(Expression.Internal native) @@ -4592,16 +4726,20 @@ namespace CppSharp return (Expression.Internal*) ret; } - private Expression(Expression.Internal native) - : this(__CopyValue(native)) + private Expression(Expression.Internal native, bool skipVTables = false) + : this(__CopyValue(native), skipVTables) { __ownsNativeInstance = true; NativeToManagedMap[__Instance] = this; } - protected Expression(Expression.Internal* native, bool isInternalImpl = false) - : base((CppSharp.Parser.AST.Statement.Internal*) native) + protected Expression(Expression.Internal* native, bool skipVTables = false) + : base((CppSharp.Parser.AST.Statement.Internal*) null) { + __PointerAdjustment = 0; + if (native == null) + return; + __Instance = new global::System.IntPtr(native); } public Expression(CppSharp.Parser.AST.Expression _0) @@ -4609,9 +4747,9 @@ namespace CppSharp { __Instance = Marshal.AllocHGlobal(40); __ownsNativeInstance = true; - var arg0 = ReferenceEquals(_0, null) ? global::System.IntPtr.Zero : _0.__Instance; - Internal.cctor_1(__Instance, arg0); NativeToManagedMap[__Instance] = this; + var arg0 = ReferenceEquals(_0, null) ? global::System.IntPtr.Zero : _0.__Instance; + Internal.cctor_1((__Instance + __PointerAdjustment), arg0); } } @@ -4653,14 +4791,14 @@ namespace CppSharp internal static extern void setOpcodeStr_0(global::System.IntPtr instance, global::System.IntPtr s); } - public static new BinaryOperator __CreateInstance(global::System.IntPtr native, bool ownsNativeInstance = false) + public static new BinaryOperator __CreateInstance(global::System.IntPtr native, bool ownsNativeInstance = false, bool skipVTables = false) { - return new BinaryOperator((BinaryOperator.Internal*) native) { __ownsNativeInstance = ownsNativeInstance }; + return new BinaryOperator((BinaryOperator.Internal*) native, skipVTables) { __ownsNativeInstance = ownsNativeInstance }; } - public static BinaryOperator __CreateInstance(BinaryOperator.Internal native) + public static BinaryOperator __CreateInstance(BinaryOperator.Internal native, bool skipVTables = false) { - return new BinaryOperator(native); + return new BinaryOperator(native, skipVTables); } private static BinaryOperator.Internal* __CopyValue(BinaryOperator.Internal native) @@ -4670,16 +4808,20 @@ namespace CppSharp return (BinaryOperator.Internal*) ret; } - private BinaryOperator(BinaryOperator.Internal native) - : this(__CopyValue(native)) + private BinaryOperator(BinaryOperator.Internal native, bool skipVTables = false) + : this(__CopyValue(native), skipVTables) { __ownsNativeInstance = true; NativeToManagedMap[__Instance] = this; } - protected BinaryOperator(BinaryOperator.Internal* native, bool isInternalImpl = false) - : base((CppSharp.Parser.AST.Expression.Internal*) native) + protected BinaryOperator(BinaryOperator.Internal* native, bool skipVTables = false) + : base((CppSharp.Parser.AST.Expression.Internal*) null) { + __PointerAdjustment = 0; + if (native == null) + return; + __Instance = new global::System.IntPtr(native); } public BinaryOperator(CppSharp.Parser.AST.BinaryOperator _0) @@ -4687,23 +4829,23 @@ namespace CppSharp { __Instance = Marshal.AllocHGlobal(80); __ownsNativeInstance = true; - var arg0 = ReferenceEquals(_0, null) ? global::System.IntPtr.Zero : _0.__Instance; - Internal.cctor_2(__Instance, arg0); NativeToManagedMap[__Instance] = this; + var arg0 = ReferenceEquals(_0, null) ? global::System.IntPtr.Zero : _0.__Instance; + Internal.cctor_2((__Instance + __PointerAdjustment), arg0); } public string OpcodeStr { get { - var __ret = Internal.getOpcodeStr_0(__Instance); + var __ret = Internal.getOpcodeStr_0((__Instance + __PointerAdjustment)); return Marshal.PtrToStringAnsi(__ret); } set { var arg0 = Marshal.StringToHGlobalAnsi(value); - Internal.setOpcodeStr_0(__Instance, arg0); + Internal.setOpcodeStr_0((__Instance + __PointerAdjustment), arg0); Marshal.FreeHGlobal(arg0); } } @@ -4787,14 +4929,14 @@ namespace CppSharp internal static extern uint getArgumentsCount_0(global::System.IntPtr instance); } - public static new CXXConstructExpr __CreateInstance(global::System.IntPtr native, bool ownsNativeInstance = false) + public static new CXXConstructExpr __CreateInstance(global::System.IntPtr native, bool ownsNativeInstance = false, bool skipVTables = false) { - return new CXXConstructExpr((CXXConstructExpr.Internal*) native) { __ownsNativeInstance = ownsNativeInstance }; + return new CXXConstructExpr((CXXConstructExpr.Internal*) native, skipVTables) { __ownsNativeInstance = ownsNativeInstance }; } - public static CXXConstructExpr __CreateInstance(CXXConstructExpr.Internal native) + public static CXXConstructExpr __CreateInstance(CXXConstructExpr.Internal native, bool skipVTables = false) { - return new CXXConstructExpr(native); + return new CXXConstructExpr(native, skipVTables); } private static CXXConstructExpr.Internal* __CopyValue(CXXConstructExpr.Internal native) @@ -4804,16 +4946,20 @@ namespace CppSharp return (CXXConstructExpr.Internal*) ret; } - private CXXConstructExpr(CXXConstructExpr.Internal native) - : this(__CopyValue(native)) + private CXXConstructExpr(CXXConstructExpr.Internal native, bool skipVTables = false) + : this(__CopyValue(native), skipVTables) { __ownsNativeInstance = true; NativeToManagedMap[__Instance] = this; } - protected CXXConstructExpr(CXXConstructExpr.Internal* native, bool isInternalImpl = false) - : base((CppSharp.Parser.AST.Expression.Internal*) native) + protected CXXConstructExpr(CXXConstructExpr.Internal* native, bool skipVTables = false) + : base((CppSharp.Parser.AST.Expression.Internal*) null) { + __PointerAdjustment = 0; + if (native == null) + return; + __Instance = new global::System.IntPtr(native); } public CXXConstructExpr(CppSharp.Parser.AST.CXXConstructExpr _0) @@ -4821,14 +4967,14 @@ namespace CppSharp { __Instance = Marshal.AllocHGlobal(64); __ownsNativeInstance = true; - var arg0 = ReferenceEquals(_0, null) ? global::System.IntPtr.Zero : _0.__Instance; - Internal.cctor_2(__Instance, arg0); NativeToManagedMap[__Instance] = this; + var arg0 = ReferenceEquals(_0, null) ? global::System.IntPtr.Zero : _0.__Instance; + Internal.cctor_2((__Instance + __PointerAdjustment), arg0); } public CppSharp.Parser.AST.Expression getArguments(uint i) { - var __ret = Internal.getArguments_0(__Instance, i); + var __ret = Internal.getArguments_0((__Instance + __PointerAdjustment), i); CppSharp.Parser.AST.Expression __result0; if (__ret == IntPtr.Zero) __result0 = null; else if (CppSharp.Parser.AST.Expression.NativeToManagedMap.ContainsKey(__ret)) @@ -4840,19 +4986,19 @@ namespace CppSharp public void addArguments(CppSharp.Parser.AST.Expression s) { var arg0 = ReferenceEquals(s, null) ? global::System.IntPtr.Zero : s.__Instance; - Internal.addArguments_0(__Instance, arg0); + Internal.addArguments_0((__Instance + __PointerAdjustment), arg0); } public void clearArguments() { - Internal.clearArguments_0(__Instance); + Internal.clearArguments_0((__Instance + __PointerAdjustment)); } public uint ArgumentsCount { get { - var __ret = Internal.getArgumentsCount_0(__Instance); + var __ret = Internal.getArgumentsCount_0((__Instance + __PointerAdjustment)); return __ret; } } @@ -4930,14 +5076,14 @@ namespace CppSharp internal static extern void dtor_0(global::System.IntPtr instance); } - public static new Parameter __CreateInstance(global::System.IntPtr native, bool ownsNativeInstance = false) + public static new Parameter __CreateInstance(global::System.IntPtr native, bool ownsNativeInstance = false, bool skipVTables = false) { - return new Parameter((Parameter.Internal*) native) { __ownsNativeInstance = ownsNativeInstance }; + return new Parameter((Parameter.Internal*) native, skipVTables) { __ownsNativeInstance = ownsNativeInstance }; } - public static Parameter __CreateInstance(Parameter.Internal native) + public static Parameter __CreateInstance(Parameter.Internal native, bool skipVTables = false) { - return new Parameter(native); + return new Parameter(native, skipVTables); } private static Parameter.Internal* __CopyValue(Parameter.Internal native) @@ -4947,16 +5093,20 @@ namespace CppSharp return (Parameter.Internal*) ret; } - private Parameter(Parameter.Internal native) - : this(__CopyValue(native)) + private Parameter(Parameter.Internal native, bool skipVTables = false) + : this(__CopyValue(native), skipVTables) { __ownsNativeInstance = true; NativeToManagedMap[__Instance] = this; } - protected Parameter(Parameter.Internal* native, bool isInternalImpl = false) - : base((CppSharp.Parser.AST.Declaration.Internal*) native) + protected Parameter(Parameter.Internal* native, bool skipVTables = false) + : base((CppSharp.Parser.AST.Declaration.Internal*) null) { + __PointerAdjustment = 0; + if (native == null) + return; + __Instance = new global::System.IntPtr(native); } public Parameter() @@ -4964,8 +5114,8 @@ namespace CppSharp { __Instance = Marshal.AllocHGlobal(200); __ownsNativeInstance = true; - Internal.ctor_0(__Instance); NativeToManagedMap[__Instance] = this; + Internal.ctor_0((__Instance + __PointerAdjustment)); } public Parameter(CppSharp.Parser.AST.Parameter _0) @@ -4973,9 +5123,9 @@ namespace CppSharp { __Instance = Marshal.AllocHGlobal(200); __ownsNativeInstance = true; - var arg0 = ReferenceEquals(_0, null) ? global::System.IntPtr.Zero : _0.__Instance; - Internal.cctor_1(__Instance, arg0); NativeToManagedMap[__Instance] = this; + var arg0 = ReferenceEquals(_0, null) ? global::System.IntPtr.Zero : _0.__Instance; + Internal.cctor_1((__Instance + __PointerAdjustment), arg0); } public CppSharp.Parser.AST.QualifiedType QualifiedType @@ -5176,14 +5326,14 @@ namespace CppSharp internal static extern uint getParametersCount_0(global::System.IntPtr instance); } - public static new Function __CreateInstance(global::System.IntPtr native, bool ownsNativeInstance = false) + public static new Function __CreateInstance(global::System.IntPtr native, bool ownsNativeInstance = false, bool skipVTables = false) { - return new Function((Function.Internal*) native) { __ownsNativeInstance = ownsNativeInstance }; + return new Function((Function.Internal*) native, skipVTables) { __ownsNativeInstance = ownsNativeInstance }; } - public static Function __CreateInstance(Function.Internal native) + public static Function __CreateInstance(Function.Internal native, bool skipVTables = false) { - return new Function(native); + return new Function(native, skipVTables); } private static Function.Internal* __CopyValue(Function.Internal native) @@ -5193,16 +5343,20 @@ namespace CppSharp return (Function.Internal*) ret; } - private Function(Function.Internal native) - : this(__CopyValue(native)) + private Function(Function.Internal native, bool skipVTables = false) + : this(__CopyValue(native), skipVTables) { __ownsNativeInstance = true; NativeToManagedMap[__Instance] = this; } - protected Function(Function.Internal* native, bool isInternalImpl = false) - : base((CppSharp.Parser.AST.Declaration.Internal*) native) + protected Function(Function.Internal* native, bool skipVTables = false) + : base((CppSharp.Parser.AST.Declaration.Internal*) null) { + __PointerAdjustment = 0; + if (native == null) + return; + __Instance = new global::System.IntPtr(native); } public Function() @@ -5210,8 +5364,8 @@ namespace CppSharp { __Instance = Marshal.AllocHGlobal(288); __ownsNativeInstance = true; - Internal.ctor_0(__Instance); NativeToManagedMap[__Instance] = this; + Internal.ctor_0((__Instance + __PointerAdjustment)); } public Function(CppSharp.Parser.AST.Function _0) @@ -5219,14 +5373,14 @@ namespace CppSharp { __Instance = Marshal.AllocHGlobal(288); __ownsNativeInstance = true; - var arg0 = ReferenceEquals(_0, null) ? global::System.IntPtr.Zero : _0.__Instance; - Internal.cctor_2(__Instance, arg0); NativeToManagedMap[__Instance] = this; + var arg0 = ReferenceEquals(_0, null) ? global::System.IntPtr.Zero : _0.__Instance; + Internal.cctor_2((__Instance + __PointerAdjustment), arg0); } public CppSharp.Parser.AST.Parameter getParameters(uint i) { - var __ret = Internal.getParameters_0(__Instance, i); + var __ret = Internal.getParameters_0((__Instance + __PointerAdjustment), i); CppSharp.Parser.AST.Parameter __result0; if (__ret == IntPtr.Zero) __result0 = null; else if (CppSharp.Parser.AST.Parameter.NativeToManagedMap.ContainsKey(__ret)) @@ -5238,26 +5392,26 @@ namespace CppSharp public void addParameters(CppSharp.Parser.AST.Parameter s) { var arg0 = ReferenceEquals(s, null) ? global::System.IntPtr.Zero : s.__Instance; - Internal.addParameters_0(__Instance, arg0); + Internal.addParameters_0((__Instance + __PointerAdjustment), arg0); } public void clearParameters() { - Internal.clearParameters_0(__Instance); + Internal.clearParameters_0((__Instance + __PointerAdjustment)); } public string Mangled { get { - var __ret = Internal.getMangled_0(__Instance); + var __ret = Internal.getMangled_0((__Instance + __PointerAdjustment)); return Marshal.PtrToStringAnsi(__ret); } set { var arg0 = Marshal.StringToHGlobalAnsi(value); - Internal.setMangled_0(__Instance, arg0); + Internal.setMangled_0((__Instance + __PointerAdjustment), arg0); Marshal.FreeHGlobal(arg0); } } @@ -5266,14 +5420,14 @@ namespace CppSharp { get { - var __ret = Internal.getSignature_0(__Instance); + var __ret = Internal.getSignature_0((__Instance + __PointerAdjustment)); return Marshal.PtrToStringAnsi(__ret); } set { var arg0 = Marshal.StringToHGlobalAnsi(value); - Internal.setSignature_0(__Instance, arg0); + Internal.setSignature_0((__Instance + __PointerAdjustment), arg0); Marshal.FreeHGlobal(arg0); } } @@ -5282,7 +5436,7 @@ namespace CppSharp { get { - var __ret = Internal.getParametersCount_0(__Instance); + var __ret = Internal.getParametersCount_0((__Instance + __PointerAdjustment)); return __ret; } } @@ -5546,14 +5700,14 @@ namespace CppSharp internal static extern void dtor_0(global::System.IntPtr instance); } - public static new Method __CreateInstance(global::System.IntPtr native, bool ownsNativeInstance = false) + public static new Method __CreateInstance(global::System.IntPtr native, bool ownsNativeInstance = false, bool skipVTables = false) { - return new Method((Method.Internal*) native) { __ownsNativeInstance = ownsNativeInstance }; + return new Method((Method.Internal*) native, skipVTables) { __ownsNativeInstance = ownsNativeInstance }; } - public static Method __CreateInstance(Method.Internal native) + public static Method __CreateInstance(Method.Internal native, bool skipVTables = false) { - return new Method(native); + return new Method(native, skipVTables); } private static Method.Internal* __CopyValue(Method.Internal native) @@ -5563,16 +5717,20 @@ namespace CppSharp return (Method.Internal*) ret; } - private Method(Method.Internal native) - : this(__CopyValue(native)) + private Method(Method.Internal native, bool skipVTables = false) + : this(__CopyValue(native), skipVTables) { __ownsNativeInstance = true; NativeToManagedMap[__Instance] = this; } - protected Method(Method.Internal* native, bool isInternalImpl = false) - : base((CppSharp.Parser.AST.Function.Internal*) native) + protected Method(Method.Internal* native, bool skipVTables = false) + : base((CppSharp.Parser.AST.Function.Internal*) null) { + __PointerAdjustment = 0; + if (native == null) + return; + __Instance = new global::System.IntPtr(native); } public Method() @@ -5580,8 +5738,8 @@ namespace CppSharp { __Instance = Marshal.AllocHGlobal(328); __ownsNativeInstance = true; - Internal.ctor_0(__Instance); NativeToManagedMap[__Instance] = this; + Internal.ctor_0((__Instance + __PointerAdjustment)); } public Method(CppSharp.Parser.AST.Method _0) @@ -5589,9 +5747,9 @@ namespace CppSharp { __Instance = Marshal.AllocHGlobal(328); __ownsNativeInstance = true; - var arg0 = ReferenceEquals(_0, null) ? global::System.IntPtr.Zero : _0.__Instance; - Internal.cctor_1(__Instance, arg0); NativeToManagedMap[__Instance] = this; + var arg0 = ReferenceEquals(_0, null) ? global::System.IntPtr.Zero : _0.__Instance; + Internal.cctor_1((__Instance + __PointerAdjustment), arg0); } public CppSharp.Parser.AST.AccessSpecifierDecl AccessDecl @@ -5923,14 +6081,14 @@ namespace CppSharp internal static extern void setExpression_0(global::System.IntPtr instance, global::System.IntPtr s); } - public static new Item __CreateInstance(global::System.IntPtr native, bool ownsNativeInstance = false) + public static new Item __CreateInstance(global::System.IntPtr native, bool ownsNativeInstance = false, bool skipVTables = false) { - return new Item((Item.Internal*) native) { __ownsNativeInstance = ownsNativeInstance }; + return new Item((Item.Internal*) native, skipVTables) { __ownsNativeInstance = ownsNativeInstance }; } - public static Item __CreateInstance(Item.Internal native) + public static Item __CreateInstance(Item.Internal native, bool skipVTables = false) { - return new Item(native); + return new Item(native, skipVTables); } private static Item.Internal* __CopyValue(Item.Internal native) @@ -5940,16 +6098,20 @@ namespace CppSharp return (Item.Internal*) ret; } - private Item(Item.Internal native) - : this(__CopyValue(native)) + private Item(Item.Internal native, bool skipVTables = false) + : this(__CopyValue(native), skipVTables) { __ownsNativeInstance = true; NativeToManagedMap[__Instance] = this; } - protected Item(Item.Internal* native, bool isInternalImpl = false) - : base((CppSharp.Parser.AST.Declaration.Internal*) native) + protected Item(Item.Internal* native, bool skipVTables = false) + : base((CppSharp.Parser.AST.Declaration.Internal*) null) { + __PointerAdjustment = 0; + if (native == null) + return; + __Instance = new global::System.IntPtr(native); } public Item() @@ -5957,8 +6119,8 @@ namespace CppSharp { __Instance = Marshal.AllocHGlobal(200); __ownsNativeInstance = true; - Internal.ctor_0(__Instance); NativeToManagedMap[__Instance] = this; + Internal.ctor_0((__Instance + __PointerAdjustment)); } public Item(CppSharp.Parser.AST.Enumeration.Item _0) @@ -5966,23 +6128,23 @@ namespace CppSharp { __Instance = Marshal.AllocHGlobal(200); __ownsNativeInstance = true; - var arg0 = ReferenceEquals(_0, null) ? global::System.IntPtr.Zero : _0.__Instance; - Internal.cctor_1(__Instance, arg0); NativeToManagedMap[__Instance] = this; + var arg0 = ReferenceEquals(_0, null) ? global::System.IntPtr.Zero : _0.__Instance; + Internal.cctor_1((__Instance + __PointerAdjustment), arg0); } public string Expression { get { - var __ret = Internal.getExpression_0(__Instance); + var __ret = Internal.getExpression_0((__Instance + __PointerAdjustment)); return Marshal.PtrToStringAnsi(__ret); } set { var arg0 = Marshal.StringToHGlobalAnsi(value); - Internal.setExpression_0(__Instance, arg0); + Internal.setExpression_0((__Instance + __PointerAdjustment), arg0); Marshal.FreeHGlobal(arg0); } } @@ -6001,14 +6163,14 @@ namespace CppSharp } } - public static new Enumeration __CreateInstance(global::System.IntPtr native, bool ownsNativeInstance = false) + public static new Enumeration __CreateInstance(global::System.IntPtr native, bool ownsNativeInstance = false, bool skipVTables = false) { - return new Enumeration((Enumeration.Internal*) native) { __ownsNativeInstance = ownsNativeInstance }; + return new Enumeration((Enumeration.Internal*) native, skipVTables) { __ownsNativeInstance = ownsNativeInstance }; } - public static Enumeration __CreateInstance(Enumeration.Internal native) + public static Enumeration __CreateInstance(Enumeration.Internal native, bool skipVTables = false) { - return new Enumeration(native); + return new Enumeration(native, skipVTables); } private static Enumeration.Internal* __CopyValue(Enumeration.Internal native) @@ -6018,16 +6180,20 @@ namespace CppSharp return (Enumeration.Internal*) ret; } - private Enumeration(Enumeration.Internal native) - : this(__CopyValue(native)) + private Enumeration(Enumeration.Internal native, bool skipVTables = false) + : this(__CopyValue(native), skipVTables) { __ownsNativeInstance = true; NativeToManagedMap[__Instance] = this; } - protected Enumeration(Enumeration.Internal* native, bool isInternalImpl = false) - : base((CppSharp.Parser.AST.DeclarationContext.Internal*) native) + protected Enumeration(Enumeration.Internal* native, bool skipVTables = false) + : base((CppSharp.Parser.AST.DeclarationContext.Internal*) null) { + __PointerAdjustment = 0; + if (native == null) + return; + __Instance = new global::System.IntPtr(native); } public Enumeration() @@ -6035,8 +6201,8 @@ namespace CppSharp { __Instance = Marshal.AllocHGlobal(432); __ownsNativeInstance = true; - Internal.ctor_0(__Instance); NativeToManagedMap[__Instance] = this; + Internal.ctor_0((__Instance + __PointerAdjustment)); } public Enumeration(CppSharp.Parser.AST.Enumeration _0) @@ -6044,34 +6210,34 @@ namespace CppSharp { __Instance = Marshal.AllocHGlobal(432); __ownsNativeInstance = true; - var arg0 = ReferenceEquals(_0, null) ? global::System.IntPtr.Zero : _0.__Instance; - Internal.cctor_2(__Instance, arg0); NativeToManagedMap[__Instance] = this; + var arg0 = ReferenceEquals(_0, null) ? global::System.IntPtr.Zero : _0.__Instance; + Internal.cctor_2((__Instance + __PointerAdjustment), arg0); } public CppSharp.Parser.AST.Enumeration.Item getItems(uint i) { var __ret = new CppSharp.Parser.AST.Enumeration.Item.Internal(); - Internal.getItems_0(new IntPtr(&__ret), __Instance, i); + Internal.getItems_0(new IntPtr(&__ret), (__Instance + __PointerAdjustment), i); return CppSharp.Parser.AST.Enumeration.Item.__CreateInstance(__ret); } public void addItems(CppSharp.Parser.AST.Enumeration.Item s) { var arg0 = ReferenceEquals(s, null) ? global::System.IntPtr.Zero : s.__Instance; - Internal.addItems_0(__Instance, arg0); + Internal.addItems_0((__Instance + __PointerAdjustment), arg0); } public void clearItems() { - Internal.clearItems_0(__Instance); + Internal.clearItems_0((__Instance + __PointerAdjustment)); } public uint ItemsCount { get { - var __ret = Internal.getItemsCount_0(__Instance); + var __ret = Internal.getItemsCount_0((__Instance + __PointerAdjustment)); return __ret; } } @@ -6196,14 +6362,14 @@ namespace CppSharp internal static extern void setMangled_0(global::System.IntPtr instance, global::System.IntPtr s); } - public static new Variable __CreateInstance(global::System.IntPtr native, bool ownsNativeInstance = false) + public static new Variable __CreateInstance(global::System.IntPtr native, bool ownsNativeInstance = false, bool skipVTables = false) { - return new Variable((Variable.Internal*) native) { __ownsNativeInstance = ownsNativeInstance }; + return new Variable((Variable.Internal*) native, skipVTables) { __ownsNativeInstance = ownsNativeInstance }; } - public static Variable __CreateInstance(Variable.Internal native) + public static Variable __CreateInstance(Variable.Internal native, bool skipVTables = false) { - return new Variable(native); + return new Variable(native, skipVTables); } private static Variable.Internal* __CopyValue(Variable.Internal native) @@ -6213,16 +6379,20 @@ namespace CppSharp return (Variable.Internal*) ret; } - private Variable(Variable.Internal native) - : this(__CopyValue(native)) + private Variable(Variable.Internal native, bool skipVTables = false) + : this(__CopyValue(native), skipVTables) { __ownsNativeInstance = true; NativeToManagedMap[__Instance] = this; } - protected Variable(Variable.Internal* native, bool isInternalImpl = false) - : base((CppSharp.Parser.AST.Declaration.Internal*) native) + protected Variable(Variable.Internal* native, bool skipVTables = false) + : base((CppSharp.Parser.AST.Declaration.Internal*) null) { + __PointerAdjustment = 0; + if (native == null) + return; + __Instance = new global::System.IntPtr(native); } public Variable() @@ -6230,8 +6400,8 @@ namespace CppSharp { __Instance = Marshal.AllocHGlobal(208); __ownsNativeInstance = true; - Internal.ctor_0(__Instance); NativeToManagedMap[__Instance] = this; + Internal.ctor_0((__Instance + __PointerAdjustment)); } public Variable(CppSharp.Parser.AST.Variable _0) @@ -6239,23 +6409,23 @@ namespace CppSharp { __Instance = Marshal.AllocHGlobal(208); __ownsNativeInstance = true; - var arg0 = ReferenceEquals(_0, null) ? global::System.IntPtr.Zero : _0.__Instance; - Internal.cctor_2(__Instance, arg0); NativeToManagedMap[__Instance] = this; + var arg0 = ReferenceEquals(_0, null) ? global::System.IntPtr.Zero : _0.__Instance; + Internal.cctor_2((__Instance + __PointerAdjustment), arg0); } public string Mangled { get { - var __ret = Internal.getMangled_0(__Instance); + var __ret = Internal.getMangled_0((__Instance + __PointerAdjustment)); return Marshal.PtrToStringAnsi(__ret); } set { var arg0 = Marshal.StringToHGlobalAnsi(value); - Internal.setMangled_0(__Instance, arg0); + Internal.setMangled_0((__Instance + __PointerAdjustment), arg0); Marshal.FreeHGlobal(arg0); } } @@ -6303,19 +6473,21 @@ namespace CppSharp } public global::System.IntPtr __Instance { get; protected set; } + + protected int __PointerAdjustment; public static readonly System.Collections.Concurrent.ConcurrentDictionary NativeToManagedMap = new System.Collections.Concurrent.ConcurrentDictionary(); protected void*[] __OriginalVTables; protected bool __ownsNativeInstance; - public static BaseClassSpecifier __CreateInstance(global::System.IntPtr native, bool ownsNativeInstance = false) + public static BaseClassSpecifier __CreateInstance(global::System.IntPtr native, bool ownsNativeInstance = false, bool skipVTables = false) { - return new BaseClassSpecifier((BaseClassSpecifier.Internal*) native) { __ownsNativeInstance = ownsNativeInstance }; + return new BaseClassSpecifier((BaseClassSpecifier.Internal*) native, skipVTables) { __ownsNativeInstance = ownsNativeInstance }; } - public static BaseClassSpecifier __CreateInstance(BaseClassSpecifier.Internal native) + public static BaseClassSpecifier __CreateInstance(BaseClassSpecifier.Internal native, bool skipVTables = false) { - return new BaseClassSpecifier(native); + return new BaseClassSpecifier(native, skipVTables); } private static BaseClassSpecifier.Internal* __CopyValue(BaseClassSpecifier.Internal native) @@ -6325,15 +6497,17 @@ namespace CppSharp return ret; } - private BaseClassSpecifier(BaseClassSpecifier.Internal native) - : this(__CopyValue(native)) + private BaseClassSpecifier(BaseClassSpecifier.Internal native, bool skipVTables = false) + : this(__CopyValue(native), skipVTables) { __ownsNativeInstance = true; NativeToManagedMap[__Instance] = this; } - protected BaseClassSpecifier(BaseClassSpecifier.Internal* native, bool isInternalImpl = false) + protected BaseClassSpecifier(BaseClassSpecifier.Internal* native, bool skipVTables = false) { + if (native == null) + return; __Instance = new global::System.IntPtr(native); } @@ -6341,16 +6515,16 @@ namespace CppSharp { __Instance = Marshal.AllocHGlobal(24); __ownsNativeInstance = true; - Internal.ctor_0(__Instance); NativeToManagedMap[__Instance] = this; + Internal.ctor_0((__Instance + __PointerAdjustment)); } public BaseClassSpecifier(CppSharp.Parser.AST.BaseClassSpecifier _0) { __Instance = Marshal.AllocHGlobal(24); __ownsNativeInstance = true; - *((BaseClassSpecifier.Internal*) __Instance) = *((BaseClassSpecifier.Internal*) _0.__Instance); NativeToManagedMap[__Instance] = this; + *((BaseClassSpecifier.Internal*) __Instance) = *((BaseClassSpecifier.Internal*) _0.__Instance); } public void Dispose() @@ -6364,7 +6538,8 @@ namespace CppSharp throw new global::System.InvalidOperationException("Managed instances owned by native code cannot be disposed of."); CppSharp.Parser.AST.BaseClassSpecifier __dummy; NativeToManagedMap.TryRemove(__Instance, out __dummy); - Marshal.FreeHGlobal(__Instance); + if (__ownsNativeInstance) + Marshal.FreeHGlobal(__Instance); } public CppSharp.Parser.AST.AccessSpecifier Access @@ -6497,14 +6672,14 @@ namespace CppSharp internal static extern void dtor_0(global::System.IntPtr instance); } - public static new Field __CreateInstance(global::System.IntPtr native, bool ownsNativeInstance = false) + public static new Field __CreateInstance(global::System.IntPtr native, bool ownsNativeInstance = false, bool skipVTables = false) { - return new Field((Field.Internal*) native) { __ownsNativeInstance = ownsNativeInstance }; + return new Field((Field.Internal*) native, skipVTables) { __ownsNativeInstance = ownsNativeInstance }; } - public static Field __CreateInstance(Field.Internal native) + public static Field __CreateInstance(Field.Internal native, bool skipVTables = false) { - return new Field(native); + return new Field(native, skipVTables); } private static Field.Internal* __CopyValue(Field.Internal native) @@ -6514,16 +6689,20 @@ namespace CppSharp return (Field.Internal*) ret; } - private Field(Field.Internal native) - : this(__CopyValue(native)) + private Field(Field.Internal native, bool skipVTables = false) + : this(__CopyValue(native), skipVTables) { __ownsNativeInstance = true; NativeToManagedMap[__Instance] = this; } - protected Field(Field.Internal* native, bool isInternalImpl = false) - : base((CppSharp.Parser.AST.Declaration.Internal*) native) + protected Field(Field.Internal* native, bool skipVTables = false) + : base((CppSharp.Parser.AST.Declaration.Internal*) null) { + __PointerAdjustment = 0; + if (native == null) + return; + __Instance = new global::System.IntPtr(native); } public Field() @@ -6531,8 +6710,8 @@ namespace CppSharp { __Instance = Marshal.AllocHGlobal(208); __ownsNativeInstance = true; - Internal.ctor_0(__Instance); NativeToManagedMap[__Instance] = this; + Internal.ctor_0((__Instance + __PointerAdjustment)); } public Field(CppSharp.Parser.AST.Field _0) @@ -6540,9 +6719,9 @@ namespace CppSharp { __Instance = Marshal.AllocHGlobal(208); __ownsNativeInstance = true; - var arg0 = ReferenceEquals(_0, null) ? global::System.IntPtr.Zero : _0.__Instance; - Internal.cctor_2(__Instance, arg0); NativeToManagedMap[__Instance] = this; + var arg0 = ReferenceEquals(_0, null) ? global::System.IntPtr.Zero : _0.__Instance; + Internal.cctor_2((__Instance + __PointerAdjustment), arg0); } public CppSharp.Parser.AST.QualifiedType QualifiedType @@ -6673,14 +6852,14 @@ namespace CppSharp internal static extern void dtor_0(global::System.IntPtr instance); } - public static new AccessSpecifierDecl __CreateInstance(global::System.IntPtr native, bool ownsNativeInstance = false) + public static new AccessSpecifierDecl __CreateInstance(global::System.IntPtr native, bool ownsNativeInstance = false, bool skipVTables = false) { - return new AccessSpecifierDecl((AccessSpecifierDecl.Internal*) native) { __ownsNativeInstance = ownsNativeInstance }; + return new AccessSpecifierDecl((AccessSpecifierDecl.Internal*) native, skipVTables) { __ownsNativeInstance = ownsNativeInstance }; } - public static AccessSpecifierDecl __CreateInstance(AccessSpecifierDecl.Internal native) + public static AccessSpecifierDecl __CreateInstance(AccessSpecifierDecl.Internal native, bool skipVTables = false) { - return new AccessSpecifierDecl(native); + return new AccessSpecifierDecl(native, skipVTables); } private static AccessSpecifierDecl.Internal* __CopyValue(AccessSpecifierDecl.Internal native) @@ -6690,16 +6869,20 @@ namespace CppSharp return (AccessSpecifierDecl.Internal*) ret; } - private AccessSpecifierDecl(AccessSpecifierDecl.Internal native) - : this(__CopyValue(native)) + private AccessSpecifierDecl(AccessSpecifierDecl.Internal native, bool skipVTables = false) + : this(__CopyValue(native), skipVTables) { __ownsNativeInstance = true; NativeToManagedMap[__Instance] = this; } - protected AccessSpecifierDecl(AccessSpecifierDecl.Internal* native, bool isInternalImpl = false) - : base((CppSharp.Parser.AST.Declaration.Internal*) native) + protected AccessSpecifierDecl(AccessSpecifierDecl.Internal* native, bool skipVTables = false) + : base((CppSharp.Parser.AST.Declaration.Internal*) null) { + __PointerAdjustment = 0; + if (native == null) + return; + __Instance = new global::System.IntPtr(native); } public AccessSpecifierDecl() @@ -6707,8 +6890,8 @@ namespace CppSharp { __Instance = Marshal.AllocHGlobal(168); __ownsNativeInstance = true; - Internal.ctor_0(__Instance); NativeToManagedMap[__Instance] = this; + Internal.ctor_0((__Instance + __PointerAdjustment)); } public AccessSpecifierDecl(CppSharp.Parser.AST.AccessSpecifierDecl _0) @@ -6716,9 +6899,9 @@ namespace CppSharp { __Instance = Marshal.AllocHGlobal(168); __ownsNativeInstance = true; - var arg0 = ReferenceEquals(_0, null) ? global::System.IntPtr.Zero : _0.__Instance; - Internal.cctor_2(__Instance, arg0); NativeToManagedMap[__Instance] = this; + var arg0 = ReferenceEquals(_0, null) ? global::System.IntPtr.Zero : _0.__Instance; + Internal.cctor_2((__Instance + __PointerAdjustment), arg0); } } @@ -6892,14 +7075,14 @@ namespace CppSharp internal static extern uint getSpecifiersCount_0(global::System.IntPtr instance); } - public static new Class __CreateInstance(global::System.IntPtr native, bool ownsNativeInstance = false) + public static new Class __CreateInstance(global::System.IntPtr native, bool ownsNativeInstance = false, bool skipVTables = false) { - return new Class((Class.Internal*) native) { __ownsNativeInstance = ownsNativeInstance }; + return new Class((Class.Internal*) native, skipVTables) { __ownsNativeInstance = ownsNativeInstance }; } - public static Class __CreateInstance(Class.Internal native) + public static Class __CreateInstance(Class.Internal native, bool skipVTables = false) { - return new Class(native); + return new Class(native, skipVTables); } private static Class.Internal* __CopyValue(Class.Internal native) @@ -6909,16 +7092,20 @@ namespace CppSharp return (Class.Internal*) ret; } - private Class(Class.Internal native) - : this(__CopyValue(native)) + private Class(Class.Internal native, bool skipVTables = false) + : this(__CopyValue(native), skipVTables) { __ownsNativeInstance = true; NativeToManagedMap[__Instance] = this; } - protected Class(Class.Internal* native, bool isInternalImpl = false) - : base((CppSharp.Parser.AST.DeclarationContext.Internal*) native) + protected Class(Class.Internal* native, bool skipVTables = false) + : base((CppSharp.Parser.AST.DeclarationContext.Internal*) null) { + __PointerAdjustment = 0; + if (native == null) + return; + __Instance = new global::System.IntPtr(native); } public Class() @@ -6926,8 +7113,8 @@ namespace CppSharp { __Instance = Marshal.AllocHGlobal(512); __ownsNativeInstance = true; - Internal.ctor_0(__Instance); NativeToManagedMap[__Instance] = this; + Internal.ctor_0((__Instance + __PointerAdjustment)); } public Class(CppSharp.Parser.AST.Class _0) @@ -6935,14 +7122,14 @@ namespace CppSharp { __Instance = Marshal.AllocHGlobal(512); __ownsNativeInstance = true; - var arg0 = ReferenceEquals(_0, null) ? global::System.IntPtr.Zero : _0.__Instance; - Internal.cctor_1(__Instance, arg0); NativeToManagedMap[__Instance] = this; + var arg0 = ReferenceEquals(_0, null) ? global::System.IntPtr.Zero : _0.__Instance; + Internal.cctor_1((__Instance + __PointerAdjustment), arg0); } public CppSharp.Parser.AST.BaseClassSpecifier getBases(uint i) { - var __ret = Internal.getBases_0(__Instance, i); + var __ret = Internal.getBases_0((__Instance + __PointerAdjustment), i); CppSharp.Parser.AST.BaseClassSpecifier __result0; if (__ret == IntPtr.Zero) __result0 = null; else if (CppSharp.Parser.AST.BaseClassSpecifier.NativeToManagedMap.ContainsKey(__ret)) @@ -6954,17 +7141,17 @@ namespace CppSharp public void addBases(CppSharp.Parser.AST.BaseClassSpecifier s) { var arg0 = ReferenceEquals(s, null) ? global::System.IntPtr.Zero : s.__Instance; - Internal.addBases_0(__Instance, arg0); + Internal.addBases_0((__Instance + __PointerAdjustment), arg0); } public void clearBases() { - Internal.clearBases_0(__Instance); + Internal.clearBases_0((__Instance + __PointerAdjustment)); } public CppSharp.Parser.AST.Field getFields(uint i) { - var __ret = Internal.getFields_0(__Instance, i); + var __ret = Internal.getFields_0((__Instance + __PointerAdjustment), i); CppSharp.Parser.AST.Field __result0; if (__ret == IntPtr.Zero) __result0 = null; else if (CppSharp.Parser.AST.Field.NativeToManagedMap.ContainsKey(__ret)) @@ -6976,17 +7163,17 @@ namespace CppSharp public void addFields(CppSharp.Parser.AST.Field s) { var arg0 = ReferenceEquals(s, null) ? global::System.IntPtr.Zero : s.__Instance; - Internal.addFields_0(__Instance, arg0); + Internal.addFields_0((__Instance + __PointerAdjustment), arg0); } public void clearFields() { - Internal.clearFields_0(__Instance); + Internal.clearFields_0((__Instance + __PointerAdjustment)); } public CppSharp.Parser.AST.Method getMethods(uint i) { - var __ret = Internal.getMethods_0(__Instance, i); + var __ret = Internal.getMethods_0((__Instance + __PointerAdjustment), i); CppSharp.Parser.AST.Method __result0; if (__ret == IntPtr.Zero) __result0 = null; else if (CppSharp.Parser.AST.Method.NativeToManagedMap.ContainsKey(__ret)) @@ -6998,17 +7185,17 @@ namespace CppSharp public void addMethods(CppSharp.Parser.AST.Method s) { var arg0 = ReferenceEquals(s, null) ? global::System.IntPtr.Zero : s.__Instance; - Internal.addMethods_0(__Instance, arg0); + Internal.addMethods_0((__Instance + __PointerAdjustment), arg0); } public void clearMethods() { - Internal.clearMethods_0(__Instance); + Internal.clearMethods_0((__Instance + __PointerAdjustment)); } public CppSharp.Parser.AST.AccessSpecifierDecl getSpecifiers(uint i) { - var __ret = Internal.getSpecifiers_0(__Instance, i); + var __ret = Internal.getSpecifiers_0((__Instance + __PointerAdjustment), i); CppSharp.Parser.AST.AccessSpecifierDecl __result0; if (__ret == IntPtr.Zero) __result0 = null; else if (CppSharp.Parser.AST.AccessSpecifierDecl.NativeToManagedMap.ContainsKey(__ret)) @@ -7020,19 +7207,19 @@ namespace CppSharp public void addSpecifiers(CppSharp.Parser.AST.AccessSpecifierDecl s) { var arg0 = ReferenceEquals(s, null) ? global::System.IntPtr.Zero : s.__Instance; - Internal.addSpecifiers_0(__Instance, arg0); + Internal.addSpecifiers_0((__Instance + __PointerAdjustment), arg0); } public void clearSpecifiers() { - Internal.clearSpecifiers_0(__Instance); + Internal.clearSpecifiers_0((__Instance + __PointerAdjustment)); } public uint BasesCount { get { - var __ret = Internal.getBasesCount_0(__Instance); + var __ret = Internal.getBasesCount_0((__Instance + __PointerAdjustment)); return __ret; } } @@ -7041,7 +7228,7 @@ namespace CppSharp { get { - var __ret = Internal.getFieldsCount_0(__Instance); + var __ret = Internal.getFieldsCount_0((__Instance + __PointerAdjustment)); return __ret; } } @@ -7050,7 +7237,7 @@ namespace CppSharp { get { - var __ret = Internal.getMethodsCount_0(__Instance); + var __ret = Internal.getMethodsCount_0((__Instance + __PointerAdjustment)); return __ret; } } @@ -7059,7 +7246,7 @@ namespace CppSharp { get { - var __ret = Internal.getSpecifiersCount_0(__Instance); + var __ret = Internal.getSpecifiersCount_0((__Instance + __PointerAdjustment)); return __ret; } } @@ -7285,14 +7472,14 @@ namespace CppSharp internal static extern uint getParametersCount_0(global::System.IntPtr instance); } - public static new Template __CreateInstance(global::System.IntPtr native, bool ownsNativeInstance = false) + public static new Template __CreateInstance(global::System.IntPtr native, bool ownsNativeInstance = false, bool skipVTables = false) { - return new Template((Template.Internal*) native) { __ownsNativeInstance = ownsNativeInstance }; + return new Template((Template.Internal*) native, skipVTables) { __ownsNativeInstance = ownsNativeInstance }; } - public static Template __CreateInstance(Template.Internal native) + public static Template __CreateInstance(Template.Internal native, bool skipVTables = false) { - return new Template(native); + return new Template(native, skipVTables); } private static Template.Internal* __CopyValue(Template.Internal native) @@ -7302,16 +7489,20 @@ namespace CppSharp return (Template.Internal*) ret; } - private Template(Template.Internal native) - : this(__CopyValue(native)) + private Template(Template.Internal native, bool skipVTables = false) + : this(__CopyValue(native), skipVTables) { __ownsNativeInstance = true; NativeToManagedMap[__Instance] = this; } - protected Template(Template.Internal* native, bool isInternalImpl = false) - : base((CppSharp.Parser.AST.Declaration.Internal*) native) + protected Template(Template.Internal* native, bool skipVTables = false) + : base((CppSharp.Parser.AST.Declaration.Internal*) null) { + __PointerAdjustment = 0; + if (native == null) + return; + __Instance = new global::System.IntPtr(native); } public Template(CppSharp.Parser.AST.DeclarationKind kind) @@ -7319,9 +7510,9 @@ namespace CppSharp { __Instance = Marshal.AllocHGlobal(200); __ownsNativeInstance = true; - var arg0 = kind; - Internal.ctor_0(__Instance, arg0); NativeToManagedMap[__Instance] = this; + var arg0 = kind; + Internal.ctor_0((__Instance + __PointerAdjustment), arg0); } public Template() @@ -7329,8 +7520,8 @@ namespace CppSharp { __Instance = Marshal.AllocHGlobal(200); __ownsNativeInstance = true; - Internal.ctor_1(__Instance); NativeToManagedMap[__Instance] = this; + Internal.ctor_1((__Instance + __PointerAdjustment)); } public Template(CppSharp.Parser.AST.Template _0) @@ -7338,34 +7529,34 @@ namespace CppSharp { __Instance = Marshal.AllocHGlobal(200); __ownsNativeInstance = true; - var arg0 = ReferenceEquals(_0, null) ? global::System.IntPtr.Zero : _0.__Instance; - Internal.cctor_3(__Instance, arg0); NativeToManagedMap[__Instance] = this; + var arg0 = ReferenceEquals(_0, null) ? global::System.IntPtr.Zero : _0.__Instance; + Internal.cctor_3((__Instance + __PointerAdjustment), arg0); } public CppSharp.Parser.AST.TemplateParameter getParameters(uint i) { var __ret = new CppSharp.Parser.AST.TemplateParameter.Internal(); - Internal.getParameters_0(new IntPtr(&__ret), __Instance, i); + Internal.getParameters_0(new IntPtr(&__ret), (__Instance + __PointerAdjustment), i); return CppSharp.Parser.AST.TemplateParameter.__CreateInstance(__ret); } public void addParameters(CppSharp.Parser.AST.TemplateParameter s) { var arg0 = ReferenceEquals(s, null) ? global::System.IntPtr.Zero : s.__Instance; - Internal.addParameters_0(__Instance, arg0); + Internal.addParameters_0((__Instance + __PointerAdjustment), arg0); } public void clearParameters() { - Internal.clearParameters_0(__Instance); + Internal.clearParameters_0((__Instance + __PointerAdjustment)); } public uint ParametersCount { get { - var __ret = Internal.getParametersCount_0(__Instance); + var __ret = Internal.getParametersCount_0((__Instance + __PointerAdjustment)); return __ret; } } @@ -7469,14 +7660,14 @@ namespace CppSharp internal static extern uint getSpecializationsCount_0(global::System.IntPtr instance); } - public static new ClassTemplate __CreateInstance(global::System.IntPtr native, bool ownsNativeInstance = false) + public static new ClassTemplate __CreateInstance(global::System.IntPtr native, bool ownsNativeInstance = false, bool skipVTables = false) { - return new ClassTemplate((ClassTemplate.Internal*) native) { __ownsNativeInstance = ownsNativeInstance }; + return new ClassTemplate((ClassTemplate.Internal*) native, skipVTables) { __ownsNativeInstance = ownsNativeInstance }; } - public static ClassTemplate __CreateInstance(ClassTemplate.Internal native) + public static ClassTemplate __CreateInstance(ClassTemplate.Internal native, bool skipVTables = false) { - return new ClassTemplate(native); + return new ClassTemplate(native, skipVTables); } private static ClassTemplate.Internal* __CopyValue(ClassTemplate.Internal native) @@ -7486,16 +7677,20 @@ namespace CppSharp return (ClassTemplate.Internal*) ret; } - private ClassTemplate(ClassTemplate.Internal native) - : this(__CopyValue(native)) + private ClassTemplate(ClassTemplate.Internal native, bool skipVTables = false) + : this(__CopyValue(native), skipVTables) { __ownsNativeInstance = true; NativeToManagedMap[__Instance] = this; } - protected ClassTemplate(ClassTemplate.Internal* native, bool isInternalImpl = false) - : base((CppSharp.Parser.AST.Template.Internal*) native) + protected ClassTemplate(ClassTemplate.Internal* native, bool skipVTables = false) + : base((CppSharp.Parser.AST.Template.Internal*) null) { + __PointerAdjustment = 0; + if (native == null) + return; + __Instance = new global::System.IntPtr(native); } public ClassTemplate() @@ -7503,8 +7698,8 @@ namespace CppSharp { __Instance = Marshal.AllocHGlobal(224); __ownsNativeInstance = true; - Internal.ctor_0(__Instance); NativeToManagedMap[__Instance] = this; + Internal.ctor_0((__Instance + __PointerAdjustment)); } public ClassTemplate(CppSharp.Parser.AST.ClassTemplate _0) @@ -7512,14 +7707,14 @@ namespace CppSharp { __Instance = Marshal.AllocHGlobal(224); __ownsNativeInstance = true; - var arg0 = ReferenceEquals(_0, null) ? global::System.IntPtr.Zero : _0.__Instance; - Internal.cctor_2(__Instance, arg0); NativeToManagedMap[__Instance] = this; + var arg0 = ReferenceEquals(_0, null) ? global::System.IntPtr.Zero : _0.__Instance; + Internal.cctor_2((__Instance + __PointerAdjustment), arg0); } public CppSharp.Parser.AST.ClassTemplateSpecialization getSpecializations(uint i) { - var __ret = Internal.getSpecializations_0(__Instance, i); + var __ret = Internal.getSpecializations_0((__Instance + __PointerAdjustment), i); CppSharp.Parser.AST.ClassTemplateSpecialization __result0; if (__ret == IntPtr.Zero) __result0 = null; else if (CppSharp.Parser.AST.ClassTemplateSpecialization.NativeToManagedMap.ContainsKey(__ret)) @@ -7531,19 +7726,19 @@ namespace CppSharp public void addSpecializations(CppSharp.Parser.AST.ClassTemplateSpecialization s) { var arg0 = ReferenceEquals(s, null) ? global::System.IntPtr.Zero : s.__Instance; - Internal.addSpecializations_0(__Instance, arg0); + Internal.addSpecializations_0((__Instance + __PointerAdjustment), arg0); } public void clearSpecializations() { - Internal.clearSpecializations_0(__Instance); + Internal.clearSpecializations_0((__Instance + __PointerAdjustment)); } public uint SpecializationsCount { get { - var __ret = Internal.getSpecializationsCount_0(__Instance); + var __ret = Internal.getSpecializationsCount_0((__Instance + __PointerAdjustment)); return __ret; } } @@ -7665,14 +7860,14 @@ namespace CppSharp internal static extern uint getArgumentsCount_0(global::System.IntPtr instance); } - public static new ClassTemplateSpecialization __CreateInstance(global::System.IntPtr native, bool ownsNativeInstance = false) + public static new ClassTemplateSpecialization __CreateInstance(global::System.IntPtr native, bool ownsNativeInstance = false, bool skipVTables = false) { - return new ClassTemplateSpecialization((ClassTemplateSpecialization.Internal*) native) { __ownsNativeInstance = ownsNativeInstance }; + return new ClassTemplateSpecialization((ClassTemplateSpecialization.Internal*) native, skipVTables) { __ownsNativeInstance = ownsNativeInstance }; } - public static ClassTemplateSpecialization __CreateInstance(ClassTemplateSpecialization.Internal native) + public static ClassTemplateSpecialization __CreateInstance(ClassTemplateSpecialization.Internal native, bool skipVTables = false) { - return new ClassTemplateSpecialization(native); + return new ClassTemplateSpecialization(native, skipVTables); } private static ClassTemplateSpecialization.Internal* __CopyValue(ClassTemplateSpecialization.Internal native) @@ -7682,16 +7877,20 @@ namespace CppSharp return (ClassTemplateSpecialization.Internal*) ret; } - private ClassTemplateSpecialization(ClassTemplateSpecialization.Internal native) - : this(__CopyValue(native)) + private ClassTemplateSpecialization(ClassTemplateSpecialization.Internal native, bool skipVTables = false) + : this(__CopyValue(native), skipVTables) { __ownsNativeInstance = true; NativeToManagedMap[__Instance] = this; } - protected ClassTemplateSpecialization(ClassTemplateSpecialization.Internal* native, bool isInternalImpl = false) - : base((CppSharp.Parser.AST.Class.Internal*) native) + protected ClassTemplateSpecialization(ClassTemplateSpecialization.Internal* native, bool skipVTables = false) + : base((CppSharp.Parser.AST.Class.Internal*) null) { + __PointerAdjustment = 0; + if (native == null) + return; + __Instance = new global::System.IntPtr(native); } public ClassTemplateSpecialization() @@ -7699,8 +7898,8 @@ namespace CppSharp { __Instance = Marshal.AllocHGlobal(552); __ownsNativeInstance = true; - Internal.ctor_0(__Instance); NativeToManagedMap[__Instance] = this; + Internal.ctor_0((__Instance + __PointerAdjustment)); } public ClassTemplateSpecialization(CppSharp.Parser.AST.ClassTemplateSpecialization _0) @@ -7708,34 +7907,34 @@ namespace CppSharp { __Instance = Marshal.AllocHGlobal(552); __ownsNativeInstance = true; - var arg0 = ReferenceEquals(_0, null) ? global::System.IntPtr.Zero : _0.__Instance; - Internal.cctor_2(__Instance, arg0); NativeToManagedMap[__Instance] = this; + var arg0 = ReferenceEquals(_0, null) ? global::System.IntPtr.Zero : _0.__Instance; + Internal.cctor_2((__Instance + __PointerAdjustment), arg0); } public CppSharp.Parser.AST.TemplateArgument getArguments(uint i) { var __ret = new CppSharp.Parser.AST.TemplateArgument.Internal(); - Internal.getArguments_0(new IntPtr(&__ret), __Instance, i); + Internal.getArguments_0(new IntPtr(&__ret), (__Instance + __PointerAdjustment), i); return CppSharp.Parser.AST.TemplateArgument.__CreateInstance(__ret); } public void addArguments(CppSharp.Parser.AST.TemplateArgument s) { var arg0 = ReferenceEquals(s, null) ? global::System.IntPtr.Zero : s.__Instance; - Internal.addArguments_0(__Instance, arg0); + Internal.addArguments_0((__Instance + __PointerAdjustment), arg0); } public void clearArguments() { - Internal.clearArguments_0(__Instance); + Internal.clearArguments_0((__Instance + __PointerAdjustment)); } public uint ArgumentsCount { get { - var __ret = Internal.getArgumentsCount_0(__Instance); + var __ret = Internal.getArgumentsCount_0((__Instance + __PointerAdjustment)); return __ret; } } @@ -7868,14 +8067,14 @@ namespace CppSharp internal static extern void dtor_0(global::System.IntPtr instance); } - public static new ClassTemplatePartialSpecialization __CreateInstance(global::System.IntPtr native, bool ownsNativeInstance = false) + public static new ClassTemplatePartialSpecialization __CreateInstance(global::System.IntPtr native, bool ownsNativeInstance = false, bool skipVTables = false) { - return new ClassTemplatePartialSpecialization((ClassTemplatePartialSpecialization.Internal*) native) { __ownsNativeInstance = ownsNativeInstance }; + return new ClassTemplatePartialSpecialization((ClassTemplatePartialSpecialization.Internal*) native, skipVTables) { __ownsNativeInstance = ownsNativeInstance }; } - public static ClassTemplatePartialSpecialization __CreateInstance(ClassTemplatePartialSpecialization.Internal native) + public static ClassTemplatePartialSpecialization __CreateInstance(ClassTemplatePartialSpecialization.Internal native, bool skipVTables = false) { - return new ClassTemplatePartialSpecialization(native); + return new ClassTemplatePartialSpecialization(native, skipVTables); } private static ClassTemplatePartialSpecialization.Internal* __CopyValue(ClassTemplatePartialSpecialization.Internal native) @@ -7885,16 +8084,20 @@ namespace CppSharp return (ClassTemplatePartialSpecialization.Internal*) ret; } - private ClassTemplatePartialSpecialization(ClassTemplatePartialSpecialization.Internal native) - : this(__CopyValue(native)) + private ClassTemplatePartialSpecialization(ClassTemplatePartialSpecialization.Internal native, bool skipVTables = false) + : this(__CopyValue(native), skipVTables) { __ownsNativeInstance = true; NativeToManagedMap[__Instance] = this; } - protected ClassTemplatePartialSpecialization(ClassTemplatePartialSpecialization.Internal* native, bool isInternalImpl = false) - : base((CppSharp.Parser.AST.ClassTemplateSpecialization.Internal*) native) + protected ClassTemplatePartialSpecialization(ClassTemplatePartialSpecialization.Internal* native, bool skipVTables = false) + : base((CppSharp.Parser.AST.ClassTemplateSpecialization.Internal*) null) { + __PointerAdjustment = 0; + if (native == null) + return; + __Instance = new global::System.IntPtr(native); } public ClassTemplatePartialSpecialization() @@ -7902,8 +8105,8 @@ namespace CppSharp { __Instance = Marshal.AllocHGlobal(552); __ownsNativeInstance = true; - Internal.ctor_0(__Instance); NativeToManagedMap[__Instance] = this; + Internal.ctor_0((__Instance + __PointerAdjustment)); } public ClassTemplatePartialSpecialization(CppSharp.Parser.AST.ClassTemplatePartialSpecialization _0) @@ -7911,9 +8114,9 @@ namespace CppSharp { __Instance = Marshal.AllocHGlobal(552); __ownsNativeInstance = true; - var arg0 = ReferenceEquals(_0, null) ? global::System.IntPtr.Zero : _0.__Instance; - Internal.cctor_1(__Instance, arg0); NativeToManagedMap[__Instance] = this; + var arg0 = ReferenceEquals(_0, null) ? global::System.IntPtr.Zero : _0.__Instance; + Internal.cctor_1((__Instance + __PointerAdjustment), arg0); } } @@ -7997,14 +8200,14 @@ namespace CppSharp internal static extern uint getSpecializationsCount_0(global::System.IntPtr instance); } - public static new FunctionTemplate __CreateInstance(global::System.IntPtr native, bool ownsNativeInstance = false) + public static new FunctionTemplate __CreateInstance(global::System.IntPtr native, bool ownsNativeInstance = false, bool skipVTables = false) { - return new FunctionTemplate((FunctionTemplate.Internal*) native) { __ownsNativeInstance = ownsNativeInstance }; + return new FunctionTemplate((FunctionTemplate.Internal*) native, skipVTables) { __ownsNativeInstance = ownsNativeInstance }; } - public static FunctionTemplate __CreateInstance(FunctionTemplate.Internal native) + public static FunctionTemplate __CreateInstance(FunctionTemplate.Internal native, bool skipVTables = false) { - return new FunctionTemplate(native); + return new FunctionTemplate(native, skipVTables); } private static FunctionTemplate.Internal* __CopyValue(FunctionTemplate.Internal native) @@ -8014,16 +8217,20 @@ namespace CppSharp return (FunctionTemplate.Internal*) ret; } - private FunctionTemplate(FunctionTemplate.Internal native) - : this(__CopyValue(native)) + private FunctionTemplate(FunctionTemplate.Internal native, bool skipVTables = false) + : this(__CopyValue(native), skipVTables) { __ownsNativeInstance = true; NativeToManagedMap[__Instance] = this; } - protected FunctionTemplate(FunctionTemplate.Internal* native, bool isInternalImpl = false) - : base((CppSharp.Parser.AST.Template.Internal*) native) + protected FunctionTemplate(FunctionTemplate.Internal* native, bool skipVTables = false) + : base((CppSharp.Parser.AST.Template.Internal*) null) { + __PointerAdjustment = 0; + if (native == null) + return; + __Instance = new global::System.IntPtr(native); } public FunctionTemplate() @@ -8031,8 +8238,8 @@ namespace CppSharp { __Instance = Marshal.AllocHGlobal(224); __ownsNativeInstance = true; - Internal.ctor_0(__Instance); NativeToManagedMap[__Instance] = this; + Internal.ctor_0((__Instance + __PointerAdjustment)); } public FunctionTemplate(CppSharp.Parser.AST.FunctionTemplate _0) @@ -8040,14 +8247,14 @@ namespace CppSharp { __Instance = Marshal.AllocHGlobal(224); __ownsNativeInstance = true; - var arg0 = ReferenceEquals(_0, null) ? global::System.IntPtr.Zero : _0.__Instance; - Internal.cctor_2(__Instance, arg0); NativeToManagedMap[__Instance] = this; + var arg0 = ReferenceEquals(_0, null) ? global::System.IntPtr.Zero : _0.__Instance; + Internal.cctor_2((__Instance + __PointerAdjustment), arg0); } public CppSharp.Parser.AST.FunctionTemplateSpecialization getSpecializations(uint i) { - var __ret = Internal.getSpecializations_0(__Instance, i); + var __ret = Internal.getSpecializations_0((__Instance + __PointerAdjustment), i); CppSharp.Parser.AST.FunctionTemplateSpecialization __result0; if (__ret == IntPtr.Zero) __result0 = null; else if (CppSharp.Parser.AST.FunctionTemplateSpecialization.NativeToManagedMap.ContainsKey(__ret)) @@ -8059,19 +8266,19 @@ namespace CppSharp public void addSpecializations(CppSharp.Parser.AST.FunctionTemplateSpecialization s) { var arg0 = ReferenceEquals(s, null) ? global::System.IntPtr.Zero : s.__Instance; - Internal.addSpecializations_0(__Instance, arg0); + Internal.addSpecializations_0((__Instance + __PointerAdjustment), arg0); } public void clearSpecializations() { - Internal.clearSpecializations_0(__Instance); + Internal.clearSpecializations_0((__Instance + __PointerAdjustment)); } public uint SpecializationsCount { get { - var __ret = Internal.getSpecializationsCount_0(__Instance); + var __ret = Internal.getSpecializationsCount_0((__Instance + __PointerAdjustment)); return __ret; } } @@ -8128,19 +8335,21 @@ namespace CppSharp } public global::System.IntPtr __Instance { get; protected set; } + + protected int __PointerAdjustment; public static readonly System.Collections.Concurrent.ConcurrentDictionary NativeToManagedMap = new System.Collections.Concurrent.ConcurrentDictionary(); protected void*[] __OriginalVTables; protected bool __ownsNativeInstance; - public static FunctionTemplateSpecialization __CreateInstance(global::System.IntPtr native, bool ownsNativeInstance = false) + public static FunctionTemplateSpecialization __CreateInstance(global::System.IntPtr native, bool ownsNativeInstance = false, bool skipVTables = false) { - return new FunctionTemplateSpecialization((FunctionTemplateSpecialization.Internal*) native) { __ownsNativeInstance = ownsNativeInstance }; + return new FunctionTemplateSpecialization((FunctionTemplateSpecialization.Internal*) native, skipVTables) { __ownsNativeInstance = ownsNativeInstance }; } - public static FunctionTemplateSpecialization __CreateInstance(FunctionTemplateSpecialization.Internal native) + public static FunctionTemplateSpecialization __CreateInstance(FunctionTemplateSpecialization.Internal native, bool skipVTables = false) { - return new FunctionTemplateSpecialization(native); + return new FunctionTemplateSpecialization(native, skipVTables); } private static FunctionTemplateSpecialization.Internal* __CopyValue(FunctionTemplateSpecialization.Internal native) @@ -8150,15 +8359,17 @@ namespace CppSharp return (FunctionTemplateSpecialization.Internal*) ret; } - private FunctionTemplateSpecialization(FunctionTemplateSpecialization.Internal native) - : this(__CopyValue(native)) + private FunctionTemplateSpecialization(FunctionTemplateSpecialization.Internal native, bool skipVTables = false) + : this(__CopyValue(native), skipVTables) { __ownsNativeInstance = true; NativeToManagedMap[__Instance] = this; } - protected FunctionTemplateSpecialization(FunctionTemplateSpecialization.Internal* native, bool isInternalImpl = false) + protected FunctionTemplateSpecialization(FunctionTemplateSpecialization.Internal* native, bool skipVTables = false) { + if (native == null) + return; __Instance = new global::System.IntPtr(native); } @@ -8166,17 +8377,17 @@ namespace CppSharp { __Instance = Marshal.AllocHGlobal(48); __ownsNativeInstance = true; - Internal.ctor_0(__Instance); NativeToManagedMap[__Instance] = this; + Internal.ctor_0((__Instance + __PointerAdjustment)); } public FunctionTemplateSpecialization(CppSharp.Parser.AST.FunctionTemplateSpecialization _0) { __Instance = Marshal.AllocHGlobal(48); __ownsNativeInstance = true; - var arg0 = ReferenceEquals(_0, null) ? global::System.IntPtr.Zero : _0.__Instance; - Internal.cctor_2(__Instance, arg0); NativeToManagedMap[__Instance] = this; + var arg0 = ReferenceEquals(_0, null) ? global::System.IntPtr.Zero : _0.__Instance; + Internal.cctor_2((__Instance + __PointerAdjustment), arg0); } public void Dispose() @@ -8190,33 +8401,34 @@ namespace CppSharp throw new global::System.InvalidOperationException("Managed instances owned by native code cannot be disposed of."); CppSharp.Parser.AST.FunctionTemplateSpecialization __dummy; NativeToManagedMap.TryRemove(__Instance, out __dummy); - Internal.dtor_0(__Instance); - Marshal.FreeHGlobal(__Instance); + Internal.dtor_0((__Instance + __PointerAdjustment)); + if (__ownsNativeInstance) + Marshal.FreeHGlobal(__Instance); } public CppSharp.Parser.AST.TemplateArgument getArguments(uint i) { var __ret = new CppSharp.Parser.AST.TemplateArgument.Internal(); - Internal.getArguments_0(new IntPtr(&__ret), __Instance, i); + Internal.getArguments_0(new IntPtr(&__ret), (__Instance + __PointerAdjustment), i); return CppSharp.Parser.AST.TemplateArgument.__CreateInstance(__ret); } public void addArguments(CppSharp.Parser.AST.TemplateArgument s) { var arg0 = ReferenceEquals(s, null) ? global::System.IntPtr.Zero : s.__Instance; - Internal.addArguments_0(__Instance, arg0); + Internal.addArguments_0((__Instance + __PointerAdjustment), arg0); } public void clearArguments() { - Internal.clearArguments_0(__Instance); + Internal.clearArguments_0((__Instance + __PointerAdjustment)); } public uint ArgumentsCount { get { - var __ret = Internal.getArgumentsCount_0(__Instance); + var __ret = Internal.getArgumentsCount_0((__Instance + __PointerAdjustment)); return __ret; } } @@ -8334,14 +8546,14 @@ namespace CppSharp internal static extern void dtor_0(global::System.IntPtr instance); } - public static new Namespace __CreateInstance(global::System.IntPtr native, bool ownsNativeInstance = false) + public static new Namespace __CreateInstance(global::System.IntPtr native, bool ownsNativeInstance = false, bool skipVTables = false) { - return new Namespace((Namespace.Internal*) native) { __ownsNativeInstance = ownsNativeInstance }; + return new Namespace((Namespace.Internal*) native, skipVTables) { __ownsNativeInstance = ownsNativeInstance }; } - public static Namespace __CreateInstance(Namespace.Internal native) + public static Namespace __CreateInstance(Namespace.Internal native, bool skipVTables = false) { - return new Namespace(native); + return new Namespace(native, skipVTables); } private static Namespace.Internal* __CopyValue(Namespace.Internal native) @@ -8351,16 +8563,20 @@ namespace CppSharp return (Namespace.Internal*) ret; } - private Namespace(Namespace.Internal native) - : this(__CopyValue(native)) + private Namespace(Namespace.Internal native, bool skipVTables = false) + : this(__CopyValue(native), skipVTables) { __ownsNativeInstance = true; NativeToManagedMap[__Instance] = this; } - protected Namespace(Namespace.Internal* native, bool isInternalImpl = false) - : base((CppSharp.Parser.AST.DeclarationContext.Internal*) native) + protected Namespace(Namespace.Internal* native, bool skipVTables = false) + : base((CppSharp.Parser.AST.DeclarationContext.Internal*) null) { + __PointerAdjustment = 0; + if (native == null) + return; + __Instance = new global::System.IntPtr(native); } public Namespace() @@ -8368,8 +8584,8 @@ namespace CppSharp { __Instance = Marshal.AllocHGlobal(392); __ownsNativeInstance = true; - Internal.ctor_0(__Instance); NativeToManagedMap[__Instance] = this; + Internal.ctor_0((__Instance + __PointerAdjustment)); } public Namespace(CppSharp.Parser.AST.Namespace _0) @@ -8377,9 +8593,9 @@ namespace CppSharp { __Instance = Marshal.AllocHGlobal(392); __ownsNativeInstance = true; - var arg0 = ReferenceEquals(_0, null) ? global::System.IntPtr.Zero : _0.__Instance; - Internal.cctor_1(__Instance, arg0); NativeToManagedMap[__Instance] = this; + var arg0 = ReferenceEquals(_0, null) ? global::System.IntPtr.Zero : _0.__Instance; + Internal.cctor_1((__Instance + __PointerAdjustment), arg0); } public bool IsInline @@ -8456,14 +8672,14 @@ namespace CppSharp internal static extern void dtor_0(global::System.IntPtr instance); } - public static new PreprocessedEntity __CreateInstance(global::System.IntPtr native, bool ownsNativeInstance = false) + public static new PreprocessedEntity __CreateInstance(global::System.IntPtr native, bool ownsNativeInstance = false, bool skipVTables = false) { - return new PreprocessedEntity((PreprocessedEntity.Internal*) native) { __ownsNativeInstance = ownsNativeInstance }; + return new PreprocessedEntity((PreprocessedEntity.Internal*) native, skipVTables) { __ownsNativeInstance = ownsNativeInstance }; } - public static PreprocessedEntity __CreateInstance(PreprocessedEntity.Internal native) + public static PreprocessedEntity __CreateInstance(PreprocessedEntity.Internal native, bool skipVTables = false) { - return new PreprocessedEntity(native); + return new PreprocessedEntity(native, skipVTables); } private static PreprocessedEntity.Internal* __CopyValue(PreprocessedEntity.Internal native) @@ -8473,16 +8689,20 @@ namespace CppSharp return (PreprocessedEntity.Internal*) ret; } - private PreprocessedEntity(PreprocessedEntity.Internal native) - : this(__CopyValue(native)) + private PreprocessedEntity(PreprocessedEntity.Internal native, bool skipVTables = false) + : this(__CopyValue(native), skipVTables) { __ownsNativeInstance = true; NativeToManagedMap[__Instance] = this; } - protected PreprocessedEntity(PreprocessedEntity.Internal* native, bool isInternalImpl = false) - : base((CppSharp.Parser.AST.Declaration.Internal*) native) + protected PreprocessedEntity(PreprocessedEntity.Internal* native, bool skipVTables = false) + : base((CppSharp.Parser.AST.Declaration.Internal*) null) { + __PointerAdjustment = 0; + if (native == null) + return; + __Instance = new global::System.IntPtr(native); } public PreprocessedEntity() @@ -8490,8 +8710,8 @@ namespace CppSharp { __Instance = Marshal.AllocHGlobal(176); __ownsNativeInstance = true; - Internal.ctor_0(__Instance); NativeToManagedMap[__Instance] = this; + Internal.ctor_0((__Instance + __PointerAdjustment)); } public PreprocessedEntity(CppSharp.Parser.AST.PreprocessedEntity _0) @@ -8499,9 +8719,9 @@ namespace CppSharp { __Instance = Marshal.AllocHGlobal(176); __ownsNativeInstance = true; - var arg0 = ReferenceEquals(_0, null) ? global::System.IntPtr.Zero : _0.__Instance; - Internal.cctor_2(__Instance, arg0); NativeToManagedMap[__Instance] = this; + var arg0 = ReferenceEquals(_0, null) ? global::System.IntPtr.Zero : _0.__Instance; + Internal.cctor_2((__Instance + __PointerAdjustment), arg0); } public CppSharp.Parser.AST.MacroLocation MacroLocation @@ -8588,14 +8808,14 @@ namespace CppSharp internal static extern void setExpression_0(global::System.IntPtr instance, global::System.IntPtr s); } - public static new MacroDefinition __CreateInstance(global::System.IntPtr native, bool ownsNativeInstance = false) + public static new MacroDefinition __CreateInstance(global::System.IntPtr native, bool ownsNativeInstance = false, bool skipVTables = false) { - return new MacroDefinition((MacroDefinition.Internal*) native) { __ownsNativeInstance = ownsNativeInstance }; + return new MacroDefinition((MacroDefinition.Internal*) native, skipVTables) { __ownsNativeInstance = ownsNativeInstance }; } - public static MacroDefinition __CreateInstance(MacroDefinition.Internal native) + public static MacroDefinition __CreateInstance(MacroDefinition.Internal native, bool skipVTables = false) { - return new MacroDefinition(native); + return new MacroDefinition(native, skipVTables); } private static MacroDefinition.Internal* __CopyValue(MacroDefinition.Internal native) @@ -8605,16 +8825,20 @@ namespace CppSharp return (MacroDefinition.Internal*) ret; } - private MacroDefinition(MacroDefinition.Internal native) - : this(__CopyValue(native)) + private MacroDefinition(MacroDefinition.Internal native, bool skipVTables = false) + : this(__CopyValue(native), skipVTables) { __ownsNativeInstance = true; NativeToManagedMap[__Instance] = this; } - protected MacroDefinition(MacroDefinition.Internal* native, bool isInternalImpl = false) - : base((CppSharp.Parser.AST.PreprocessedEntity.Internal*) native) + protected MacroDefinition(MacroDefinition.Internal* native, bool skipVTables = false) + : base((CppSharp.Parser.AST.PreprocessedEntity.Internal*) null) { + __PointerAdjustment = 0; + if (native == null) + return; + __Instance = new global::System.IntPtr(native); } public MacroDefinition() @@ -8622,8 +8846,8 @@ namespace CppSharp { __Instance = Marshal.AllocHGlobal(200); __ownsNativeInstance = true; - Internal.ctor_0(__Instance); NativeToManagedMap[__Instance] = this; + Internal.ctor_0((__Instance + __PointerAdjustment)); } public MacroDefinition(CppSharp.Parser.AST.MacroDefinition _0) @@ -8631,23 +8855,23 @@ namespace CppSharp { __Instance = Marshal.AllocHGlobal(200); __ownsNativeInstance = true; - var arg0 = ReferenceEquals(_0, null) ? global::System.IntPtr.Zero : _0.__Instance; - Internal.cctor_2(__Instance, arg0); NativeToManagedMap[__Instance] = this; + var arg0 = ReferenceEquals(_0, null) ? global::System.IntPtr.Zero : _0.__Instance; + Internal.cctor_2((__Instance + __PointerAdjustment), arg0); } public string Expression { get { - var __ret = Internal.getExpression_0(__Instance); + var __ret = Internal.getExpression_0((__Instance + __PointerAdjustment)); return Marshal.PtrToStringAnsi(__ret); } set { var arg0 = Marshal.StringToHGlobalAnsi(value); - Internal.setExpression_0(__Instance, arg0); + Internal.setExpression_0((__Instance + __PointerAdjustment), arg0); Marshal.FreeHGlobal(arg0); } } @@ -8726,14 +8950,14 @@ namespace CppSharp internal static extern void setText_0(global::System.IntPtr instance, global::System.IntPtr s); } - public static new MacroExpansion __CreateInstance(global::System.IntPtr native, bool ownsNativeInstance = false) + public static new MacroExpansion __CreateInstance(global::System.IntPtr native, bool ownsNativeInstance = false, bool skipVTables = false) { - return new MacroExpansion((MacroExpansion.Internal*) native) { __ownsNativeInstance = ownsNativeInstance }; + return new MacroExpansion((MacroExpansion.Internal*) native, skipVTables) { __ownsNativeInstance = ownsNativeInstance }; } - public static MacroExpansion __CreateInstance(MacroExpansion.Internal native) + public static MacroExpansion __CreateInstance(MacroExpansion.Internal native, bool skipVTables = false) { - return new MacroExpansion(native); + return new MacroExpansion(native, skipVTables); } private static MacroExpansion.Internal* __CopyValue(MacroExpansion.Internal native) @@ -8743,16 +8967,20 @@ namespace CppSharp return (MacroExpansion.Internal*) ret; } - private MacroExpansion(MacroExpansion.Internal native) - : this(__CopyValue(native)) + private MacroExpansion(MacroExpansion.Internal native, bool skipVTables = false) + : this(__CopyValue(native), skipVTables) { __ownsNativeInstance = true; NativeToManagedMap[__Instance] = this; } - protected MacroExpansion(MacroExpansion.Internal* native, bool isInternalImpl = false) - : base((CppSharp.Parser.AST.PreprocessedEntity.Internal*) native) + protected MacroExpansion(MacroExpansion.Internal* native, bool skipVTables = false) + : base((CppSharp.Parser.AST.PreprocessedEntity.Internal*) null) { + __PointerAdjustment = 0; + if (native == null) + return; + __Instance = new global::System.IntPtr(native); } public MacroExpansion() @@ -8760,8 +8988,8 @@ namespace CppSharp { __Instance = Marshal.AllocHGlobal(208); __ownsNativeInstance = true; - Internal.ctor_0(__Instance); NativeToManagedMap[__Instance] = this; + Internal.ctor_0((__Instance + __PointerAdjustment)); } public MacroExpansion(CppSharp.Parser.AST.MacroExpansion _0) @@ -8769,23 +8997,23 @@ namespace CppSharp { __Instance = Marshal.AllocHGlobal(208); __ownsNativeInstance = true; - var arg0 = ReferenceEquals(_0, null) ? global::System.IntPtr.Zero : _0.__Instance; - Internal.cctor_2(__Instance, arg0); NativeToManagedMap[__Instance] = this; + var arg0 = ReferenceEquals(_0, null) ? global::System.IntPtr.Zero : _0.__Instance; + Internal.cctor_2((__Instance + __PointerAdjustment), arg0); } public string Text { get { - var __ret = Internal.getText_0(__Instance); + var __ret = Internal.getText_0((__Instance + __PointerAdjustment)); return Marshal.PtrToStringAnsi(__ret); } set { var arg0 = Marshal.StringToHGlobalAnsi(value); - Internal.setText_0(__Instance, arg0); + Internal.setText_0((__Instance + __PointerAdjustment), arg0); Marshal.FreeHGlobal(arg0); } } @@ -8905,14 +9133,14 @@ namespace CppSharp internal static extern uint getMacrosCount_0(global::System.IntPtr instance); } - public static new TranslationUnit __CreateInstance(global::System.IntPtr native, bool ownsNativeInstance = false) + public static new TranslationUnit __CreateInstance(global::System.IntPtr native, bool ownsNativeInstance = false, bool skipVTables = false) { - return new TranslationUnit((TranslationUnit.Internal*) native) { __ownsNativeInstance = ownsNativeInstance }; + return new TranslationUnit((TranslationUnit.Internal*) native, skipVTables) { __ownsNativeInstance = ownsNativeInstance }; } - public static TranslationUnit __CreateInstance(TranslationUnit.Internal native) + public static TranslationUnit __CreateInstance(TranslationUnit.Internal native, bool skipVTables = false) { - return new TranslationUnit(native); + return new TranslationUnit(native, skipVTables); } private static TranslationUnit.Internal* __CopyValue(TranslationUnit.Internal native) @@ -8922,16 +9150,20 @@ namespace CppSharp return (TranslationUnit.Internal*) ret; } - private TranslationUnit(TranslationUnit.Internal native) - : this(__CopyValue(native)) + private TranslationUnit(TranslationUnit.Internal native, bool skipVTables = false) + : this(__CopyValue(native), skipVTables) { __ownsNativeInstance = true; NativeToManagedMap[__Instance] = this; } - protected TranslationUnit(TranslationUnit.Internal* native, bool isInternalImpl = false) - : base((CppSharp.Parser.AST.Namespace.Internal*) native) + protected TranslationUnit(TranslationUnit.Internal* native, bool skipVTables = false) + : base((CppSharp.Parser.AST.Namespace.Internal*) null) { + __PointerAdjustment = 0; + if (native == null) + return; + __Instance = new global::System.IntPtr(native); } public TranslationUnit() @@ -8939,8 +9171,8 @@ namespace CppSharp { __Instance = Marshal.AllocHGlobal(448); __ownsNativeInstance = true; - Internal.ctor_0(__Instance); NativeToManagedMap[__Instance] = this; + Internal.ctor_0((__Instance + __PointerAdjustment)); } public TranslationUnit(CppSharp.Parser.AST.TranslationUnit _0) @@ -8948,14 +9180,14 @@ namespace CppSharp { __Instance = Marshal.AllocHGlobal(448); __ownsNativeInstance = true; - var arg0 = ReferenceEquals(_0, null) ? global::System.IntPtr.Zero : _0.__Instance; - Internal.cctor_2(__Instance, arg0); NativeToManagedMap[__Instance] = this; + var arg0 = ReferenceEquals(_0, null) ? global::System.IntPtr.Zero : _0.__Instance; + Internal.cctor_2((__Instance + __PointerAdjustment), arg0); } public CppSharp.Parser.AST.MacroDefinition getMacros(uint i) { - var __ret = Internal.getMacros_0(__Instance, i); + var __ret = Internal.getMacros_0((__Instance + __PointerAdjustment), i); CppSharp.Parser.AST.MacroDefinition __result0; if (__ret == IntPtr.Zero) __result0 = null; else if (CppSharp.Parser.AST.MacroDefinition.NativeToManagedMap.ContainsKey(__ret)) @@ -8967,26 +9199,26 @@ namespace CppSharp public void addMacros(CppSharp.Parser.AST.MacroDefinition s) { var arg0 = ReferenceEquals(s, null) ? global::System.IntPtr.Zero : s.__Instance; - Internal.addMacros_0(__Instance, arg0); + Internal.addMacros_0((__Instance + __PointerAdjustment), arg0); } public void clearMacros() { - Internal.clearMacros_0(__Instance); + Internal.clearMacros_0((__Instance + __PointerAdjustment)); } public string FileName { get { - var __ret = Internal.getFileName_0(__Instance); + var __ret = Internal.getFileName_0((__Instance + __PointerAdjustment)); return Marshal.PtrToStringAnsi(__ret); } set { var arg0 = Marshal.StringToHGlobalAnsi(value); - Internal.setFileName_0(__Instance, arg0); + Internal.setFileName_0((__Instance + __PointerAdjustment), arg0); Marshal.FreeHGlobal(arg0); } } @@ -8995,7 +9227,7 @@ namespace CppSharp { get { - var __ret = Internal.getMacrosCount_0(__Instance); + var __ret = Internal.getMacrosCount_0((__Instance + __PointerAdjustment)); return __ret; } } @@ -9089,19 +9321,21 @@ namespace CppSharp } public global::System.IntPtr __Instance { get; protected set; } + + protected int __PointerAdjustment; public static readonly System.Collections.Concurrent.ConcurrentDictionary NativeToManagedMap = new System.Collections.Concurrent.ConcurrentDictionary(); protected void*[] __OriginalVTables; protected bool __ownsNativeInstance; - public static NativeLibrary __CreateInstance(global::System.IntPtr native, bool ownsNativeInstance = false) + public static NativeLibrary __CreateInstance(global::System.IntPtr native, bool ownsNativeInstance = false, bool skipVTables = false) { - return new NativeLibrary((NativeLibrary.Internal*) native) { __ownsNativeInstance = ownsNativeInstance }; + return new NativeLibrary((NativeLibrary.Internal*) native, skipVTables) { __ownsNativeInstance = ownsNativeInstance }; } - public static NativeLibrary __CreateInstance(NativeLibrary.Internal native) + public static NativeLibrary __CreateInstance(NativeLibrary.Internal native, bool skipVTables = false) { - return new NativeLibrary(native); + return new NativeLibrary(native, skipVTables); } private static NativeLibrary.Internal* __CopyValue(NativeLibrary.Internal native) @@ -9111,15 +9345,17 @@ namespace CppSharp return (NativeLibrary.Internal*) ret; } - private NativeLibrary(NativeLibrary.Internal native) - : this(__CopyValue(native)) + private NativeLibrary(NativeLibrary.Internal native, bool skipVTables = false) + : this(__CopyValue(native), skipVTables) { __ownsNativeInstance = true; NativeToManagedMap[__Instance] = this; } - protected NativeLibrary(NativeLibrary.Internal* native, bool isInternalImpl = false) + protected NativeLibrary(NativeLibrary.Internal* native, bool skipVTables = false) { + if (native == null) + return; __Instance = new global::System.IntPtr(native); } @@ -9127,17 +9363,17 @@ namespace CppSharp { __Instance = Marshal.AllocHGlobal(80); __ownsNativeInstance = true; - Internal.ctor_0(__Instance); NativeToManagedMap[__Instance] = this; + Internal.ctor_0((__Instance + __PointerAdjustment)); } public NativeLibrary(CppSharp.Parser.AST.NativeLibrary _0) { __Instance = Marshal.AllocHGlobal(80); __ownsNativeInstance = true; - var arg0 = ReferenceEquals(_0, null) ? global::System.IntPtr.Zero : _0.__Instance; - Internal.cctor_2(__Instance, arg0); NativeToManagedMap[__Instance] = this; + var arg0 = ReferenceEquals(_0, null) ? global::System.IntPtr.Zero : _0.__Instance; + Internal.cctor_2((__Instance + __PointerAdjustment), arg0); } public void Dispose() @@ -9151,58 +9387,59 @@ namespace CppSharp throw new global::System.InvalidOperationException("Managed instances owned by native code cannot be disposed of."); CppSharp.Parser.AST.NativeLibrary __dummy; NativeToManagedMap.TryRemove(__Instance, out __dummy); - Internal.dtor_0(__Instance); - Marshal.FreeHGlobal(__Instance); + Internal.dtor_0((__Instance + __PointerAdjustment)); + if (__ownsNativeInstance) + Marshal.FreeHGlobal(__Instance); } public string getSymbols(uint i) { - var __ret = Internal.getSymbols_0(__Instance, i); + var __ret = Internal.getSymbols_0((__Instance + __PointerAdjustment), i); return Marshal.PtrToStringAnsi(__ret); } public void addSymbols(string s) { var arg0 = Marshal.StringToHGlobalAnsi(s); - Internal.addSymbols_0(__Instance, arg0); + Internal.addSymbols_0((__Instance + __PointerAdjustment), arg0); Marshal.FreeHGlobal(arg0); } public void clearSymbols() { - Internal.clearSymbols_0(__Instance); + Internal.clearSymbols_0((__Instance + __PointerAdjustment)); } public string getDependencies(uint i) { - var __ret = Internal.getDependencies_0(__Instance, i); + var __ret = Internal.getDependencies_0((__Instance + __PointerAdjustment), i); return Marshal.PtrToStringAnsi(__ret); } public void addDependencies(string s) { var arg0 = Marshal.StringToHGlobalAnsi(s); - Internal.addDependencies_0(__Instance, arg0); + Internal.addDependencies_0((__Instance + __PointerAdjustment), arg0); Marshal.FreeHGlobal(arg0); } public void clearDependencies() { - Internal.clearDependencies_0(__Instance); + Internal.clearDependencies_0((__Instance + __PointerAdjustment)); } public string FileName { get { - var __ret = Internal.getFileName_0(__Instance); + var __ret = Internal.getFileName_0((__Instance + __PointerAdjustment)); return Marshal.PtrToStringAnsi(__ret); } set { var arg0 = Marshal.StringToHGlobalAnsi(value); - Internal.setFileName_0(__Instance, arg0); + Internal.setFileName_0((__Instance + __PointerAdjustment), arg0); Marshal.FreeHGlobal(arg0); } } @@ -9211,7 +9448,7 @@ namespace CppSharp { get { - var __ret = Internal.getSymbolsCount_0(__Instance); + var __ret = Internal.getSymbolsCount_0((__Instance + __PointerAdjustment)); return __ret; } } @@ -9220,7 +9457,7 @@ namespace CppSharp { get { - var __ret = Internal.getDependenciesCount_0(__Instance); + var __ret = Internal.getDependenciesCount_0((__Instance + __PointerAdjustment)); return __ret; } } @@ -9281,19 +9518,21 @@ namespace CppSharp } public global::System.IntPtr __Instance { get; protected set; } + + protected int __PointerAdjustment; public static readonly System.Collections.Concurrent.ConcurrentDictionary NativeToManagedMap = new System.Collections.Concurrent.ConcurrentDictionary(); protected void*[] __OriginalVTables; protected bool __ownsNativeInstance; - public static ASTContext __CreateInstance(global::System.IntPtr native, bool ownsNativeInstance = false) + public static ASTContext __CreateInstance(global::System.IntPtr native, bool ownsNativeInstance = false, bool skipVTables = false) { - return new ASTContext((ASTContext.Internal*) native) { __ownsNativeInstance = ownsNativeInstance }; + return new ASTContext((ASTContext.Internal*) native, skipVTables) { __ownsNativeInstance = ownsNativeInstance }; } - public static ASTContext __CreateInstance(ASTContext.Internal native) + public static ASTContext __CreateInstance(ASTContext.Internal native, bool skipVTables = false) { - return new ASTContext(native); + return new ASTContext(native, skipVTables); } private static ASTContext.Internal* __CopyValue(ASTContext.Internal native) @@ -9303,15 +9542,17 @@ namespace CppSharp return (ASTContext.Internal*) ret; } - private ASTContext(ASTContext.Internal native) - : this(__CopyValue(native)) + private ASTContext(ASTContext.Internal native, bool skipVTables = false) + : this(__CopyValue(native), skipVTables) { __ownsNativeInstance = true; NativeToManagedMap[__Instance] = this; } - protected ASTContext(ASTContext.Internal* native, bool isInternalImpl = false) + protected ASTContext(ASTContext.Internal* native, bool skipVTables = false) { + if (native == null) + return; __Instance = new global::System.IntPtr(native); } @@ -9319,17 +9560,17 @@ namespace CppSharp { __Instance = Marshal.AllocHGlobal(24); __ownsNativeInstance = true; - Internal.ctor_0(__Instance); NativeToManagedMap[__Instance] = this; + Internal.ctor_0((__Instance + __PointerAdjustment)); } public ASTContext(CppSharp.Parser.AST.ASTContext _0) { __Instance = Marshal.AllocHGlobal(24); __ownsNativeInstance = true; - var arg0 = ReferenceEquals(_0, null) ? global::System.IntPtr.Zero : _0.__Instance; - Internal.cctor_2(__Instance, arg0); NativeToManagedMap[__Instance] = this; + var arg0 = ReferenceEquals(_0, null) ? global::System.IntPtr.Zero : _0.__Instance; + Internal.cctor_2((__Instance + __PointerAdjustment), arg0); } public void Dispose() @@ -9343,13 +9584,14 @@ namespace CppSharp throw new global::System.InvalidOperationException("Managed instances owned by native code cannot be disposed of."); CppSharp.Parser.AST.ASTContext __dummy; NativeToManagedMap.TryRemove(__Instance, out __dummy); - Internal.dtor_0(__Instance); - Marshal.FreeHGlobal(__Instance); + Internal.dtor_0((__Instance + __PointerAdjustment)); + if (__ownsNativeInstance) + Marshal.FreeHGlobal(__Instance); } public CppSharp.Parser.AST.TranslationUnit getTranslationUnits(uint i) { - var __ret = Internal.getTranslationUnits_0(__Instance, i); + var __ret = Internal.getTranslationUnits_0((__Instance + __PointerAdjustment), i); CppSharp.Parser.AST.TranslationUnit __result0; if (__ret == IntPtr.Zero) __result0 = null; else if (CppSharp.Parser.AST.TranslationUnit.NativeToManagedMap.ContainsKey(__ret)) @@ -9361,19 +9603,19 @@ namespace CppSharp public void addTranslationUnits(CppSharp.Parser.AST.TranslationUnit s) { var arg0 = ReferenceEquals(s, null) ? global::System.IntPtr.Zero : s.__Instance; - Internal.addTranslationUnits_0(__Instance, arg0); + Internal.addTranslationUnits_0((__Instance + __PointerAdjustment), arg0); } public void clearTranslationUnits() { - Internal.clearTranslationUnits_0(__Instance); + Internal.clearTranslationUnits_0((__Instance + __PointerAdjustment)); } public uint TranslationUnitsCount { get { - var __ret = Internal.getTranslationUnitsCount_0(__Instance); + var __ret = Internal.getTranslationUnitsCount_0((__Instance + __PointerAdjustment)); return __ret; } } @@ -9399,19 +9641,21 @@ namespace CppSharp } public global::System.IntPtr __Instance { get; protected set; } + + protected int __PointerAdjustment; public static readonly System.Collections.Concurrent.ConcurrentDictionary NativeToManagedMap = new System.Collections.Concurrent.ConcurrentDictionary(); protected void*[] __OriginalVTables; protected bool __ownsNativeInstance; - public static Comment __CreateInstance(global::System.IntPtr native, bool ownsNativeInstance = false) + public static Comment __CreateInstance(global::System.IntPtr native, bool ownsNativeInstance = false, bool skipVTables = false) { - return new Comment((Comment.Internal*) native) { __ownsNativeInstance = ownsNativeInstance }; + return new Comment((Comment.Internal*) native, skipVTables) { __ownsNativeInstance = ownsNativeInstance }; } - public static Comment __CreateInstance(Comment.Internal native) + public static Comment __CreateInstance(Comment.Internal native, bool skipVTables = false) { - return new Comment(native); + return new Comment(native, skipVTables); } private static Comment.Internal* __CopyValue(Comment.Internal native) @@ -9421,15 +9665,17 @@ namespace CppSharp return ret; } - private Comment(Comment.Internal native) - : this(__CopyValue(native)) + private Comment(Comment.Internal native, bool skipVTables = false) + : this(__CopyValue(native), skipVTables) { __ownsNativeInstance = true; NativeToManagedMap[__Instance] = this; } - protected Comment(Comment.Internal* native, bool isInternalImpl = false) + protected Comment(Comment.Internal* native, bool skipVTables = false) { + if (native == null) + return; __Instance = new global::System.IntPtr(native); } @@ -9437,17 +9683,17 @@ namespace CppSharp { __Instance = Marshal.AllocHGlobal(4); __ownsNativeInstance = true; - var arg0 = kind; - Internal.ctor_0(__Instance, arg0); NativeToManagedMap[__Instance] = this; + var arg0 = kind; + Internal.ctor_0((__Instance + __PointerAdjustment), arg0); } public Comment(CppSharp.Parser.AST.Comment _0) { __Instance = Marshal.AllocHGlobal(4); __ownsNativeInstance = true; - *((Comment.Internal*) __Instance) = *((Comment.Internal*) _0.__Instance); NativeToManagedMap[__Instance] = this; + *((Comment.Internal*) __Instance) = *((Comment.Internal*) _0.__Instance); } public void Dispose() @@ -9461,7 +9707,8 @@ namespace CppSharp throw new global::System.InvalidOperationException("Managed instances owned by native code cannot be disposed of."); CppSharp.Parser.AST.Comment __dummy; NativeToManagedMap.TryRemove(__Instance, out __dummy); - Marshal.FreeHGlobal(__Instance); + if (__ownsNativeInstance) + Marshal.FreeHGlobal(__Instance); } public CppSharp.Parser.AST.CommentKind Kind @@ -9502,14 +9749,14 @@ namespace CppSharp internal static extern void cctor_2(global::System.IntPtr instance, global::System.IntPtr _0); } - public static new BlockContentComment __CreateInstance(global::System.IntPtr native, bool ownsNativeInstance = false) + public static new BlockContentComment __CreateInstance(global::System.IntPtr native, bool ownsNativeInstance = false, bool skipVTables = false) { - return new BlockContentComment((BlockContentComment.Internal*) native) { __ownsNativeInstance = ownsNativeInstance }; + return new BlockContentComment((BlockContentComment.Internal*) native, skipVTables) { __ownsNativeInstance = ownsNativeInstance }; } - public static BlockContentComment __CreateInstance(BlockContentComment.Internal native) + public static BlockContentComment __CreateInstance(BlockContentComment.Internal native, bool skipVTables = false) { - return new BlockContentComment(native); + return new BlockContentComment(native, skipVTables); } private static BlockContentComment.Internal* __CopyValue(BlockContentComment.Internal native) @@ -9519,16 +9766,20 @@ namespace CppSharp return ret; } - private BlockContentComment(BlockContentComment.Internal native) - : this(__CopyValue(native)) + private BlockContentComment(BlockContentComment.Internal native, bool skipVTables = false) + : this(__CopyValue(native), skipVTables) { __ownsNativeInstance = true; NativeToManagedMap[__Instance] = this; } - protected BlockContentComment(BlockContentComment.Internal* native, bool isInternalImpl = false) - : base((CppSharp.Parser.AST.Comment.Internal*) native) + protected BlockContentComment(BlockContentComment.Internal* native, bool skipVTables = false) + : base((CppSharp.Parser.AST.Comment.Internal*) null) { + __PointerAdjustment = 0; + if (native == null) + return; + __Instance = new global::System.IntPtr(native); } public BlockContentComment() @@ -9536,8 +9787,8 @@ namespace CppSharp { __Instance = Marshal.AllocHGlobal(4); __ownsNativeInstance = true; - Internal.ctor_0(__Instance); NativeToManagedMap[__Instance] = this; + Internal.ctor_0((__Instance + __PointerAdjustment)); } public BlockContentComment(CppSharp.Parser.AST.CommentKind Kind) @@ -9545,9 +9796,9 @@ namespace CppSharp { __Instance = Marshal.AllocHGlobal(4); __ownsNativeInstance = true; - var arg0 = Kind; - Internal.ctor_1(__Instance, arg0); NativeToManagedMap[__Instance] = this; + var arg0 = Kind; + Internal.ctor_1((__Instance + __PointerAdjustment), arg0); } public BlockContentComment(CppSharp.Parser.AST.BlockContentComment _0) @@ -9555,8 +9806,8 @@ namespace CppSharp { __Instance = Marshal.AllocHGlobal(4); __ownsNativeInstance = true; - *((BlockContentComment.Internal*) __Instance) = *((BlockContentComment.Internal*) _0.__Instance); NativeToManagedMap[__Instance] = this; + *((BlockContentComment.Internal*) __Instance) = *((BlockContentComment.Internal*) _0.__Instance); } } @@ -9604,14 +9855,14 @@ namespace CppSharp internal static extern uint getBlocksCount_0(global::System.IntPtr instance); } - public static new FullComment __CreateInstance(global::System.IntPtr native, bool ownsNativeInstance = false) + public static new FullComment __CreateInstance(global::System.IntPtr native, bool ownsNativeInstance = false, bool skipVTables = false) { - return new FullComment((FullComment.Internal*) native) { __ownsNativeInstance = ownsNativeInstance }; + return new FullComment((FullComment.Internal*) native, skipVTables) { __ownsNativeInstance = ownsNativeInstance }; } - public static FullComment __CreateInstance(FullComment.Internal native) + public static FullComment __CreateInstance(FullComment.Internal native, bool skipVTables = false) { - return new FullComment(native); + return new FullComment(native, skipVTables); } private static FullComment.Internal* __CopyValue(FullComment.Internal native) @@ -9621,16 +9872,20 @@ namespace CppSharp return (FullComment.Internal*) ret; } - private FullComment(FullComment.Internal native) - : this(__CopyValue(native)) + private FullComment(FullComment.Internal native, bool skipVTables = false) + : this(__CopyValue(native), skipVTables) { __ownsNativeInstance = true; NativeToManagedMap[__Instance] = this; } - protected FullComment(FullComment.Internal* native, bool isInternalImpl = false) - : base((CppSharp.Parser.AST.Comment.Internal*) native) + protected FullComment(FullComment.Internal* native, bool skipVTables = false) + : base((CppSharp.Parser.AST.Comment.Internal*) null) { + __PointerAdjustment = 0; + if (native == null) + return; + __Instance = new global::System.IntPtr(native); } public FullComment() @@ -9638,8 +9893,8 @@ namespace CppSharp { __Instance = Marshal.AllocHGlobal(32); __ownsNativeInstance = true; - Internal.ctor_0(__Instance); NativeToManagedMap[__Instance] = this; + Internal.ctor_0((__Instance + __PointerAdjustment)); } public FullComment(CppSharp.Parser.AST.FullComment _0) @@ -9647,14 +9902,14 @@ namespace CppSharp { __Instance = Marshal.AllocHGlobal(32); __ownsNativeInstance = true; - var arg0 = ReferenceEquals(_0, null) ? global::System.IntPtr.Zero : _0.__Instance; - Internal.cctor_2(__Instance, arg0); NativeToManagedMap[__Instance] = this; + var arg0 = ReferenceEquals(_0, null) ? global::System.IntPtr.Zero : _0.__Instance; + Internal.cctor_2((__Instance + __PointerAdjustment), arg0); } public CppSharp.Parser.AST.BlockContentComment getBlocks(uint i) { - var __ret = Internal.getBlocks_0(__Instance, i); + var __ret = Internal.getBlocks_0((__Instance + __PointerAdjustment), i); CppSharp.Parser.AST.BlockContentComment __result0; if (__ret == IntPtr.Zero) __result0 = null; else if (CppSharp.Parser.AST.BlockContentComment.NativeToManagedMap.ContainsKey(__ret)) @@ -9666,19 +9921,19 @@ namespace CppSharp public void addBlocks(CppSharp.Parser.AST.BlockContentComment s) { var arg0 = ReferenceEquals(s, null) ? global::System.IntPtr.Zero : s.__Instance; - Internal.addBlocks_0(__Instance, arg0); + Internal.addBlocks_0((__Instance + __PointerAdjustment), arg0); } public void clearBlocks() { - Internal.clearBlocks_0(__Instance); + Internal.clearBlocks_0((__Instance + __PointerAdjustment)); } public uint BlocksCount { get { - var __ret = Internal.getBlocksCount_0(__Instance); + var __ret = Internal.getBlocksCount_0((__Instance + __PointerAdjustment)); return __ret; } } @@ -9768,19 +10023,21 @@ namespace CppSharp } public global::System.IntPtr __Instance { get; protected set; } + + protected int __PointerAdjustment; public static readonly System.Collections.Concurrent.ConcurrentDictionary NativeToManagedMap = new System.Collections.Concurrent.ConcurrentDictionary(); protected void*[] __OriginalVTables; protected bool __ownsNativeInstance; - public static Argument __CreateInstance(global::System.IntPtr native, bool ownsNativeInstance = false) + public static Argument __CreateInstance(global::System.IntPtr native, bool ownsNativeInstance = false, bool skipVTables = false) { - return new Argument((Argument.Internal*) native) { __ownsNativeInstance = ownsNativeInstance }; + return new Argument((Argument.Internal*) native, skipVTables) { __ownsNativeInstance = ownsNativeInstance }; } - public static Argument __CreateInstance(Argument.Internal native) + public static Argument __CreateInstance(Argument.Internal native, bool skipVTables = false) { - return new Argument(native); + return new Argument(native, skipVTables); } private static Argument.Internal* __CopyValue(Argument.Internal native) @@ -9790,15 +10047,17 @@ namespace CppSharp return (Argument.Internal*) ret; } - private Argument(Argument.Internal native) - : this(__CopyValue(native)) + private Argument(Argument.Internal native, bool skipVTables = false) + : this(__CopyValue(native), skipVTables) { __ownsNativeInstance = true; NativeToManagedMap[__Instance] = this; } - protected Argument(Argument.Internal* native, bool isInternalImpl = false) + protected Argument(Argument.Internal* native, bool skipVTables = false) { + if (native == null) + return; __Instance = new global::System.IntPtr(native); } @@ -9806,17 +10065,17 @@ namespace CppSharp { __Instance = Marshal.AllocHGlobal(24); __ownsNativeInstance = true; - Internal.ctor_0(__Instance); NativeToManagedMap[__Instance] = this; + Internal.ctor_0((__Instance + __PointerAdjustment)); } public Argument(CppSharp.Parser.AST.BlockCommandComment.Argument _0) { __Instance = Marshal.AllocHGlobal(24); __ownsNativeInstance = true; - var arg0 = ReferenceEquals(_0, null) ? global::System.IntPtr.Zero : _0.__Instance; - Internal.cctor_2(__Instance, arg0); NativeToManagedMap[__Instance] = this; + var arg0 = ReferenceEquals(_0, null) ? global::System.IntPtr.Zero : _0.__Instance; + Internal.cctor_2((__Instance + __PointerAdjustment), arg0); } public void Dispose() @@ -9830,35 +10089,36 @@ namespace CppSharp throw new global::System.InvalidOperationException("Managed instances owned by native code cannot be disposed of."); CppSharp.Parser.AST.BlockCommandComment.Argument __dummy; NativeToManagedMap.TryRemove(__Instance, out __dummy); - Internal.dtor_0(__Instance); - Marshal.FreeHGlobal(__Instance); + Internal.dtor_0((__Instance + __PointerAdjustment)); + if (__ownsNativeInstance) + Marshal.FreeHGlobal(__Instance); } public string Text { get { - var __ret = Internal.getText_0(__Instance); + var __ret = Internal.getText_0((__Instance + __PointerAdjustment)); return Marshal.PtrToStringAnsi(__ret); } set { var arg0 = Marshal.StringToHGlobalAnsi(value); - Internal.setText_0(__Instance, arg0); + Internal.setText_0((__Instance + __PointerAdjustment), arg0); Marshal.FreeHGlobal(arg0); } } } - public static new BlockCommandComment __CreateInstance(global::System.IntPtr native, bool ownsNativeInstance = false) + public static new BlockCommandComment __CreateInstance(global::System.IntPtr native, bool ownsNativeInstance = false, bool skipVTables = false) { - return new BlockCommandComment((BlockCommandComment.Internal*) native) { __ownsNativeInstance = ownsNativeInstance }; + return new BlockCommandComment((BlockCommandComment.Internal*) native, skipVTables) { __ownsNativeInstance = ownsNativeInstance }; } - public static BlockCommandComment __CreateInstance(BlockCommandComment.Internal native) + public static BlockCommandComment __CreateInstance(BlockCommandComment.Internal native, bool skipVTables = false) { - return new BlockCommandComment(native); + return new BlockCommandComment(native, skipVTables); } private static BlockCommandComment.Internal* __CopyValue(BlockCommandComment.Internal native) @@ -9868,16 +10128,20 @@ namespace CppSharp return (BlockCommandComment.Internal*) ret; } - private BlockCommandComment(BlockCommandComment.Internal native) - : this(__CopyValue(native)) + private BlockCommandComment(BlockCommandComment.Internal native, bool skipVTables = false) + : this(__CopyValue(native), skipVTables) { __ownsNativeInstance = true; NativeToManagedMap[__Instance] = this; } - protected BlockCommandComment(BlockCommandComment.Internal* native, bool isInternalImpl = false) - : base((CppSharp.Parser.AST.BlockContentComment.Internal*) native) + protected BlockCommandComment(BlockCommandComment.Internal* native, bool skipVTables = false) + : base((CppSharp.Parser.AST.BlockContentComment.Internal*) null) { + __PointerAdjustment = 0; + if (native == null) + return; + __Instance = new global::System.IntPtr(native); } public BlockCommandComment() @@ -9885,8 +10149,8 @@ namespace CppSharp { __Instance = Marshal.AllocHGlobal(32); __ownsNativeInstance = true; - Internal.ctor_0(__Instance); NativeToManagedMap[__Instance] = this; + Internal.ctor_0((__Instance + __PointerAdjustment)); } public BlockCommandComment(CppSharp.Parser.AST.CommentKind Kind) @@ -9894,9 +10158,9 @@ namespace CppSharp { __Instance = Marshal.AllocHGlobal(32); __ownsNativeInstance = true; - var arg0 = Kind; - Internal.ctor_1(__Instance, arg0); NativeToManagedMap[__Instance] = this; + var arg0 = Kind; + Internal.ctor_1((__Instance + __PointerAdjustment), arg0); } public BlockCommandComment(CppSharp.Parser.AST.BlockCommandComment _0) @@ -9904,34 +10168,34 @@ namespace CppSharp { __Instance = Marshal.AllocHGlobal(32); __ownsNativeInstance = true; - var arg0 = ReferenceEquals(_0, null) ? global::System.IntPtr.Zero : _0.__Instance; - Internal.cctor_3(__Instance, arg0); NativeToManagedMap[__Instance] = this; + var arg0 = ReferenceEquals(_0, null) ? global::System.IntPtr.Zero : _0.__Instance; + Internal.cctor_3((__Instance + __PointerAdjustment), arg0); } public CppSharp.Parser.AST.BlockCommandComment.Argument getArguments(uint i) { var __ret = new CppSharp.Parser.AST.BlockCommandComment.Argument.Internal(); - Internal.getArguments_0(new IntPtr(&__ret), __Instance, i); + Internal.getArguments_0(new IntPtr(&__ret), (__Instance + __PointerAdjustment), i); return CppSharp.Parser.AST.BlockCommandComment.Argument.__CreateInstance(__ret); } public void addArguments(CppSharp.Parser.AST.BlockCommandComment.Argument s) { var arg0 = ReferenceEquals(s, null) ? global::System.IntPtr.Zero : s.__Instance; - Internal.addArguments_0(__Instance, arg0); + Internal.addArguments_0((__Instance + __PointerAdjustment), arg0); } public void clearArguments() { - Internal.clearArguments_0(__Instance); + Internal.clearArguments_0((__Instance + __PointerAdjustment)); } public uint ArgumentsCount { get { - var __ret = Internal.getArgumentsCount_0(__Instance); + var __ret = Internal.getArgumentsCount_0((__Instance + __PointerAdjustment)); return __ret; } } @@ -9990,14 +10254,14 @@ namespace CppSharp InOut = 2 } - public static new ParamCommandComment __CreateInstance(global::System.IntPtr native, bool ownsNativeInstance = false) + public static new ParamCommandComment __CreateInstance(global::System.IntPtr native, bool ownsNativeInstance = false, bool skipVTables = false) { - return new ParamCommandComment((ParamCommandComment.Internal*) native) { __ownsNativeInstance = ownsNativeInstance }; + return new ParamCommandComment((ParamCommandComment.Internal*) native, skipVTables) { __ownsNativeInstance = ownsNativeInstance }; } - public static ParamCommandComment __CreateInstance(ParamCommandComment.Internal native) + public static ParamCommandComment __CreateInstance(ParamCommandComment.Internal native, bool skipVTables = false) { - return new ParamCommandComment(native); + return new ParamCommandComment(native, skipVTables); } private static ParamCommandComment.Internal* __CopyValue(ParamCommandComment.Internal native) @@ -10007,16 +10271,20 @@ namespace CppSharp return (ParamCommandComment.Internal*) ret; } - private ParamCommandComment(ParamCommandComment.Internal native) - : this(__CopyValue(native)) + private ParamCommandComment(ParamCommandComment.Internal native, bool skipVTables = false) + : this(__CopyValue(native), skipVTables) { __ownsNativeInstance = true; NativeToManagedMap[__Instance] = this; } - protected ParamCommandComment(ParamCommandComment.Internal* native, bool isInternalImpl = false) - : base((CppSharp.Parser.AST.BlockCommandComment.Internal*) native) + protected ParamCommandComment(ParamCommandComment.Internal* native, bool skipVTables = false) + : base((CppSharp.Parser.AST.BlockCommandComment.Internal*) null) { + __PointerAdjustment = 0; + if (native == null) + return; + __Instance = new global::System.IntPtr(native); } public ParamCommandComment() @@ -10024,8 +10292,8 @@ namespace CppSharp { __Instance = Marshal.AllocHGlobal(40); __ownsNativeInstance = true; - Internal.ctor_0(__Instance); NativeToManagedMap[__Instance] = this; + Internal.ctor_0((__Instance + __PointerAdjustment)); } public ParamCommandComment(CppSharp.Parser.AST.ParamCommandComment _0) @@ -10033,9 +10301,9 @@ namespace CppSharp { __Instance = Marshal.AllocHGlobal(40); __ownsNativeInstance = true; - var arg0 = ReferenceEquals(_0, null) ? global::System.IntPtr.Zero : _0.__Instance; - Internal.cctor_1(__Instance, arg0); NativeToManagedMap[__Instance] = this; + var arg0 = ReferenceEquals(_0, null) ? global::System.IntPtr.Zero : _0.__Instance; + Internal.cctor_1((__Instance + __PointerAdjustment), arg0); } public CppSharp.Parser.AST.ParamCommandComment.PassDirection Direction @@ -10112,14 +10380,14 @@ namespace CppSharp internal static extern uint getPositionCount_0(global::System.IntPtr instance); } - public static new TParamCommandComment __CreateInstance(global::System.IntPtr native, bool ownsNativeInstance = false) + public static new TParamCommandComment __CreateInstance(global::System.IntPtr native, bool ownsNativeInstance = false, bool skipVTables = false) { - return new TParamCommandComment((TParamCommandComment.Internal*) native) { __ownsNativeInstance = ownsNativeInstance }; + return new TParamCommandComment((TParamCommandComment.Internal*) native, skipVTables) { __ownsNativeInstance = ownsNativeInstance }; } - public static TParamCommandComment __CreateInstance(TParamCommandComment.Internal native) + public static TParamCommandComment __CreateInstance(TParamCommandComment.Internal native, bool skipVTables = false) { - return new TParamCommandComment(native); + return new TParamCommandComment(native, skipVTables); } private static TParamCommandComment.Internal* __CopyValue(TParamCommandComment.Internal native) @@ -10129,16 +10397,20 @@ namespace CppSharp return (TParamCommandComment.Internal*) ret; } - private TParamCommandComment(TParamCommandComment.Internal native) - : this(__CopyValue(native)) + private TParamCommandComment(TParamCommandComment.Internal native, bool skipVTables = false) + : this(__CopyValue(native), skipVTables) { __ownsNativeInstance = true; NativeToManagedMap[__Instance] = this; } - protected TParamCommandComment(TParamCommandComment.Internal* native, bool isInternalImpl = false) - : base((CppSharp.Parser.AST.BlockCommandComment.Internal*) native) + protected TParamCommandComment(TParamCommandComment.Internal* native, bool skipVTables = false) + : base((CppSharp.Parser.AST.BlockCommandComment.Internal*) null) { + __PointerAdjustment = 0; + if (native == null) + return; + __Instance = new global::System.IntPtr(native); } public TParamCommandComment() @@ -10146,8 +10418,8 @@ namespace CppSharp { __Instance = Marshal.AllocHGlobal(56); __ownsNativeInstance = true; - Internal.ctor_0(__Instance); NativeToManagedMap[__Instance] = this; + Internal.ctor_0((__Instance + __PointerAdjustment)); } public TParamCommandComment(CppSharp.Parser.AST.TParamCommandComment _0) @@ -10155,35 +10427,36 @@ namespace CppSharp { __Instance = Marshal.AllocHGlobal(56); __ownsNativeInstance = true; - var arg0 = ReferenceEquals(_0, null) ? global::System.IntPtr.Zero : _0.__Instance; - Internal.cctor_2(__Instance, arg0); NativeToManagedMap[__Instance] = this; + var arg0 = ReferenceEquals(_0, null) ? global::System.IntPtr.Zero : _0.__Instance; + Internal.cctor_2((__Instance + __PointerAdjustment), arg0); } public uint getPosition(uint i) { - var __ret = Internal.getPosition_0(__Instance, i); + var __ret = Internal.getPosition_0((__Instance + __PointerAdjustment), i); return __ret; } public void addPosition(ref uint s) { - fixed (uint* arg0 = &s) + fixed (uint* __refParamPtr0 = &s) { - Internal.addPosition_0(__Instance, arg0); + var arg0 = __refParamPtr0; + Internal.addPosition_0((__Instance + __PointerAdjustment), arg0); } } public void clearPosition() { - Internal.clearPosition_0(__Instance); + Internal.clearPosition_0((__Instance + __PointerAdjustment)); } public uint PositionCount { get { - var __ret = Internal.getPositionCount_0(__Instance); + var __ret = Internal.getPositionCount_0((__Instance + __PointerAdjustment)); return __ret; } } @@ -10223,14 +10496,14 @@ namespace CppSharp internal static extern void setText_0(global::System.IntPtr instance, global::System.IntPtr s); } - public static new VerbatimBlockLineComment __CreateInstance(global::System.IntPtr native, bool ownsNativeInstance = false) + public static new VerbatimBlockLineComment __CreateInstance(global::System.IntPtr native, bool ownsNativeInstance = false, bool skipVTables = false) { - return new VerbatimBlockLineComment((VerbatimBlockLineComment.Internal*) native) { __ownsNativeInstance = ownsNativeInstance }; + return new VerbatimBlockLineComment((VerbatimBlockLineComment.Internal*) native, skipVTables) { __ownsNativeInstance = ownsNativeInstance }; } - public static VerbatimBlockLineComment __CreateInstance(VerbatimBlockLineComment.Internal native) + public static VerbatimBlockLineComment __CreateInstance(VerbatimBlockLineComment.Internal native, bool skipVTables = false) { - return new VerbatimBlockLineComment(native); + return new VerbatimBlockLineComment(native, skipVTables); } private static VerbatimBlockLineComment.Internal* __CopyValue(VerbatimBlockLineComment.Internal native) @@ -10240,16 +10513,20 @@ namespace CppSharp return (VerbatimBlockLineComment.Internal*) ret; } - private VerbatimBlockLineComment(VerbatimBlockLineComment.Internal native) - : this(__CopyValue(native)) + private VerbatimBlockLineComment(VerbatimBlockLineComment.Internal native, bool skipVTables = false) + : this(__CopyValue(native), skipVTables) { __ownsNativeInstance = true; NativeToManagedMap[__Instance] = this; } - protected VerbatimBlockLineComment(VerbatimBlockLineComment.Internal* native, bool isInternalImpl = false) - : base((CppSharp.Parser.AST.Comment.Internal*) native) + protected VerbatimBlockLineComment(VerbatimBlockLineComment.Internal* native, bool skipVTables = false) + : base((CppSharp.Parser.AST.Comment.Internal*) null) { + __PointerAdjustment = 0; + if (native == null) + return; + __Instance = new global::System.IntPtr(native); } public VerbatimBlockLineComment() @@ -10257,8 +10534,8 @@ namespace CppSharp { __Instance = Marshal.AllocHGlobal(32); __ownsNativeInstance = true; - Internal.ctor_0(__Instance); NativeToManagedMap[__Instance] = this; + Internal.ctor_0((__Instance + __PointerAdjustment)); } public VerbatimBlockLineComment(CppSharp.Parser.AST.VerbatimBlockLineComment _0) @@ -10266,23 +10543,23 @@ namespace CppSharp { __Instance = Marshal.AllocHGlobal(32); __ownsNativeInstance = true; - var arg0 = ReferenceEquals(_0, null) ? global::System.IntPtr.Zero : _0.__Instance; - Internal.cctor_2(__Instance, arg0); NativeToManagedMap[__Instance] = this; + var arg0 = ReferenceEquals(_0, null) ? global::System.IntPtr.Zero : _0.__Instance; + Internal.cctor_2((__Instance + __PointerAdjustment), arg0); } public string Text { get { - var __ret = Internal.getText_0(__Instance); + var __ret = Internal.getText_0((__Instance + __PointerAdjustment)); return Marshal.PtrToStringAnsi(__ret); } set { var arg0 = Marshal.StringToHGlobalAnsi(value); - Internal.setText_0(__Instance, arg0); + Internal.setText_0((__Instance + __PointerAdjustment), arg0); Marshal.FreeHGlobal(arg0); } } @@ -10335,14 +10612,14 @@ namespace CppSharp internal static extern uint getLinesCount_0(global::System.IntPtr instance); } - public static new VerbatimBlockComment __CreateInstance(global::System.IntPtr native, bool ownsNativeInstance = false) + public static new VerbatimBlockComment __CreateInstance(global::System.IntPtr native, bool ownsNativeInstance = false, bool skipVTables = false) { - return new VerbatimBlockComment((VerbatimBlockComment.Internal*) native) { __ownsNativeInstance = ownsNativeInstance }; + return new VerbatimBlockComment((VerbatimBlockComment.Internal*) native, skipVTables) { __ownsNativeInstance = ownsNativeInstance }; } - public static VerbatimBlockComment __CreateInstance(VerbatimBlockComment.Internal native) + public static VerbatimBlockComment __CreateInstance(VerbatimBlockComment.Internal native, bool skipVTables = false) { - return new VerbatimBlockComment(native); + return new VerbatimBlockComment(native, skipVTables); } private static VerbatimBlockComment.Internal* __CopyValue(VerbatimBlockComment.Internal native) @@ -10352,16 +10629,20 @@ namespace CppSharp return (VerbatimBlockComment.Internal*) ret; } - private VerbatimBlockComment(VerbatimBlockComment.Internal native) - : this(__CopyValue(native)) + private VerbatimBlockComment(VerbatimBlockComment.Internal native, bool skipVTables = false) + : this(__CopyValue(native), skipVTables) { __ownsNativeInstance = true; NativeToManagedMap[__Instance] = this; } - protected VerbatimBlockComment(VerbatimBlockComment.Internal* native, bool isInternalImpl = false) - : base((CppSharp.Parser.AST.BlockCommandComment.Internal*) native) + protected VerbatimBlockComment(VerbatimBlockComment.Internal* native, bool skipVTables = false) + : base((CppSharp.Parser.AST.BlockCommandComment.Internal*) null) { + __PointerAdjustment = 0; + if (native == null) + return; + __Instance = new global::System.IntPtr(native); } public VerbatimBlockComment() @@ -10369,8 +10650,8 @@ namespace CppSharp { __Instance = Marshal.AllocHGlobal(56); __ownsNativeInstance = true; - Internal.ctor_0(__Instance); NativeToManagedMap[__Instance] = this; + Internal.ctor_0((__Instance + __PointerAdjustment)); } public VerbatimBlockComment(CppSharp.Parser.AST.VerbatimBlockComment _0) @@ -10378,14 +10659,14 @@ namespace CppSharp { __Instance = Marshal.AllocHGlobal(56); __ownsNativeInstance = true; - var arg0 = ReferenceEquals(_0, null) ? global::System.IntPtr.Zero : _0.__Instance; - Internal.cctor_2(__Instance, arg0); NativeToManagedMap[__Instance] = this; + var arg0 = ReferenceEquals(_0, null) ? global::System.IntPtr.Zero : _0.__Instance; + Internal.cctor_2((__Instance + __PointerAdjustment), arg0); } public CppSharp.Parser.AST.VerbatimBlockLineComment getLines(uint i) { - var __ret = Internal.getLines_0(__Instance, i); + var __ret = Internal.getLines_0((__Instance + __PointerAdjustment), i); CppSharp.Parser.AST.VerbatimBlockLineComment __result0; if (__ret == IntPtr.Zero) __result0 = null; else if (CppSharp.Parser.AST.VerbatimBlockLineComment.NativeToManagedMap.ContainsKey(__ret)) @@ -10397,19 +10678,19 @@ namespace CppSharp public void addLines(CppSharp.Parser.AST.VerbatimBlockLineComment s) { var arg0 = ReferenceEquals(s, null) ? global::System.IntPtr.Zero : s.__Instance; - Internal.addLines_0(__Instance, arg0); + Internal.addLines_0((__Instance + __PointerAdjustment), arg0); } public void clearLines() { - Internal.clearLines_0(__Instance); + Internal.clearLines_0((__Instance + __PointerAdjustment)); } public uint LinesCount { get { - var __ret = Internal.getLinesCount_0(__Instance); + var __ret = Internal.getLinesCount_0((__Instance + __PointerAdjustment)); return __ret; } } @@ -10452,14 +10733,14 @@ namespace CppSharp internal static extern void setText_0(global::System.IntPtr instance, global::System.IntPtr s); } - public static new VerbatimLineComment __CreateInstance(global::System.IntPtr native, bool ownsNativeInstance = false) + public static new VerbatimLineComment __CreateInstance(global::System.IntPtr native, bool ownsNativeInstance = false, bool skipVTables = false) { - return new VerbatimLineComment((VerbatimLineComment.Internal*) native) { __ownsNativeInstance = ownsNativeInstance }; + return new VerbatimLineComment((VerbatimLineComment.Internal*) native, skipVTables) { __ownsNativeInstance = ownsNativeInstance }; } - public static VerbatimLineComment __CreateInstance(VerbatimLineComment.Internal native) + public static VerbatimLineComment __CreateInstance(VerbatimLineComment.Internal native, bool skipVTables = false) { - return new VerbatimLineComment(native); + return new VerbatimLineComment(native, skipVTables); } private static VerbatimLineComment.Internal* __CopyValue(VerbatimLineComment.Internal native) @@ -10469,16 +10750,20 @@ namespace CppSharp return (VerbatimLineComment.Internal*) ret; } - private VerbatimLineComment(VerbatimLineComment.Internal native) - : this(__CopyValue(native)) + private VerbatimLineComment(VerbatimLineComment.Internal native, bool skipVTables = false) + : this(__CopyValue(native), skipVTables) { __ownsNativeInstance = true; NativeToManagedMap[__Instance] = this; } - protected VerbatimLineComment(VerbatimLineComment.Internal* native, bool isInternalImpl = false) - : base((CppSharp.Parser.AST.BlockCommandComment.Internal*) native) + protected VerbatimLineComment(VerbatimLineComment.Internal* native, bool skipVTables = false) + : base((CppSharp.Parser.AST.BlockCommandComment.Internal*) null) { + __PointerAdjustment = 0; + if (native == null) + return; + __Instance = new global::System.IntPtr(native); } public VerbatimLineComment() @@ -10486,8 +10771,8 @@ namespace CppSharp { __Instance = Marshal.AllocHGlobal(56); __ownsNativeInstance = true; - Internal.ctor_0(__Instance); NativeToManagedMap[__Instance] = this; + Internal.ctor_0((__Instance + __PointerAdjustment)); } public VerbatimLineComment(CppSharp.Parser.AST.VerbatimLineComment _0) @@ -10495,23 +10780,23 @@ namespace CppSharp { __Instance = Marshal.AllocHGlobal(56); __ownsNativeInstance = true; - var arg0 = ReferenceEquals(_0, null) ? global::System.IntPtr.Zero : _0.__Instance; - Internal.cctor_2(__Instance, arg0); NativeToManagedMap[__Instance] = this; + var arg0 = ReferenceEquals(_0, null) ? global::System.IntPtr.Zero : _0.__Instance; + Internal.cctor_2((__Instance + __PointerAdjustment), arg0); } public string Text { get { - var __ret = Internal.getText_0(__Instance); + var __ret = Internal.getText_0((__Instance + __PointerAdjustment)); return Marshal.PtrToStringAnsi(__ret); } set { var arg0 = Marshal.StringToHGlobalAnsi(value); - Internal.setText_0(__Instance, arg0); + Internal.setText_0((__Instance + __PointerAdjustment), arg0); Marshal.FreeHGlobal(arg0); } } @@ -10541,14 +10826,14 @@ namespace CppSharp internal static extern void cctor_2(global::System.IntPtr instance, global::System.IntPtr _0); } - public static new InlineContentComment __CreateInstance(global::System.IntPtr native, bool ownsNativeInstance = false) + public static new InlineContentComment __CreateInstance(global::System.IntPtr native, bool ownsNativeInstance = false, bool skipVTables = false) { - return new InlineContentComment((InlineContentComment.Internal*) native) { __ownsNativeInstance = ownsNativeInstance }; + return new InlineContentComment((InlineContentComment.Internal*) native, skipVTables) { __ownsNativeInstance = ownsNativeInstance }; } - public static InlineContentComment __CreateInstance(InlineContentComment.Internal native) + public static InlineContentComment __CreateInstance(InlineContentComment.Internal native, bool skipVTables = false) { - return new InlineContentComment(native); + return new InlineContentComment(native, skipVTables); } private static InlineContentComment.Internal* __CopyValue(InlineContentComment.Internal native) @@ -10558,16 +10843,20 @@ namespace CppSharp return ret; } - private InlineContentComment(InlineContentComment.Internal native) - : this(__CopyValue(native)) + private InlineContentComment(InlineContentComment.Internal native, bool skipVTables = false) + : this(__CopyValue(native), skipVTables) { __ownsNativeInstance = true; NativeToManagedMap[__Instance] = this; } - protected InlineContentComment(InlineContentComment.Internal* native, bool isInternalImpl = false) - : base((CppSharp.Parser.AST.Comment.Internal*) native) + protected InlineContentComment(InlineContentComment.Internal* native, bool skipVTables = false) + : base((CppSharp.Parser.AST.Comment.Internal*) null) { + __PointerAdjustment = 0; + if (native == null) + return; + __Instance = new global::System.IntPtr(native); } public InlineContentComment() @@ -10575,8 +10864,8 @@ namespace CppSharp { __Instance = Marshal.AllocHGlobal(4); __ownsNativeInstance = true; - Internal.ctor_0(__Instance); NativeToManagedMap[__Instance] = this; + Internal.ctor_0((__Instance + __PointerAdjustment)); } public InlineContentComment(CppSharp.Parser.AST.CommentKind Kind) @@ -10584,9 +10873,9 @@ namespace CppSharp { __Instance = Marshal.AllocHGlobal(4); __ownsNativeInstance = true; - var arg0 = Kind; - Internal.ctor_1(__Instance, arg0); NativeToManagedMap[__Instance] = this; + var arg0 = Kind; + Internal.ctor_1((__Instance + __PointerAdjustment), arg0); } public InlineContentComment(CppSharp.Parser.AST.InlineContentComment _0) @@ -10594,8 +10883,8 @@ namespace CppSharp { __Instance = Marshal.AllocHGlobal(4); __ownsNativeInstance = true; - *((InlineContentComment.Internal*) __Instance) = *((InlineContentComment.Internal*) _0.__Instance); NativeToManagedMap[__Instance] = this; + *((InlineContentComment.Internal*) __Instance) = *((InlineContentComment.Internal*) _0.__Instance); } } @@ -10646,14 +10935,14 @@ namespace CppSharp internal static extern uint getContentCount_0(global::System.IntPtr instance); } - public static new ParagraphComment __CreateInstance(global::System.IntPtr native, bool ownsNativeInstance = false) + public static new ParagraphComment __CreateInstance(global::System.IntPtr native, bool ownsNativeInstance = false, bool skipVTables = false) { - return new ParagraphComment((ParagraphComment.Internal*) native) { __ownsNativeInstance = ownsNativeInstance }; + return new ParagraphComment((ParagraphComment.Internal*) native, skipVTables) { __ownsNativeInstance = ownsNativeInstance }; } - public static ParagraphComment __CreateInstance(ParagraphComment.Internal native) + public static ParagraphComment __CreateInstance(ParagraphComment.Internal native, bool skipVTables = false) { - return new ParagraphComment(native); + return new ParagraphComment(native, skipVTables); } private static ParagraphComment.Internal* __CopyValue(ParagraphComment.Internal native) @@ -10663,16 +10952,20 @@ namespace CppSharp return (ParagraphComment.Internal*) ret; } - private ParagraphComment(ParagraphComment.Internal native) - : this(__CopyValue(native)) + private ParagraphComment(ParagraphComment.Internal native, bool skipVTables = false) + : this(__CopyValue(native), skipVTables) { __ownsNativeInstance = true; NativeToManagedMap[__Instance] = this; } - protected ParagraphComment(ParagraphComment.Internal* native, bool isInternalImpl = false) - : base((CppSharp.Parser.AST.BlockContentComment.Internal*) native) + protected ParagraphComment(ParagraphComment.Internal* native, bool skipVTables = false) + : base((CppSharp.Parser.AST.BlockContentComment.Internal*) null) { + __PointerAdjustment = 0; + if (native == null) + return; + __Instance = new global::System.IntPtr(native); } public ParagraphComment() @@ -10680,8 +10973,8 @@ namespace CppSharp { __Instance = Marshal.AllocHGlobal(32); __ownsNativeInstance = true; - Internal.ctor_0(__Instance); NativeToManagedMap[__Instance] = this; + Internal.ctor_0((__Instance + __PointerAdjustment)); } public ParagraphComment(CppSharp.Parser.AST.ParagraphComment _0) @@ -10689,14 +10982,14 @@ namespace CppSharp { __Instance = Marshal.AllocHGlobal(32); __ownsNativeInstance = true; - var arg0 = ReferenceEquals(_0, null) ? global::System.IntPtr.Zero : _0.__Instance; - Internal.cctor_2(__Instance, arg0); NativeToManagedMap[__Instance] = this; + var arg0 = ReferenceEquals(_0, null) ? global::System.IntPtr.Zero : _0.__Instance; + Internal.cctor_2((__Instance + __PointerAdjustment), arg0); } public CppSharp.Parser.AST.InlineContentComment getContent(uint i) { - var __ret = Internal.getContent_0(__Instance, i); + var __ret = Internal.getContent_0((__Instance + __PointerAdjustment), i); CppSharp.Parser.AST.InlineContentComment __result0; if (__ret == IntPtr.Zero) __result0 = null; else if (CppSharp.Parser.AST.InlineContentComment.NativeToManagedMap.ContainsKey(__ret)) @@ -10708,19 +11001,19 @@ namespace CppSharp public void addContent(CppSharp.Parser.AST.InlineContentComment s) { var arg0 = ReferenceEquals(s, null) ? global::System.IntPtr.Zero : s.__Instance; - Internal.addContent_0(__Instance, arg0); + Internal.addContent_0((__Instance + __PointerAdjustment), arg0); } public void clearContent() { - Internal.clearContent_0(__Instance); + Internal.clearContent_0((__Instance + __PointerAdjustment)); } public uint ContentCount { get { - var __ret = Internal.getContentCount_0(__Instance); + var __ret = Internal.getContentCount_0((__Instance + __PointerAdjustment)); return __ret; } } @@ -10826,19 +11119,21 @@ namespace CppSharp } public global::System.IntPtr __Instance { get; protected set; } + + protected int __PointerAdjustment; public static readonly System.Collections.Concurrent.ConcurrentDictionary NativeToManagedMap = new System.Collections.Concurrent.ConcurrentDictionary(); protected void*[] __OriginalVTables; protected bool __ownsNativeInstance; - public static Argument __CreateInstance(global::System.IntPtr native, bool ownsNativeInstance = false) + public static Argument __CreateInstance(global::System.IntPtr native, bool ownsNativeInstance = false, bool skipVTables = false) { - return new Argument((Argument.Internal*) native) { __ownsNativeInstance = ownsNativeInstance }; + return new Argument((Argument.Internal*) native, skipVTables) { __ownsNativeInstance = ownsNativeInstance }; } - public static Argument __CreateInstance(Argument.Internal native) + public static Argument __CreateInstance(Argument.Internal native, bool skipVTables = false) { - return new Argument(native); + return new Argument(native, skipVTables); } private static Argument.Internal* __CopyValue(Argument.Internal native) @@ -10848,15 +11143,17 @@ namespace CppSharp return (Argument.Internal*) ret; } - private Argument(Argument.Internal native) - : this(__CopyValue(native)) + private Argument(Argument.Internal native, bool skipVTables = false) + : this(__CopyValue(native), skipVTables) { __ownsNativeInstance = true; NativeToManagedMap[__Instance] = this; } - protected Argument(Argument.Internal* native, bool isInternalImpl = false) + protected Argument(Argument.Internal* native, bool skipVTables = false) { + if (native == null) + return; __Instance = new global::System.IntPtr(native); } @@ -10864,17 +11161,17 @@ namespace CppSharp { __Instance = Marshal.AllocHGlobal(24); __ownsNativeInstance = true; - Internal.ctor_0(__Instance); NativeToManagedMap[__Instance] = this; + Internal.ctor_0((__Instance + __PointerAdjustment)); } public Argument(CppSharp.Parser.AST.InlineCommandComment.Argument _0) { __Instance = Marshal.AllocHGlobal(24); __ownsNativeInstance = true; - var arg0 = ReferenceEquals(_0, null) ? global::System.IntPtr.Zero : _0.__Instance; - Internal.cctor_2(__Instance, arg0); NativeToManagedMap[__Instance] = this; + var arg0 = ReferenceEquals(_0, null) ? global::System.IntPtr.Zero : _0.__Instance; + Internal.cctor_2((__Instance + __PointerAdjustment), arg0); } public void Dispose() @@ -10888,35 +11185,36 @@ namespace CppSharp throw new global::System.InvalidOperationException("Managed instances owned by native code cannot be disposed of."); CppSharp.Parser.AST.InlineCommandComment.Argument __dummy; NativeToManagedMap.TryRemove(__Instance, out __dummy); - Internal.dtor_0(__Instance); - Marshal.FreeHGlobal(__Instance); + Internal.dtor_0((__Instance + __PointerAdjustment)); + if (__ownsNativeInstance) + Marshal.FreeHGlobal(__Instance); } public string Text { get { - var __ret = Internal.getText_0(__Instance); + var __ret = Internal.getText_0((__Instance + __PointerAdjustment)); return Marshal.PtrToStringAnsi(__ret); } set { var arg0 = Marshal.StringToHGlobalAnsi(value); - Internal.setText_0(__Instance, arg0); + Internal.setText_0((__Instance + __PointerAdjustment), arg0); Marshal.FreeHGlobal(arg0); } } } - public static new InlineCommandComment __CreateInstance(global::System.IntPtr native, bool ownsNativeInstance = false) + public static new InlineCommandComment __CreateInstance(global::System.IntPtr native, bool ownsNativeInstance = false, bool skipVTables = false) { - return new InlineCommandComment((InlineCommandComment.Internal*) native) { __ownsNativeInstance = ownsNativeInstance }; + return new InlineCommandComment((InlineCommandComment.Internal*) native, skipVTables) { __ownsNativeInstance = ownsNativeInstance }; } - public static InlineCommandComment __CreateInstance(InlineCommandComment.Internal native) + public static InlineCommandComment __CreateInstance(InlineCommandComment.Internal native, bool skipVTables = false) { - return new InlineCommandComment(native); + return new InlineCommandComment(native, skipVTables); } private static InlineCommandComment.Internal* __CopyValue(InlineCommandComment.Internal native) @@ -10926,16 +11224,20 @@ namespace CppSharp return (InlineCommandComment.Internal*) ret; } - private InlineCommandComment(InlineCommandComment.Internal native) - : this(__CopyValue(native)) + private InlineCommandComment(InlineCommandComment.Internal native, bool skipVTables = false) + : this(__CopyValue(native), skipVTables) { __ownsNativeInstance = true; NativeToManagedMap[__Instance] = this; } - protected InlineCommandComment(InlineCommandComment.Internal* native, bool isInternalImpl = false) - : base((CppSharp.Parser.AST.InlineContentComment.Internal*) native) + protected InlineCommandComment(InlineCommandComment.Internal* native, bool skipVTables = false) + : base((CppSharp.Parser.AST.InlineContentComment.Internal*) null) { + __PointerAdjustment = 0; + if (native == null) + return; + __Instance = new global::System.IntPtr(native); } public InlineCommandComment() @@ -10943,8 +11245,8 @@ namespace CppSharp { __Instance = Marshal.AllocHGlobal(32); __ownsNativeInstance = true; - Internal.ctor_0(__Instance); NativeToManagedMap[__Instance] = this; + Internal.ctor_0((__Instance + __PointerAdjustment)); } public InlineCommandComment(CppSharp.Parser.AST.InlineCommandComment _0) @@ -10952,34 +11254,34 @@ namespace CppSharp { __Instance = Marshal.AllocHGlobal(32); __ownsNativeInstance = true; - var arg0 = ReferenceEquals(_0, null) ? global::System.IntPtr.Zero : _0.__Instance; - Internal.cctor_2(__Instance, arg0); NativeToManagedMap[__Instance] = this; + var arg0 = ReferenceEquals(_0, null) ? global::System.IntPtr.Zero : _0.__Instance; + Internal.cctor_2((__Instance + __PointerAdjustment), arg0); } public CppSharp.Parser.AST.InlineCommandComment.Argument getArguments(uint i) { var __ret = new CppSharp.Parser.AST.InlineCommandComment.Argument.Internal(); - Internal.getArguments_0(new IntPtr(&__ret), __Instance, i); + Internal.getArguments_0(new IntPtr(&__ret), (__Instance + __PointerAdjustment), i); return CppSharp.Parser.AST.InlineCommandComment.Argument.__CreateInstance(__ret); } public void addArguments(CppSharp.Parser.AST.InlineCommandComment.Argument s) { var arg0 = ReferenceEquals(s, null) ? global::System.IntPtr.Zero : s.__Instance; - Internal.addArguments_0(__Instance, arg0); + Internal.addArguments_0((__Instance + __PointerAdjustment), arg0); } public void clearArguments() { - Internal.clearArguments_0(__Instance); + Internal.clearArguments_0((__Instance + __PointerAdjustment)); } public uint ArgumentsCount { get { - var __ret = Internal.getArgumentsCount_0(__Instance); + var __ret = Internal.getArgumentsCount_0((__Instance + __PointerAdjustment)); return __ret; } } @@ -11022,14 +11324,14 @@ namespace CppSharp internal static extern void cctor_2(global::System.IntPtr instance, global::System.IntPtr _0); } - public static new HTMLTagComment __CreateInstance(global::System.IntPtr native, bool ownsNativeInstance = false) + public static new HTMLTagComment __CreateInstance(global::System.IntPtr native, bool ownsNativeInstance = false, bool skipVTables = false) { - return new HTMLTagComment((HTMLTagComment.Internal*) native) { __ownsNativeInstance = ownsNativeInstance }; + return new HTMLTagComment((HTMLTagComment.Internal*) native, skipVTables) { __ownsNativeInstance = ownsNativeInstance }; } - public static HTMLTagComment __CreateInstance(HTMLTagComment.Internal native) + public static HTMLTagComment __CreateInstance(HTMLTagComment.Internal native, bool skipVTables = false) { - return new HTMLTagComment(native); + return new HTMLTagComment(native, skipVTables); } private static HTMLTagComment.Internal* __CopyValue(HTMLTagComment.Internal native) @@ -11039,16 +11341,20 @@ namespace CppSharp return ret; } - private HTMLTagComment(HTMLTagComment.Internal native) - : this(__CopyValue(native)) + private HTMLTagComment(HTMLTagComment.Internal native, bool skipVTables = false) + : this(__CopyValue(native), skipVTables) { __ownsNativeInstance = true; NativeToManagedMap[__Instance] = this; } - protected HTMLTagComment(HTMLTagComment.Internal* native, bool isInternalImpl = false) - : base((CppSharp.Parser.AST.InlineContentComment.Internal*) native) + protected HTMLTagComment(HTMLTagComment.Internal* native, bool skipVTables = false) + : base((CppSharp.Parser.AST.InlineContentComment.Internal*) null) { + __PointerAdjustment = 0; + if (native == null) + return; + __Instance = new global::System.IntPtr(native); } public HTMLTagComment() @@ -11056,8 +11362,8 @@ namespace CppSharp { __Instance = Marshal.AllocHGlobal(4); __ownsNativeInstance = true; - Internal.ctor_0(__Instance); NativeToManagedMap[__Instance] = this; + Internal.ctor_0((__Instance + __PointerAdjustment)); } public HTMLTagComment(CppSharp.Parser.AST.CommentKind Kind) @@ -11065,9 +11371,9 @@ namespace CppSharp { __Instance = Marshal.AllocHGlobal(4); __ownsNativeInstance = true; - var arg0 = Kind; - Internal.ctor_1(__Instance, arg0); NativeToManagedMap[__Instance] = this; + var arg0 = Kind; + Internal.ctor_1((__Instance + __PointerAdjustment), arg0); } public HTMLTagComment(CppSharp.Parser.AST.HTMLTagComment _0) @@ -11075,8 +11381,8 @@ namespace CppSharp { __Instance = Marshal.AllocHGlobal(4); __ownsNativeInstance = true; - *((HTMLTagComment.Internal*) __Instance) = *((HTMLTagComment.Internal*) _0.__Instance); NativeToManagedMap[__Instance] = this; + *((HTMLTagComment.Internal*) __Instance) = *((HTMLTagComment.Internal*) _0.__Instance); } } @@ -11176,19 +11482,21 @@ namespace CppSharp } public global::System.IntPtr __Instance { get; protected set; } + + protected int __PointerAdjustment; public static readonly System.Collections.Concurrent.ConcurrentDictionary NativeToManagedMap = new System.Collections.Concurrent.ConcurrentDictionary(); protected void*[] __OriginalVTables; protected bool __ownsNativeInstance; - public static Attribute __CreateInstance(global::System.IntPtr native, bool ownsNativeInstance = false) + public static Attribute __CreateInstance(global::System.IntPtr native, bool ownsNativeInstance = false, bool skipVTables = false) { - return new Attribute((Attribute.Internal*) native) { __ownsNativeInstance = ownsNativeInstance }; + return new Attribute((Attribute.Internal*) native, skipVTables) { __ownsNativeInstance = ownsNativeInstance }; } - public static Attribute __CreateInstance(Attribute.Internal native) + public static Attribute __CreateInstance(Attribute.Internal native, bool skipVTables = false) { - return new Attribute(native); + return new Attribute(native, skipVTables); } private static Attribute.Internal* __CopyValue(Attribute.Internal native) @@ -11198,15 +11506,17 @@ namespace CppSharp return (Attribute.Internal*) ret; } - private Attribute(Attribute.Internal native) - : this(__CopyValue(native)) + private Attribute(Attribute.Internal native, bool skipVTables = false) + : this(__CopyValue(native), skipVTables) { __ownsNativeInstance = true; NativeToManagedMap[__Instance] = this; } - protected Attribute(Attribute.Internal* native, bool isInternalImpl = false) + protected Attribute(Attribute.Internal* native, bool skipVTables = false) { + if (native == null) + return; __Instance = new global::System.IntPtr(native); } @@ -11214,17 +11524,17 @@ namespace CppSharp { __Instance = Marshal.AllocHGlobal(48); __ownsNativeInstance = true; - Internal.ctor_0(__Instance); NativeToManagedMap[__Instance] = this; + Internal.ctor_0((__Instance + __PointerAdjustment)); } public Attribute(CppSharp.Parser.AST.HTMLStartTagComment.Attribute _0) { __Instance = Marshal.AllocHGlobal(48); __ownsNativeInstance = true; - var arg0 = ReferenceEquals(_0, null) ? global::System.IntPtr.Zero : _0.__Instance; - Internal.cctor_2(__Instance, arg0); NativeToManagedMap[__Instance] = this; + var arg0 = ReferenceEquals(_0, null) ? global::System.IntPtr.Zero : _0.__Instance; + Internal.cctor_2((__Instance + __PointerAdjustment), arg0); } public void Dispose() @@ -11238,22 +11548,23 @@ namespace CppSharp throw new global::System.InvalidOperationException("Managed instances owned by native code cannot be disposed of."); CppSharp.Parser.AST.HTMLStartTagComment.Attribute __dummy; NativeToManagedMap.TryRemove(__Instance, out __dummy); - Internal.dtor_0(__Instance); - Marshal.FreeHGlobal(__Instance); + Internal.dtor_0((__Instance + __PointerAdjustment)); + if (__ownsNativeInstance) + Marshal.FreeHGlobal(__Instance); } public string Name { get { - var __ret = Internal.getName_0(__Instance); + var __ret = Internal.getName_0((__Instance + __PointerAdjustment)); return Marshal.PtrToStringAnsi(__ret); } set { var arg0 = Marshal.StringToHGlobalAnsi(value); - Internal.setName_0(__Instance, arg0); + Internal.setName_0((__Instance + __PointerAdjustment), arg0); Marshal.FreeHGlobal(arg0); } } @@ -11262,27 +11573,27 @@ namespace CppSharp { get { - var __ret = Internal.getValue_0(__Instance); + var __ret = Internal.getValue_0((__Instance + __PointerAdjustment)); return Marshal.PtrToStringAnsi(__ret); } set { var arg0 = Marshal.StringToHGlobalAnsi(value); - Internal.setValue_0(__Instance, arg0); + Internal.setValue_0((__Instance + __PointerAdjustment), arg0); Marshal.FreeHGlobal(arg0); } } } - public static new HTMLStartTagComment __CreateInstance(global::System.IntPtr native, bool ownsNativeInstance = false) + public static new HTMLStartTagComment __CreateInstance(global::System.IntPtr native, bool ownsNativeInstance = false, bool skipVTables = false) { - return new HTMLStartTagComment((HTMLStartTagComment.Internal*) native) { __ownsNativeInstance = ownsNativeInstance }; + return new HTMLStartTagComment((HTMLStartTagComment.Internal*) native, skipVTables) { __ownsNativeInstance = ownsNativeInstance }; } - public static HTMLStartTagComment __CreateInstance(HTMLStartTagComment.Internal native) + public static HTMLStartTagComment __CreateInstance(HTMLStartTagComment.Internal native, bool skipVTables = false) { - return new HTMLStartTagComment(native); + return new HTMLStartTagComment(native, skipVTables); } private static HTMLStartTagComment.Internal* __CopyValue(HTMLStartTagComment.Internal native) @@ -11292,16 +11603,20 @@ namespace CppSharp return (HTMLStartTagComment.Internal*) ret; } - private HTMLStartTagComment(HTMLStartTagComment.Internal native) - : this(__CopyValue(native)) + private HTMLStartTagComment(HTMLStartTagComment.Internal native, bool skipVTables = false) + : this(__CopyValue(native), skipVTables) { __ownsNativeInstance = true; NativeToManagedMap[__Instance] = this; } - protected HTMLStartTagComment(HTMLStartTagComment.Internal* native, bool isInternalImpl = false) - : base((CppSharp.Parser.AST.HTMLTagComment.Internal*) native) + protected HTMLStartTagComment(HTMLStartTagComment.Internal* native, bool skipVTables = false) + : base((CppSharp.Parser.AST.HTMLTagComment.Internal*) null) { + __PointerAdjustment = 0; + if (native == null) + return; + __Instance = new global::System.IntPtr(native); } public HTMLStartTagComment() @@ -11309,8 +11624,8 @@ namespace CppSharp { __Instance = Marshal.AllocHGlobal(56); __ownsNativeInstance = true; - Internal.ctor_0(__Instance); NativeToManagedMap[__Instance] = this; + Internal.ctor_0((__Instance + __PointerAdjustment)); } public HTMLStartTagComment(CppSharp.Parser.AST.HTMLStartTagComment _0) @@ -11318,41 +11633,41 @@ namespace CppSharp { __Instance = Marshal.AllocHGlobal(56); __ownsNativeInstance = true; - var arg0 = ReferenceEquals(_0, null) ? global::System.IntPtr.Zero : _0.__Instance; - Internal.cctor_2(__Instance, arg0); NativeToManagedMap[__Instance] = this; + var arg0 = ReferenceEquals(_0, null) ? global::System.IntPtr.Zero : _0.__Instance; + Internal.cctor_2((__Instance + __PointerAdjustment), arg0); } public CppSharp.Parser.AST.HTMLStartTagComment.Attribute getAttributes(uint i) { var __ret = new CppSharp.Parser.AST.HTMLStartTagComment.Attribute.Internal(); - Internal.getAttributes_0(new IntPtr(&__ret), __Instance, i); + Internal.getAttributes_0(new IntPtr(&__ret), (__Instance + __PointerAdjustment), i); return CppSharp.Parser.AST.HTMLStartTagComment.Attribute.__CreateInstance(__ret); } public void addAttributes(CppSharp.Parser.AST.HTMLStartTagComment.Attribute s) { var arg0 = ReferenceEquals(s, null) ? global::System.IntPtr.Zero : s.__Instance; - Internal.addAttributes_0(__Instance, arg0); + Internal.addAttributes_0((__Instance + __PointerAdjustment), arg0); } public void clearAttributes() { - Internal.clearAttributes_0(__Instance); + Internal.clearAttributes_0((__Instance + __PointerAdjustment)); } public string TagName { get { - var __ret = Internal.getTagName_0(__Instance); + var __ret = Internal.getTagName_0((__Instance + __PointerAdjustment)); return Marshal.PtrToStringAnsi(__ret); } set { var arg0 = Marshal.StringToHGlobalAnsi(value); - Internal.setTagName_0(__Instance, arg0); + Internal.setTagName_0((__Instance + __PointerAdjustment), arg0); Marshal.FreeHGlobal(arg0); } } @@ -11361,7 +11676,7 @@ namespace CppSharp { get { - var __ret = Internal.getAttributesCount_0(__Instance); + var __ret = Internal.getAttributesCount_0((__Instance + __PointerAdjustment)); return __ret; } } @@ -11401,14 +11716,14 @@ namespace CppSharp internal static extern void setTagName_0(global::System.IntPtr instance, global::System.IntPtr s); } - public static new HTMLEndTagComment __CreateInstance(global::System.IntPtr native, bool ownsNativeInstance = false) + public static new HTMLEndTagComment __CreateInstance(global::System.IntPtr native, bool ownsNativeInstance = false, bool skipVTables = false) { - return new HTMLEndTagComment((HTMLEndTagComment.Internal*) native) { __ownsNativeInstance = ownsNativeInstance }; + return new HTMLEndTagComment((HTMLEndTagComment.Internal*) native, skipVTables) { __ownsNativeInstance = ownsNativeInstance }; } - public static HTMLEndTagComment __CreateInstance(HTMLEndTagComment.Internal native) + public static HTMLEndTagComment __CreateInstance(HTMLEndTagComment.Internal native, bool skipVTables = false) { - return new HTMLEndTagComment(native); + return new HTMLEndTagComment(native, skipVTables); } private static HTMLEndTagComment.Internal* __CopyValue(HTMLEndTagComment.Internal native) @@ -11418,16 +11733,20 @@ namespace CppSharp return (HTMLEndTagComment.Internal*) ret; } - private HTMLEndTagComment(HTMLEndTagComment.Internal native) - : this(__CopyValue(native)) + private HTMLEndTagComment(HTMLEndTagComment.Internal native, bool skipVTables = false) + : this(__CopyValue(native), skipVTables) { __ownsNativeInstance = true; NativeToManagedMap[__Instance] = this; } - protected HTMLEndTagComment(HTMLEndTagComment.Internal* native, bool isInternalImpl = false) - : base((CppSharp.Parser.AST.HTMLTagComment.Internal*) native) + protected HTMLEndTagComment(HTMLEndTagComment.Internal* native, bool skipVTables = false) + : base((CppSharp.Parser.AST.HTMLTagComment.Internal*) null) { + __PointerAdjustment = 0; + if (native == null) + return; + __Instance = new global::System.IntPtr(native); } public HTMLEndTagComment() @@ -11435,8 +11754,8 @@ namespace CppSharp { __Instance = Marshal.AllocHGlobal(32); __ownsNativeInstance = true; - Internal.ctor_0(__Instance); NativeToManagedMap[__Instance] = this; + Internal.ctor_0((__Instance + __PointerAdjustment)); } public HTMLEndTagComment(CppSharp.Parser.AST.HTMLEndTagComment _0) @@ -11444,23 +11763,23 @@ namespace CppSharp { __Instance = Marshal.AllocHGlobal(32); __ownsNativeInstance = true; - var arg0 = ReferenceEquals(_0, null) ? global::System.IntPtr.Zero : _0.__Instance; - Internal.cctor_2(__Instance, arg0); NativeToManagedMap[__Instance] = this; + var arg0 = ReferenceEquals(_0, null) ? global::System.IntPtr.Zero : _0.__Instance; + Internal.cctor_2((__Instance + __PointerAdjustment), arg0); } public string TagName { get { - var __ret = Internal.getTagName_0(__Instance); + var __ret = Internal.getTagName_0((__Instance + __PointerAdjustment)); return Marshal.PtrToStringAnsi(__ret); } set { var arg0 = Marshal.StringToHGlobalAnsi(value); - Internal.setTagName_0(__Instance, arg0); + Internal.setTagName_0((__Instance + __PointerAdjustment), arg0); Marshal.FreeHGlobal(arg0); } } @@ -11500,14 +11819,14 @@ namespace CppSharp internal static extern void setText_0(global::System.IntPtr instance, global::System.IntPtr s); } - public static new TextComment __CreateInstance(global::System.IntPtr native, bool ownsNativeInstance = false) + public static new TextComment __CreateInstance(global::System.IntPtr native, bool ownsNativeInstance = false, bool skipVTables = false) { - return new TextComment((TextComment.Internal*) native) { __ownsNativeInstance = ownsNativeInstance }; + return new TextComment((TextComment.Internal*) native, skipVTables) { __ownsNativeInstance = ownsNativeInstance }; } - public static TextComment __CreateInstance(TextComment.Internal native) + public static TextComment __CreateInstance(TextComment.Internal native, bool skipVTables = false) { - return new TextComment(native); + return new TextComment(native, skipVTables); } private static TextComment.Internal* __CopyValue(TextComment.Internal native) @@ -11517,16 +11836,20 @@ namespace CppSharp return (TextComment.Internal*) ret; } - private TextComment(TextComment.Internal native) - : this(__CopyValue(native)) + private TextComment(TextComment.Internal native, bool skipVTables = false) + : this(__CopyValue(native), skipVTables) { __ownsNativeInstance = true; NativeToManagedMap[__Instance] = this; } - protected TextComment(TextComment.Internal* native, bool isInternalImpl = false) - : base((CppSharp.Parser.AST.InlineContentComment.Internal*) native) + protected TextComment(TextComment.Internal* native, bool skipVTables = false) + : base((CppSharp.Parser.AST.InlineContentComment.Internal*) null) { + __PointerAdjustment = 0; + if (native == null) + return; + __Instance = new global::System.IntPtr(native); } public TextComment() @@ -11534,8 +11857,8 @@ namespace CppSharp { __Instance = Marshal.AllocHGlobal(32); __ownsNativeInstance = true; - Internal.ctor_0(__Instance); NativeToManagedMap[__Instance] = this; + Internal.ctor_0((__Instance + __PointerAdjustment)); } public TextComment(CppSharp.Parser.AST.TextComment _0) @@ -11543,23 +11866,23 @@ namespace CppSharp { __Instance = Marshal.AllocHGlobal(32); __ownsNativeInstance = true; - var arg0 = ReferenceEquals(_0, null) ? global::System.IntPtr.Zero : _0.__Instance; - Internal.cctor_2(__Instance, arg0); NativeToManagedMap[__Instance] = this; + var arg0 = ReferenceEquals(_0, null) ? global::System.IntPtr.Zero : _0.__Instance; + Internal.cctor_2((__Instance + __PointerAdjustment), arg0); } public string Text { get { - var __ret = Internal.getText_0(__Instance); + var __ret = Internal.getText_0((__Instance + __PointerAdjustment)); return Marshal.PtrToStringAnsi(__ret); } set { var arg0 = Marshal.StringToHGlobalAnsi(value); - Internal.setText_0(__Instance, arg0); + Internal.setText_0((__Instance + __PointerAdjustment), arg0); Marshal.FreeHGlobal(arg0); } } @@ -11613,19 +11936,21 @@ namespace CppSharp } public global::System.IntPtr __Instance { get; protected set; } + + protected int __PointerAdjustment; public static readonly System.Collections.Concurrent.ConcurrentDictionary NativeToManagedMap = new System.Collections.Concurrent.ConcurrentDictionary(); protected void*[] __OriginalVTables; protected bool __ownsNativeInstance; - public static RawComment __CreateInstance(global::System.IntPtr native, bool ownsNativeInstance = false) + public static RawComment __CreateInstance(global::System.IntPtr native, bool ownsNativeInstance = false, bool skipVTables = false) { - return new RawComment((RawComment.Internal*) native) { __ownsNativeInstance = ownsNativeInstance }; + return new RawComment((RawComment.Internal*) native, skipVTables) { __ownsNativeInstance = ownsNativeInstance }; } - public static RawComment __CreateInstance(RawComment.Internal native) + public static RawComment __CreateInstance(RawComment.Internal native, bool skipVTables = false) { - return new RawComment(native); + return new RawComment(native, skipVTables); } private static RawComment.Internal* __CopyValue(RawComment.Internal native) @@ -11635,15 +11960,17 @@ namespace CppSharp return (RawComment.Internal*) ret; } - private RawComment(RawComment.Internal native) - : this(__CopyValue(native)) + private RawComment(RawComment.Internal native, bool skipVTables = false) + : this(__CopyValue(native), skipVTables) { __ownsNativeInstance = true; NativeToManagedMap[__Instance] = this; } - protected RawComment(RawComment.Internal* native, bool isInternalImpl = false) + protected RawComment(RawComment.Internal* native, bool skipVTables = false) { + if (native == null) + return; __Instance = new global::System.IntPtr(native); } @@ -11651,17 +11978,17 @@ namespace CppSharp { __Instance = Marshal.AllocHGlobal(64); __ownsNativeInstance = true; - Internal.ctor_0(__Instance); NativeToManagedMap[__Instance] = this; + Internal.ctor_0((__Instance + __PointerAdjustment)); } public RawComment(CppSharp.Parser.AST.RawComment _0) { __Instance = Marshal.AllocHGlobal(64); __ownsNativeInstance = true; - var arg0 = ReferenceEquals(_0, null) ? global::System.IntPtr.Zero : _0.__Instance; - Internal.cctor_2(__Instance, arg0); NativeToManagedMap[__Instance] = this; + var arg0 = ReferenceEquals(_0, null) ? global::System.IntPtr.Zero : _0.__Instance; + Internal.cctor_2((__Instance + __PointerAdjustment), arg0); } public void Dispose() @@ -11675,22 +12002,23 @@ namespace CppSharp throw new global::System.InvalidOperationException("Managed instances owned by native code cannot be disposed of."); CppSharp.Parser.AST.RawComment __dummy; NativeToManagedMap.TryRemove(__Instance, out __dummy); - Internal.dtor_0(__Instance); - Marshal.FreeHGlobal(__Instance); + Internal.dtor_0((__Instance + __PointerAdjustment)); + if (__ownsNativeInstance) + Marshal.FreeHGlobal(__Instance); } public string Text { get { - var __ret = Internal.getText_0(__Instance); + var __ret = Internal.getText_0((__Instance + __PointerAdjustment)); return Marshal.PtrToStringAnsi(__ret); } set { var arg0 = Marshal.StringToHGlobalAnsi(value); - Internal.setText_0(__Instance, arg0); + Internal.setText_0((__Instance + __PointerAdjustment), arg0); Marshal.FreeHGlobal(arg0); } } @@ -11699,14 +12027,14 @@ namespace CppSharp { get { - var __ret = Internal.getBriefText_0(__Instance); + var __ret = Internal.getBriefText_0((__Instance + __PointerAdjustment)); return Marshal.PtrToStringAnsi(__ret); } set { var arg0 = Marshal.StringToHGlobalAnsi(value); - Internal.setBriefText_0(__Instance, arg0); + Internal.setBriefText_0((__Instance + __PointerAdjustment), arg0); Marshal.FreeHGlobal(arg0); } } diff --git a/src/CppParser/Bindings/CSharp/x86_64-apple-darwin12.4.0/CppParser.cs b/src/CppParser/Bindings/CSharp/x86_64-apple-darwin12.4.0/CppParser.cs index 231cd0b1..1ffc7a7a 100644 --- a/src/CppParser/Bindings/CSharp/x86_64-apple-darwin12.4.0/CppParser.cs +++ b/src/CppParser/Bindings/CSharp/x86_64-apple-darwin12.4.0/CppParser.cs @@ -234,19 +234,21 @@ namespace CppSharp } public global::System.IntPtr __Instance { get; protected set; } + + protected int __PointerAdjustment; public static readonly System.Collections.Concurrent.ConcurrentDictionary NativeToManagedMap = new System.Collections.Concurrent.ConcurrentDictionary(); protected void*[] __OriginalVTables; protected bool __ownsNativeInstance; - public static ParserOptions __CreateInstance(global::System.IntPtr native, bool ownsNativeInstance = false) + public static ParserOptions __CreateInstance(global::System.IntPtr native, bool ownsNativeInstance = false, bool skipVTables = false) { - return new ParserOptions((ParserOptions.Internal*) native) { __ownsNativeInstance = ownsNativeInstance }; + return new ParserOptions((ParserOptions.Internal*) native, skipVTables) { __ownsNativeInstance = ownsNativeInstance }; } - public static ParserOptions __CreateInstance(ParserOptions.Internal native) + public static ParserOptions __CreateInstance(ParserOptions.Internal native, bool skipVTables = false) { - return new ParserOptions(native); + return new ParserOptions(native, skipVTables); } private static ParserOptions.Internal* __CopyValue(ParserOptions.Internal native) @@ -256,15 +258,17 @@ namespace CppSharp return (ParserOptions.Internal*) ret; } - private ParserOptions(ParserOptions.Internal native) - : this(__CopyValue(native)) + private ParserOptions(ParserOptions.Internal native, bool skipVTables = false) + : this(__CopyValue(native), skipVTables) { __ownsNativeInstance = true; NativeToManagedMap[__Instance] = this; } - protected ParserOptions(ParserOptions.Internal* native, bool isInternalImpl = false) + protected ParserOptions(ParserOptions.Internal* native, bool skipVTables = false) { + if (native == null) + return; __Instance = new global::System.IntPtr(native); } @@ -272,17 +276,17 @@ namespace CppSharp { __Instance = Marshal.AllocHGlobal(232); __ownsNativeInstance = true; - Internal.ctor_0(__Instance); NativeToManagedMap[__Instance] = this; + Internal.ctor_0((__Instance + __PointerAdjustment)); } public ParserOptions(CppSharp.Parser.ParserOptions _0) { __Instance = Marshal.AllocHGlobal(232); __ownsNativeInstance = true; - var arg0 = ReferenceEquals(_0, null) ? global::System.IntPtr.Zero : _0.__Instance; - Internal.cctor_2(__Instance, arg0); NativeToManagedMap[__Instance] = this; + var arg0 = ReferenceEquals(_0, null) ? global::System.IntPtr.Zero : _0.__Instance; + Internal.cctor_2((__Instance + __PointerAdjustment), arg0); } public void Dispose() @@ -296,123 +300,124 @@ namespace CppSharp throw new global::System.InvalidOperationException("Managed instances owned by native code cannot be disposed of."); CppSharp.Parser.ParserOptions __dummy; NativeToManagedMap.TryRemove(__Instance, out __dummy); - Internal.dtor_0(__Instance); - Marshal.FreeHGlobal(__Instance); + Internal.dtor_0((__Instance + __PointerAdjustment)); + if (__ownsNativeInstance) + Marshal.FreeHGlobal(__Instance); } public string getArguments(uint i) { - var __ret = Internal.getArguments_0(__Instance, i); + var __ret = Internal.getArguments_0((__Instance + __PointerAdjustment), i); return Marshal.PtrToStringAnsi(__ret); } public void addArguments(string s) { var arg0 = Marshal.StringToHGlobalAnsi(s); - Internal.addArguments_0(__Instance, arg0); + Internal.addArguments_0((__Instance + __PointerAdjustment), arg0); Marshal.FreeHGlobal(arg0); } public void clearArguments() { - Internal.clearArguments_0(__Instance); + Internal.clearArguments_0((__Instance + __PointerAdjustment)); } public string getIncludeDirs(uint i) { - var __ret = Internal.getIncludeDirs_0(__Instance, i); + var __ret = Internal.getIncludeDirs_0((__Instance + __PointerAdjustment), i); return Marshal.PtrToStringAnsi(__ret); } public void addIncludeDirs(string s) { var arg0 = Marshal.StringToHGlobalAnsi(s); - Internal.addIncludeDirs_0(__Instance, arg0); + Internal.addIncludeDirs_0((__Instance + __PointerAdjustment), arg0); Marshal.FreeHGlobal(arg0); } public void clearIncludeDirs() { - Internal.clearIncludeDirs_0(__Instance); + Internal.clearIncludeDirs_0((__Instance + __PointerAdjustment)); } public string getSystemIncludeDirs(uint i) { - var __ret = Internal.getSystemIncludeDirs_0(__Instance, i); + var __ret = Internal.getSystemIncludeDirs_0((__Instance + __PointerAdjustment), i); return Marshal.PtrToStringAnsi(__ret); } public void addSystemIncludeDirs(string s) { var arg0 = Marshal.StringToHGlobalAnsi(s); - Internal.addSystemIncludeDirs_0(__Instance, arg0); + Internal.addSystemIncludeDirs_0((__Instance + __PointerAdjustment), arg0); Marshal.FreeHGlobal(arg0); } public void clearSystemIncludeDirs() { - Internal.clearSystemIncludeDirs_0(__Instance); + Internal.clearSystemIncludeDirs_0((__Instance + __PointerAdjustment)); } public string getDefines(uint i) { - var __ret = Internal.getDefines_0(__Instance, i); + var __ret = Internal.getDefines_0((__Instance + __PointerAdjustment), i); return Marshal.PtrToStringAnsi(__ret); } public void addDefines(string s) { var arg0 = Marshal.StringToHGlobalAnsi(s); - Internal.addDefines_0(__Instance, arg0); + Internal.addDefines_0((__Instance + __PointerAdjustment), arg0); Marshal.FreeHGlobal(arg0); } public void clearDefines() { - Internal.clearDefines_0(__Instance); + Internal.clearDefines_0((__Instance + __PointerAdjustment)); } public string getUndefines(uint i) { - var __ret = Internal.getUndefines_0(__Instance, i); + var __ret = Internal.getUndefines_0((__Instance + __PointerAdjustment), i); return Marshal.PtrToStringAnsi(__ret); } public void addUndefines(string s) { var arg0 = Marshal.StringToHGlobalAnsi(s); - Internal.addUndefines_0(__Instance, arg0); + Internal.addUndefines_0((__Instance + __PointerAdjustment), arg0); Marshal.FreeHGlobal(arg0); } public void clearUndefines() { - Internal.clearUndefines_0(__Instance); + Internal.clearUndefines_0((__Instance + __PointerAdjustment)); } public string getLibraryDirs(uint i) { - var __ret = Internal.getLibraryDirs_0(__Instance, i); + var __ret = Internal.getLibraryDirs_0((__Instance + __PointerAdjustment), i); return Marshal.PtrToStringAnsi(__ret); } public void addLibraryDirs(string s) { var arg0 = Marshal.StringToHGlobalAnsi(s); - Internal.addLibraryDirs_0(__Instance, arg0); + Internal.addLibraryDirs_0((__Instance + __PointerAdjustment), arg0); Marshal.FreeHGlobal(arg0); } public void clearLibraryDirs() { - Internal.clearLibraryDirs_0(__Instance); + Internal.clearLibraryDirs_0((__Instance + __PointerAdjustment)); } public uint ArgumentsCount { get { - var __ret = Internal.getArgumentsCount_0(__Instance); + var __ret = Internal.getArgumentsCount_0((__Instance + __PointerAdjustment)); return __ret; } } @@ -421,14 +426,14 @@ namespace CppSharp { get { - var __ret = Internal.getFileName_0(__Instance); + var __ret = Internal.getFileName_0((__Instance + __PointerAdjustment)); return Marshal.PtrToStringAnsi(__ret); } set { var arg0 = Marshal.StringToHGlobalAnsi(value); - Internal.setFileName_0(__Instance, arg0); + Internal.setFileName_0((__Instance + __PointerAdjustment), arg0); Marshal.FreeHGlobal(arg0); } } @@ -437,7 +442,7 @@ namespace CppSharp { get { - var __ret = Internal.getIncludeDirsCount_0(__Instance); + var __ret = Internal.getIncludeDirsCount_0((__Instance + __PointerAdjustment)); return __ret; } } @@ -446,7 +451,7 @@ namespace CppSharp { get { - var __ret = Internal.getSystemIncludeDirsCount_0(__Instance); + var __ret = Internal.getSystemIncludeDirsCount_0((__Instance + __PointerAdjustment)); return __ret; } } @@ -455,7 +460,7 @@ namespace CppSharp { get { - var __ret = Internal.getDefinesCount_0(__Instance); + var __ret = Internal.getDefinesCount_0((__Instance + __PointerAdjustment)); return __ret; } } @@ -464,7 +469,7 @@ namespace CppSharp { get { - var __ret = Internal.getUndefinesCount_0(__Instance); + var __ret = Internal.getUndefinesCount_0((__Instance + __PointerAdjustment)); return __ret; } } @@ -473,7 +478,7 @@ namespace CppSharp { get { - var __ret = Internal.getLibraryDirsCount_0(__Instance); + var __ret = Internal.getLibraryDirsCount_0((__Instance + __PointerAdjustment)); return __ret; } } @@ -482,14 +487,14 @@ namespace CppSharp { get { - var __ret = Internal.getTargetTriple_0(__Instance); + var __ret = Internal.getTargetTriple_0((__Instance + __PointerAdjustment)); return Marshal.PtrToStringAnsi(__ret); } set { var arg0 = Marshal.StringToHGlobalAnsi(value); - Internal.setTargetTriple_0(__Instance, arg0); + Internal.setTargetTriple_0((__Instance + __PointerAdjustment), arg0); Marshal.FreeHGlobal(arg0); } } @@ -673,19 +678,21 @@ namespace CppSharp } public global::System.IntPtr __Instance { get; protected set; } + + protected int __PointerAdjustment; public static readonly System.Collections.Concurrent.ConcurrentDictionary NativeToManagedMap = new System.Collections.Concurrent.ConcurrentDictionary(); protected void*[] __OriginalVTables; protected bool __ownsNativeInstance; - public static ParserDiagnostic __CreateInstance(global::System.IntPtr native, bool ownsNativeInstance = false) + public static ParserDiagnostic __CreateInstance(global::System.IntPtr native, bool ownsNativeInstance = false, bool skipVTables = false) { - return new ParserDiagnostic((ParserDiagnostic.Internal*) native) { __ownsNativeInstance = ownsNativeInstance }; + return new ParserDiagnostic((ParserDiagnostic.Internal*) native, skipVTables) { __ownsNativeInstance = ownsNativeInstance }; } - public static ParserDiagnostic __CreateInstance(ParserDiagnostic.Internal native) + public static ParserDiagnostic __CreateInstance(ParserDiagnostic.Internal native, bool skipVTables = false) { - return new ParserDiagnostic(native); + return new ParserDiagnostic(native, skipVTables); } private static ParserDiagnostic.Internal* __CopyValue(ParserDiagnostic.Internal native) @@ -695,15 +702,17 @@ namespace CppSharp return (ParserDiagnostic.Internal*) ret; } - private ParserDiagnostic(ParserDiagnostic.Internal native) - : this(__CopyValue(native)) + private ParserDiagnostic(ParserDiagnostic.Internal native, bool skipVTables = false) + : this(__CopyValue(native), skipVTables) { __ownsNativeInstance = true; NativeToManagedMap[__Instance] = this; } - protected ParserDiagnostic(ParserDiagnostic.Internal* native, bool isInternalImpl = false) + protected ParserDiagnostic(ParserDiagnostic.Internal* native, bool skipVTables = false) { + if (native == null) + return; __Instance = new global::System.IntPtr(native); } @@ -711,17 +720,17 @@ namespace CppSharp { __Instance = Marshal.AllocHGlobal(64); __ownsNativeInstance = true; - Internal.ctor_0(__Instance); NativeToManagedMap[__Instance] = this; + Internal.ctor_0((__Instance + __PointerAdjustment)); } public ParserDiagnostic(CppSharp.Parser.ParserDiagnostic _0) { __Instance = Marshal.AllocHGlobal(64); __ownsNativeInstance = true; - var arg0 = ReferenceEquals(_0, null) ? global::System.IntPtr.Zero : _0.__Instance; - Internal.cctor_1(__Instance, arg0); NativeToManagedMap[__Instance] = this; + var arg0 = ReferenceEquals(_0, null) ? global::System.IntPtr.Zero : _0.__Instance; + Internal.cctor_1((__Instance + __PointerAdjustment), arg0); } public void Dispose() @@ -735,22 +744,23 @@ namespace CppSharp throw new global::System.InvalidOperationException("Managed instances owned by native code cannot be disposed of."); CppSharp.Parser.ParserDiagnostic __dummy; NativeToManagedMap.TryRemove(__Instance, out __dummy); - Internal.dtor_0(__Instance); - Marshal.FreeHGlobal(__Instance); + Internal.dtor_0((__Instance + __PointerAdjustment)); + if (__ownsNativeInstance) + Marshal.FreeHGlobal(__Instance); } public string FileName { get { - var __ret = Internal.getFileName_0(__Instance); + var __ret = Internal.getFileName_0((__Instance + __PointerAdjustment)); return Marshal.PtrToStringAnsi(__ret); } set { var arg0 = Marshal.StringToHGlobalAnsi(value); - Internal.setFileName_0(__Instance, arg0); + Internal.setFileName_0((__Instance + __PointerAdjustment), arg0); Marshal.FreeHGlobal(arg0); } } @@ -759,14 +769,14 @@ namespace CppSharp { get { - var __ret = Internal.getMessage_0(__Instance); + var __ret = Internal.getMessage_0((__Instance + __PointerAdjustment)); return Marshal.PtrToStringAnsi(__ret); } set { var arg0 = Marshal.StringToHGlobalAnsi(value); - Internal.setMessage_0(__Instance, arg0); + Internal.setMessage_0((__Instance + __PointerAdjustment), arg0); Marshal.FreeHGlobal(arg0); } } @@ -865,19 +875,21 @@ namespace CppSharp } public global::System.IntPtr __Instance { get; protected set; } + + protected int __PointerAdjustment; public static readonly System.Collections.Concurrent.ConcurrentDictionary NativeToManagedMap = new System.Collections.Concurrent.ConcurrentDictionary(); protected void*[] __OriginalVTables; protected bool __ownsNativeInstance; - public static ParserResult __CreateInstance(global::System.IntPtr native, bool ownsNativeInstance = false) + public static ParserResult __CreateInstance(global::System.IntPtr native, bool ownsNativeInstance = false, bool skipVTables = false) { - return new ParserResult((ParserResult.Internal*) native) { __ownsNativeInstance = ownsNativeInstance }; + return new ParserResult((ParserResult.Internal*) native, skipVTables) { __ownsNativeInstance = ownsNativeInstance }; } - public static ParserResult __CreateInstance(ParserResult.Internal native) + public static ParserResult __CreateInstance(ParserResult.Internal native, bool skipVTables = false) { - return new ParserResult(native); + return new ParserResult(native, skipVTables); } private static ParserResult.Internal* __CopyValue(ParserResult.Internal native) @@ -887,15 +899,17 @@ namespace CppSharp return (ParserResult.Internal*) ret; } - private ParserResult(ParserResult.Internal native) - : this(__CopyValue(native)) + private ParserResult(ParserResult.Internal native, bool skipVTables = false) + : this(__CopyValue(native), skipVTables) { __ownsNativeInstance = true; NativeToManagedMap[__Instance] = this; } - protected ParserResult(ParserResult.Internal* native, bool isInternalImpl = false) + protected ParserResult(ParserResult.Internal* native, bool skipVTables = false) { + if (native == null) + return; __Instance = new global::System.IntPtr(native); } @@ -903,17 +917,17 @@ namespace CppSharp { __Instance = Marshal.AllocHGlobal(56); __ownsNativeInstance = true; - Internal.ctor_0(__Instance); NativeToManagedMap[__Instance] = this; + Internal.ctor_0((__Instance + __PointerAdjustment)); } public ParserResult(CppSharp.Parser.ParserResult _0) { __Instance = Marshal.AllocHGlobal(56); __ownsNativeInstance = true; - var arg0 = ReferenceEquals(_0, null) ? global::System.IntPtr.Zero : _0.__Instance; - Internal.cctor_1(__Instance, arg0); NativeToManagedMap[__Instance] = this; + var arg0 = ReferenceEquals(_0, null) ? global::System.IntPtr.Zero : _0.__Instance; + Internal.cctor_1((__Instance + __PointerAdjustment), arg0); } public void Dispose() @@ -927,33 +941,34 @@ namespace CppSharp throw new global::System.InvalidOperationException("Managed instances owned by native code cannot be disposed of."); CppSharp.Parser.ParserResult __dummy; NativeToManagedMap.TryRemove(__Instance, out __dummy); - Internal.dtor_0(__Instance); - Marshal.FreeHGlobal(__Instance); + Internal.dtor_0((__Instance + __PointerAdjustment)); + if (__ownsNativeInstance) + Marshal.FreeHGlobal(__Instance); } public CppSharp.Parser.ParserDiagnostic getDiagnostics(uint i) { var __ret = new CppSharp.Parser.ParserDiagnostic.Internal(); - Internal.getDiagnostics_0(new IntPtr(&__ret), __Instance, i); + Internal.getDiagnostics_0(new IntPtr(&__ret), (__Instance + __PointerAdjustment), i); return CppSharp.Parser.ParserDiagnostic.__CreateInstance(__ret); } public void addDiagnostics(CppSharp.Parser.ParserDiagnostic s) { var arg0 = ReferenceEquals(s, null) ? global::System.IntPtr.Zero : s.__Instance; - Internal.addDiagnostics_0(__Instance, arg0); + Internal.addDiagnostics_0((__Instance + __PointerAdjustment), arg0); } public void clearDiagnostics() { - Internal.clearDiagnostics_0(__Instance); + Internal.clearDiagnostics_0((__Instance + __PointerAdjustment)); } public uint DiagnosticsCount { get { - var __ret = Internal.getDiagnosticsCount_0(__Instance); + var __ret = Internal.getDiagnosticsCount_0((__Instance + __PointerAdjustment)); return __ret; } } @@ -1035,19 +1050,21 @@ namespace CppSharp } public global::System.IntPtr __Instance { get; protected set; } + + protected int __PointerAdjustment; public static readonly System.Collections.Concurrent.ConcurrentDictionary NativeToManagedMap = new System.Collections.Concurrent.ConcurrentDictionary(); protected void*[] __OriginalVTables; protected bool __ownsNativeInstance; - public static ClangParser __CreateInstance(global::System.IntPtr native, bool ownsNativeInstance = false) + public static ClangParser __CreateInstance(global::System.IntPtr native, bool ownsNativeInstance = false, bool skipVTables = false) { - return new ClangParser((ClangParser.Internal*) native) { __ownsNativeInstance = ownsNativeInstance }; + return new ClangParser((ClangParser.Internal*) native, skipVTables) { __ownsNativeInstance = ownsNativeInstance }; } - public static ClangParser __CreateInstance(ClangParser.Internal native) + public static ClangParser __CreateInstance(ClangParser.Internal native, bool skipVTables = false) { - return new ClangParser(native); + return new ClangParser(native, skipVTables); } private static ClangParser.Internal* __CopyValue(ClangParser.Internal native) @@ -1057,15 +1074,17 @@ namespace CppSharp return ret; } - private ClangParser(ClangParser.Internal native) - : this(__CopyValue(native)) + private ClangParser(ClangParser.Internal native, bool skipVTables = false) + : this(__CopyValue(native), skipVTables) { __ownsNativeInstance = true; NativeToManagedMap[__Instance] = this; } - protected ClangParser(ClangParser.Internal* native, bool isInternalImpl = false) + protected ClangParser(ClangParser.Internal* native, bool skipVTables = false) { + if (native == null) + return; __Instance = new global::System.IntPtr(native); } @@ -1080,8 +1099,8 @@ namespace CppSharp { __Instance = Marshal.AllocHGlobal(0); __ownsNativeInstance = true; - *((ClangParser.Internal*) __Instance) = *((ClangParser.Internal*) _0.__Instance); NativeToManagedMap[__Instance] = this; + *((ClangParser.Internal*) __Instance) = *((ClangParser.Internal*) _0.__Instance); } public void Dispose() @@ -1095,7 +1114,8 @@ namespace CppSharp throw new global::System.InvalidOperationException("Managed instances owned by native code cannot be disposed of."); CppSharp.Parser.ClangParser __dummy; NativeToManagedMap.TryRemove(__Instance, out __dummy); - Marshal.FreeHGlobal(__Instance); + if (__ownsNativeInstance) + Marshal.FreeHGlobal(__Instance); } public static CppSharp.Parser.ParserResult ParseHeader(CppSharp.Parser.ParserOptions Opts) diff --git a/src/CppParser/Bindings/CSharp/x86_64-apple-darwin12.4.0/Sources.cs b/src/CppParser/Bindings/CSharp/x86_64-apple-darwin12.4.0/Sources.cs index 7693db9c..a24bbc0c 100644 --- a/src/CppParser/Bindings/CSharp/x86_64-apple-darwin12.4.0/Sources.cs +++ b/src/CppParser/Bindings/CSharp/x86_64-apple-darwin12.4.0/Sources.cs @@ -37,23 +37,23 @@ namespace CppSharp private SourceLocation.Internal __instance; public SourceLocation.Internal __Instance { get { return __instance; } } - public static SourceLocation __CreateInstance(global::System.IntPtr native) + public static SourceLocation __CreateInstance(global::System.IntPtr native, bool skipVTables = false) { - return new SourceLocation((SourceLocation.Internal*) native); + return new SourceLocation((SourceLocation.Internal*) native, skipVTables); } - public static SourceLocation __CreateInstance(SourceLocation.Internal native) + public static SourceLocation __CreateInstance(SourceLocation.Internal native, bool skipVTables = false) { - return new SourceLocation(native); + return new SourceLocation(native, skipVTables); } - private SourceLocation(SourceLocation.Internal native) + private SourceLocation(SourceLocation.Internal native, bool skipVTables = false) : this() { __instance = native; } - private SourceLocation(SourceLocation.Internal* native, bool isInternalImpl = false) : this() + private SourceLocation(SourceLocation.Internal* native, bool skipVTables = false) : this() { __instance = *native; } diff --git a/src/CppParser/Bindings/CSharp/x86_64-apple-darwin12.4.0/Target.cs b/src/CppParser/Bindings/CSharp/x86_64-apple-darwin12.4.0/Target.cs index 3a6fc65d..dace0769 100644 --- a/src/CppParser/Bindings/CSharp/x86_64-apple-darwin12.4.0/Target.cs +++ b/src/CppParser/Bindings/CSharp/x86_64-apple-darwin12.4.0/Target.cs @@ -171,19 +171,21 @@ namespace CppSharp } public global::System.IntPtr __Instance { get; protected set; } + + protected int __PointerAdjustment; public static readonly System.Collections.Concurrent.ConcurrentDictionary NativeToManagedMap = new System.Collections.Concurrent.ConcurrentDictionary(); protected void*[] __OriginalVTables; protected bool __ownsNativeInstance; - public static ParserTargetInfo __CreateInstance(global::System.IntPtr native, bool ownsNativeInstance = false) + public static ParserTargetInfo __CreateInstance(global::System.IntPtr native, bool ownsNativeInstance = false, bool skipVTables = false) { - return new ParserTargetInfo((ParserTargetInfo.Internal*) native) { __ownsNativeInstance = ownsNativeInstance }; + return new ParserTargetInfo((ParserTargetInfo.Internal*) native, skipVTables) { __ownsNativeInstance = ownsNativeInstance }; } - public static ParserTargetInfo __CreateInstance(ParserTargetInfo.Internal native) + public static ParserTargetInfo __CreateInstance(ParserTargetInfo.Internal native, bool skipVTables = false) { - return new ParserTargetInfo(native); + return new ParserTargetInfo(native, skipVTables); } private static ParserTargetInfo.Internal* __CopyValue(ParserTargetInfo.Internal native) @@ -193,15 +195,17 @@ namespace CppSharp return (ParserTargetInfo.Internal*) ret; } - private ParserTargetInfo(ParserTargetInfo.Internal native) - : this(__CopyValue(native)) + private ParserTargetInfo(ParserTargetInfo.Internal native, bool skipVTables = false) + : this(__CopyValue(native), skipVTables) { __ownsNativeInstance = true; NativeToManagedMap[__Instance] = this; } - protected ParserTargetInfo(ParserTargetInfo.Internal* native, bool isInternalImpl = false) + protected ParserTargetInfo(ParserTargetInfo.Internal* native, bool skipVTables = false) { + if (native == null) + return; __Instance = new global::System.IntPtr(native); } @@ -209,17 +213,17 @@ namespace CppSharp { __Instance = Marshal.AllocHGlobal(176); __ownsNativeInstance = true; - Internal.ctor_0(__Instance); NativeToManagedMap[__Instance] = this; + Internal.ctor_0((__Instance + __PointerAdjustment)); } public ParserTargetInfo(CppSharp.Parser.ParserTargetInfo _0) { __Instance = Marshal.AllocHGlobal(176); __ownsNativeInstance = true; - var arg0 = ReferenceEquals(_0, null) ? global::System.IntPtr.Zero : _0.__Instance; - Internal.cctor_2(__Instance, arg0); NativeToManagedMap[__Instance] = this; + var arg0 = ReferenceEquals(_0, null) ? global::System.IntPtr.Zero : _0.__Instance; + Internal.cctor_2((__Instance + __PointerAdjustment), arg0); } public void Dispose() @@ -233,22 +237,23 @@ namespace CppSharp throw new global::System.InvalidOperationException("Managed instances owned by native code cannot be disposed of."); CppSharp.Parser.ParserTargetInfo __dummy; NativeToManagedMap.TryRemove(__Instance, out __dummy); - Internal.dtor_0(__Instance); - Marshal.FreeHGlobal(__Instance); + Internal.dtor_0((__Instance + __PointerAdjustment)); + if (__ownsNativeInstance) + Marshal.FreeHGlobal(__Instance); } public string ABI { get { - var __ret = Internal.getABI_0(__Instance); + var __ret = Internal.getABI_0((__Instance + __PointerAdjustment)); return Marshal.PtrToStringAnsi(__ret); } set { var arg0 = Marshal.StringToHGlobalAnsi(value); - Internal.setABI_0(__Instance, arg0); + Internal.setABI_0((__Instance + __PointerAdjustment), arg0); Marshal.FreeHGlobal(arg0); } } diff --git a/src/CppParser/Bindings/CSharp/x86_64-linux-gnu/AST.cs b/src/CppParser/Bindings/CSharp/x86_64-linux-gnu/AST.cs index 2314cc95..49921841 100644 --- a/src/CppParser/Bindings/CSharp/x86_64-linux-gnu/AST.cs +++ b/src/CppParser/Bindings/CSharp/x86_64-linux-gnu/AST.cs @@ -265,19 +265,21 @@ namespace CppSharp } public global::System.IntPtr __Instance { get; protected set; } + + protected int __PointerAdjustment; public static readonly System.Collections.Concurrent.ConcurrentDictionary NativeToManagedMap = new System.Collections.Concurrent.ConcurrentDictionary(); protected void*[] __OriginalVTables; protected bool __ownsNativeInstance; - public static Type __CreateInstance(global::System.IntPtr native, bool ownsNativeInstance = false) + public static Type __CreateInstance(global::System.IntPtr native, bool ownsNativeInstance = false, bool skipVTables = false) { - return new Type((Type.Internal*) native) { __ownsNativeInstance = ownsNativeInstance }; + return new Type((Type.Internal*) native, skipVTables) { __ownsNativeInstance = ownsNativeInstance }; } - public static Type __CreateInstance(Type.Internal native) + public static Type __CreateInstance(Type.Internal native, bool skipVTables = false) { - return new Type(native); + return new Type(native, skipVTables); } private static Type.Internal* __CopyValue(Type.Internal native) @@ -287,15 +289,17 @@ namespace CppSharp return (Type.Internal*) ret; } - private Type(Type.Internal native) - : this(__CopyValue(native)) + private Type(Type.Internal native, bool skipVTables = false) + : this(__CopyValue(native), skipVTables) { __ownsNativeInstance = true; NativeToManagedMap[__Instance] = this; } - protected Type(Type.Internal* native, bool isInternalImpl = false) + protected Type(Type.Internal* native, bool skipVTables = false) { + if (native == null) + return; __Instance = new global::System.IntPtr(native); } @@ -303,18 +307,18 @@ namespace CppSharp { __Instance = Marshal.AllocHGlobal(8); __ownsNativeInstance = true; - var arg0 = kind; - Internal.ctor_0(__Instance, arg0); NativeToManagedMap[__Instance] = this; + var arg0 = kind; + Internal.ctor_0((__Instance + __PointerAdjustment), arg0); } public Type(CppSharp.Parser.AST.Type _0) { __Instance = Marshal.AllocHGlobal(8); __ownsNativeInstance = true; - var arg0 = ReferenceEquals(_0, null) ? global::System.IntPtr.Zero : _0.__Instance; - Internal.cctor_1(__Instance, arg0); NativeToManagedMap[__Instance] = this; + var arg0 = ReferenceEquals(_0, null) ? global::System.IntPtr.Zero : _0.__Instance; + Internal.cctor_1((__Instance + __PointerAdjustment), arg0); } public void Dispose() @@ -328,7 +332,8 @@ namespace CppSharp throw new global::System.InvalidOperationException("Managed instances owned by native code cannot be disposed of."); CppSharp.Parser.AST.Type __dummy; NativeToManagedMap.TryRemove(__Instance, out __dummy); - Marshal.FreeHGlobal(__Instance); + if (__ownsNativeInstance) + Marshal.FreeHGlobal(__Instance); } public CppSharp.Parser.AST.TypeKind Kind @@ -379,19 +384,21 @@ namespace CppSharp } public global::System.IntPtr __Instance { get; protected set; } + + protected int __PointerAdjustment; public static readonly System.Collections.Concurrent.ConcurrentDictionary NativeToManagedMap = new System.Collections.Concurrent.ConcurrentDictionary(); protected void*[] __OriginalVTables; protected bool __ownsNativeInstance; - public static TypeQualifiers __CreateInstance(global::System.IntPtr native, bool ownsNativeInstance = false) + public static TypeQualifiers __CreateInstance(global::System.IntPtr native, bool ownsNativeInstance = false, bool skipVTables = false) { - return new TypeQualifiers((TypeQualifiers.Internal*) native) { __ownsNativeInstance = ownsNativeInstance }; + return new TypeQualifiers((TypeQualifiers.Internal*) native, skipVTables) { __ownsNativeInstance = ownsNativeInstance }; } - public static TypeQualifiers __CreateInstance(TypeQualifiers.Internal native) + public static TypeQualifiers __CreateInstance(TypeQualifiers.Internal native, bool skipVTables = false) { - return new TypeQualifiers(native); + return new TypeQualifiers(native, skipVTables); } private static TypeQualifiers.Internal* __CopyValue(TypeQualifiers.Internal native) @@ -401,15 +408,17 @@ namespace CppSharp return ret; } - private TypeQualifiers(TypeQualifiers.Internal native) - : this(__CopyValue(native)) + private TypeQualifiers(TypeQualifiers.Internal native, bool skipVTables = false) + : this(__CopyValue(native), skipVTables) { __ownsNativeInstance = true; NativeToManagedMap[__Instance] = this; } - protected TypeQualifiers(TypeQualifiers.Internal* native, bool isInternalImpl = false) + protected TypeQualifiers(TypeQualifiers.Internal* native, bool skipVTables = false) { + if (native == null) + return; __Instance = new global::System.IntPtr(native); } @@ -417,8 +426,8 @@ namespace CppSharp { __Instance = Marshal.AllocHGlobal(3); __ownsNativeInstance = true; - *((TypeQualifiers.Internal*) __Instance) = *((TypeQualifiers.Internal*) _0.__Instance); NativeToManagedMap[__Instance] = this; + *((TypeQualifiers.Internal*) __Instance) = *((TypeQualifiers.Internal*) _0.__Instance); } public TypeQualifiers() @@ -439,7 +448,8 @@ namespace CppSharp throw new global::System.InvalidOperationException("Managed instances owned by native code cannot be disposed of."); CppSharp.Parser.AST.TypeQualifiers __dummy; NativeToManagedMap.TryRemove(__Instance, out __dummy); - Marshal.FreeHGlobal(__Instance); + if (__ownsNativeInstance) + Marshal.FreeHGlobal(__Instance); } public bool IsConst @@ -505,19 +515,21 @@ namespace CppSharp } public global::System.IntPtr __Instance { get; protected set; } + + protected int __PointerAdjustment; public static readonly System.Collections.Concurrent.ConcurrentDictionary NativeToManagedMap = new System.Collections.Concurrent.ConcurrentDictionary(); protected void*[] __OriginalVTables; protected bool __ownsNativeInstance; - public static QualifiedType __CreateInstance(global::System.IntPtr native, bool ownsNativeInstance = false) + public static QualifiedType __CreateInstance(global::System.IntPtr native, bool ownsNativeInstance = false, bool skipVTables = false) { - return new QualifiedType((QualifiedType.Internal*) native) { __ownsNativeInstance = ownsNativeInstance }; + return new QualifiedType((QualifiedType.Internal*) native, skipVTables) { __ownsNativeInstance = ownsNativeInstance }; } - public static QualifiedType __CreateInstance(QualifiedType.Internal native) + public static QualifiedType __CreateInstance(QualifiedType.Internal native, bool skipVTables = false) { - return new QualifiedType(native); + return new QualifiedType(native, skipVTables); } private static QualifiedType.Internal* __CopyValue(QualifiedType.Internal native) @@ -527,15 +539,17 @@ namespace CppSharp return ret; } - private QualifiedType(QualifiedType.Internal native) - : this(__CopyValue(native)) + private QualifiedType(QualifiedType.Internal native, bool skipVTables = false) + : this(__CopyValue(native), skipVTables) { __ownsNativeInstance = true; NativeToManagedMap[__Instance] = this; } - protected QualifiedType(QualifiedType.Internal* native, bool isInternalImpl = false) + protected QualifiedType(QualifiedType.Internal* native, bool skipVTables = false) { + if (native == null) + return; __Instance = new global::System.IntPtr(native); } @@ -543,16 +557,16 @@ namespace CppSharp { __Instance = Marshal.AllocHGlobal(16); __ownsNativeInstance = true; - Internal.ctor_0(__Instance); NativeToManagedMap[__Instance] = this; + Internal.ctor_0((__Instance + __PointerAdjustment)); } public QualifiedType(CppSharp.Parser.AST.QualifiedType _0) { __Instance = Marshal.AllocHGlobal(16); __ownsNativeInstance = true; - *((QualifiedType.Internal*) __Instance) = *((QualifiedType.Internal*) _0.__Instance); NativeToManagedMap[__Instance] = this; + *((QualifiedType.Internal*) __Instance) = *((QualifiedType.Internal*) _0.__Instance); } public void Dispose() @@ -566,7 +580,8 @@ namespace CppSharp throw new global::System.InvalidOperationException("Managed instances owned by native code cannot be disposed of."); CppSharp.Parser.AST.QualifiedType __dummy; NativeToManagedMap.TryRemove(__Instance, out __dummy); - Marshal.FreeHGlobal(__Instance); + if (__ownsNativeInstance) + Marshal.FreeHGlobal(__Instance); } public CppSharp.Parser.AST.Type Type @@ -626,14 +641,14 @@ namespace CppSharp internal static extern void cctor_2(global::System.IntPtr instance, global::System.IntPtr _0); } - public static new TagType __CreateInstance(global::System.IntPtr native, bool ownsNativeInstance = false) + public static new TagType __CreateInstance(global::System.IntPtr native, bool ownsNativeInstance = false, bool skipVTables = false) { - return new TagType((TagType.Internal*) native) { __ownsNativeInstance = ownsNativeInstance }; + return new TagType((TagType.Internal*) native, skipVTables) { __ownsNativeInstance = ownsNativeInstance }; } - public static TagType __CreateInstance(TagType.Internal native) + public static TagType __CreateInstance(TagType.Internal native, bool skipVTables = false) { - return new TagType(native); + return new TagType(native, skipVTables); } private static TagType.Internal* __CopyValue(TagType.Internal native) @@ -643,16 +658,20 @@ namespace CppSharp return (TagType.Internal*) ret; } - private TagType(TagType.Internal native) - : this(__CopyValue(native)) + private TagType(TagType.Internal native, bool skipVTables = false) + : this(__CopyValue(native), skipVTables) { __ownsNativeInstance = true; NativeToManagedMap[__Instance] = this; } - protected TagType(TagType.Internal* native, bool isInternalImpl = false) - : base((CppSharp.Parser.AST.Type.Internal*) native) + protected TagType(TagType.Internal* native, bool skipVTables = false) + : base((CppSharp.Parser.AST.Type.Internal*) null) { + __PointerAdjustment = 0; + if (native == null) + return; + __Instance = new global::System.IntPtr(native); } public TagType() @@ -660,8 +679,8 @@ namespace CppSharp { __Instance = Marshal.AllocHGlobal(16); __ownsNativeInstance = true; - Internal.ctor_0(__Instance); NativeToManagedMap[__Instance] = this; + Internal.ctor_0((__Instance + __PointerAdjustment)); } public TagType(CppSharp.Parser.AST.TagType _0) @@ -669,9 +688,9 @@ namespace CppSharp { __Instance = Marshal.AllocHGlobal(16); __ownsNativeInstance = true; - var arg0 = ReferenceEquals(_0, null) ? global::System.IntPtr.Zero : _0.__Instance; - Internal.cctor_2(__Instance, arg0); NativeToManagedMap[__Instance] = this; + var arg0 = ReferenceEquals(_0, null) ? global::System.IntPtr.Zero : _0.__Instance; + Internal.cctor_2((__Instance + __PointerAdjustment), arg0); } public CppSharp.Parser.AST.Declaration Declaration @@ -735,14 +754,14 @@ namespace CppSharp Incomplete = 3 } - public static new ArrayType __CreateInstance(global::System.IntPtr native, bool ownsNativeInstance = false) + public static new ArrayType __CreateInstance(global::System.IntPtr native, bool ownsNativeInstance = false, bool skipVTables = false) { - return new ArrayType((ArrayType.Internal*) native) { __ownsNativeInstance = ownsNativeInstance }; + return new ArrayType((ArrayType.Internal*) native, skipVTables) { __ownsNativeInstance = ownsNativeInstance }; } - public static ArrayType __CreateInstance(ArrayType.Internal native) + public static ArrayType __CreateInstance(ArrayType.Internal native, bool skipVTables = false) { - return new ArrayType(native); + return new ArrayType(native, skipVTables); } private static ArrayType.Internal* __CopyValue(ArrayType.Internal native) @@ -752,16 +771,20 @@ namespace CppSharp return (ArrayType.Internal*) ret; } - private ArrayType(ArrayType.Internal native) - : this(__CopyValue(native)) + private ArrayType(ArrayType.Internal native, bool skipVTables = false) + : this(__CopyValue(native), skipVTables) { __ownsNativeInstance = true; NativeToManagedMap[__Instance] = this; } - protected ArrayType(ArrayType.Internal* native, bool isInternalImpl = false) - : base((CppSharp.Parser.AST.Type.Internal*) native) + protected ArrayType(ArrayType.Internal* native, bool skipVTables = false) + : base((CppSharp.Parser.AST.Type.Internal*) null) { + __PointerAdjustment = 0; + if (native == null) + return; + __Instance = new global::System.IntPtr(native); } public ArrayType() @@ -769,8 +792,8 @@ namespace CppSharp { __Instance = Marshal.AllocHGlobal(48); __ownsNativeInstance = true; - Internal.ctor_0(__Instance); NativeToManagedMap[__Instance] = this; + Internal.ctor_0((__Instance + __PointerAdjustment)); } public ArrayType(CppSharp.Parser.AST.ArrayType _0) @@ -778,9 +801,9 @@ namespace CppSharp { __Instance = Marshal.AllocHGlobal(48); __ownsNativeInstance = true; - var arg0 = ReferenceEquals(_0, null) ? global::System.IntPtr.Zero : _0.__Instance; - Internal.cctor_2(__Instance, arg0); NativeToManagedMap[__Instance] = this; + var arg0 = ReferenceEquals(_0, null) ? global::System.IntPtr.Zero : _0.__Instance; + Internal.cctor_2((__Instance + __PointerAdjustment), arg0); } public CppSharp.Parser.AST.QualifiedType QualifiedType @@ -889,14 +912,14 @@ namespace CppSharp internal static extern uint getParametersCount_0(global::System.IntPtr instance); } - public static new FunctionType __CreateInstance(global::System.IntPtr native, bool ownsNativeInstance = false) + public static new FunctionType __CreateInstance(global::System.IntPtr native, bool ownsNativeInstance = false, bool skipVTables = false) { - return new FunctionType((FunctionType.Internal*) native) { __ownsNativeInstance = ownsNativeInstance }; + return new FunctionType((FunctionType.Internal*) native, skipVTables) { __ownsNativeInstance = ownsNativeInstance }; } - public static FunctionType __CreateInstance(FunctionType.Internal native) + public static FunctionType __CreateInstance(FunctionType.Internal native, bool skipVTables = false) { - return new FunctionType(native); + return new FunctionType(native, skipVTables); } private static FunctionType.Internal* __CopyValue(FunctionType.Internal native) @@ -906,16 +929,20 @@ namespace CppSharp return (FunctionType.Internal*) ret; } - private FunctionType(FunctionType.Internal native) - : this(__CopyValue(native)) + private FunctionType(FunctionType.Internal native, bool skipVTables = false) + : this(__CopyValue(native), skipVTables) { __ownsNativeInstance = true; NativeToManagedMap[__Instance] = this; } - protected FunctionType(FunctionType.Internal* native, bool isInternalImpl = false) - : base((CppSharp.Parser.AST.Type.Internal*) native) + protected FunctionType(FunctionType.Internal* native, bool skipVTables = false) + : base((CppSharp.Parser.AST.Type.Internal*) null) { + __PointerAdjustment = 0; + if (native == null) + return; + __Instance = new global::System.IntPtr(native); } public FunctionType() @@ -923,8 +950,8 @@ namespace CppSharp { __Instance = Marshal.AllocHGlobal(56); __ownsNativeInstance = true; - Internal.ctor_0(__Instance); NativeToManagedMap[__Instance] = this; + Internal.ctor_0((__Instance + __PointerAdjustment)); } public FunctionType(CppSharp.Parser.AST.FunctionType _0) @@ -932,14 +959,14 @@ namespace CppSharp { __Instance = Marshal.AllocHGlobal(56); __ownsNativeInstance = true; - var arg0 = ReferenceEquals(_0, null) ? global::System.IntPtr.Zero : _0.__Instance; - Internal.cctor_2(__Instance, arg0); NativeToManagedMap[__Instance] = this; + var arg0 = ReferenceEquals(_0, null) ? global::System.IntPtr.Zero : _0.__Instance; + Internal.cctor_2((__Instance + __PointerAdjustment), arg0); } public CppSharp.Parser.AST.Parameter getParameters(uint i) { - var __ret = Internal.getParameters_0(__Instance, i); + var __ret = Internal.getParameters_0((__Instance + __PointerAdjustment), i); CppSharp.Parser.AST.Parameter __result0; if (__ret == IntPtr.Zero) __result0 = null; else if (CppSharp.Parser.AST.Parameter.NativeToManagedMap.ContainsKey(__ret)) @@ -951,19 +978,19 @@ namespace CppSharp public void addParameters(CppSharp.Parser.AST.Parameter s) { var arg0 = ReferenceEquals(s, null) ? global::System.IntPtr.Zero : s.__Instance; - Internal.addParameters_0(__Instance, arg0); + Internal.addParameters_0((__Instance + __PointerAdjustment), arg0); } public void clearParameters() { - Internal.clearParameters_0(__Instance); + Internal.clearParameters_0((__Instance + __PointerAdjustment)); } public uint ParametersCount { get { - var __ret = Internal.getParametersCount_0(__Instance); + var __ret = Internal.getParametersCount_0((__Instance + __PointerAdjustment)); return __ret; } } @@ -1031,14 +1058,14 @@ namespace CppSharp RVReference = 3 } - public static new PointerType __CreateInstance(global::System.IntPtr native, bool ownsNativeInstance = false) + public static new PointerType __CreateInstance(global::System.IntPtr native, bool ownsNativeInstance = false, bool skipVTables = false) { - return new PointerType((PointerType.Internal*) native) { __ownsNativeInstance = ownsNativeInstance }; + return new PointerType((PointerType.Internal*) native, skipVTables) { __ownsNativeInstance = ownsNativeInstance }; } - public static PointerType __CreateInstance(PointerType.Internal native) + public static PointerType __CreateInstance(PointerType.Internal native, bool skipVTables = false) { - return new PointerType(native); + return new PointerType(native, skipVTables); } private static PointerType.Internal* __CopyValue(PointerType.Internal native) @@ -1048,16 +1075,20 @@ namespace CppSharp return (PointerType.Internal*) ret; } - private PointerType(PointerType.Internal native) - : this(__CopyValue(native)) + private PointerType(PointerType.Internal native, bool skipVTables = false) + : this(__CopyValue(native), skipVTables) { __ownsNativeInstance = true; NativeToManagedMap[__Instance] = this; } - protected PointerType(PointerType.Internal* native, bool isInternalImpl = false) - : base((CppSharp.Parser.AST.Type.Internal*) native) + protected PointerType(PointerType.Internal* native, bool skipVTables = false) + : base((CppSharp.Parser.AST.Type.Internal*) null) { + __PointerAdjustment = 0; + if (native == null) + return; + __Instance = new global::System.IntPtr(native); } public PointerType() @@ -1065,8 +1096,8 @@ namespace CppSharp { __Instance = Marshal.AllocHGlobal(32); __ownsNativeInstance = true; - Internal.ctor_0(__Instance); NativeToManagedMap[__Instance] = this; + Internal.ctor_0((__Instance + __PointerAdjustment)); } public PointerType(CppSharp.Parser.AST.PointerType _0) @@ -1074,9 +1105,9 @@ namespace CppSharp { __Instance = Marshal.AllocHGlobal(32); __ownsNativeInstance = true; - var arg0 = ReferenceEquals(_0, null) ? global::System.IntPtr.Zero : _0.__Instance; - Internal.cctor_2(__Instance, arg0); NativeToManagedMap[__Instance] = this; + var arg0 = ReferenceEquals(_0, null) ? global::System.IntPtr.Zero : _0.__Instance; + Internal.cctor_2((__Instance + __PointerAdjustment), arg0); } public CppSharp.Parser.AST.QualifiedType QualifiedPointee @@ -1131,14 +1162,14 @@ namespace CppSharp internal static extern void cctor_2(global::System.IntPtr instance, global::System.IntPtr _0); } - public static new MemberPointerType __CreateInstance(global::System.IntPtr native, bool ownsNativeInstance = false) + public static new MemberPointerType __CreateInstance(global::System.IntPtr native, bool ownsNativeInstance = false, bool skipVTables = false) { - return new MemberPointerType((MemberPointerType.Internal*) native) { __ownsNativeInstance = ownsNativeInstance }; + return new MemberPointerType((MemberPointerType.Internal*) native, skipVTables) { __ownsNativeInstance = ownsNativeInstance }; } - public static MemberPointerType __CreateInstance(MemberPointerType.Internal native) + public static MemberPointerType __CreateInstance(MemberPointerType.Internal native, bool skipVTables = false) { - return new MemberPointerType(native); + return new MemberPointerType(native, skipVTables); } private static MemberPointerType.Internal* __CopyValue(MemberPointerType.Internal native) @@ -1148,16 +1179,20 @@ namespace CppSharp return (MemberPointerType.Internal*) ret; } - private MemberPointerType(MemberPointerType.Internal native) - : this(__CopyValue(native)) + private MemberPointerType(MemberPointerType.Internal native, bool skipVTables = false) + : this(__CopyValue(native), skipVTables) { __ownsNativeInstance = true; NativeToManagedMap[__Instance] = this; } - protected MemberPointerType(MemberPointerType.Internal* native, bool isInternalImpl = false) - : base((CppSharp.Parser.AST.Type.Internal*) native) + protected MemberPointerType(MemberPointerType.Internal* native, bool skipVTables = false) + : base((CppSharp.Parser.AST.Type.Internal*) null) { + __PointerAdjustment = 0; + if (native == null) + return; + __Instance = new global::System.IntPtr(native); } public MemberPointerType() @@ -1165,8 +1200,8 @@ namespace CppSharp { __Instance = Marshal.AllocHGlobal(24); __ownsNativeInstance = true; - Internal.ctor_0(__Instance); NativeToManagedMap[__Instance] = this; + Internal.ctor_0((__Instance + __PointerAdjustment)); } public MemberPointerType(CppSharp.Parser.AST.MemberPointerType _0) @@ -1174,9 +1209,9 @@ namespace CppSharp { __Instance = Marshal.AllocHGlobal(24); __ownsNativeInstance = true; - var arg0 = ReferenceEquals(_0, null) ? global::System.IntPtr.Zero : _0.__Instance; - Internal.cctor_2(__Instance, arg0); NativeToManagedMap[__Instance] = this; + var arg0 = ReferenceEquals(_0, null) ? global::System.IntPtr.Zero : _0.__Instance; + Internal.cctor_2((__Instance + __PointerAdjustment), arg0); } public CppSharp.Parser.AST.QualifiedType Pointee @@ -1218,14 +1253,14 @@ namespace CppSharp internal static extern void cctor_2(global::System.IntPtr instance, global::System.IntPtr _0); } - public static new TypedefType __CreateInstance(global::System.IntPtr native, bool ownsNativeInstance = false) + public static new TypedefType __CreateInstance(global::System.IntPtr native, bool ownsNativeInstance = false, bool skipVTables = false) { - return new TypedefType((TypedefType.Internal*) native) { __ownsNativeInstance = ownsNativeInstance }; + return new TypedefType((TypedefType.Internal*) native, skipVTables) { __ownsNativeInstance = ownsNativeInstance }; } - public static TypedefType __CreateInstance(TypedefType.Internal native) + public static TypedefType __CreateInstance(TypedefType.Internal native, bool skipVTables = false) { - return new TypedefType(native); + return new TypedefType(native, skipVTables); } private static TypedefType.Internal* __CopyValue(TypedefType.Internal native) @@ -1235,16 +1270,20 @@ namespace CppSharp return (TypedefType.Internal*) ret; } - private TypedefType(TypedefType.Internal native) - : this(__CopyValue(native)) + private TypedefType(TypedefType.Internal native, bool skipVTables = false) + : this(__CopyValue(native), skipVTables) { __ownsNativeInstance = true; NativeToManagedMap[__Instance] = this; } - protected TypedefType(TypedefType.Internal* native, bool isInternalImpl = false) - : base((CppSharp.Parser.AST.Type.Internal*) native) + protected TypedefType(TypedefType.Internal* native, bool skipVTables = false) + : base((CppSharp.Parser.AST.Type.Internal*) null) { + __PointerAdjustment = 0; + if (native == null) + return; + __Instance = new global::System.IntPtr(native); } public TypedefType() @@ -1252,8 +1291,8 @@ namespace CppSharp { __Instance = Marshal.AllocHGlobal(16); __ownsNativeInstance = true; - Internal.ctor_0(__Instance); NativeToManagedMap[__Instance] = this; + Internal.ctor_0((__Instance + __PointerAdjustment)); } public TypedefType(CppSharp.Parser.AST.TypedefType _0) @@ -1261,9 +1300,9 @@ namespace CppSharp { __Instance = Marshal.AllocHGlobal(16); __ownsNativeInstance = true; - var arg0 = ReferenceEquals(_0, null) ? global::System.IntPtr.Zero : _0.__Instance; - Internal.cctor_2(__Instance, arg0); NativeToManagedMap[__Instance] = this; + var arg0 = ReferenceEquals(_0, null) ? global::System.IntPtr.Zero : _0.__Instance; + Internal.cctor_2((__Instance + __PointerAdjustment), arg0); } public CppSharp.Parser.AST.TypedefDecl Declaration @@ -1313,14 +1352,14 @@ namespace CppSharp internal static extern void cctor_2(global::System.IntPtr instance, global::System.IntPtr _0); } - public static new AttributedType __CreateInstance(global::System.IntPtr native, bool ownsNativeInstance = false) + public static new AttributedType __CreateInstance(global::System.IntPtr native, bool ownsNativeInstance = false, bool skipVTables = false) { - return new AttributedType((AttributedType.Internal*) native) { __ownsNativeInstance = ownsNativeInstance }; + return new AttributedType((AttributedType.Internal*) native, skipVTables) { __ownsNativeInstance = ownsNativeInstance }; } - public static AttributedType __CreateInstance(AttributedType.Internal native) + public static AttributedType __CreateInstance(AttributedType.Internal native, bool skipVTables = false) { - return new AttributedType(native); + return new AttributedType(native, skipVTables); } private static AttributedType.Internal* __CopyValue(AttributedType.Internal native) @@ -1330,16 +1369,20 @@ namespace CppSharp return (AttributedType.Internal*) ret; } - private AttributedType(AttributedType.Internal native) - : this(__CopyValue(native)) + private AttributedType(AttributedType.Internal native, bool skipVTables = false) + : this(__CopyValue(native), skipVTables) { __ownsNativeInstance = true; NativeToManagedMap[__Instance] = this; } - protected AttributedType(AttributedType.Internal* native, bool isInternalImpl = false) - : base((CppSharp.Parser.AST.Type.Internal*) native) + protected AttributedType(AttributedType.Internal* native, bool skipVTables = false) + : base((CppSharp.Parser.AST.Type.Internal*) null) { + __PointerAdjustment = 0; + if (native == null) + return; + __Instance = new global::System.IntPtr(native); } public AttributedType() @@ -1347,8 +1390,8 @@ namespace CppSharp { __Instance = Marshal.AllocHGlobal(40); __ownsNativeInstance = true; - Internal.ctor_0(__Instance); NativeToManagedMap[__Instance] = this; + Internal.ctor_0((__Instance + __PointerAdjustment)); } public AttributedType(CppSharp.Parser.AST.AttributedType _0) @@ -1356,9 +1399,9 @@ namespace CppSharp { __Instance = Marshal.AllocHGlobal(40); __ownsNativeInstance = true; - var arg0 = ReferenceEquals(_0, null) ? global::System.IntPtr.Zero : _0.__Instance; - Internal.cctor_2(__Instance, arg0); NativeToManagedMap[__Instance] = this; + var arg0 = ReferenceEquals(_0, null) ? global::System.IntPtr.Zero : _0.__Instance; + Internal.cctor_2((__Instance + __PointerAdjustment), arg0); } public CppSharp.Parser.AST.QualifiedType Modified @@ -1419,14 +1462,14 @@ namespace CppSharp internal static extern void cctor_2(global::System.IntPtr instance, global::System.IntPtr _0); } - public static new DecayedType __CreateInstance(global::System.IntPtr native, bool ownsNativeInstance = false) + public static new DecayedType __CreateInstance(global::System.IntPtr native, bool ownsNativeInstance = false, bool skipVTables = false) { - return new DecayedType((DecayedType.Internal*) native) { __ownsNativeInstance = ownsNativeInstance }; + return new DecayedType((DecayedType.Internal*) native, skipVTables) { __ownsNativeInstance = ownsNativeInstance }; } - public static DecayedType __CreateInstance(DecayedType.Internal native) + public static DecayedType __CreateInstance(DecayedType.Internal native, bool skipVTables = false) { - return new DecayedType(native); + return new DecayedType(native, skipVTables); } private static DecayedType.Internal* __CopyValue(DecayedType.Internal native) @@ -1436,16 +1479,20 @@ namespace CppSharp return (DecayedType.Internal*) ret; } - private DecayedType(DecayedType.Internal native) - : this(__CopyValue(native)) + private DecayedType(DecayedType.Internal native, bool skipVTables = false) + : this(__CopyValue(native), skipVTables) { __ownsNativeInstance = true; NativeToManagedMap[__Instance] = this; } - protected DecayedType(DecayedType.Internal* native, bool isInternalImpl = false) - : base((CppSharp.Parser.AST.Type.Internal*) native) + protected DecayedType(DecayedType.Internal* native, bool skipVTables = false) + : base((CppSharp.Parser.AST.Type.Internal*) null) { + __PointerAdjustment = 0; + if (native == null) + return; + __Instance = new global::System.IntPtr(native); } public DecayedType() @@ -1453,8 +1500,8 @@ namespace CppSharp { __Instance = Marshal.AllocHGlobal(56); __ownsNativeInstance = true; - Internal.ctor_0(__Instance); NativeToManagedMap[__Instance] = this; + Internal.ctor_0((__Instance + __PointerAdjustment)); } public DecayedType(CppSharp.Parser.AST.DecayedType _0) @@ -1462,9 +1509,9 @@ namespace CppSharp { __Instance = Marshal.AllocHGlobal(56); __ownsNativeInstance = true; - var arg0 = ReferenceEquals(_0, null) ? global::System.IntPtr.Zero : _0.__Instance; - Internal.cctor_2(__Instance, arg0); NativeToManagedMap[__Instance] = this; + var arg0 = ReferenceEquals(_0, null) ? global::System.IntPtr.Zero : _0.__Instance; + Internal.cctor_2((__Instance + __PointerAdjustment), arg0); } public CppSharp.Parser.AST.QualifiedType Decayed @@ -1548,19 +1595,21 @@ namespace CppSharp } public global::System.IntPtr __Instance { get; protected set; } + + protected int __PointerAdjustment; public static readonly System.Collections.Concurrent.ConcurrentDictionary NativeToManagedMap = new System.Collections.Concurrent.ConcurrentDictionary(); protected void*[] __OriginalVTables; protected bool __ownsNativeInstance; - public static TemplateArgument __CreateInstance(global::System.IntPtr native, bool ownsNativeInstance = false) + public static TemplateArgument __CreateInstance(global::System.IntPtr native, bool ownsNativeInstance = false, bool skipVTables = false) { - return new TemplateArgument((TemplateArgument.Internal*) native) { __ownsNativeInstance = ownsNativeInstance }; + return new TemplateArgument((TemplateArgument.Internal*) native, skipVTables) { __ownsNativeInstance = ownsNativeInstance }; } - public static TemplateArgument __CreateInstance(TemplateArgument.Internal native) + public static TemplateArgument __CreateInstance(TemplateArgument.Internal native, bool skipVTables = false) { - return new TemplateArgument(native); + return new TemplateArgument(native, skipVTables); } private static TemplateArgument.Internal* __CopyValue(TemplateArgument.Internal native) @@ -1570,15 +1619,17 @@ namespace CppSharp return ret; } - private TemplateArgument(TemplateArgument.Internal native) - : this(__CopyValue(native)) + private TemplateArgument(TemplateArgument.Internal native, bool skipVTables = false) + : this(__CopyValue(native), skipVTables) { __ownsNativeInstance = true; NativeToManagedMap[__Instance] = this; } - protected TemplateArgument(TemplateArgument.Internal* native, bool isInternalImpl = false) + protected TemplateArgument(TemplateArgument.Internal* native, bool skipVTables = false) { + if (native == null) + return; __Instance = new global::System.IntPtr(native); } @@ -1586,16 +1637,16 @@ namespace CppSharp { __Instance = Marshal.AllocHGlobal(40); __ownsNativeInstance = true; - Internal.ctor_0(__Instance); NativeToManagedMap[__Instance] = this; + Internal.ctor_0((__Instance + __PointerAdjustment)); } public TemplateArgument(CppSharp.Parser.AST.TemplateArgument _0) { __Instance = Marshal.AllocHGlobal(40); __ownsNativeInstance = true; - *((TemplateArgument.Internal*) __Instance) = *((TemplateArgument.Internal*) _0.__Instance); NativeToManagedMap[__Instance] = this; + *((TemplateArgument.Internal*) __Instance) = *((TemplateArgument.Internal*) _0.__Instance); } public void Dispose() @@ -1609,7 +1660,8 @@ namespace CppSharp throw new global::System.InvalidOperationException("Managed instances owned by native code cannot be disposed of."); CppSharp.Parser.AST.TemplateArgument __dummy; NativeToManagedMap.TryRemove(__Instance, out __dummy); - Marshal.FreeHGlobal(__Instance); + if (__ownsNativeInstance) + Marshal.FreeHGlobal(__Instance); } public CppSharp.Parser.AST.TemplateArgument.ArgumentKind Kind @@ -1723,14 +1775,14 @@ namespace CppSharp internal static extern uint getArgumentsCount_0(global::System.IntPtr instance); } - public static new TemplateSpecializationType __CreateInstance(global::System.IntPtr native, bool ownsNativeInstance = false) + public static new TemplateSpecializationType __CreateInstance(global::System.IntPtr native, bool ownsNativeInstance = false, bool skipVTables = false) { - return new TemplateSpecializationType((TemplateSpecializationType.Internal*) native) { __ownsNativeInstance = ownsNativeInstance }; + return new TemplateSpecializationType((TemplateSpecializationType.Internal*) native, skipVTables) { __ownsNativeInstance = ownsNativeInstance }; } - public static TemplateSpecializationType __CreateInstance(TemplateSpecializationType.Internal native) + public static TemplateSpecializationType __CreateInstance(TemplateSpecializationType.Internal native, bool skipVTables = false) { - return new TemplateSpecializationType(native); + return new TemplateSpecializationType(native, skipVTables); } private static TemplateSpecializationType.Internal* __CopyValue(TemplateSpecializationType.Internal native) @@ -1740,16 +1792,20 @@ namespace CppSharp return (TemplateSpecializationType.Internal*) ret; } - private TemplateSpecializationType(TemplateSpecializationType.Internal native) - : this(__CopyValue(native)) + private TemplateSpecializationType(TemplateSpecializationType.Internal native, bool skipVTables = false) + : this(__CopyValue(native), skipVTables) { __ownsNativeInstance = true; NativeToManagedMap[__Instance] = this; } - protected TemplateSpecializationType(TemplateSpecializationType.Internal* native, bool isInternalImpl = false) - : base((CppSharp.Parser.AST.Type.Internal*) native) + protected TemplateSpecializationType(TemplateSpecializationType.Internal* native, bool skipVTables = false) + : base((CppSharp.Parser.AST.Type.Internal*) null) { + __PointerAdjustment = 0; + if (native == null) + return; + __Instance = new global::System.IntPtr(native); } public TemplateSpecializationType() @@ -1757,8 +1813,8 @@ namespace CppSharp { __Instance = Marshal.AllocHGlobal(48); __ownsNativeInstance = true; - Internal.ctor_0(__Instance); NativeToManagedMap[__Instance] = this; + Internal.ctor_0((__Instance + __PointerAdjustment)); } public TemplateSpecializationType(CppSharp.Parser.AST.TemplateSpecializationType _0) @@ -1766,34 +1822,34 @@ namespace CppSharp { __Instance = Marshal.AllocHGlobal(48); __ownsNativeInstance = true; - var arg0 = ReferenceEquals(_0, null) ? global::System.IntPtr.Zero : _0.__Instance; - Internal.cctor_1(__Instance, arg0); NativeToManagedMap[__Instance] = this; + var arg0 = ReferenceEquals(_0, null) ? global::System.IntPtr.Zero : _0.__Instance; + Internal.cctor_1((__Instance + __PointerAdjustment), arg0); } public CppSharp.Parser.AST.TemplateArgument getArguments(uint i) { var __ret = new CppSharp.Parser.AST.TemplateArgument.Internal(); - Internal.getArguments_0(new IntPtr(&__ret), __Instance, i); + Internal.getArguments_0(new IntPtr(&__ret), (__Instance + __PointerAdjustment), i); return CppSharp.Parser.AST.TemplateArgument.__CreateInstance(__ret); } public void addArguments(CppSharp.Parser.AST.TemplateArgument s) { var arg0 = ReferenceEquals(s, null) ? global::System.IntPtr.Zero : s.__Instance; - Internal.addArguments_0(__Instance, arg0); + Internal.addArguments_0((__Instance + __PointerAdjustment), arg0); } public void clearArguments() { - Internal.clearArguments_0(__Instance); + Internal.clearArguments_0((__Instance + __PointerAdjustment)); } public uint ArgumentsCount { get { - var __ret = Internal.getArgumentsCount_0(__Instance); + var __ret = Internal.getArgumentsCount_0((__Instance + __PointerAdjustment)); return __ret; } } @@ -1862,7 +1918,7 @@ namespace CppSharp [DllImport("CppSharp.CppParser.dll", CallingConvention = global::System.Runtime.InteropServices.CallingConvention.Cdecl, EntryPoint="_ZNK8CppSharp9CppParser3AST17TemplateParametereqERKS2_")] [return: MarshalAsAttribute(UnmanagedType.I1)] - internal static extern byte OperatorEqualEqual_0(global::System.IntPtr instance, global::System.IntPtr param); + internal static extern bool OperatorEqualEqual_0(global::System.IntPtr instance, global::System.IntPtr param); [SuppressUnmanagedCodeSecurity] [DllImport("CppSharp.CppParser.dll", CallingConvention = global::System.Runtime.InteropServices.CallingConvention.Cdecl, @@ -1876,19 +1932,21 @@ namespace CppSharp } public global::System.IntPtr __Instance { get; protected set; } + + protected int __PointerAdjustment; public static readonly System.Collections.Concurrent.ConcurrentDictionary NativeToManagedMap = new System.Collections.Concurrent.ConcurrentDictionary(); protected void*[] __OriginalVTables; protected bool __ownsNativeInstance; - public static TemplateParameter __CreateInstance(global::System.IntPtr native, bool ownsNativeInstance = false) + public static TemplateParameter __CreateInstance(global::System.IntPtr native, bool ownsNativeInstance = false, bool skipVTables = false) { - return new TemplateParameter((TemplateParameter.Internal*) native) { __ownsNativeInstance = ownsNativeInstance }; + return new TemplateParameter((TemplateParameter.Internal*) native, skipVTables) { __ownsNativeInstance = ownsNativeInstance }; } - public static TemplateParameter __CreateInstance(TemplateParameter.Internal native) + public static TemplateParameter __CreateInstance(TemplateParameter.Internal native, bool skipVTables = false) { - return new TemplateParameter(native); + return new TemplateParameter(native, skipVTables); } private static TemplateParameter.Internal* __CopyValue(TemplateParameter.Internal native) @@ -1898,15 +1956,17 @@ namespace CppSharp return (TemplateParameter.Internal*) ret; } - private TemplateParameter(TemplateParameter.Internal native) - : this(__CopyValue(native)) + private TemplateParameter(TemplateParameter.Internal native, bool skipVTables = false) + : this(__CopyValue(native), skipVTables) { __ownsNativeInstance = true; NativeToManagedMap[__Instance] = this; } - protected TemplateParameter(TemplateParameter.Internal* native, bool isInternalImpl = false) + protected TemplateParameter(TemplateParameter.Internal* native, bool skipVTables = false) { + if (native == null) + return; __Instance = new global::System.IntPtr(native); } @@ -1914,17 +1974,17 @@ namespace CppSharp { __Instance = Marshal.AllocHGlobal(16); __ownsNativeInstance = true; - Internal.ctor_0(__Instance); NativeToManagedMap[__Instance] = this; + Internal.ctor_0((__Instance + __PointerAdjustment)); } public TemplateParameter(CppSharp.Parser.AST.TemplateParameter _0) { __Instance = Marshal.AllocHGlobal(16); __ownsNativeInstance = true; - var arg0 = ReferenceEquals(_0, null) ? global::System.IntPtr.Zero : _0.__Instance; - Internal.cctor_1(__Instance, arg0); NativeToManagedMap[__Instance] = this; + var arg0 = ReferenceEquals(_0, null) ? global::System.IntPtr.Zero : _0.__Instance; + Internal.cctor_1((__Instance + __PointerAdjustment), arg0); } public void Dispose() @@ -1938,8 +1998,9 @@ namespace CppSharp throw new global::System.InvalidOperationException("Managed instances owned by native code cannot be disposed of."); CppSharp.Parser.AST.TemplateParameter __dummy; NativeToManagedMap.TryRemove(__Instance, out __dummy); - Internal.dtor_0(__Instance); - Marshal.FreeHGlobal(__Instance); + Internal.dtor_0((__Instance + __PointerAdjustment)); + if (__ownsNativeInstance) + Marshal.FreeHGlobal(__Instance); } public static bool operator !=(CppSharp.Parser.AST.TemplateParameter __op, CppSharp.Parser.AST.TemplateParameter param) @@ -1956,7 +2017,7 @@ namespace CppSharp var arg0 = __op.__Instance; var arg1 = param.__Instance; var __ret = Internal.OperatorEqualEqual_0(arg0, arg1); - return __ret != 0; + return __ret; } public override bool Equals(object obj) @@ -1964,18 +2025,25 @@ namespace CppSharp return this == obj as TemplateParameter; } + public override int GetHashCode() + { + if (__Instance == global::System.IntPtr.Zero) + return global::System.IntPtr.Zero.GetHashCode(); + return (*(Internal*) __Instance).GetHashCode(); + } + public string Name { get { - var __ret = Internal.getName_0(__Instance); + var __ret = Internal.getName_0((__Instance + __PointerAdjustment)); return Marshal.PtrToStringAnsi(__ret); } set { var arg0 = Marshal.StringToHGlobalAnsi(value); - Internal.setName_0(__Instance, arg0); + Internal.setName_0((__Instance + __PointerAdjustment), arg0); Marshal.FreeHGlobal(arg0); } } @@ -2033,14 +2101,14 @@ namespace CppSharp internal static extern void dtor_0(global::System.IntPtr instance); } - public static new TemplateParameterType __CreateInstance(global::System.IntPtr native, bool ownsNativeInstance = false) + public static new TemplateParameterType __CreateInstance(global::System.IntPtr native, bool ownsNativeInstance = false, bool skipVTables = false) { - return new TemplateParameterType((TemplateParameterType.Internal*) native) { __ownsNativeInstance = ownsNativeInstance }; + return new TemplateParameterType((TemplateParameterType.Internal*) native, skipVTables) { __ownsNativeInstance = ownsNativeInstance }; } - public static TemplateParameterType __CreateInstance(TemplateParameterType.Internal native) + public static TemplateParameterType __CreateInstance(TemplateParameterType.Internal native, bool skipVTables = false) { - return new TemplateParameterType(native); + return new TemplateParameterType(native, skipVTables); } private static TemplateParameterType.Internal* __CopyValue(TemplateParameterType.Internal native) @@ -2050,16 +2118,20 @@ namespace CppSharp return (TemplateParameterType.Internal*) ret; } - private TemplateParameterType(TemplateParameterType.Internal native) - : this(__CopyValue(native)) + private TemplateParameterType(TemplateParameterType.Internal native, bool skipVTables = false) + : this(__CopyValue(native), skipVTables) { __ownsNativeInstance = true; NativeToManagedMap[__Instance] = this; } - protected TemplateParameterType(TemplateParameterType.Internal* native, bool isInternalImpl = false) - : base((CppSharp.Parser.AST.Type.Internal*) native) + protected TemplateParameterType(TemplateParameterType.Internal* native, bool skipVTables = false) + : base((CppSharp.Parser.AST.Type.Internal*) null) { + __PointerAdjustment = 0; + if (native == null) + return; + __Instance = new global::System.IntPtr(native); } public TemplateParameterType() @@ -2067,8 +2139,8 @@ namespace CppSharp { __Instance = Marshal.AllocHGlobal(40); __ownsNativeInstance = true; - Internal.ctor_0(__Instance); NativeToManagedMap[__Instance] = this; + Internal.ctor_0((__Instance + __PointerAdjustment)); } public TemplateParameterType(CppSharp.Parser.AST.TemplateParameterType _0) @@ -2076,9 +2148,9 @@ namespace CppSharp { __Instance = Marshal.AllocHGlobal(40); __ownsNativeInstance = true; - var arg0 = ReferenceEquals(_0, null) ? global::System.IntPtr.Zero : _0.__Instance; - Internal.cctor_1(__Instance, arg0); NativeToManagedMap[__Instance] = this; + var arg0 = ReferenceEquals(_0, null) ? global::System.IntPtr.Zero : _0.__Instance; + Internal.cctor_1((__Instance + __PointerAdjustment), arg0); } public CppSharp.Parser.AST.TemplateParameter Parameter @@ -2159,14 +2231,14 @@ namespace CppSharp internal static extern void cctor_2(global::System.IntPtr instance, global::System.IntPtr _0); } - public static new TemplateParameterSubstitutionType __CreateInstance(global::System.IntPtr native, bool ownsNativeInstance = false) + public static new TemplateParameterSubstitutionType __CreateInstance(global::System.IntPtr native, bool ownsNativeInstance = false, bool skipVTables = false) { - return new TemplateParameterSubstitutionType((TemplateParameterSubstitutionType.Internal*) native) { __ownsNativeInstance = ownsNativeInstance }; + return new TemplateParameterSubstitutionType((TemplateParameterSubstitutionType.Internal*) native, skipVTables) { __ownsNativeInstance = ownsNativeInstance }; } - public static TemplateParameterSubstitutionType __CreateInstance(TemplateParameterSubstitutionType.Internal native) + public static TemplateParameterSubstitutionType __CreateInstance(TemplateParameterSubstitutionType.Internal native, bool skipVTables = false) { - return new TemplateParameterSubstitutionType(native); + return new TemplateParameterSubstitutionType(native, skipVTables); } private static TemplateParameterSubstitutionType.Internal* __CopyValue(TemplateParameterSubstitutionType.Internal native) @@ -2176,16 +2248,20 @@ namespace CppSharp return (TemplateParameterSubstitutionType.Internal*) ret; } - private TemplateParameterSubstitutionType(TemplateParameterSubstitutionType.Internal native) - : this(__CopyValue(native)) + private TemplateParameterSubstitutionType(TemplateParameterSubstitutionType.Internal native, bool skipVTables = false) + : this(__CopyValue(native), skipVTables) { __ownsNativeInstance = true; NativeToManagedMap[__Instance] = this; } - protected TemplateParameterSubstitutionType(TemplateParameterSubstitutionType.Internal* native, bool isInternalImpl = false) - : base((CppSharp.Parser.AST.Type.Internal*) native) + protected TemplateParameterSubstitutionType(TemplateParameterSubstitutionType.Internal* native, bool skipVTables = false) + : base((CppSharp.Parser.AST.Type.Internal*) null) { + __PointerAdjustment = 0; + if (native == null) + return; + __Instance = new global::System.IntPtr(native); } public TemplateParameterSubstitutionType() @@ -2193,8 +2269,8 @@ namespace CppSharp { __Instance = Marshal.AllocHGlobal(24); __ownsNativeInstance = true; - Internal.ctor_0(__Instance); NativeToManagedMap[__Instance] = this; + Internal.ctor_0((__Instance + __PointerAdjustment)); } public TemplateParameterSubstitutionType(CppSharp.Parser.AST.TemplateParameterSubstitutionType _0) @@ -2202,9 +2278,9 @@ namespace CppSharp { __Instance = Marshal.AllocHGlobal(24); __ownsNativeInstance = true; - var arg0 = ReferenceEquals(_0, null) ? global::System.IntPtr.Zero : _0.__Instance; - Internal.cctor_2(__Instance, arg0); NativeToManagedMap[__Instance] = this; + var arg0 = ReferenceEquals(_0, null) ? global::System.IntPtr.Zero : _0.__Instance; + Internal.cctor_2((__Instance + __PointerAdjustment), arg0); } public CppSharp.Parser.AST.QualifiedType Replacement @@ -2249,14 +2325,14 @@ namespace CppSharp internal static extern void cctor_2(global::System.IntPtr instance, global::System.IntPtr _0); } - public static new InjectedClassNameType __CreateInstance(global::System.IntPtr native, bool ownsNativeInstance = false) + public static new InjectedClassNameType __CreateInstance(global::System.IntPtr native, bool ownsNativeInstance = false, bool skipVTables = false) { - return new InjectedClassNameType((InjectedClassNameType.Internal*) native) { __ownsNativeInstance = ownsNativeInstance }; + return new InjectedClassNameType((InjectedClassNameType.Internal*) native, skipVTables) { __ownsNativeInstance = ownsNativeInstance }; } - public static InjectedClassNameType __CreateInstance(InjectedClassNameType.Internal native) + public static InjectedClassNameType __CreateInstance(InjectedClassNameType.Internal native, bool skipVTables = false) { - return new InjectedClassNameType(native); + return new InjectedClassNameType(native, skipVTables); } private static InjectedClassNameType.Internal* __CopyValue(InjectedClassNameType.Internal native) @@ -2266,16 +2342,20 @@ namespace CppSharp return (InjectedClassNameType.Internal*) ret; } - private InjectedClassNameType(InjectedClassNameType.Internal native) - : this(__CopyValue(native)) + private InjectedClassNameType(InjectedClassNameType.Internal native, bool skipVTables = false) + : this(__CopyValue(native), skipVTables) { __ownsNativeInstance = true; NativeToManagedMap[__Instance] = this; } - protected InjectedClassNameType(InjectedClassNameType.Internal* native, bool isInternalImpl = false) - : base((CppSharp.Parser.AST.Type.Internal*) native) + protected InjectedClassNameType(InjectedClassNameType.Internal* native, bool skipVTables = false) + : base((CppSharp.Parser.AST.Type.Internal*) null) { + __PointerAdjustment = 0; + if (native == null) + return; + __Instance = new global::System.IntPtr(native); } public InjectedClassNameType() @@ -2283,8 +2363,8 @@ namespace CppSharp { __Instance = Marshal.AllocHGlobal(24); __ownsNativeInstance = true; - Internal.ctor_0(__Instance); NativeToManagedMap[__Instance] = this; + Internal.ctor_0((__Instance + __PointerAdjustment)); } public InjectedClassNameType(CppSharp.Parser.AST.InjectedClassNameType _0) @@ -2292,9 +2372,9 @@ namespace CppSharp { __Instance = Marshal.AllocHGlobal(24); __ownsNativeInstance = true; - var arg0 = ReferenceEquals(_0, null) ? global::System.IntPtr.Zero : _0.__Instance; - Internal.cctor_2(__Instance, arg0); NativeToManagedMap[__Instance] = this; + var arg0 = ReferenceEquals(_0, null) ? global::System.IntPtr.Zero : _0.__Instance; + Internal.cctor_2((__Instance + __PointerAdjustment), arg0); } public CppSharp.Parser.AST.TemplateSpecializationType TemplateSpecialization @@ -2356,14 +2436,14 @@ namespace CppSharp internal static extern void cctor_2(global::System.IntPtr instance, global::System.IntPtr _0); } - public static new DependentNameType __CreateInstance(global::System.IntPtr native, bool ownsNativeInstance = false) + public static new DependentNameType __CreateInstance(global::System.IntPtr native, bool ownsNativeInstance = false, bool skipVTables = false) { - return new DependentNameType((DependentNameType.Internal*) native) { __ownsNativeInstance = ownsNativeInstance }; + return new DependentNameType((DependentNameType.Internal*) native, skipVTables) { __ownsNativeInstance = ownsNativeInstance }; } - public static DependentNameType __CreateInstance(DependentNameType.Internal native) + public static DependentNameType __CreateInstance(DependentNameType.Internal native, bool skipVTables = false) { - return new DependentNameType(native); + return new DependentNameType(native, skipVTables); } private static DependentNameType.Internal* __CopyValue(DependentNameType.Internal native) @@ -2373,16 +2453,20 @@ namespace CppSharp return (DependentNameType.Internal*) ret; } - private DependentNameType(DependentNameType.Internal native) - : this(__CopyValue(native)) + private DependentNameType(DependentNameType.Internal native, bool skipVTables = false) + : this(__CopyValue(native), skipVTables) { __ownsNativeInstance = true; NativeToManagedMap[__Instance] = this; } - protected DependentNameType(DependentNameType.Internal* native, bool isInternalImpl = false) - : base((CppSharp.Parser.AST.Type.Internal*) native) + protected DependentNameType(DependentNameType.Internal* native, bool skipVTables = false) + : base((CppSharp.Parser.AST.Type.Internal*) null) { + __PointerAdjustment = 0; + if (native == null) + return; + __Instance = new global::System.IntPtr(native); } public DependentNameType() @@ -2390,8 +2474,8 @@ namespace CppSharp { __Instance = Marshal.AllocHGlobal(8); __ownsNativeInstance = true; - Internal.ctor_0(__Instance); NativeToManagedMap[__Instance] = this; + Internal.ctor_0((__Instance + __PointerAdjustment)); } public DependentNameType(CppSharp.Parser.AST.DependentNameType _0) @@ -2399,9 +2483,9 @@ namespace CppSharp { __Instance = Marshal.AllocHGlobal(8); __ownsNativeInstance = true; - var arg0 = ReferenceEquals(_0, null) ? global::System.IntPtr.Zero : _0.__Instance; - Internal.cctor_2(__Instance, arg0); NativeToManagedMap[__Instance] = this; + var arg0 = ReferenceEquals(_0, null) ? global::System.IntPtr.Zero : _0.__Instance; + Internal.cctor_2((__Instance + __PointerAdjustment), arg0); } } @@ -2427,14 +2511,14 @@ namespace CppSharp internal static extern void cctor_2(global::System.IntPtr instance, global::System.IntPtr _0); } - public static new PackExpansionType __CreateInstance(global::System.IntPtr native, bool ownsNativeInstance = false) + public static new PackExpansionType __CreateInstance(global::System.IntPtr native, bool ownsNativeInstance = false, bool skipVTables = false) { - return new PackExpansionType((PackExpansionType.Internal*) native) { __ownsNativeInstance = ownsNativeInstance }; + return new PackExpansionType((PackExpansionType.Internal*) native, skipVTables) { __ownsNativeInstance = ownsNativeInstance }; } - public static PackExpansionType __CreateInstance(PackExpansionType.Internal native) + public static PackExpansionType __CreateInstance(PackExpansionType.Internal native, bool skipVTables = false) { - return new PackExpansionType(native); + return new PackExpansionType(native, skipVTables); } private static PackExpansionType.Internal* __CopyValue(PackExpansionType.Internal native) @@ -2444,16 +2528,20 @@ namespace CppSharp return (PackExpansionType.Internal*) ret; } - private PackExpansionType(PackExpansionType.Internal native) - : this(__CopyValue(native)) + private PackExpansionType(PackExpansionType.Internal native, bool skipVTables = false) + : this(__CopyValue(native), skipVTables) { __ownsNativeInstance = true; NativeToManagedMap[__Instance] = this; } - protected PackExpansionType(PackExpansionType.Internal* native, bool isInternalImpl = false) - : base((CppSharp.Parser.AST.Type.Internal*) native) + protected PackExpansionType(PackExpansionType.Internal* native, bool skipVTables = false) + : base((CppSharp.Parser.AST.Type.Internal*) null) { + __PointerAdjustment = 0; + if (native == null) + return; + __Instance = new global::System.IntPtr(native); } public PackExpansionType() @@ -2461,8 +2549,8 @@ namespace CppSharp { __Instance = Marshal.AllocHGlobal(8); __ownsNativeInstance = true; - Internal.ctor_0(__Instance); NativeToManagedMap[__Instance] = this; + Internal.ctor_0((__Instance + __PointerAdjustment)); } public PackExpansionType(CppSharp.Parser.AST.PackExpansionType _0) @@ -2470,9 +2558,9 @@ namespace CppSharp { __Instance = Marshal.AllocHGlobal(8); __ownsNativeInstance = true; - var arg0 = ReferenceEquals(_0, null) ? global::System.IntPtr.Zero : _0.__Instance; - Internal.cctor_2(__Instance, arg0); NativeToManagedMap[__Instance] = this; + var arg0 = ReferenceEquals(_0, null) ? global::System.IntPtr.Zero : _0.__Instance; + Internal.cctor_2((__Instance + __PointerAdjustment), arg0); } } @@ -2501,14 +2589,14 @@ namespace CppSharp internal static extern void cctor_2(global::System.IntPtr instance, global::System.IntPtr _0); } - public static new BuiltinType __CreateInstance(global::System.IntPtr native, bool ownsNativeInstance = false) + public static new BuiltinType __CreateInstance(global::System.IntPtr native, bool ownsNativeInstance = false, bool skipVTables = false) { - return new BuiltinType((BuiltinType.Internal*) native) { __ownsNativeInstance = ownsNativeInstance }; + return new BuiltinType((BuiltinType.Internal*) native, skipVTables) { __ownsNativeInstance = ownsNativeInstance }; } - public static BuiltinType __CreateInstance(BuiltinType.Internal native) + public static BuiltinType __CreateInstance(BuiltinType.Internal native, bool skipVTables = false) { - return new BuiltinType(native); + return new BuiltinType(native, skipVTables); } private static BuiltinType.Internal* __CopyValue(BuiltinType.Internal native) @@ -2518,16 +2606,20 @@ namespace CppSharp return (BuiltinType.Internal*) ret; } - private BuiltinType(BuiltinType.Internal native) - : this(__CopyValue(native)) + private BuiltinType(BuiltinType.Internal native, bool skipVTables = false) + : this(__CopyValue(native), skipVTables) { __ownsNativeInstance = true; NativeToManagedMap[__Instance] = this; } - protected BuiltinType(BuiltinType.Internal* native, bool isInternalImpl = false) - : base((CppSharp.Parser.AST.Type.Internal*) native) + protected BuiltinType(BuiltinType.Internal* native, bool skipVTables = false) + : base((CppSharp.Parser.AST.Type.Internal*) null) { + __PointerAdjustment = 0; + if (native == null) + return; + __Instance = new global::System.IntPtr(native); } public BuiltinType() @@ -2535,8 +2627,8 @@ namespace CppSharp { __Instance = Marshal.AllocHGlobal(12); __ownsNativeInstance = true; - Internal.ctor_0(__Instance); NativeToManagedMap[__Instance] = this; + Internal.ctor_0((__Instance + __PointerAdjustment)); } public BuiltinType(CppSharp.Parser.AST.BuiltinType _0) @@ -2544,9 +2636,9 @@ namespace CppSharp { __Instance = Marshal.AllocHGlobal(12); __ownsNativeInstance = true; - var arg0 = ReferenceEquals(_0, null) ? global::System.IntPtr.Zero : _0.__Instance; - Internal.cctor_2(__Instance, arg0); NativeToManagedMap[__Instance] = this; + var arg0 = ReferenceEquals(_0, null) ? global::System.IntPtr.Zero : _0.__Instance; + Internal.cctor_2((__Instance + __PointerAdjustment), arg0); } public CppSharp.Parser.AST.PrimitiveType Type @@ -2589,19 +2681,21 @@ namespace CppSharp } public global::System.IntPtr __Instance { get; protected set; } + + protected int __PointerAdjustment; public static readonly System.Collections.Concurrent.ConcurrentDictionary NativeToManagedMap = new System.Collections.Concurrent.ConcurrentDictionary(); protected void*[] __OriginalVTables; protected bool __ownsNativeInstance; - public static VTableComponent __CreateInstance(global::System.IntPtr native, bool ownsNativeInstance = false) + public static VTableComponent __CreateInstance(global::System.IntPtr native, bool ownsNativeInstance = false, bool skipVTables = false) { - return new VTableComponent((VTableComponent.Internal*) native) { __ownsNativeInstance = ownsNativeInstance }; + return new VTableComponent((VTableComponent.Internal*) native, skipVTables) { __ownsNativeInstance = ownsNativeInstance }; } - public static VTableComponent __CreateInstance(VTableComponent.Internal native) + public static VTableComponent __CreateInstance(VTableComponent.Internal native, bool skipVTables = false) { - return new VTableComponent(native); + return new VTableComponent(native, skipVTables); } private static VTableComponent.Internal* __CopyValue(VTableComponent.Internal native) @@ -2611,15 +2705,17 @@ namespace CppSharp return ret; } - private VTableComponent(VTableComponent.Internal native) - : this(__CopyValue(native)) + private VTableComponent(VTableComponent.Internal native, bool skipVTables = false) + : this(__CopyValue(native), skipVTables) { __ownsNativeInstance = true; NativeToManagedMap[__Instance] = this; } - protected VTableComponent(VTableComponent.Internal* native, bool isInternalImpl = false) + protected VTableComponent(VTableComponent.Internal* native, bool skipVTables = false) { + if (native == null) + return; __Instance = new global::System.IntPtr(native); } @@ -2627,16 +2723,16 @@ namespace CppSharp { __Instance = Marshal.AllocHGlobal(16); __ownsNativeInstance = true; - Internal.ctor_0(__Instance); NativeToManagedMap[__Instance] = this; + Internal.ctor_0((__Instance + __PointerAdjustment)); } public VTableComponent(CppSharp.Parser.AST.VTableComponent _0) { __Instance = Marshal.AllocHGlobal(16); __ownsNativeInstance = true; - *((VTableComponent.Internal*) __Instance) = *((VTableComponent.Internal*) _0.__Instance); NativeToManagedMap[__Instance] = this; + *((VTableComponent.Internal*) __Instance) = *((VTableComponent.Internal*) _0.__Instance); } public void Dispose() @@ -2650,7 +2746,8 @@ namespace CppSharp throw new global::System.InvalidOperationException("Managed instances owned by native code cannot be disposed of."); CppSharp.Parser.AST.VTableComponent __dummy; NativeToManagedMap.TryRemove(__Instance, out __dummy); - Marshal.FreeHGlobal(__Instance); + if (__ownsNativeInstance) + Marshal.FreeHGlobal(__Instance); } public CppSharp.Parser.AST.VTableComponentKind Kind @@ -2740,19 +2837,21 @@ namespace CppSharp } public global::System.IntPtr __Instance { get; protected set; } + + protected int __PointerAdjustment; public static readonly System.Collections.Concurrent.ConcurrentDictionary NativeToManagedMap = new System.Collections.Concurrent.ConcurrentDictionary(); protected void*[] __OriginalVTables; protected bool __ownsNativeInstance; - public static VTableLayout __CreateInstance(global::System.IntPtr native, bool ownsNativeInstance = false) + public static VTableLayout __CreateInstance(global::System.IntPtr native, bool ownsNativeInstance = false, bool skipVTables = false) { - return new VTableLayout((VTableLayout.Internal*) native) { __ownsNativeInstance = ownsNativeInstance }; + return new VTableLayout((VTableLayout.Internal*) native, skipVTables) { __ownsNativeInstance = ownsNativeInstance }; } - public static VTableLayout __CreateInstance(VTableLayout.Internal native) + public static VTableLayout __CreateInstance(VTableLayout.Internal native, bool skipVTables = false) { - return new VTableLayout(native); + return new VTableLayout(native, skipVTables); } private static VTableLayout.Internal* __CopyValue(VTableLayout.Internal native) @@ -2762,15 +2861,17 @@ namespace CppSharp return (VTableLayout.Internal*) ret; } - private VTableLayout(VTableLayout.Internal native) - : this(__CopyValue(native)) + private VTableLayout(VTableLayout.Internal native, bool skipVTables = false) + : this(__CopyValue(native), skipVTables) { __ownsNativeInstance = true; NativeToManagedMap[__Instance] = this; } - protected VTableLayout(VTableLayout.Internal* native, bool isInternalImpl = false) + protected VTableLayout(VTableLayout.Internal* native, bool skipVTables = false) { + if (native == null) + return; __Instance = new global::System.IntPtr(native); } @@ -2778,17 +2879,17 @@ namespace CppSharp { __Instance = Marshal.AllocHGlobal(24); __ownsNativeInstance = true; - Internal.ctor_0(__Instance); NativeToManagedMap[__Instance] = this; + Internal.ctor_0((__Instance + __PointerAdjustment)); } public VTableLayout(CppSharp.Parser.AST.VTableLayout _0) { __Instance = Marshal.AllocHGlobal(24); __ownsNativeInstance = true; - var arg0 = ReferenceEquals(_0, null) ? global::System.IntPtr.Zero : _0.__Instance; - Internal.cctor_1(__Instance, arg0); NativeToManagedMap[__Instance] = this; + var arg0 = ReferenceEquals(_0, null) ? global::System.IntPtr.Zero : _0.__Instance; + Internal.cctor_1((__Instance + __PointerAdjustment), arg0); } public void Dispose() @@ -2802,32 +2903,33 @@ namespace CppSharp throw new global::System.InvalidOperationException("Managed instances owned by native code cannot be disposed of."); CppSharp.Parser.AST.VTableLayout __dummy; NativeToManagedMap.TryRemove(__Instance, out __dummy); - Internal.dtor_0(__Instance); - Marshal.FreeHGlobal(__Instance); + Internal.dtor_0((__Instance + __PointerAdjustment)); + if (__ownsNativeInstance) + Marshal.FreeHGlobal(__Instance); } public CppSharp.Parser.AST.VTableComponent getComponents(uint i) { - var __ret = Internal.getComponents_0(__Instance, i); + var __ret = Internal.getComponents_0((__Instance + __PointerAdjustment), i); return CppSharp.Parser.AST.VTableComponent.__CreateInstance(__ret); } public void addComponents(CppSharp.Parser.AST.VTableComponent s) { var arg0 = ReferenceEquals(s, null) ? global::System.IntPtr.Zero : s.__Instance; - Internal.addComponents_0(__Instance, arg0); + Internal.addComponents_0((__Instance + __PointerAdjustment), arg0); } public void clearComponents() { - Internal.clearComponents_0(__Instance); + Internal.clearComponents_0((__Instance + __PointerAdjustment)); } public uint ComponentsCount { get { - var __ret = Internal.getComponentsCount_0(__Instance); + var __ret = Internal.getComponentsCount_0((__Instance + __PointerAdjustment)); return __ret; } } @@ -2867,19 +2969,21 @@ namespace CppSharp } public global::System.IntPtr __Instance { get; protected set; } + + protected int __PointerAdjustment; public static readonly System.Collections.Concurrent.ConcurrentDictionary NativeToManagedMap = new System.Collections.Concurrent.ConcurrentDictionary(); protected void*[] __OriginalVTables; protected bool __ownsNativeInstance; - public static VFTableInfo __CreateInstance(global::System.IntPtr native, bool ownsNativeInstance = false) + public static VFTableInfo __CreateInstance(global::System.IntPtr native, bool ownsNativeInstance = false, bool skipVTables = false) { - return new VFTableInfo((VFTableInfo.Internal*) native) { __ownsNativeInstance = ownsNativeInstance }; + return new VFTableInfo((VFTableInfo.Internal*) native, skipVTables) { __ownsNativeInstance = ownsNativeInstance }; } - public static VFTableInfo __CreateInstance(VFTableInfo.Internal native) + public static VFTableInfo __CreateInstance(VFTableInfo.Internal native, bool skipVTables = false) { - return new VFTableInfo(native); + return new VFTableInfo(native, skipVTables); } private static VFTableInfo.Internal* __CopyValue(VFTableInfo.Internal native) @@ -2889,15 +2993,17 @@ namespace CppSharp return (VFTableInfo.Internal*) ret; } - private VFTableInfo(VFTableInfo.Internal native) - : this(__CopyValue(native)) + private VFTableInfo(VFTableInfo.Internal native, bool skipVTables = false) + : this(__CopyValue(native), skipVTables) { __ownsNativeInstance = true; NativeToManagedMap[__Instance] = this; } - protected VFTableInfo(VFTableInfo.Internal* native, bool isInternalImpl = false) + protected VFTableInfo(VFTableInfo.Internal* native, bool skipVTables = false) { + if (native == null) + return; __Instance = new global::System.IntPtr(native); } @@ -2905,17 +3011,17 @@ namespace CppSharp { __Instance = Marshal.AllocHGlobal(40); __ownsNativeInstance = true; - Internal.ctor_0(__Instance); NativeToManagedMap[__Instance] = this; + Internal.ctor_0((__Instance + __PointerAdjustment)); } public VFTableInfo(CppSharp.Parser.AST.VFTableInfo _0) { __Instance = Marshal.AllocHGlobal(40); __ownsNativeInstance = true; - var arg0 = ReferenceEquals(_0, null) ? global::System.IntPtr.Zero : _0.__Instance; - Internal.cctor_1(__Instance, arg0); NativeToManagedMap[__Instance] = this; + var arg0 = ReferenceEquals(_0, null) ? global::System.IntPtr.Zero : _0.__Instance; + Internal.cctor_1((__Instance + __PointerAdjustment), arg0); } public void Dispose() @@ -2929,8 +3035,9 @@ namespace CppSharp throw new global::System.InvalidOperationException("Managed instances owned by native code cannot be disposed of."); CppSharp.Parser.AST.VFTableInfo __dummy; NativeToManagedMap.TryRemove(__Instance, out __dummy); - Internal.dtor_0(__Instance); - Marshal.FreeHGlobal(__Instance); + Internal.dtor_0((__Instance + __PointerAdjustment)); + if (__ownsNativeInstance) + Marshal.FreeHGlobal(__Instance); } public ulong VBTableIndex @@ -3049,19 +3156,21 @@ namespace CppSharp } public global::System.IntPtr __Instance { get; protected set; } + + protected int __PointerAdjustment; public static readonly System.Collections.Concurrent.ConcurrentDictionary NativeToManagedMap = new System.Collections.Concurrent.ConcurrentDictionary(); protected void*[] __OriginalVTables; protected bool __ownsNativeInstance; - public static ClassLayout __CreateInstance(global::System.IntPtr native, bool ownsNativeInstance = false) + public static ClassLayout __CreateInstance(global::System.IntPtr native, bool ownsNativeInstance = false, bool skipVTables = false) { - return new ClassLayout((ClassLayout.Internal*) native) { __ownsNativeInstance = ownsNativeInstance }; + return new ClassLayout((ClassLayout.Internal*) native, skipVTables) { __ownsNativeInstance = ownsNativeInstance }; } - public static ClassLayout __CreateInstance(ClassLayout.Internal native) + public static ClassLayout __CreateInstance(ClassLayout.Internal native, bool skipVTables = false) { - return new ClassLayout(native); + return new ClassLayout(native, skipVTables); } private static ClassLayout.Internal* __CopyValue(ClassLayout.Internal native) @@ -3071,15 +3180,17 @@ namespace CppSharp return (ClassLayout.Internal*) ret; } - private ClassLayout(ClassLayout.Internal native) - : this(__CopyValue(native)) + private ClassLayout(ClassLayout.Internal native, bool skipVTables = false) + : this(__CopyValue(native), skipVTables) { __ownsNativeInstance = true; NativeToManagedMap[__Instance] = this; } - protected ClassLayout(ClassLayout.Internal* native, bool isInternalImpl = false) + protected ClassLayout(ClassLayout.Internal* native, bool skipVTables = false) { + if (native == null) + return; __Instance = new global::System.IntPtr(native); } @@ -3087,17 +3198,17 @@ namespace CppSharp { __Instance = Marshal.AllocHGlobal(88); __ownsNativeInstance = true; - Internal.ctor_0(__Instance); NativeToManagedMap[__Instance] = this; + Internal.ctor_0((__Instance + __PointerAdjustment)); } public ClassLayout(CppSharp.Parser.AST.ClassLayout _0) { __Instance = Marshal.AllocHGlobal(88); __ownsNativeInstance = true; - var arg0 = ReferenceEquals(_0, null) ? global::System.IntPtr.Zero : _0.__Instance; - Internal.cctor_2(__Instance, arg0); NativeToManagedMap[__Instance] = this; + var arg0 = ReferenceEquals(_0, null) ? global::System.IntPtr.Zero : _0.__Instance; + Internal.cctor_2((__Instance + __PointerAdjustment), arg0); } public void Dispose() @@ -3111,33 +3222,34 @@ namespace CppSharp throw new global::System.InvalidOperationException("Managed instances owned by native code cannot be disposed of."); CppSharp.Parser.AST.ClassLayout __dummy; NativeToManagedMap.TryRemove(__Instance, out __dummy); - Internal.dtor_0(__Instance); - Marshal.FreeHGlobal(__Instance); + Internal.dtor_0((__Instance + __PointerAdjustment)); + if (__ownsNativeInstance) + Marshal.FreeHGlobal(__Instance); } public CppSharp.Parser.AST.VFTableInfo getVFTables(uint i) { var __ret = new CppSharp.Parser.AST.VFTableInfo.Internal(); - Internal.getVFTables_0(new IntPtr(&__ret), __Instance, i); + Internal.getVFTables_0(new IntPtr(&__ret), (__Instance + __PointerAdjustment), i); return CppSharp.Parser.AST.VFTableInfo.__CreateInstance(__ret); } public void addVFTables(CppSharp.Parser.AST.VFTableInfo s) { var arg0 = ReferenceEquals(s, null) ? global::System.IntPtr.Zero : s.__Instance; - Internal.addVFTables_0(__Instance, arg0); + Internal.addVFTables_0((__Instance + __PointerAdjustment), arg0); } public void clearVFTables() { - Internal.clearVFTables_0(__Instance); + Internal.clearVFTables_0((__Instance + __PointerAdjustment)); } public uint VFTablesCount { get { - var __ret = Internal.getVFTablesCount_0(__Instance); + var __ret = Internal.getVFTablesCount_0((__Instance + __PointerAdjustment)); return __ret; } } @@ -3332,19 +3444,21 @@ namespace CppSharp } public global::System.IntPtr __Instance { get; protected set; } + + protected int __PointerAdjustment; public static readonly System.Collections.Concurrent.ConcurrentDictionary NativeToManagedMap = new System.Collections.Concurrent.ConcurrentDictionary(); protected void*[] __OriginalVTables; protected bool __ownsNativeInstance; - public static Declaration __CreateInstance(global::System.IntPtr native, bool ownsNativeInstance = false) + public static Declaration __CreateInstance(global::System.IntPtr native, bool ownsNativeInstance = false, bool skipVTables = false) { - return new Declaration((Declaration.Internal*) native) { __ownsNativeInstance = ownsNativeInstance }; + return new Declaration((Declaration.Internal*) native, skipVTables) { __ownsNativeInstance = ownsNativeInstance }; } - public static Declaration __CreateInstance(Declaration.Internal native) + public static Declaration __CreateInstance(Declaration.Internal native, bool skipVTables = false) { - return new Declaration(native); + return new Declaration(native, skipVTables); } private static Declaration.Internal* __CopyValue(Declaration.Internal native) @@ -3354,15 +3468,17 @@ namespace CppSharp return (Declaration.Internal*) ret; } - private Declaration(Declaration.Internal native) - : this(__CopyValue(native)) + private Declaration(Declaration.Internal native, bool skipVTables = false) + : this(__CopyValue(native), skipVTables) { __ownsNativeInstance = true; NativeToManagedMap[__Instance] = this; } - protected Declaration(Declaration.Internal* native, bool isInternalImpl = false) + protected Declaration(Declaration.Internal* native, bool skipVTables = false) { + if (native == null) + return; __Instance = new global::System.IntPtr(native); } @@ -3370,18 +3486,18 @@ namespace CppSharp { __Instance = Marshal.AllocHGlobal(120); __ownsNativeInstance = true; - var arg0 = kind; - Internal.ctor_0(__Instance, arg0); NativeToManagedMap[__Instance] = this; + var arg0 = kind; + Internal.ctor_0((__Instance + __PointerAdjustment), arg0); } public Declaration(CppSharp.Parser.AST.Declaration _0) { __Instance = Marshal.AllocHGlobal(120); __ownsNativeInstance = true; - var arg0 = ReferenceEquals(_0, null) ? global::System.IntPtr.Zero : _0.__Instance; - Internal.cctor_1(__Instance, arg0); NativeToManagedMap[__Instance] = this; + var arg0 = ReferenceEquals(_0, null) ? global::System.IntPtr.Zero : _0.__Instance; + Internal.cctor_1((__Instance + __PointerAdjustment), arg0); } public void Dispose() @@ -3395,13 +3511,14 @@ namespace CppSharp throw new global::System.InvalidOperationException("Managed instances owned by native code cannot be disposed of."); CppSharp.Parser.AST.Declaration __dummy; NativeToManagedMap.TryRemove(__Instance, out __dummy); - Internal.dtor_0(__Instance); - Marshal.FreeHGlobal(__Instance); + Internal.dtor_0((__Instance + __PointerAdjustment)); + if (__ownsNativeInstance) + Marshal.FreeHGlobal(__Instance); } public CppSharp.Parser.AST.PreprocessedEntity getPreprocessedEntities(uint i) { - var __ret = Internal.getPreprocessedEntities_0(__Instance, i); + var __ret = Internal.getPreprocessedEntities_0((__Instance + __PointerAdjustment), i); CppSharp.Parser.AST.PreprocessedEntity __result0; if (__ret == IntPtr.Zero) __result0 = null; else if (CppSharp.Parser.AST.PreprocessedEntity.NativeToManagedMap.ContainsKey(__ret)) @@ -3413,26 +3530,26 @@ namespace CppSharp public void addPreprocessedEntities(CppSharp.Parser.AST.PreprocessedEntity s) { var arg0 = ReferenceEquals(s, null) ? global::System.IntPtr.Zero : s.__Instance; - Internal.addPreprocessedEntities_0(__Instance, arg0); + Internal.addPreprocessedEntities_0((__Instance + __PointerAdjustment), arg0); } public void clearPreprocessedEntities() { - Internal.clearPreprocessedEntities_0(__Instance); + Internal.clearPreprocessedEntities_0((__Instance + __PointerAdjustment)); } public string Name { get { - var __ret = Internal.getName_0(__Instance); + var __ret = Internal.getName_0((__Instance + __PointerAdjustment)); return Marshal.PtrToStringAnsi(__ret); } set { var arg0 = Marshal.StringToHGlobalAnsi(value); - Internal.setName_0(__Instance, arg0); + Internal.setName_0((__Instance + __PointerAdjustment), arg0); Marshal.FreeHGlobal(arg0); } } @@ -3441,14 +3558,14 @@ namespace CppSharp { get { - var __ret = Internal.getDebugText_0(__Instance); + var __ret = Internal.getDebugText_0((__Instance + __PointerAdjustment)); return Marshal.PtrToStringAnsi(__ret); } set { var arg0 = Marshal.StringToHGlobalAnsi(value); - Internal.setDebugText_0(__Instance, arg0); + Internal.setDebugText_0((__Instance + __PointerAdjustment), arg0); Marshal.FreeHGlobal(arg0); } } @@ -3457,7 +3574,7 @@ namespace CppSharp { get { - var __ret = Internal.getPreprocessedEntitiesCount_0(__Instance); + var __ret = Internal.getPreprocessedEntitiesCount_0((__Instance + __PointerAdjustment)); return __ret; } } @@ -3854,14 +3971,14 @@ namespace CppSharp internal static extern uint getFriendsCount_0(global::System.IntPtr instance); } - public static new DeclarationContext __CreateInstance(global::System.IntPtr native, bool ownsNativeInstance = false) + public static new DeclarationContext __CreateInstance(global::System.IntPtr native, bool ownsNativeInstance = false, bool skipVTables = false) { - return new DeclarationContext((DeclarationContext.Internal*) native) { __ownsNativeInstance = ownsNativeInstance }; + return new DeclarationContext((DeclarationContext.Internal*) native, skipVTables) { __ownsNativeInstance = ownsNativeInstance }; } - public static DeclarationContext __CreateInstance(DeclarationContext.Internal native) + public static DeclarationContext __CreateInstance(DeclarationContext.Internal native, bool skipVTables = false) { - return new DeclarationContext(native); + return new DeclarationContext(native, skipVTables); } private static DeclarationContext.Internal* __CopyValue(DeclarationContext.Internal native) @@ -3871,16 +3988,20 @@ namespace CppSharp return (DeclarationContext.Internal*) ret; } - private DeclarationContext(DeclarationContext.Internal native) - : this(__CopyValue(native)) + private DeclarationContext(DeclarationContext.Internal native, bool skipVTables = false) + : this(__CopyValue(native), skipVTables) { __ownsNativeInstance = true; NativeToManagedMap[__Instance] = this; } - protected DeclarationContext(DeclarationContext.Internal* native, bool isInternalImpl = false) - : base((CppSharp.Parser.AST.Declaration.Internal*) native) + protected DeclarationContext(DeclarationContext.Internal* native, bool skipVTables = false) + : base((CppSharp.Parser.AST.Declaration.Internal*) null) { + __PointerAdjustment = 0; + if (native == null) + return; + __Instance = new global::System.IntPtr(native); } public DeclarationContext(CppSharp.Parser.AST.DeclarationKind kind) @@ -3888,9 +4009,9 @@ namespace CppSharp { __Instance = Marshal.AllocHGlobal(368); __ownsNativeInstance = true; - var arg0 = kind; - Internal.ctor_0(__Instance, arg0); NativeToManagedMap[__Instance] = this; + var arg0 = kind; + Internal.ctor_0((__Instance + __PointerAdjustment), arg0); } public DeclarationContext(CppSharp.Parser.AST.DeclarationContext _0) @@ -3898,14 +4019,14 @@ namespace CppSharp { __Instance = Marshal.AllocHGlobal(368); __ownsNativeInstance = true; - var arg0 = ReferenceEquals(_0, null) ? global::System.IntPtr.Zero : _0.__Instance; - Internal.cctor_1(__Instance, arg0); NativeToManagedMap[__Instance] = this; + var arg0 = ReferenceEquals(_0, null) ? global::System.IntPtr.Zero : _0.__Instance; + Internal.cctor_1((__Instance + __PointerAdjustment), arg0); } public CppSharp.Parser.AST.Namespace getNamespaces(uint i) { - var __ret = Internal.getNamespaces_0(__Instance, i); + var __ret = Internal.getNamespaces_0((__Instance + __PointerAdjustment), i); CppSharp.Parser.AST.Namespace __result0; if (__ret == IntPtr.Zero) __result0 = null; else if (CppSharp.Parser.AST.Namespace.NativeToManagedMap.ContainsKey(__ret)) @@ -3917,17 +4038,17 @@ namespace CppSharp public void addNamespaces(CppSharp.Parser.AST.Namespace s) { var arg0 = ReferenceEquals(s, null) ? global::System.IntPtr.Zero : s.__Instance; - Internal.addNamespaces_0(__Instance, arg0); + Internal.addNamespaces_0((__Instance + __PointerAdjustment), arg0); } public void clearNamespaces() { - Internal.clearNamespaces_0(__Instance); + Internal.clearNamespaces_0((__Instance + __PointerAdjustment)); } public CppSharp.Parser.AST.Enumeration getEnums(uint i) { - var __ret = Internal.getEnums_0(__Instance, i); + var __ret = Internal.getEnums_0((__Instance + __PointerAdjustment), i); CppSharp.Parser.AST.Enumeration __result0; if (__ret == IntPtr.Zero) __result0 = null; else if (CppSharp.Parser.AST.Enumeration.NativeToManagedMap.ContainsKey(__ret)) @@ -3939,17 +4060,17 @@ namespace CppSharp public void addEnums(CppSharp.Parser.AST.Enumeration s) { var arg0 = ReferenceEquals(s, null) ? global::System.IntPtr.Zero : s.__Instance; - Internal.addEnums_0(__Instance, arg0); + Internal.addEnums_0((__Instance + __PointerAdjustment), arg0); } public void clearEnums() { - Internal.clearEnums_0(__Instance); + Internal.clearEnums_0((__Instance + __PointerAdjustment)); } public CppSharp.Parser.AST.Function getFunctions(uint i) { - var __ret = Internal.getFunctions_0(__Instance, i); + var __ret = Internal.getFunctions_0((__Instance + __PointerAdjustment), i); CppSharp.Parser.AST.Function __result0; if (__ret == IntPtr.Zero) __result0 = null; else if (CppSharp.Parser.AST.Function.NativeToManagedMap.ContainsKey(__ret)) @@ -3961,17 +4082,17 @@ namespace CppSharp public void addFunctions(CppSharp.Parser.AST.Function s) { var arg0 = ReferenceEquals(s, null) ? global::System.IntPtr.Zero : s.__Instance; - Internal.addFunctions_0(__Instance, arg0); + Internal.addFunctions_0((__Instance + __PointerAdjustment), arg0); } public void clearFunctions() { - Internal.clearFunctions_0(__Instance); + Internal.clearFunctions_0((__Instance + __PointerAdjustment)); } public CppSharp.Parser.AST.Class getClasses(uint i) { - var __ret = Internal.getClasses_0(__Instance, i); + var __ret = Internal.getClasses_0((__Instance + __PointerAdjustment), i); CppSharp.Parser.AST.Class __result0; if (__ret == IntPtr.Zero) __result0 = null; else if (CppSharp.Parser.AST.Class.NativeToManagedMap.ContainsKey(__ret)) @@ -3983,17 +4104,17 @@ namespace CppSharp public void addClasses(CppSharp.Parser.AST.Class s) { var arg0 = ReferenceEquals(s, null) ? global::System.IntPtr.Zero : s.__Instance; - Internal.addClasses_0(__Instance, arg0); + Internal.addClasses_0((__Instance + __PointerAdjustment), arg0); } public void clearClasses() { - Internal.clearClasses_0(__Instance); + Internal.clearClasses_0((__Instance + __PointerAdjustment)); } public CppSharp.Parser.AST.Template getTemplates(uint i) { - var __ret = Internal.getTemplates_0(__Instance, i); + var __ret = Internal.getTemplates_0((__Instance + __PointerAdjustment), i); CppSharp.Parser.AST.Template __result0; if (__ret == IntPtr.Zero) __result0 = null; else if (CppSharp.Parser.AST.Template.NativeToManagedMap.ContainsKey(__ret)) @@ -4005,17 +4126,17 @@ namespace CppSharp public void addTemplates(CppSharp.Parser.AST.Template s) { var arg0 = ReferenceEquals(s, null) ? global::System.IntPtr.Zero : s.__Instance; - Internal.addTemplates_0(__Instance, arg0); + Internal.addTemplates_0((__Instance + __PointerAdjustment), arg0); } public void clearTemplates() { - Internal.clearTemplates_0(__Instance); + Internal.clearTemplates_0((__Instance + __PointerAdjustment)); } public CppSharp.Parser.AST.TypedefDecl getTypedefs(uint i) { - var __ret = Internal.getTypedefs_0(__Instance, i); + var __ret = Internal.getTypedefs_0((__Instance + __PointerAdjustment), i); CppSharp.Parser.AST.TypedefDecl __result0; if (__ret == IntPtr.Zero) __result0 = null; else if (CppSharp.Parser.AST.TypedefDecl.NativeToManagedMap.ContainsKey(__ret)) @@ -4027,17 +4148,17 @@ namespace CppSharp public void addTypedefs(CppSharp.Parser.AST.TypedefDecl s) { var arg0 = ReferenceEquals(s, null) ? global::System.IntPtr.Zero : s.__Instance; - Internal.addTypedefs_0(__Instance, arg0); + Internal.addTypedefs_0((__Instance + __PointerAdjustment), arg0); } public void clearTypedefs() { - Internal.clearTypedefs_0(__Instance); + Internal.clearTypedefs_0((__Instance + __PointerAdjustment)); } public CppSharp.Parser.AST.Variable getVariables(uint i) { - var __ret = Internal.getVariables_0(__Instance, i); + var __ret = Internal.getVariables_0((__Instance + __PointerAdjustment), i); CppSharp.Parser.AST.Variable __result0; if (__ret == IntPtr.Zero) __result0 = null; else if (CppSharp.Parser.AST.Variable.NativeToManagedMap.ContainsKey(__ret)) @@ -4049,17 +4170,17 @@ namespace CppSharp public void addVariables(CppSharp.Parser.AST.Variable s) { var arg0 = ReferenceEquals(s, null) ? global::System.IntPtr.Zero : s.__Instance; - Internal.addVariables_0(__Instance, arg0); + Internal.addVariables_0((__Instance + __PointerAdjustment), arg0); } public void clearVariables() { - Internal.clearVariables_0(__Instance); + Internal.clearVariables_0((__Instance + __PointerAdjustment)); } public CppSharp.Parser.AST.Friend getFriends(uint i) { - var __ret = Internal.getFriends_0(__Instance, i); + var __ret = Internal.getFriends_0((__Instance + __PointerAdjustment), i); CppSharp.Parser.AST.Friend __result0; if (__ret == IntPtr.Zero) __result0 = null; else if (CppSharp.Parser.AST.Friend.NativeToManagedMap.ContainsKey(__ret)) @@ -4071,19 +4192,19 @@ namespace CppSharp public void addFriends(CppSharp.Parser.AST.Friend s) { var arg0 = ReferenceEquals(s, null) ? global::System.IntPtr.Zero : s.__Instance; - Internal.addFriends_0(__Instance, arg0); + Internal.addFriends_0((__Instance + __PointerAdjustment), arg0); } public void clearFriends() { - Internal.clearFriends_0(__Instance); + Internal.clearFriends_0((__Instance + __PointerAdjustment)); } public uint NamespacesCount { get { - var __ret = Internal.getNamespacesCount_0(__Instance); + var __ret = Internal.getNamespacesCount_0((__Instance + __PointerAdjustment)); return __ret; } } @@ -4092,7 +4213,7 @@ namespace CppSharp { get { - var __ret = Internal.getEnumsCount_0(__Instance); + var __ret = Internal.getEnumsCount_0((__Instance + __PointerAdjustment)); return __ret; } } @@ -4101,7 +4222,7 @@ namespace CppSharp { get { - var __ret = Internal.getFunctionsCount_0(__Instance); + var __ret = Internal.getFunctionsCount_0((__Instance + __PointerAdjustment)); return __ret; } } @@ -4110,7 +4231,7 @@ namespace CppSharp { get { - var __ret = Internal.getClassesCount_0(__Instance); + var __ret = Internal.getClassesCount_0((__Instance + __PointerAdjustment)); return __ret; } } @@ -4119,7 +4240,7 @@ namespace CppSharp { get { - var __ret = Internal.getTemplatesCount_0(__Instance); + var __ret = Internal.getTemplatesCount_0((__Instance + __PointerAdjustment)); return __ret; } } @@ -4128,7 +4249,7 @@ namespace CppSharp { get { - var __ret = Internal.getTypedefsCount_0(__Instance); + var __ret = Internal.getTypedefsCount_0((__Instance + __PointerAdjustment)); return __ret; } } @@ -4137,7 +4258,7 @@ namespace CppSharp { get { - var __ret = Internal.getVariablesCount_0(__Instance); + var __ret = Internal.getVariablesCount_0((__Instance + __PointerAdjustment)); return __ret; } } @@ -4146,7 +4267,7 @@ namespace CppSharp { get { - var __ret = Internal.getFriendsCount_0(__Instance); + var __ret = Internal.getFriendsCount_0((__Instance + __PointerAdjustment)); return __ret; } } @@ -4225,14 +4346,14 @@ namespace CppSharp internal static extern void dtor_0(global::System.IntPtr instance); } - public static new TypedefDecl __CreateInstance(global::System.IntPtr native, bool ownsNativeInstance = false) + public static new TypedefDecl __CreateInstance(global::System.IntPtr native, bool ownsNativeInstance = false, bool skipVTables = false) { - return new TypedefDecl((TypedefDecl.Internal*) native) { __ownsNativeInstance = ownsNativeInstance }; + return new TypedefDecl((TypedefDecl.Internal*) native, skipVTables) { __ownsNativeInstance = ownsNativeInstance }; } - public static TypedefDecl __CreateInstance(TypedefDecl.Internal native) + public static TypedefDecl __CreateInstance(TypedefDecl.Internal native, bool skipVTables = false) { - return new TypedefDecl(native); + return new TypedefDecl(native, skipVTables); } private static TypedefDecl.Internal* __CopyValue(TypedefDecl.Internal native) @@ -4242,16 +4363,20 @@ namespace CppSharp return (TypedefDecl.Internal*) ret; } - private TypedefDecl(TypedefDecl.Internal native) - : this(__CopyValue(native)) + private TypedefDecl(TypedefDecl.Internal native, bool skipVTables = false) + : this(__CopyValue(native), skipVTables) { __ownsNativeInstance = true; NativeToManagedMap[__Instance] = this; } - protected TypedefDecl(TypedefDecl.Internal* native, bool isInternalImpl = false) - : base((CppSharp.Parser.AST.Declaration.Internal*) native) + protected TypedefDecl(TypedefDecl.Internal* native, bool skipVTables = false) + : base((CppSharp.Parser.AST.Declaration.Internal*) null) { + __PointerAdjustment = 0; + if (native == null) + return; + __Instance = new global::System.IntPtr(native); } public TypedefDecl() @@ -4259,8 +4384,8 @@ namespace CppSharp { __Instance = Marshal.AllocHGlobal(136); __ownsNativeInstance = true; - Internal.ctor_0(__Instance); NativeToManagedMap[__Instance] = this; + Internal.ctor_0((__Instance + __PointerAdjustment)); } public TypedefDecl(CppSharp.Parser.AST.TypedefDecl _0) @@ -4268,9 +4393,9 @@ namespace CppSharp { __Instance = Marshal.AllocHGlobal(136); __ownsNativeInstance = true; - var arg0 = ReferenceEquals(_0, null) ? global::System.IntPtr.Zero : _0.__Instance; - Internal.cctor_1(__Instance, arg0); NativeToManagedMap[__Instance] = this; + var arg0 = ReferenceEquals(_0, null) ? global::System.IntPtr.Zero : _0.__Instance; + Internal.cctor_1((__Instance + __PointerAdjustment), arg0); } public CppSharp.Parser.AST.QualifiedType QualifiedType @@ -4347,14 +4472,14 @@ namespace CppSharp internal static extern void dtor_0(global::System.IntPtr instance); } - public static new Friend __CreateInstance(global::System.IntPtr native, bool ownsNativeInstance = false) + public static new Friend __CreateInstance(global::System.IntPtr native, bool ownsNativeInstance = false, bool skipVTables = false) { - return new Friend((Friend.Internal*) native) { __ownsNativeInstance = ownsNativeInstance }; + return new Friend((Friend.Internal*) native, skipVTables) { __ownsNativeInstance = ownsNativeInstance }; } - public static Friend __CreateInstance(Friend.Internal native) + public static Friend __CreateInstance(Friend.Internal native, bool skipVTables = false) { - return new Friend(native); + return new Friend(native, skipVTables); } private static Friend.Internal* __CopyValue(Friend.Internal native) @@ -4364,16 +4489,20 @@ namespace CppSharp return (Friend.Internal*) ret; } - private Friend(Friend.Internal native) - : this(__CopyValue(native)) + private Friend(Friend.Internal native, bool skipVTables = false) + : this(__CopyValue(native), skipVTables) { __ownsNativeInstance = true; NativeToManagedMap[__Instance] = this; } - protected Friend(Friend.Internal* native, bool isInternalImpl = false) - : base((CppSharp.Parser.AST.Declaration.Internal*) native) + protected Friend(Friend.Internal* native, bool skipVTables = false) + : base((CppSharp.Parser.AST.Declaration.Internal*) null) { + __PointerAdjustment = 0; + if (native == null) + return; + __Instance = new global::System.IntPtr(native); } public Friend() @@ -4381,8 +4510,8 @@ namespace CppSharp { __Instance = Marshal.AllocHGlobal(128); __ownsNativeInstance = true; - Internal.ctor_0(__Instance); NativeToManagedMap[__Instance] = this; + Internal.ctor_0((__Instance + __PointerAdjustment)); } public Friend(CppSharp.Parser.AST.Friend _0) @@ -4390,9 +4519,9 @@ namespace CppSharp { __Instance = Marshal.AllocHGlobal(128); __ownsNativeInstance = true; - var arg0 = ReferenceEquals(_0, null) ? global::System.IntPtr.Zero : _0.__Instance; - Internal.cctor_1(__Instance, arg0); NativeToManagedMap[__Instance] = this; + var arg0 = ReferenceEquals(_0, null) ? global::System.IntPtr.Zero : _0.__Instance; + Internal.cctor_1((__Instance + __PointerAdjustment), arg0); } public CppSharp.Parser.AST.Declaration Declaration @@ -4447,19 +4576,21 @@ namespace CppSharp } public global::System.IntPtr __Instance { get; protected set; } + + protected int __PointerAdjustment; public static readonly System.Collections.Concurrent.ConcurrentDictionary NativeToManagedMap = new System.Collections.Concurrent.ConcurrentDictionary(); protected void*[] __OriginalVTables; protected bool __ownsNativeInstance; - public static Statement __CreateInstance(global::System.IntPtr native, bool ownsNativeInstance = false) + public static Statement __CreateInstance(global::System.IntPtr native, bool ownsNativeInstance = false, bool skipVTables = false) { - return new Statement((Statement.Internal*) native) { __ownsNativeInstance = ownsNativeInstance }; + return new Statement((Statement.Internal*) native, skipVTables) { __ownsNativeInstance = ownsNativeInstance }; } - public static Statement __CreateInstance(Statement.Internal native) + public static Statement __CreateInstance(Statement.Internal native, bool skipVTables = false) { - return new Statement(native); + return new Statement(native, skipVTables); } private static Statement.Internal* __CopyValue(Statement.Internal native) @@ -4469,15 +4600,17 @@ namespace CppSharp return (Statement.Internal*) ret; } - private Statement(Statement.Internal native) - : this(__CopyValue(native)) + private Statement(Statement.Internal native, bool skipVTables = false) + : this(__CopyValue(native), skipVTables) { __ownsNativeInstance = true; NativeToManagedMap[__Instance] = this; } - protected Statement(Statement.Internal* native, bool isInternalImpl = false) + protected Statement(Statement.Internal* native, bool skipVTables = false) { + if (native == null) + return; __Instance = new global::System.IntPtr(native); } @@ -4485,9 +4618,9 @@ namespace CppSharp { __Instance = Marshal.AllocHGlobal(24); __ownsNativeInstance = true; - var arg0 = ReferenceEquals(_0, null) ? global::System.IntPtr.Zero : _0.__Instance; - Internal.cctor_1(__Instance, arg0); NativeToManagedMap[__Instance] = this; + var arg0 = ReferenceEquals(_0, null) ? global::System.IntPtr.Zero : _0.__Instance; + Internal.cctor_1((__Instance + __PointerAdjustment), arg0); } public void Dispose() @@ -4501,22 +4634,23 @@ namespace CppSharp throw new global::System.InvalidOperationException("Managed instances owned by native code cannot be disposed of."); CppSharp.Parser.AST.Statement __dummy; NativeToManagedMap.TryRemove(__Instance, out __dummy); - Internal.dtor_0(__Instance); - Marshal.FreeHGlobal(__Instance); + Internal.dtor_0((__Instance + __PointerAdjustment)); + if (__ownsNativeInstance) + Marshal.FreeHGlobal(__Instance); } public string String { get { - var __ret = Internal.getString_0(__Instance); + var __ret = Internal.getString_0((__Instance + __PointerAdjustment)); return Marshal.PtrToStringAnsi(__ret); } set { var arg0 = Marshal.StringToHGlobalAnsi(value); - Internal.setString_0(__Instance, arg0); + Internal.setString_0((__Instance + __PointerAdjustment), arg0); Marshal.FreeHGlobal(arg0); } } @@ -4575,14 +4709,14 @@ namespace CppSharp internal static extern void dtor_0(global::System.IntPtr instance); } - public static new Expression __CreateInstance(global::System.IntPtr native, bool ownsNativeInstance = false) + public static new Expression __CreateInstance(global::System.IntPtr native, bool ownsNativeInstance = false, bool skipVTables = false) { - return new Expression((Expression.Internal*) native) { __ownsNativeInstance = ownsNativeInstance }; + return new Expression((Expression.Internal*) native, skipVTables) { __ownsNativeInstance = ownsNativeInstance }; } - public static Expression __CreateInstance(Expression.Internal native) + public static Expression __CreateInstance(Expression.Internal native, bool skipVTables = false) { - return new Expression(native); + return new Expression(native, skipVTables); } private static Expression.Internal* __CopyValue(Expression.Internal native) @@ -4592,16 +4726,20 @@ namespace CppSharp return (Expression.Internal*) ret; } - private Expression(Expression.Internal native) - : this(__CopyValue(native)) + private Expression(Expression.Internal native, bool skipVTables = false) + : this(__CopyValue(native), skipVTables) { __ownsNativeInstance = true; NativeToManagedMap[__Instance] = this; } - protected Expression(Expression.Internal* native, bool isInternalImpl = false) - : base((CppSharp.Parser.AST.Statement.Internal*) native) + protected Expression(Expression.Internal* native, bool skipVTables = false) + : base((CppSharp.Parser.AST.Statement.Internal*) null) { + __PointerAdjustment = 0; + if (native == null) + return; + __Instance = new global::System.IntPtr(native); } public Expression(CppSharp.Parser.AST.Expression _0) @@ -4609,9 +4747,9 @@ namespace CppSharp { __Instance = Marshal.AllocHGlobal(24); __ownsNativeInstance = true; - var arg0 = ReferenceEquals(_0, null) ? global::System.IntPtr.Zero : _0.__Instance; - Internal.cctor_1(__Instance, arg0); NativeToManagedMap[__Instance] = this; + var arg0 = ReferenceEquals(_0, null) ? global::System.IntPtr.Zero : _0.__Instance; + Internal.cctor_1((__Instance + __PointerAdjustment), arg0); } } @@ -4653,14 +4791,14 @@ namespace CppSharp internal static extern void setOpcodeStr_0(global::System.IntPtr instance, global::System.IntPtr s); } - public static new BinaryOperator __CreateInstance(global::System.IntPtr native, bool ownsNativeInstance = false) + public static new BinaryOperator __CreateInstance(global::System.IntPtr native, bool ownsNativeInstance = false, bool skipVTables = false) { - return new BinaryOperator((BinaryOperator.Internal*) native) { __ownsNativeInstance = ownsNativeInstance }; + return new BinaryOperator((BinaryOperator.Internal*) native, skipVTables) { __ownsNativeInstance = ownsNativeInstance }; } - public static BinaryOperator __CreateInstance(BinaryOperator.Internal native) + public static BinaryOperator __CreateInstance(BinaryOperator.Internal native, bool skipVTables = false) { - return new BinaryOperator(native); + return new BinaryOperator(native, skipVTables); } private static BinaryOperator.Internal* __CopyValue(BinaryOperator.Internal native) @@ -4670,16 +4808,20 @@ namespace CppSharp return (BinaryOperator.Internal*) ret; } - private BinaryOperator(BinaryOperator.Internal native) - : this(__CopyValue(native)) + private BinaryOperator(BinaryOperator.Internal native, bool skipVTables = false) + : this(__CopyValue(native), skipVTables) { __ownsNativeInstance = true; NativeToManagedMap[__Instance] = this; } - protected BinaryOperator(BinaryOperator.Internal* native, bool isInternalImpl = false) - : base((CppSharp.Parser.AST.Expression.Internal*) native) + protected BinaryOperator(BinaryOperator.Internal* native, bool skipVTables = false) + : base((CppSharp.Parser.AST.Expression.Internal*) null) { + __PointerAdjustment = 0; + if (native == null) + return; + __Instance = new global::System.IntPtr(native); } public BinaryOperator(CppSharp.Parser.AST.BinaryOperator _0) @@ -4687,23 +4829,23 @@ namespace CppSharp { __Instance = Marshal.AllocHGlobal(48); __ownsNativeInstance = true; - var arg0 = ReferenceEquals(_0, null) ? global::System.IntPtr.Zero : _0.__Instance; - Internal.cctor_1(__Instance, arg0); NativeToManagedMap[__Instance] = this; + var arg0 = ReferenceEquals(_0, null) ? global::System.IntPtr.Zero : _0.__Instance; + Internal.cctor_1((__Instance + __PointerAdjustment), arg0); } public string OpcodeStr { get { - var __ret = Internal.getOpcodeStr_0(__Instance); + var __ret = Internal.getOpcodeStr_0((__Instance + __PointerAdjustment)); return Marshal.PtrToStringAnsi(__ret); } set { var arg0 = Marshal.StringToHGlobalAnsi(value); - Internal.setOpcodeStr_0(__Instance, arg0); + Internal.setOpcodeStr_0((__Instance + __PointerAdjustment), arg0); Marshal.FreeHGlobal(arg0); } } @@ -4787,14 +4929,14 @@ namespace CppSharp internal static extern uint getArgumentsCount_0(global::System.IntPtr instance); } - public static new CXXConstructExpr __CreateInstance(global::System.IntPtr native, bool ownsNativeInstance = false) + public static new CXXConstructExpr __CreateInstance(global::System.IntPtr native, bool ownsNativeInstance = false, bool skipVTables = false) { - return new CXXConstructExpr((CXXConstructExpr.Internal*) native) { __ownsNativeInstance = ownsNativeInstance }; + return new CXXConstructExpr((CXXConstructExpr.Internal*) native, skipVTables) { __ownsNativeInstance = ownsNativeInstance }; } - public static CXXConstructExpr __CreateInstance(CXXConstructExpr.Internal native) + public static CXXConstructExpr __CreateInstance(CXXConstructExpr.Internal native, bool skipVTables = false) { - return new CXXConstructExpr(native); + return new CXXConstructExpr(native, skipVTables); } private static CXXConstructExpr.Internal* __CopyValue(CXXConstructExpr.Internal native) @@ -4804,16 +4946,20 @@ namespace CppSharp return (CXXConstructExpr.Internal*) ret; } - private CXXConstructExpr(CXXConstructExpr.Internal native) - : this(__CopyValue(native)) + private CXXConstructExpr(CXXConstructExpr.Internal native, bool skipVTables = false) + : this(__CopyValue(native), skipVTables) { __ownsNativeInstance = true; NativeToManagedMap[__Instance] = this; } - protected CXXConstructExpr(CXXConstructExpr.Internal* native, bool isInternalImpl = false) - : base((CppSharp.Parser.AST.Expression.Internal*) native) + protected CXXConstructExpr(CXXConstructExpr.Internal* native, bool skipVTables = false) + : base((CppSharp.Parser.AST.Expression.Internal*) null) { + __PointerAdjustment = 0; + if (native == null) + return; + __Instance = new global::System.IntPtr(native); } public CXXConstructExpr(CppSharp.Parser.AST.CXXConstructExpr _0) @@ -4821,14 +4967,14 @@ namespace CppSharp { __Instance = Marshal.AllocHGlobal(48); __ownsNativeInstance = true; - var arg0 = ReferenceEquals(_0, null) ? global::System.IntPtr.Zero : _0.__Instance; - Internal.cctor_1(__Instance, arg0); NativeToManagedMap[__Instance] = this; + var arg0 = ReferenceEquals(_0, null) ? global::System.IntPtr.Zero : _0.__Instance; + Internal.cctor_1((__Instance + __PointerAdjustment), arg0); } public CppSharp.Parser.AST.Expression getArguments(uint i) { - var __ret = Internal.getArguments_0(__Instance, i); + var __ret = Internal.getArguments_0((__Instance + __PointerAdjustment), i); CppSharp.Parser.AST.Expression __result0; if (__ret == IntPtr.Zero) __result0 = null; else if (CppSharp.Parser.AST.Expression.NativeToManagedMap.ContainsKey(__ret)) @@ -4840,19 +4986,19 @@ namespace CppSharp public void addArguments(CppSharp.Parser.AST.Expression s) { var arg0 = ReferenceEquals(s, null) ? global::System.IntPtr.Zero : s.__Instance; - Internal.addArguments_0(__Instance, arg0); + Internal.addArguments_0((__Instance + __PointerAdjustment), arg0); } public void clearArguments() { - Internal.clearArguments_0(__Instance); + Internal.clearArguments_0((__Instance + __PointerAdjustment)); } public uint ArgumentsCount { get { - var __ret = Internal.getArgumentsCount_0(__Instance); + var __ret = Internal.getArgumentsCount_0((__Instance + __PointerAdjustment)); return __ret; } } @@ -4930,14 +5076,14 @@ namespace CppSharp internal static extern void dtor_0(global::System.IntPtr instance); } - public static new Parameter __CreateInstance(global::System.IntPtr native, bool ownsNativeInstance = false) + public static new Parameter __CreateInstance(global::System.IntPtr native, bool ownsNativeInstance = false, bool skipVTables = false) { - return new Parameter((Parameter.Internal*) native) { __ownsNativeInstance = ownsNativeInstance }; + return new Parameter((Parameter.Internal*) native, skipVTables) { __ownsNativeInstance = ownsNativeInstance }; } - public static Parameter __CreateInstance(Parameter.Internal native) + public static Parameter __CreateInstance(Parameter.Internal native, bool skipVTables = false) { - return new Parameter(native); + return new Parameter(native, skipVTables); } private static Parameter.Internal* __CopyValue(Parameter.Internal native) @@ -4947,16 +5093,20 @@ namespace CppSharp return (Parameter.Internal*) ret; } - private Parameter(Parameter.Internal native) - : this(__CopyValue(native)) + private Parameter(Parameter.Internal native, bool skipVTables = false) + : this(__CopyValue(native), skipVTables) { __ownsNativeInstance = true; NativeToManagedMap[__Instance] = this; } - protected Parameter(Parameter.Internal* native, bool isInternalImpl = false) - : base((CppSharp.Parser.AST.Declaration.Internal*) native) + protected Parameter(Parameter.Internal* native, bool skipVTables = false) + : base((CppSharp.Parser.AST.Declaration.Internal*) null) { + __PointerAdjustment = 0; + if (native == null) + return; + __Instance = new global::System.IntPtr(native); } public Parameter() @@ -4964,8 +5114,8 @@ namespace CppSharp { __Instance = Marshal.AllocHGlobal(152); __ownsNativeInstance = true; - Internal.ctor_0(__Instance); NativeToManagedMap[__Instance] = this; + Internal.ctor_0((__Instance + __PointerAdjustment)); } public Parameter(CppSharp.Parser.AST.Parameter _0) @@ -4973,9 +5123,9 @@ namespace CppSharp { __Instance = Marshal.AllocHGlobal(152); __ownsNativeInstance = true; - var arg0 = ReferenceEquals(_0, null) ? global::System.IntPtr.Zero : _0.__Instance; - Internal.cctor_1(__Instance, arg0); NativeToManagedMap[__Instance] = this; + var arg0 = ReferenceEquals(_0, null) ? global::System.IntPtr.Zero : _0.__Instance; + Internal.cctor_1((__Instance + __PointerAdjustment), arg0); } public CppSharp.Parser.AST.QualifiedType QualifiedType @@ -5176,14 +5326,14 @@ namespace CppSharp internal static extern uint getParametersCount_0(global::System.IntPtr instance); } - public static new Function __CreateInstance(global::System.IntPtr native, bool ownsNativeInstance = false) + public static new Function __CreateInstance(global::System.IntPtr native, bool ownsNativeInstance = false, bool skipVTables = false) { - return new Function((Function.Internal*) native) { __ownsNativeInstance = ownsNativeInstance }; + return new Function((Function.Internal*) native, skipVTables) { __ownsNativeInstance = ownsNativeInstance }; } - public static Function __CreateInstance(Function.Internal native) + public static Function __CreateInstance(Function.Internal native, bool skipVTables = false) { - return new Function(native); + return new Function(native, skipVTables); } private static Function.Internal* __CopyValue(Function.Internal native) @@ -5193,16 +5343,20 @@ namespace CppSharp return (Function.Internal*) ret; } - private Function(Function.Internal native) - : this(__CopyValue(native)) + private Function(Function.Internal native, bool skipVTables = false) + : this(__CopyValue(native), skipVTables) { __ownsNativeInstance = true; NativeToManagedMap[__Instance] = this; } - protected Function(Function.Internal* native, bool isInternalImpl = false) - : base((CppSharp.Parser.AST.Declaration.Internal*) native) + protected Function(Function.Internal* native, bool skipVTables = false) + : base((CppSharp.Parser.AST.Declaration.Internal*) null) { + __PointerAdjustment = 0; + if (native == null) + return; + __Instance = new global::System.IntPtr(native); } public Function() @@ -5210,8 +5364,8 @@ namespace CppSharp { __Instance = Marshal.AllocHGlobal(208); __ownsNativeInstance = true; - Internal.ctor_0(__Instance); NativeToManagedMap[__Instance] = this; + Internal.ctor_0((__Instance + __PointerAdjustment)); } public Function(CppSharp.Parser.AST.Function _0) @@ -5219,14 +5373,14 @@ namespace CppSharp { __Instance = Marshal.AllocHGlobal(208); __ownsNativeInstance = true; - var arg0 = ReferenceEquals(_0, null) ? global::System.IntPtr.Zero : _0.__Instance; - Internal.cctor_1(__Instance, arg0); NativeToManagedMap[__Instance] = this; + var arg0 = ReferenceEquals(_0, null) ? global::System.IntPtr.Zero : _0.__Instance; + Internal.cctor_1((__Instance + __PointerAdjustment), arg0); } public CppSharp.Parser.AST.Parameter getParameters(uint i) { - var __ret = Internal.getParameters_0(__Instance, i); + var __ret = Internal.getParameters_0((__Instance + __PointerAdjustment), i); CppSharp.Parser.AST.Parameter __result0; if (__ret == IntPtr.Zero) __result0 = null; else if (CppSharp.Parser.AST.Parameter.NativeToManagedMap.ContainsKey(__ret)) @@ -5238,26 +5392,26 @@ namespace CppSharp public void addParameters(CppSharp.Parser.AST.Parameter s) { var arg0 = ReferenceEquals(s, null) ? global::System.IntPtr.Zero : s.__Instance; - Internal.addParameters_0(__Instance, arg0); + Internal.addParameters_0((__Instance + __PointerAdjustment), arg0); } public void clearParameters() { - Internal.clearParameters_0(__Instance); + Internal.clearParameters_0((__Instance + __PointerAdjustment)); } public string Mangled { get { - var __ret = Internal.getMangled_0(__Instance); + var __ret = Internal.getMangled_0((__Instance + __PointerAdjustment)); return Marshal.PtrToStringAnsi(__ret); } set { var arg0 = Marshal.StringToHGlobalAnsi(value); - Internal.setMangled_0(__Instance, arg0); + Internal.setMangled_0((__Instance + __PointerAdjustment), arg0); Marshal.FreeHGlobal(arg0); } } @@ -5266,14 +5420,14 @@ namespace CppSharp { get { - var __ret = Internal.getSignature_0(__Instance); + var __ret = Internal.getSignature_0((__Instance + __PointerAdjustment)); return Marshal.PtrToStringAnsi(__ret); } set { var arg0 = Marshal.StringToHGlobalAnsi(value); - Internal.setSignature_0(__Instance, arg0); + Internal.setSignature_0((__Instance + __PointerAdjustment), arg0); Marshal.FreeHGlobal(arg0); } } @@ -5282,7 +5436,7 @@ namespace CppSharp { get { - var __ret = Internal.getParametersCount_0(__Instance); + var __ret = Internal.getParametersCount_0((__Instance + __PointerAdjustment)); return __ret; } } @@ -5546,14 +5700,14 @@ namespace CppSharp internal static extern void dtor_0(global::System.IntPtr instance); } - public static new Method __CreateInstance(global::System.IntPtr native, bool ownsNativeInstance = false) + public static new Method __CreateInstance(global::System.IntPtr native, bool ownsNativeInstance = false, bool skipVTables = false) { - return new Method((Method.Internal*) native) { __ownsNativeInstance = ownsNativeInstance }; + return new Method((Method.Internal*) native, skipVTables) { __ownsNativeInstance = ownsNativeInstance }; } - public static Method __CreateInstance(Method.Internal native) + public static Method __CreateInstance(Method.Internal native, bool skipVTables = false) { - return new Method(native); + return new Method(native, skipVTables); } private static Method.Internal* __CopyValue(Method.Internal native) @@ -5563,16 +5717,20 @@ namespace CppSharp return (Method.Internal*) ret; } - private Method(Method.Internal native) - : this(__CopyValue(native)) + private Method(Method.Internal native, bool skipVTables = false) + : this(__CopyValue(native), skipVTables) { __ownsNativeInstance = true; NativeToManagedMap[__Instance] = this; } - protected Method(Method.Internal* native, bool isInternalImpl = false) - : base((CppSharp.Parser.AST.Function.Internal*) native) + protected Method(Method.Internal* native, bool skipVTables = false) + : base((CppSharp.Parser.AST.Function.Internal*) null) { + __PointerAdjustment = 0; + if (native == null) + return; + __Instance = new global::System.IntPtr(native); } public Method() @@ -5580,8 +5738,8 @@ namespace CppSharp { __Instance = Marshal.AllocHGlobal(248); __ownsNativeInstance = true; - Internal.ctor_0(__Instance); NativeToManagedMap[__Instance] = this; + Internal.ctor_0((__Instance + __PointerAdjustment)); } public Method(CppSharp.Parser.AST.Method _0) @@ -5589,9 +5747,9 @@ namespace CppSharp { __Instance = Marshal.AllocHGlobal(248); __ownsNativeInstance = true; - var arg0 = ReferenceEquals(_0, null) ? global::System.IntPtr.Zero : _0.__Instance; - Internal.cctor_1(__Instance, arg0); NativeToManagedMap[__Instance] = this; + var arg0 = ReferenceEquals(_0, null) ? global::System.IntPtr.Zero : _0.__Instance; + Internal.cctor_1((__Instance + __PointerAdjustment), arg0); } public CppSharp.Parser.AST.AccessSpecifierDecl AccessDecl @@ -5923,14 +6081,14 @@ namespace CppSharp internal static extern void setExpression_0(global::System.IntPtr instance, global::System.IntPtr s); } - public static new Item __CreateInstance(global::System.IntPtr native, bool ownsNativeInstance = false) + public static new Item __CreateInstance(global::System.IntPtr native, bool ownsNativeInstance = false, bool skipVTables = false) { - return new Item((Item.Internal*) native) { __ownsNativeInstance = ownsNativeInstance }; + return new Item((Item.Internal*) native, skipVTables) { __ownsNativeInstance = ownsNativeInstance }; } - public static Item __CreateInstance(Item.Internal native) + public static Item __CreateInstance(Item.Internal native, bool skipVTables = false) { - return new Item(native); + return new Item(native, skipVTables); } private static Item.Internal* __CopyValue(Item.Internal native) @@ -5940,16 +6098,20 @@ namespace CppSharp return (Item.Internal*) ret; } - private Item(Item.Internal native) - : this(__CopyValue(native)) + private Item(Item.Internal native, bool skipVTables = false) + : this(__CopyValue(native), skipVTables) { __ownsNativeInstance = true; NativeToManagedMap[__Instance] = this; } - protected Item(Item.Internal* native, bool isInternalImpl = false) - : base((CppSharp.Parser.AST.Declaration.Internal*) native) + protected Item(Item.Internal* native, bool skipVTables = false) + : base((CppSharp.Parser.AST.Declaration.Internal*) null) { + __PointerAdjustment = 0; + if (native == null) + return; + __Instance = new global::System.IntPtr(native); } public Item() @@ -5957,8 +6119,8 @@ namespace CppSharp { __Instance = Marshal.AllocHGlobal(136); __ownsNativeInstance = true; - Internal.ctor_0(__Instance); NativeToManagedMap[__Instance] = this; + Internal.ctor_0((__Instance + __PointerAdjustment)); } public Item(CppSharp.Parser.AST.Enumeration.Item _0) @@ -5966,23 +6128,23 @@ namespace CppSharp { __Instance = Marshal.AllocHGlobal(136); __ownsNativeInstance = true; - var arg0 = ReferenceEquals(_0, null) ? global::System.IntPtr.Zero : _0.__Instance; - Internal.cctor_1(__Instance, arg0); NativeToManagedMap[__Instance] = this; + var arg0 = ReferenceEquals(_0, null) ? global::System.IntPtr.Zero : _0.__Instance; + Internal.cctor_1((__Instance + __PointerAdjustment), arg0); } public string Expression { get { - var __ret = Internal.getExpression_0(__Instance); + var __ret = Internal.getExpression_0((__Instance + __PointerAdjustment)); return Marshal.PtrToStringAnsi(__ret); } set { var arg0 = Marshal.StringToHGlobalAnsi(value); - Internal.setExpression_0(__Instance, arg0); + Internal.setExpression_0((__Instance + __PointerAdjustment), arg0); Marshal.FreeHGlobal(arg0); } } @@ -6001,14 +6163,14 @@ namespace CppSharp } } - public static new Enumeration __CreateInstance(global::System.IntPtr native, bool ownsNativeInstance = false) + public static new Enumeration __CreateInstance(global::System.IntPtr native, bool ownsNativeInstance = false, bool skipVTables = false) { - return new Enumeration((Enumeration.Internal*) native) { __ownsNativeInstance = ownsNativeInstance }; + return new Enumeration((Enumeration.Internal*) native, skipVTables) { __ownsNativeInstance = ownsNativeInstance }; } - public static Enumeration __CreateInstance(Enumeration.Internal native) + public static Enumeration __CreateInstance(Enumeration.Internal native, bool skipVTables = false) { - return new Enumeration(native); + return new Enumeration(native, skipVTables); } private static Enumeration.Internal* __CopyValue(Enumeration.Internal native) @@ -6018,16 +6180,20 @@ namespace CppSharp return (Enumeration.Internal*) ret; } - private Enumeration(Enumeration.Internal native) - : this(__CopyValue(native)) + private Enumeration(Enumeration.Internal native, bool skipVTables = false) + : this(__CopyValue(native), skipVTables) { __ownsNativeInstance = true; NativeToManagedMap[__Instance] = this; } - protected Enumeration(Enumeration.Internal* native, bool isInternalImpl = false) - : base((CppSharp.Parser.AST.DeclarationContext.Internal*) native) + protected Enumeration(Enumeration.Internal* native, bool skipVTables = false) + : base((CppSharp.Parser.AST.DeclarationContext.Internal*) null) { + __PointerAdjustment = 0; + if (native == null) + return; + __Instance = new global::System.IntPtr(native); } public Enumeration() @@ -6035,8 +6201,8 @@ namespace CppSharp { __Instance = Marshal.AllocHGlobal(408); __ownsNativeInstance = true; - Internal.ctor_0(__Instance); NativeToManagedMap[__Instance] = this; + Internal.ctor_0((__Instance + __PointerAdjustment)); } public Enumeration(CppSharp.Parser.AST.Enumeration _0) @@ -6044,34 +6210,34 @@ namespace CppSharp { __Instance = Marshal.AllocHGlobal(408); __ownsNativeInstance = true; - var arg0 = ReferenceEquals(_0, null) ? global::System.IntPtr.Zero : _0.__Instance; - Internal.cctor_1(__Instance, arg0); NativeToManagedMap[__Instance] = this; + var arg0 = ReferenceEquals(_0, null) ? global::System.IntPtr.Zero : _0.__Instance; + Internal.cctor_1((__Instance + __PointerAdjustment), arg0); } public CppSharp.Parser.AST.Enumeration.Item getItems(uint i) { var __ret = new CppSharp.Parser.AST.Enumeration.Item.Internal(); - Internal.getItems_0(new IntPtr(&__ret), __Instance, i); + Internal.getItems_0(new IntPtr(&__ret), (__Instance + __PointerAdjustment), i); return CppSharp.Parser.AST.Enumeration.Item.__CreateInstance(__ret); } public void addItems(CppSharp.Parser.AST.Enumeration.Item s) { var arg0 = ReferenceEquals(s, null) ? global::System.IntPtr.Zero : s.__Instance; - Internal.addItems_0(__Instance, arg0); + Internal.addItems_0((__Instance + __PointerAdjustment), arg0); } public void clearItems() { - Internal.clearItems_0(__Instance); + Internal.clearItems_0((__Instance + __PointerAdjustment)); } public uint ItemsCount { get { - var __ret = Internal.getItemsCount_0(__Instance); + var __ret = Internal.getItemsCount_0((__Instance + __PointerAdjustment)); return __ret; } } @@ -6196,14 +6362,14 @@ namespace CppSharp internal static extern void setMangled_0(global::System.IntPtr instance, global::System.IntPtr s); } - public static new Variable __CreateInstance(global::System.IntPtr native, bool ownsNativeInstance = false) + public static new Variable __CreateInstance(global::System.IntPtr native, bool ownsNativeInstance = false, bool skipVTables = false) { - return new Variable((Variable.Internal*) native) { __ownsNativeInstance = ownsNativeInstance }; + return new Variable((Variable.Internal*) native, skipVTables) { __ownsNativeInstance = ownsNativeInstance }; } - public static Variable __CreateInstance(Variable.Internal native) + public static Variable __CreateInstance(Variable.Internal native, bool skipVTables = false) { - return new Variable(native); + return new Variable(native, skipVTables); } private static Variable.Internal* __CopyValue(Variable.Internal native) @@ -6213,16 +6379,20 @@ namespace CppSharp return (Variable.Internal*) ret; } - private Variable(Variable.Internal native) - : this(__CopyValue(native)) + private Variable(Variable.Internal native, bool skipVTables = false) + : this(__CopyValue(native), skipVTables) { __ownsNativeInstance = true; NativeToManagedMap[__Instance] = this; } - protected Variable(Variable.Internal* native, bool isInternalImpl = false) - : base((CppSharp.Parser.AST.Declaration.Internal*) native) + protected Variable(Variable.Internal* native, bool skipVTables = false) + : base((CppSharp.Parser.AST.Declaration.Internal*) null) { + __PointerAdjustment = 0; + if (native == null) + return; + __Instance = new global::System.IntPtr(native); } public Variable() @@ -6230,8 +6400,8 @@ namespace CppSharp { __Instance = Marshal.AllocHGlobal(144); __ownsNativeInstance = true; - Internal.ctor_0(__Instance); NativeToManagedMap[__Instance] = this; + Internal.ctor_0((__Instance + __PointerAdjustment)); } public Variable(CppSharp.Parser.AST.Variable _0) @@ -6239,23 +6409,23 @@ namespace CppSharp { __Instance = Marshal.AllocHGlobal(144); __ownsNativeInstance = true; - var arg0 = ReferenceEquals(_0, null) ? global::System.IntPtr.Zero : _0.__Instance; - Internal.cctor_1(__Instance, arg0); NativeToManagedMap[__Instance] = this; + var arg0 = ReferenceEquals(_0, null) ? global::System.IntPtr.Zero : _0.__Instance; + Internal.cctor_1((__Instance + __PointerAdjustment), arg0); } public string Mangled { get { - var __ret = Internal.getMangled_0(__Instance); + var __ret = Internal.getMangled_0((__Instance + __PointerAdjustment)); return Marshal.PtrToStringAnsi(__ret); } set { var arg0 = Marshal.StringToHGlobalAnsi(value); - Internal.setMangled_0(__Instance, arg0); + Internal.setMangled_0((__Instance + __PointerAdjustment), arg0); Marshal.FreeHGlobal(arg0); } } @@ -6303,19 +6473,21 @@ namespace CppSharp } public global::System.IntPtr __Instance { get; protected set; } + + protected int __PointerAdjustment; public static readonly System.Collections.Concurrent.ConcurrentDictionary NativeToManagedMap = new System.Collections.Concurrent.ConcurrentDictionary(); protected void*[] __OriginalVTables; protected bool __ownsNativeInstance; - public static BaseClassSpecifier __CreateInstance(global::System.IntPtr native, bool ownsNativeInstance = false) + public static BaseClassSpecifier __CreateInstance(global::System.IntPtr native, bool ownsNativeInstance = false, bool skipVTables = false) { - return new BaseClassSpecifier((BaseClassSpecifier.Internal*) native) { __ownsNativeInstance = ownsNativeInstance }; + return new BaseClassSpecifier((BaseClassSpecifier.Internal*) native, skipVTables) { __ownsNativeInstance = ownsNativeInstance }; } - public static BaseClassSpecifier __CreateInstance(BaseClassSpecifier.Internal native) + public static BaseClassSpecifier __CreateInstance(BaseClassSpecifier.Internal native, bool skipVTables = false) { - return new BaseClassSpecifier(native); + return new BaseClassSpecifier(native, skipVTables); } private static BaseClassSpecifier.Internal* __CopyValue(BaseClassSpecifier.Internal native) @@ -6325,15 +6497,17 @@ namespace CppSharp return ret; } - private BaseClassSpecifier(BaseClassSpecifier.Internal native) - : this(__CopyValue(native)) + private BaseClassSpecifier(BaseClassSpecifier.Internal native, bool skipVTables = false) + : this(__CopyValue(native), skipVTables) { __ownsNativeInstance = true; NativeToManagedMap[__Instance] = this; } - protected BaseClassSpecifier(BaseClassSpecifier.Internal* native, bool isInternalImpl = false) + protected BaseClassSpecifier(BaseClassSpecifier.Internal* native, bool skipVTables = false) { + if (native == null) + return; __Instance = new global::System.IntPtr(native); } @@ -6341,16 +6515,16 @@ namespace CppSharp { __Instance = Marshal.AllocHGlobal(24); __ownsNativeInstance = true; - Internal.ctor_0(__Instance); NativeToManagedMap[__Instance] = this; + Internal.ctor_0((__Instance + __PointerAdjustment)); } public BaseClassSpecifier(CppSharp.Parser.AST.BaseClassSpecifier _0) { __Instance = Marshal.AllocHGlobal(24); __ownsNativeInstance = true; - *((BaseClassSpecifier.Internal*) __Instance) = *((BaseClassSpecifier.Internal*) _0.__Instance); NativeToManagedMap[__Instance] = this; + *((BaseClassSpecifier.Internal*) __Instance) = *((BaseClassSpecifier.Internal*) _0.__Instance); } public void Dispose() @@ -6364,7 +6538,8 @@ namespace CppSharp throw new global::System.InvalidOperationException("Managed instances owned by native code cannot be disposed of."); CppSharp.Parser.AST.BaseClassSpecifier __dummy; NativeToManagedMap.TryRemove(__Instance, out __dummy); - Marshal.FreeHGlobal(__Instance); + if (__ownsNativeInstance) + Marshal.FreeHGlobal(__Instance); } public CppSharp.Parser.AST.AccessSpecifier Access @@ -6497,14 +6672,14 @@ namespace CppSharp internal static extern void dtor_0(global::System.IntPtr instance); } - public static new Field __CreateInstance(global::System.IntPtr native, bool ownsNativeInstance = false) + public static new Field __CreateInstance(global::System.IntPtr native, bool ownsNativeInstance = false, bool skipVTables = false) { - return new Field((Field.Internal*) native) { __ownsNativeInstance = ownsNativeInstance }; + return new Field((Field.Internal*) native, skipVTables) { __ownsNativeInstance = ownsNativeInstance }; } - public static Field __CreateInstance(Field.Internal native) + public static Field __CreateInstance(Field.Internal native, bool skipVTables = false) { - return new Field(native); + return new Field(native, skipVTables); } private static Field.Internal* __CopyValue(Field.Internal native) @@ -6514,16 +6689,20 @@ namespace CppSharp return (Field.Internal*) ret; } - private Field(Field.Internal native) - : this(__CopyValue(native)) + private Field(Field.Internal native, bool skipVTables = false) + : this(__CopyValue(native), skipVTables) { __ownsNativeInstance = true; NativeToManagedMap[__Instance] = this; } - protected Field(Field.Internal* native, bool isInternalImpl = false) - : base((CppSharp.Parser.AST.Declaration.Internal*) native) + protected Field(Field.Internal* native, bool skipVTables = false) + : base((CppSharp.Parser.AST.Declaration.Internal*) null) { + __PointerAdjustment = 0; + if (native == null) + return; + __Instance = new global::System.IntPtr(native); } public Field() @@ -6531,8 +6710,8 @@ namespace CppSharp { __Instance = Marshal.AllocHGlobal(160); __ownsNativeInstance = true; - Internal.ctor_0(__Instance); NativeToManagedMap[__Instance] = this; + Internal.ctor_0((__Instance + __PointerAdjustment)); } public Field(CppSharp.Parser.AST.Field _0) @@ -6540,9 +6719,9 @@ namespace CppSharp { __Instance = Marshal.AllocHGlobal(160); __ownsNativeInstance = true; - var arg0 = ReferenceEquals(_0, null) ? global::System.IntPtr.Zero : _0.__Instance; - Internal.cctor_1(__Instance, arg0); NativeToManagedMap[__Instance] = this; + var arg0 = ReferenceEquals(_0, null) ? global::System.IntPtr.Zero : _0.__Instance; + Internal.cctor_1((__Instance + __PointerAdjustment), arg0); } public CppSharp.Parser.AST.QualifiedType QualifiedType @@ -6673,14 +6852,14 @@ namespace CppSharp internal static extern void dtor_0(global::System.IntPtr instance); } - public static new AccessSpecifierDecl __CreateInstance(global::System.IntPtr native, bool ownsNativeInstance = false) + public static new AccessSpecifierDecl __CreateInstance(global::System.IntPtr native, bool ownsNativeInstance = false, bool skipVTables = false) { - return new AccessSpecifierDecl((AccessSpecifierDecl.Internal*) native) { __ownsNativeInstance = ownsNativeInstance }; + return new AccessSpecifierDecl((AccessSpecifierDecl.Internal*) native, skipVTables) { __ownsNativeInstance = ownsNativeInstance }; } - public static AccessSpecifierDecl __CreateInstance(AccessSpecifierDecl.Internal native) + public static AccessSpecifierDecl __CreateInstance(AccessSpecifierDecl.Internal native, bool skipVTables = false) { - return new AccessSpecifierDecl(native); + return new AccessSpecifierDecl(native, skipVTables); } private static AccessSpecifierDecl.Internal* __CopyValue(AccessSpecifierDecl.Internal native) @@ -6690,16 +6869,20 @@ namespace CppSharp return (AccessSpecifierDecl.Internal*) ret; } - private AccessSpecifierDecl(AccessSpecifierDecl.Internal native) - : this(__CopyValue(native)) + private AccessSpecifierDecl(AccessSpecifierDecl.Internal native, bool skipVTables = false) + : this(__CopyValue(native), skipVTables) { __ownsNativeInstance = true; NativeToManagedMap[__Instance] = this; } - protected AccessSpecifierDecl(AccessSpecifierDecl.Internal* native, bool isInternalImpl = false) - : base((CppSharp.Parser.AST.Declaration.Internal*) native) + protected AccessSpecifierDecl(AccessSpecifierDecl.Internal* native, bool skipVTables = false) + : base((CppSharp.Parser.AST.Declaration.Internal*) null) { + __PointerAdjustment = 0; + if (native == null) + return; + __Instance = new global::System.IntPtr(native); } public AccessSpecifierDecl() @@ -6707,8 +6890,8 @@ namespace CppSharp { __Instance = Marshal.AllocHGlobal(120); __ownsNativeInstance = true; - Internal.ctor_0(__Instance); NativeToManagedMap[__Instance] = this; + Internal.ctor_0((__Instance + __PointerAdjustment)); } public AccessSpecifierDecl(CppSharp.Parser.AST.AccessSpecifierDecl _0) @@ -6716,9 +6899,9 @@ namespace CppSharp { __Instance = Marshal.AllocHGlobal(120); __ownsNativeInstance = true; - var arg0 = ReferenceEquals(_0, null) ? global::System.IntPtr.Zero : _0.__Instance; - Internal.cctor_1(__Instance, arg0); NativeToManagedMap[__Instance] = this; + var arg0 = ReferenceEquals(_0, null) ? global::System.IntPtr.Zero : _0.__Instance; + Internal.cctor_1((__Instance + __PointerAdjustment), arg0); } } @@ -6892,14 +7075,14 @@ namespace CppSharp internal static extern uint getSpecifiersCount_0(global::System.IntPtr instance); } - public static new Class __CreateInstance(global::System.IntPtr native, bool ownsNativeInstance = false) + public static new Class __CreateInstance(global::System.IntPtr native, bool ownsNativeInstance = false, bool skipVTables = false) { - return new Class((Class.Internal*) native) { __ownsNativeInstance = ownsNativeInstance }; + return new Class((Class.Internal*) native, skipVTables) { __ownsNativeInstance = ownsNativeInstance }; } - public static Class __CreateInstance(Class.Internal native) + public static Class __CreateInstance(Class.Internal native, bool skipVTables = false) { - return new Class(native); + return new Class(native, skipVTables); } private static Class.Internal* __CopyValue(Class.Internal native) @@ -6909,16 +7092,20 @@ namespace CppSharp return (Class.Internal*) ret; } - private Class(Class.Internal native) - : this(__CopyValue(native)) + private Class(Class.Internal native, bool skipVTables = false) + : this(__CopyValue(native), skipVTables) { __ownsNativeInstance = true; NativeToManagedMap[__Instance] = this; } - protected Class(Class.Internal* native, bool isInternalImpl = false) - : base((CppSharp.Parser.AST.DeclarationContext.Internal*) native) + protected Class(Class.Internal* native, bool skipVTables = false) + : base((CppSharp.Parser.AST.DeclarationContext.Internal*) null) { + __PointerAdjustment = 0; + if (native == null) + return; + __Instance = new global::System.IntPtr(native); } public Class() @@ -6926,8 +7113,8 @@ namespace CppSharp { __Instance = Marshal.AllocHGlobal(488); __ownsNativeInstance = true; - Internal.ctor_0(__Instance); NativeToManagedMap[__Instance] = this; + Internal.ctor_0((__Instance + __PointerAdjustment)); } public Class(CppSharp.Parser.AST.Class _0) @@ -6935,14 +7122,14 @@ namespace CppSharp { __Instance = Marshal.AllocHGlobal(488); __ownsNativeInstance = true; - var arg0 = ReferenceEquals(_0, null) ? global::System.IntPtr.Zero : _0.__Instance; - Internal.cctor_1(__Instance, arg0); NativeToManagedMap[__Instance] = this; + var arg0 = ReferenceEquals(_0, null) ? global::System.IntPtr.Zero : _0.__Instance; + Internal.cctor_1((__Instance + __PointerAdjustment), arg0); } public CppSharp.Parser.AST.BaseClassSpecifier getBases(uint i) { - var __ret = Internal.getBases_0(__Instance, i); + var __ret = Internal.getBases_0((__Instance + __PointerAdjustment), i); CppSharp.Parser.AST.BaseClassSpecifier __result0; if (__ret == IntPtr.Zero) __result0 = null; else if (CppSharp.Parser.AST.BaseClassSpecifier.NativeToManagedMap.ContainsKey(__ret)) @@ -6954,17 +7141,17 @@ namespace CppSharp public void addBases(CppSharp.Parser.AST.BaseClassSpecifier s) { var arg0 = ReferenceEquals(s, null) ? global::System.IntPtr.Zero : s.__Instance; - Internal.addBases_0(__Instance, arg0); + Internal.addBases_0((__Instance + __PointerAdjustment), arg0); } public void clearBases() { - Internal.clearBases_0(__Instance); + Internal.clearBases_0((__Instance + __PointerAdjustment)); } public CppSharp.Parser.AST.Field getFields(uint i) { - var __ret = Internal.getFields_0(__Instance, i); + var __ret = Internal.getFields_0((__Instance + __PointerAdjustment), i); CppSharp.Parser.AST.Field __result0; if (__ret == IntPtr.Zero) __result0 = null; else if (CppSharp.Parser.AST.Field.NativeToManagedMap.ContainsKey(__ret)) @@ -6976,17 +7163,17 @@ namespace CppSharp public void addFields(CppSharp.Parser.AST.Field s) { var arg0 = ReferenceEquals(s, null) ? global::System.IntPtr.Zero : s.__Instance; - Internal.addFields_0(__Instance, arg0); + Internal.addFields_0((__Instance + __PointerAdjustment), arg0); } public void clearFields() { - Internal.clearFields_0(__Instance); + Internal.clearFields_0((__Instance + __PointerAdjustment)); } public CppSharp.Parser.AST.Method getMethods(uint i) { - var __ret = Internal.getMethods_0(__Instance, i); + var __ret = Internal.getMethods_0((__Instance + __PointerAdjustment), i); CppSharp.Parser.AST.Method __result0; if (__ret == IntPtr.Zero) __result0 = null; else if (CppSharp.Parser.AST.Method.NativeToManagedMap.ContainsKey(__ret)) @@ -6998,17 +7185,17 @@ namespace CppSharp public void addMethods(CppSharp.Parser.AST.Method s) { var arg0 = ReferenceEquals(s, null) ? global::System.IntPtr.Zero : s.__Instance; - Internal.addMethods_0(__Instance, arg0); + Internal.addMethods_0((__Instance + __PointerAdjustment), arg0); } public void clearMethods() { - Internal.clearMethods_0(__Instance); + Internal.clearMethods_0((__Instance + __PointerAdjustment)); } public CppSharp.Parser.AST.AccessSpecifierDecl getSpecifiers(uint i) { - var __ret = Internal.getSpecifiers_0(__Instance, i); + var __ret = Internal.getSpecifiers_0((__Instance + __PointerAdjustment), i); CppSharp.Parser.AST.AccessSpecifierDecl __result0; if (__ret == IntPtr.Zero) __result0 = null; else if (CppSharp.Parser.AST.AccessSpecifierDecl.NativeToManagedMap.ContainsKey(__ret)) @@ -7020,19 +7207,19 @@ namespace CppSharp public void addSpecifiers(CppSharp.Parser.AST.AccessSpecifierDecl s) { var arg0 = ReferenceEquals(s, null) ? global::System.IntPtr.Zero : s.__Instance; - Internal.addSpecifiers_0(__Instance, arg0); + Internal.addSpecifiers_0((__Instance + __PointerAdjustment), arg0); } public void clearSpecifiers() { - Internal.clearSpecifiers_0(__Instance); + Internal.clearSpecifiers_0((__Instance + __PointerAdjustment)); } public uint BasesCount { get { - var __ret = Internal.getBasesCount_0(__Instance); + var __ret = Internal.getBasesCount_0((__Instance + __PointerAdjustment)); return __ret; } } @@ -7041,7 +7228,7 @@ namespace CppSharp { get { - var __ret = Internal.getFieldsCount_0(__Instance); + var __ret = Internal.getFieldsCount_0((__Instance + __PointerAdjustment)); return __ret; } } @@ -7050,7 +7237,7 @@ namespace CppSharp { get { - var __ret = Internal.getMethodsCount_0(__Instance); + var __ret = Internal.getMethodsCount_0((__Instance + __PointerAdjustment)); return __ret; } } @@ -7059,7 +7246,7 @@ namespace CppSharp { get { - var __ret = Internal.getSpecifiersCount_0(__Instance); + var __ret = Internal.getSpecifiersCount_0((__Instance + __PointerAdjustment)); return __ret; } } @@ -7285,14 +7472,14 @@ namespace CppSharp internal static extern uint getParametersCount_0(global::System.IntPtr instance); } - public static new Template __CreateInstance(global::System.IntPtr native, bool ownsNativeInstance = false) + public static new Template __CreateInstance(global::System.IntPtr native, bool ownsNativeInstance = false, bool skipVTables = false) { - return new Template((Template.Internal*) native) { __ownsNativeInstance = ownsNativeInstance }; + return new Template((Template.Internal*) native, skipVTables) { __ownsNativeInstance = ownsNativeInstance }; } - public static Template __CreateInstance(Template.Internal native) + public static Template __CreateInstance(Template.Internal native, bool skipVTables = false) { - return new Template(native); + return new Template(native, skipVTables); } private static Template.Internal* __CopyValue(Template.Internal native) @@ -7302,16 +7489,20 @@ namespace CppSharp return (Template.Internal*) ret; } - private Template(Template.Internal native) - : this(__CopyValue(native)) + private Template(Template.Internal native, bool skipVTables = false) + : this(__CopyValue(native), skipVTables) { __ownsNativeInstance = true; NativeToManagedMap[__Instance] = this; } - protected Template(Template.Internal* native, bool isInternalImpl = false) - : base((CppSharp.Parser.AST.Declaration.Internal*) native) + protected Template(Template.Internal* native, bool skipVTables = false) + : base((CppSharp.Parser.AST.Declaration.Internal*) null) { + __PointerAdjustment = 0; + if (native == null) + return; + __Instance = new global::System.IntPtr(native); } public Template(CppSharp.Parser.AST.DeclarationKind kind) @@ -7319,9 +7510,9 @@ namespace CppSharp { __Instance = Marshal.AllocHGlobal(152); __ownsNativeInstance = true; - var arg0 = kind; - Internal.ctor_0(__Instance, arg0); NativeToManagedMap[__Instance] = this; + var arg0 = kind; + Internal.ctor_0((__Instance + __PointerAdjustment), arg0); } public Template() @@ -7329,8 +7520,8 @@ namespace CppSharp { __Instance = Marshal.AllocHGlobal(152); __ownsNativeInstance = true; - Internal.ctor_1(__Instance); NativeToManagedMap[__Instance] = this; + Internal.ctor_1((__Instance + __PointerAdjustment)); } public Template(CppSharp.Parser.AST.Template _0) @@ -7338,34 +7529,34 @@ namespace CppSharp { __Instance = Marshal.AllocHGlobal(152); __ownsNativeInstance = true; - var arg0 = ReferenceEquals(_0, null) ? global::System.IntPtr.Zero : _0.__Instance; - Internal.cctor_2(__Instance, arg0); NativeToManagedMap[__Instance] = this; + var arg0 = ReferenceEquals(_0, null) ? global::System.IntPtr.Zero : _0.__Instance; + Internal.cctor_2((__Instance + __PointerAdjustment), arg0); } public CppSharp.Parser.AST.TemplateParameter getParameters(uint i) { var __ret = new CppSharp.Parser.AST.TemplateParameter.Internal(); - Internal.getParameters_0(new IntPtr(&__ret), __Instance, i); + Internal.getParameters_0(new IntPtr(&__ret), (__Instance + __PointerAdjustment), i); return CppSharp.Parser.AST.TemplateParameter.__CreateInstance(__ret); } public void addParameters(CppSharp.Parser.AST.TemplateParameter s) { var arg0 = ReferenceEquals(s, null) ? global::System.IntPtr.Zero : s.__Instance; - Internal.addParameters_0(__Instance, arg0); + Internal.addParameters_0((__Instance + __PointerAdjustment), arg0); } public void clearParameters() { - Internal.clearParameters_0(__Instance); + Internal.clearParameters_0((__Instance + __PointerAdjustment)); } public uint ParametersCount { get { - var __ret = Internal.getParametersCount_0(__Instance); + var __ret = Internal.getParametersCount_0((__Instance + __PointerAdjustment)); return __ret; } } @@ -7469,14 +7660,14 @@ namespace CppSharp internal static extern uint getSpecializationsCount_0(global::System.IntPtr instance); } - public static new ClassTemplate __CreateInstance(global::System.IntPtr native, bool ownsNativeInstance = false) + public static new ClassTemplate __CreateInstance(global::System.IntPtr native, bool ownsNativeInstance = false, bool skipVTables = false) { - return new ClassTemplate((ClassTemplate.Internal*) native) { __ownsNativeInstance = ownsNativeInstance }; + return new ClassTemplate((ClassTemplate.Internal*) native, skipVTables) { __ownsNativeInstance = ownsNativeInstance }; } - public static ClassTemplate __CreateInstance(ClassTemplate.Internal native) + public static ClassTemplate __CreateInstance(ClassTemplate.Internal native, bool skipVTables = false) { - return new ClassTemplate(native); + return new ClassTemplate(native, skipVTables); } private static ClassTemplate.Internal* __CopyValue(ClassTemplate.Internal native) @@ -7486,16 +7677,20 @@ namespace CppSharp return (ClassTemplate.Internal*) ret; } - private ClassTemplate(ClassTemplate.Internal native) - : this(__CopyValue(native)) + private ClassTemplate(ClassTemplate.Internal native, bool skipVTables = false) + : this(__CopyValue(native), skipVTables) { __ownsNativeInstance = true; NativeToManagedMap[__Instance] = this; } - protected ClassTemplate(ClassTemplate.Internal* native, bool isInternalImpl = false) - : base((CppSharp.Parser.AST.Template.Internal*) native) + protected ClassTemplate(ClassTemplate.Internal* native, bool skipVTables = false) + : base((CppSharp.Parser.AST.Template.Internal*) null) { + __PointerAdjustment = 0; + if (native == null) + return; + __Instance = new global::System.IntPtr(native); } public ClassTemplate() @@ -7503,8 +7698,8 @@ namespace CppSharp { __Instance = Marshal.AllocHGlobal(176); __ownsNativeInstance = true; - Internal.ctor_0(__Instance); NativeToManagedMap[__Instance] = this; + Internal.ctor_0((__Instance + __PointerAdjustment)); } public ClassTemplate(CppSharp.Parser.AST.ClassTemplate _0) @@ -7512,14 +7707,14 @@ namespace CppSharp { __Instance = Marshal.AllocHGlobal(176); __ownsNativeInstance = true; - var arg0 = ReferenceEquals(_0, null) ? global::System.IntPtr.Zero : _0.__Instance; - Internal.cctor_1(__Instance, arg0); NativeToManagedMap[__Instance] = this; + var arg0 = ReferenceEquals(_0, null) ? global::System.IntPtr.Zero : _0.__Instance; + Internal.cctor_1((__Instance + __PointerAdjustment), arg0); } public CppSharp.Parser.AST.ClassTemplateSpecialization getSpecializations(uint i) { - var __ret = Internal.getSpecializations_0(__Instance, i); + var __ret = Internal.getSpecializations_0((__Instance + __PointerAdjustment), i); CppSharp.Parser.AST.ClassTemplateSpecialization __result0; if (__ret == IntPtr.Zero) __result0 = null; else if (CppSharp.Parser.AST.ClassTemplateSpecialization.NativeToManagedMap.ContainsKey(__ret)) @@ -7531,19 +7726,19 @@ namespace CppSharp public void addSpecializations(CppSharp.Parser.AST.ClassTemplateSpecialization s) { var arg0 = ReferenceEquals(s, null) ? global::System.IntPtr.Zero : s.__Instance; - Internal.addSpecializations_0(__Instance, arg0); + Internal.addSpecializations_0((__Instance + __PointerAdjustment), arg0); } public void clearSpecializations() { - Internal.clearSpecializations_0(__Instance); + Internal.clearSpecializations_0((__Instance + __PointerAdjustment)); } public uint SpecializationsCount { get { - var __ret = Internal.getSpecializationsCount_0(__Instance); + var __ret = Internal.getSpecializationsCount_0((__Instance + __PointerAdjustment)); return __ret; } } @@ -7665,14 +7860,14 @@ namespace CppSharp internal static extern uint getArgumentsCount_0(global::System.IntPtr instance); } - public static new ClassTemplateSpecialization __CreateInstance(global::System.IntPtr native, bool ownsNativeInstance = false) + public static new ClassTemplateSpecialization __CreateInstance(global::System.IntPtr native, bool ownsNativeInstance = false, bool skipVTables = false) { - return new ClassTemplateSpecialization((ClassTemplateSpecialization.Internal*) native) { __ownsNativeInstance = ownsNativeInstance }; + return new ClassTemplateSpecialization((ClassTemplateSpecialization.Internal*) native, skipVTables) { __ownsNativeInstance = ownsNativeInstance }; } - public static ClassTemplateSpecialization __CreateInstance(ClassTemplateSpecialization.Internal native) + public static ClassTemplateSpecialization __CreateInstance(ClassTemplateSpecialization.Internal native, bool skipVTables = false) { - return new ClassTemplateSpecialization(native); + return new ClassTemplateSpecialization(native, skipVTables); } private static ClassTemplateSpecialization.Internal* __CopyValue(ClassTemplateSpecialization.Internal native) @@ -7682,16 +7877,20 @@ namespace CppSharp return (ClassTemplateSpecialization.Internal*) ret; } - private ClassTemplateSpecialization(ClassTemplateSpecialization.Internal native) - : this(__CopyValue(native)) + private ClassTemplateSpecialization(ClassTemplateSpecialization.Internal native, bool skipVTables = false) + : this(__CopyValue(native), skipVTables) { __ownsNativeInstance = true; NativeToManagedMap[__Instance] = this; } - protected ClassTemplateSpecialization(ClassTemplateSpecialization.Internal* native, bool isInternalImpl = false) - : base((CppSharp.Parser.AST.Class.Internal*) native) + protected ClassTemplateSpecialization(ClassTemplateSpecialization.Internal* native, bool skipVTables = false) + : base((CppSharp.Parser.AST.Class.Internal*) null) { + __PointerAdjustment = 0; + if (native == null) + return; + __Instance = new global::System.IntPtr(native); } public ClassTemplateSpecialization() @@ -7699,8 +7898,8 @@ namespace CppSharp { __Instance = Marshal.AllocHGlobal(528); __ownsNativeInstance = true; - Internal.ctor_0(__Instance); NativeToManagedMap[__Instance] = this; + Internal.ctor_0((__Instance + __PointerAdjustment)); } public ClassTemplateSpecialization(CppSharp.Parser.AST.ClassTemplateSpecialization _0) @@ -7708,34 +7907,34 @@ namespace CppSharp { __Instance = Marshal.AllocHGlobal(528); __ownsNativeInstance = true; - var arg0 = ReferenceEquals(_0, null) ? global::System.IntPtr.Zero : _0.__Instance; - Internal.cctor_1(__Instance, arg0); NativeToManagedMap[__Instance] = this; + var arg0 = ReferenceEquals(_0, null) ? global::System.IntPtr.Zero : _0.__Instance; + Internal.cctor_1((__Instance + __PointerAdjustment), arg0); } public CppSharp.Parser.AST.TemplateArgument getArguments(uint i) { var __ret = new CppSharp.Parser.AST.TemplateArgument.Internal(); - Internal.getArguments_0(new IntPtr(&__ret), __Instance, i); + Internal.getArguments_0(new IntPtr(&__ret), (__Instance + __PointerAdjustment), i); return CppSharp.Parser.AST.TemplateArgument.__CreateInstance(__ret); } public void addArguments(CppSharp.Parser.AST.TemplateArgument s) { var arg0 = ReferenceEquals(s, null) ? global::System.IntPtr.Zero : s.__Instance; - Internal.addArguments_0(__Instance, arg0); + Internal.addArguments_0((__Instance + __PointerAdjustment), arg0); } public void clearArguments() { - Internal.clearArguments_0(__Instance); + Internal.clearArguments_0((__Instance + __PointerAdjustment)); } public uint ArgumentsCount { get { - var __ret = Internal.getArgumentsCount_0(__Instance); + var __ret = Internal.getArgumentsCount_0((__Instance + __PointerAdjustment)); return __ret; } } @@ -7868,14 +8067,14 @@ namespace CppSharp internal static extern void dtor_0(global::System.IntPtr instance); } - public static new ClassTemplatePartialSpecialization __CreateInstance(global::System.IntPtr native, bool ownsNativeInstance = false) + public static new ClassTemplatePartialSpecialization __CreateInstance(global::System.IntPtr native, bool ownsNativeInstance = false, bool skipVTables = false) { - return new ClassTemplatePartialSpecialization((ClassTemplatePartialSpecialization.Internal*) native) { __ownsNativeInstance = ownsNativeInstance }; + return new ClassTemplatePartialSpecialization((ClassTemplatePartialSpecialization.Internal*) native, skipVTables) { __ownsNativeInstance = ownsNativeInstance }; } - public static ClassTemplatePartialSpecialization __CreateInstance(ClassTemplatePartialSpecialization.Internal native) + public static ClassTemplatePartialSpecialization __CreateInstance(ClassTemplatePartialSpecialization.Internal native, bool skipVTables = false) { - return new ClassTemplatePartialSpecialization(native); + return new ClassTemplatePartialSpecialization(native, skipVTables); } private static ClassTemplatePartialSpecialization.Internal* __CopyValue(ClassTemplatePartialSpecialization.Internal native) @@ -7885,16 +8084,20 @@ namespace CppSharp return (ClassTemplatePartialSpecialization.Internal*) ret; } - private ClassTemplatePartialSpecialization(ClassTemplatePartialSpecialization.Internal native) - : this(__CopyValue(native)) + private ClassTemplatePartialSpecialization(ClassTemplatePartialSpecialization.Internal native, bool skipVTables = false) + : this(__CopyValue(native), skipVTables) { __ownsNativeInstance = true; NativeToManagedMap[__Instance] = this; } - protected ClassTemplatePartialSpecialization(ClassTemplatePartialSpecialization.Internal* native, bool isInternalImpl = false) - : base((CppSharp.Parser.AST.ClassTemplateSpecialization.Internal*) native) + protected ClassTemplatePartialSpecialization(ClassTemplatePartialSpecialization.Internal* native, bool skipVTables = false) + : base((CppSharp.Parser.AST.ClassTemplateSpecialization.Internal*) null) { + __PointerAdjustment = 0; + if (native == null) + return; + __Instance = new global::System.IntPtr(native); } public ClassTemplatePartialSpecialization() @@ -7902,8 +8105,8 @@ namespace CppSharp { __Instance = Marshal.AllocHGlobal(528); __ownsNativeInstance = true; - Internal.ctor_0(__Instance); NativeToManagedMap[__Instance] = this; + Internal.ctor_0((__Instance + __PointerAdjustment)); } public ClassTemplatePartialSpecialization(CppSharp.Parser.AST.ClassTemplatePartialSpecialization _0) @@ -7911,9 +8114,9 @@ namespace CppSharp { __Instance = Marshal.AllocHGlobal(528); __ownsNativeInstance = true; - var arg0 = ReferenceEquals(_0, null) ? global::System.IntPtr.Zero : _0.__Instance; - Internal.cctor_1(__Instance, arg0); NativeToManagedMap[__Instance] = this; + var arg0 = ReferenceEquals(_0, null) ? global::System.IntPtr.Zero : _0.__Instance; + Internal.cctor_1((__Instance + __PointerAdjustment), arg0); } } @@ -7997,14 +8200,14 @@ namespace CppSharp internal static extern uint getSpecializationsCount_0(global::System.IntPtr instance); } - public static new FunctionTemplate __CreateInstance(global::System.IntPtr native, bool ownsNativeInstance = false) + public static new FunctionTemplate __CreateInstance(global::System.IntPtr native, bool ownsNativeInstance = false, bool skipVTables = false) { - return new FunctionTemplate((FunctionTemplate.Internal*) native) { __ownsNativeInstance = ownsNativeInstance }; + return new FunctionTemplate((FunctionTemplate.Internal*) native, skipVTables) { __ownsNativeInstance = ownsNativeInstance }; } - public static FunctionTemplate __CreateInstance(FunctionTemplate.Internal native) + public static FunctionTemplate __CreateInstance(FunctionTemplate.Internal native, bool skipVTables = false) { - return new FunctionTemplate(native); + return new FunctionTemplate(native, skipVTables); } private static FunctionTemplate.Internal* __CopyValue(FunctionTemplate.Internal native) @@ -8014,16 +8217,20 @@ namespace CppSharp return (FunctionTemplate.Internal*) ret; } - private FunctionTemplate(FunctionTemplate.Internal native) - : this(__CopyValue(native)) + private FunctionTemplate(FunctionTemplate.Internal native, bool skipVTables = false) + : this(__CopyValue(native), skipVTables) { __ownsNativeInstance = true; NativeToManagedMap[__Instance] = this; } - protected FunctionTemplate(FunctionTemplate.Internal* native, bool isInternalImpl = false) - : base((CppSharp.Parser.AST.Template.Internal*) native) + protected FunctionTemplate(FunctionTemplate.Internal* native, bool skipVTables = false) + : base((CppSharp.Parser.AST.Template.Internal*) null) { + __PointerAdjustment = 0; + if (native == null) + return; + __Instance = new global::System.IntPtr(native); } public FunctionTemplate() @@ -8031,8 +8238,8 @@ namespace CppSharp { __Instance = Marshal.AllocHGlobal(176); __ownsNativeInstance = true; - Internal.ctor_0(__Instance); NativeToManagedMap[__Instance] = this; + Internal.ctor_0((__Instance + __PointerAdjustment)); } public FunctionTemplate(CppSharp.Parser.AST.FunctionTemplate _0) @@ -8040,14 +8247,14 @@ namespace CppSharp { __Instance = Marshal.AllocHGlobal(176); __ownsNativeInstance = true; - var arg0 = ReferenceEquals(_0, null) ? global::System.IntPtr.Zero : _0.__Instance; - Internal.cctor_1(__Instance, arg0); NativeToManagedMap[__Instance] = this; + var arg0 = ReferenceEquals(_0, null) ? global::System.IntPtr.Zero : _0.__Instance; + Internal.cctor_1((__Instance + __PointerAdjustment), arg0); } public CppSharp.Parser.AST.FunctionTemplateSpecialization getSpecializations(uint i) { - var __ret = Internal.getSpecializations_0(__Instance, i); + var __ret = Internal.getSpecializations_0((__Instance + __PointerAdjustment), i); CppSharp.Parser.AST.FunctionTemplateSpecialization __result0; if (__ret == IntPtr.Zero) __result0 = null; else if (CppSharp.Parser.AST.FunctionTemplateSpecialization.NativeToManagedMap.ContainsKey(__ret)) @@ -8059,19 +8266,19 @@ namespace CppSharp public void addSpecializations(CppSharp.Parser.AST.FunctionTemplateSpecialization s) { var arg0 = ReferenceEquals(s, null) ? global::System.IntPtr.Zero : s.__Instance; - Internal.addSpecializations_0(__Instance, arg0); + Internal.addSpecializations_0((__Instance + __PointerAdjustment), arg0); } public void clearSpecializations() { - Internal.clearSpecializations_0(__Instance); + Internal.clearSpecializations_0((__Instance + __PointerAdjustment)); } public uint SpecializationsCount { get { - var __ret = Internal.getSpecializationsCount_0(__Instance); + var __ret = Internal.getSpecializationsCount_0((__Instance + __PointerAdjustment)); return __ret; } } @@ -8128,19 +8335,21 @@ namespace CppSharp } public global::System.IntPtr __Instance { get; protected set; } + + protected int __PointerAdjustment; public static readonly System.Collections.Concurrent.ConcurrentDictionary NativeToManagedMap = new System.Collections.Concurrent.ConcurrentDictionary(); protected void*[] __OriginalVTables; protected bool __ownsNativeInstance; - public static FunctionTemplateSpecialization __CreateInstance(global::System.IntPtr native, bool ownsNativeInstance = false) + public static FunctionTemplateSpecialization __CreateInstance(global::System.IntPtr native, bool ownsNativeInstance = false, bool skipVTables = false) { - return new FunctionTemplateSpecialization((FunctionTemplateSpecialization.Internal*) native) { __ownsNativeInstance = ownsNativeInstance }; + return new FunctionTemplateSpecialization((FunctionTemplateSpecialization.Internal*) native, skipVTables) { __ownsNativeInstance = ownsNativeInstance }; } - public static FunctionTemplateSpecialization __CreateInstance(FunctionTemplateSpecialization.Internal native) + public static FunctionTemplateSpecialization __CreateInstance(FunctionTemplateSpecialization.Internal native, bool skipVTables = false) { - return new FunctionTemplateSpecialization(native); + return new FunctionTemplateSpecialization(native, skipVTables); } private static FunctionTemplateSpecialization.Internal* __CopyValue(FunctionTemplateSpecialization.Internal native) @@ -8150,15 +8359,17 @@ namespace CppSharp return (FunctionTemplateSpecialization.Internal*) ret; } - private FunctionTemplateSpecialization(FunctionTemplateSpecialization.Internal native) - : this(__CopyValue(native)) + private FunctionTemplateSpecialization(FunctionTemplateSpecialization.Internal native, bool skipVTables = false) + : this(__CopyValue(native), skipVTables) { __ownsNativeInstance = true; NativeToManagedMap[__Instance] = this; } - protected FunctionTemplateSpecialization(FunctionTemplateSpecialization.Internal* native, bool isInternalImpl = false) + protected FunctionTemplateSpecialization(FunctionTemplateSpecialization.Internal* native, bool skipVTables = false) { + if (native == null) + return; __Instance = new global::System.IntPtr(native); } @@ -8166,17 +8377,17 @@ namespace CppSharp { __Instance = Marshal.AllocHGlobal(48); __ownsNativeInstance = true; - Internal.ctor_0(__Instance); NativeToManagedMap[__Instance] = this; + Internal.ctor_0((__Instance + __PointerAdjustment)); } public FunctionTemplateSpecialization(CppSharp.Parser.AST.FunctionTemplateSpecialization _0) { __Instance = Marshal.AllocHGlobal(48); __ownsNativeInstance = true; - var arg0 = ReferenceEquals(_0, null) ? global::System.IntPtr.Zero : _0.__Instance; - Internal.cctor_2(__Instance, arg0); NativeToManagedMap[__Instance] = this; + var arg0 = ReferenceEquals(_0, null) ? global::System.IntPtr.Zero : _0.__Instance; + Internal.cctor_2((__Instance + __PointerAdjustment), arg0); } public void Dispose() @@ -8190,33 +8401,34 @@ namespace CppSharp throw new global::System.InvalidOperationException("Managed instances owned by native code cannot be disposed of."); CppSharp.Parser.AST.FunctionTemplateSpecialization __dummy; NativeToManagedMap.TryRemove(__Instance, out __dummy); - Internal.dtor_0(__Instance); - Marshal.FreeHGlobal(__Instance); + Internal.dtor_0((__Instance + __PointerAdjustment)); + if (__ownsNativeInstance) + Marshal.FreeHGlobal(__Instance); } public CppSharp.Parser.AST.TemplateArgument getArguments(uint i) { var __ret = new CppSharp.Parser.AST.TemplateArgument.Internal(); - Internal.getArguments_0(new IntPtr(&__ret), __Instance, i); + Internal.getArguments_0(new IntPtr(&__ret), (__Instance + __PointerAdjustment), i); return CppSharp.Parser.AST.TemplateArgument.__CreateInstance(__ret); } public void addArguments(CppSharp.Parser.AST.TemplateArgument s) { var arg0 = ReferenceEquals(s, null) ? global::System.IntPtr.Zero : s.__Instance; - Internal.addArguments_0(__Instance, arg0); + Internal.addArguments_0((__Instance + __PointerAdjustment), arg0); } public void clearArguments() { - Internal.clearArguments_0(__Instance); + Internal.clearArguments_0((__Instance + __PointerAdjustment)); } public uint ArgumentsCount { get { - var __ret = Internal.getArgumentsCount_0(__Instance); + var __ret = Internal.getArgumentsCount_0((__Instance + __PointerAdjustment)); return __ret; } } @@ -8334,14 +8546,14 @@ namespace CppSharp internal static extern void dtor_0(global::System.IntPtr instance); } - public static new Namespace __CreateInstance(global::System.IntPtr native, bool ownsNativeInstance = false) + public static new Namespace __CreateInstance(global::System.IntPtr native, bool ownsNativeInstance = false, bool skipVTables = false) { - return new Namespace((Namespace.Internal*) native) { __ownsNativeInstance = ownsNativeInstance }; + return new Namespace((Namespace.Internal*) native, skipVTables) { __ownsNativeInstance = ownsNativeInstance }; } - public static Namespace __CreateInstance(Namespace.Internal native) + public static Namespace __CreateInstance(Namespace.Internal native, bool skipVTables = false) { - return new Namespace(native); + return new Namespace(native, skipVTables); } private static Namespace.Internal* __CopyValue(Namespace.Internal native) @@ -8351,16 +8563,20 @@ namespace CppSharp return (Namespace.Internal*) ret; } - private Namespace(Namespace.Internal native) - : this(__CopyValue(native)) + private Namespace(Namespace.Internal native, bool skipVTables = false) + : this(__CopyValue(native), skipVTables) { __ownsNativeInstance = true; NativeToManagedMap[__Instance] = this; } - protected Namespace(Namespace.Internal* native, bool isInternalImpl = false) - : base((CppSharp.Parser.AST.DeclarationContext.Internal*) native) + protected Namespace(Namespace.Internal* native, bool skipVTables = false) + : base((CppSharp.Parser.AST.DeclarationContext.Internal*) null) { + __PointerAdjustment = 0; + if (native == null) + return; + __Instance = new global::System.IntPtr(native); } public Namespace() @@ -8368,8 +8584,8 @@ namespace CppSharp { __Instance = Marshal.AllocHGlobal(368); __ownsNativeInstance = true; - Internal.ctor_0(__Instance); NativeToManagedMap[__Instance] = this; + Internal.ctor_0((__Instance + __PointerAdjustment)); } public Namespace(CppSharp.Parser.AST.Namespace _0) @@ -8377,9 +8593,9 @@ namespace CppSharp { __Instance = Marshal.AllocHGlobal(368); __ownsNativeInstance = true; - var arg0 = ReferenceEquals(_0, null) ? global::System.IntPtr.Zero : _0.__Instance; - Internal.cctor_1(__Instance, arg0); NativeToManagedMap[__Instance] = this; + var arg0 = ReferenceEquals(_0, null) ? global::System.IntPtr.Zero : _0.__Instance; + Internal.cctor_1((__Instance + __PointerAdjustment), arg0); } public bool IsInline @@ -8456,14 +8672,14 @@ namespace CppSharp internal static extern void dtor_0(global::System.IntPtr instance); } - public static new PreprocessedEntity __CreateInstance(global::System.IntPtr native, bool ownsNativeInstance = false) + public static new PreprocessedEntity __CreateInstance(global::System.IntPtr native, bool ownsNativeInstance = false, bool skipVTables = false) { - return new PreprocessedEntity((PreprocessedEntity.Internal*) native) { __ownsNativeInstance = ownsNativeInstance }; + return new PreprocessedEntity((PreprocessedEntity.Internal*) native, skipVTables) { __ownsNativeInstance = ownsNativeInstance }; } - public static PreprocessedEntity __CreateInstance(PreprocessedEntity.Internal native) + public static PreprocessedEntity __CreateInstance(PreprocessedEntity.Internal native, bool skipVTables = false) { - return new PreprocessedEntity(native); + return new PreprocessedEntity(native, skipVTables); } private static PreprocessedEntity.Internal* __CopyValue(PreprocessedEntity.Internal native) @@ -8473,16 +8689,20 @@ namespace CppSharp return (PreprocessedEntity.Internal*) ret; } - private PreprocessedEntity(PreprocessedEntity.Internal native) - : this(__CopyValue(native)) + private PreprocessedEntity(PreprocessedEntity.Internal native, bool skipVTables = false) + : this(__CopyValue(native), skipVTables) { __ownsNativeInstance = true; NativeToManagedMap[__Instance] = this; } - protected PreprocessedEntity(PreprocessedEntity.Internal* native, bool isInternalImpl = false) - : base((CppSharp.Parser.AST.Declaration.Internal*) native) + protected PreprocessedEntity(PreprocessedEntity.Internal* native, bool skipVTables = false) + : base((CppSharp.Parser.AST.Declaration.Internal*) null) { + __PointerAdjustment = 0; + if (native == null) + return; + __Instance = new global::System.IntPtr(native); } public PreprocessedEntity() @@ -8490,8 +8710,8 @@ namespace CppSharp { __Instance = Marshal.AllocHGlobal(128); __ownsNativeInstance = true; - Internal.ctor_0(__Instance); NativeToManagedMap[__Instance] = this; + Internal.ctor_0((__Instance + __PointerAdjustment)); } public PreprocessedEntity(CppSharp.Parser.AST.PreprocessedEntity _0) @@ -8499,9 +8719,9 @@ namespace CppSharp { __Instance = Marshal.AllocHGlobal(128); __ownsNativeInstance = true; - var arg0 = ReferenceEquals(_0, null) ? global::System.IntPtr.Zero : _0.__Instance; - Internal.cctor_1(__Instance, arg0); NativeToManagedMap[__Instance] = this; + var arg0 = ReferenceEquals(_0, null) ? global::System.IntPtr.Zero : _0.__Instance; + Internal.cctor_1((__Instance + __PointerAdjustment), arg0); } public CppSharp.Parser.AST.MacroLocation MacroLocation @@ -8588,14 +8808,14 @@ namespace CppSharp internal static extern void setExpression_0(global::System.IntPtr instance, global::System.IntPtr s); } - public static new MacroDefinition __CreateInstance(global::System.IntPtr native, bool ownsNativeInstance = false) + public static new MacroDefinition __CreateInstance(global::System.IntPtr native, bool ownsNativeInstance = false, bool skipVTables = false) { - return new MacroDefinition((MacroDefinition.Internal*) native) { __ownsNativeInstance = ownsNativeInstance }; + return new MacroDefinition((MacroDefinition.Internal*) native, skipVTables) { __ownsNativeInstance = ownsNativeInstance }; } - public static MacroDefinition __CreateInstance(MacroDefinition.Internal native) + public static MacroDefinition __CreateInstance(MacroDefinition.Internal native, bool skipVTables = false) { - return new MacroDefinition(native); + return new MacroDefinition(native, skipVTables); } private static MacroDefinition.Internal* __CopyValue(MacroDefinition.Internal native) @@ -8605,16 +8825,20 @@ namespace CppSharp return (MacroDefinition.Internal*) ret; } - private MacroDefinition(MacroDefinition.Internal native) - : this(__CopyValue(native)) + private MacroDefinition(MacroDefinition.Internal native, bool skipVTables = false) + : this(__CopyValue(native), skipVTables) { __ownsNativeInstance = true; NativeToManagedMap[__Instance] = this; } - protected MacroDefinition(MacroDefinition.Internal* native, bool isInternalImpl = false) - : base((CppSharp.Parser.AST.PreprocessedEntity.Internal*) native) + protected MacroDefinition(MacroDefinition.Internal* native, bool skipVTables = false) + : base((CppSharp.Parser.AST.PreprocessedEntity.Internal*) null) { + __PointerAdjustment = 0; + if (native == null) + return; + __Instance = new global::System.IntPtr(native); } public MacroDefinition() @@ -8622,8 +8846,8 @@ namespace CppSharp { __Instance = Marshal.AllocHGlobal(136); __ownsNativeInstance = true; - Internal.ctor_0(__Instance); NativeToManagedMap[__Instance] = this; + Internal.ctor_0((__Instance + __PointerAdjustment)); } public MacroDefinition(CppSharp.Parser.AST.MacroDefinition _0) @@ -8631,23 +8855,23 @@ namespace CppSharp { __Instance = Marshal.AllocHGlobal(136); __ownsNativeInstance = true; - var arg0 = ReferenceEquals(_0, null) ? global::System.IntPtr.Zero : _0.__Instance; - Internal.cctor_1(__Instance, arg0); NativeToManagedMap[__Instance] = this; + var arg0 = ReferenceEquals(_0, null) ? global::System.IntPtr.Zero : _0.__Instance; + Internal.cctor_1((__Instance + __PointerAdjustment), arg0); } public string Expression { get { - var __ret = Internal.getExpression_0(__Instance); + var __ret = Internal.getExpression_0((__Instance + __PointerAdjustment)); return Marshal.PtrToStringAnsi(__ret); } set { var arg0 = Marshal.StringToHGlobalAnsi(value); - Internal.setExpression_0(__Instance, arg0); + Internal.setExpression_0((__Instance + __PointerAdjustment), arg0); Marshal.FreeHGlobal(arg0); } } @@ -8726,14 +8950,14 @@ namespace CppSharp internal static extern void setText_0(global::System.IntPtr instance, global::System.IntPtr s); } - public static new MacroExpansion __CreateInstance(global::System.IntPtr native, bool ownsNativeInstance = false) + public static new MacroExpansion __CreateInstance(global::System.IntPtr native, bool ownsNativeInstance = false, bool skipVTables = false) { - return new MacroExpansion((MacroExpansion.Internal*) native) { __ownsNativeInstance = ownsNativeInstance }; + return new MacroExpansion((MacroExpansion.Internal*) native, skipVTables) { __ownsNativeInstance = ownsNativeInstance }; } - public static MacroExpansion __CreateInstance(MacroExpansion.Internal native) + public static MacroExpansion __CreateInstance(MacroExpansion.Internal native, bool skipVTables = false) { - return new MacroExpansion(native); + return new MacroExpansion(native, skipVTables); } private static MacroExpansion.Internal* __CopyValue(MacroExpansion.Internal native) @@ -8743,16 +8967,20 @@ namespace CppSharp return (MacroExpansion.Internal*) ret; } - private MacroExpansion(MacroExpansion.Internal native) - : this(__CopyValue(native)) + private MacroExpansion(MacroExpansion.Internal native, bool skipVTables = false) + : this(__CopyValue(native), skipVTables) { __ownsNativeInstance = true; NativeToManagedMap[__Instance] = this; } - protected MacroExpansion(MacroExpansion.Internal* native, bool isInternalImpl = false) - : base((CppSharp.Parser.AST.PreprocessedEntity.Internal*) native) + protected MacroExpansion(MacroExpansion.Internal* native, bool skipVTables = false) + : base((CppSharp.Parser.AST.PreprocessedEntity.Internal*) null) { + __PointerAdjustment = 0; + if (native == null) + return; + __Instance = new global::System.IntPtr(native); } public MacroExpansion() @@ -8760,8 +8988,8 @@ namespace CppSharp { __Instance = Marshal.AllocHGlobal(144); __ownsNativeInstance = true; - Internal.ctor_0(__Instance); NativeToManagedMap[__Instance] = this; + Internal.ctor_0((__Instance + __PointerAdjustment)); } public MacroExpansion(CppSharp.Parser.AST.MacroExpansion _0) @@ -8769,23 +8997,23 @@ namespace CppSharp { __Instance = Marshal.AllocHGlobal(144); __ownsNativeInstance = true; - var arg0 = ReferenceEquals(_0, null) ? global::System.IntPtr.Zero : _0.__Instance; - Internal.cctor_1(__Instance, arg0); NativeToManagedMap[__Instance] = this; + var arg0 = ReferenceEquals(_0, null) ? global::System.IntPtr.Zero : _0.__Instance; + Internal.cctor_1((__Instance + __PointerAdjustment), arg0); } public string Text { get { - var __ret = Internal.getText_0(__Instance); + var __ret = Internal.getText_0((__Instance + __PointerAdjustment)); return Marshal.PtrToStringAnsi(__ret); } set { var arg0 = Marshal.StringToHGlobalAnsi(value); - Internal.setText_0(__Instance, arg0); + Internal.setText_0((__Instance + __PointerAdjustment), arg0); Marshal.FreeHGlobal(arg0); } } @@ -8905,14 +9133,14 @@ namespace CppSharp internal static extern uint getMacrosCount_0(global::System.IntPtr instance); } - public static new TranslationUnit __CreateInstance(global::System.IntPtr native, bool ownsNativeInstance = false) + public static new TranslationUnit __CreateInstance(global::System.IntPtr native, bool ownsNativeInstance = false, bool skipVTables = false) { - return new TranslationUnit((TranslationUnit.Internal*) native) { __ownsNativeInstance = ownsNativeInstance }; + return new TranslationUnit((TranslationUnit.Internal*) native, skipVTables) { __ownsNativeInstance = ownsNativeInstance }; } - public static TranslationUnit __CreateInstance(TranslationUnit.Internal native) + public static TranslationUnit __CreateInstance(TranslationUnit.Internal native, bool skipVTables = false) { - return new TranslationUnit(native); + return new TranslationUnit(native, skipVTables); } private static TranslationUnit.Internal* __CopyValue(TranslationUnit.Internal native) @@ -8922,16 +9150,20 @@ namespace CppSharp return (TranslationUnit.Internal*) ret; } - private TranslationUnit(TranslationUnit.Internal native) - : this(__CopyValue(native)) + private TranslationUnit(TranslationUnit.Internal native, bool skipVTables = false) + : this(__CopyValue(native), skipVTables) { __ownsNativeInstance = true; NativeToManagedMap[__Instance] = this; } - protected TranslationUnit(TranslationUnit.Internal* native, bool isInternalImpl = false) - : base((CppSharp.Parser.AST.Namespace.Internal*) native) + protected TranslationUnit(TranslationUnit.Internal* native, bool skipVTables = false) + : base((CppSharp.Parser.AST.Namespace.Internal*) null) { + __PointerAdjustment = 0; + if (native == null) + return; + __Instance = new global::System.IntPtr(native); } public TranslationUnit() @@ -8939,8 +9171,8 @@ namespace CppSharp { __Instance = Marshal.AllocHGlobal(408); __ownsNativeInstance = true; - Internal.ctor_0(__Instance); NativeToManagedMap[__Instance] = this; + Internal.ctor_0((__Instance + __PointerAdjustment)); } public TranslationUnit(CppSharp.Parser.AST.TranslationUnit _0) @@ -8948,14 +9180,14 @@ namespace CppSharp { __Instance = Marshal.AllocHGlobal(408); __ownsNativeInstance = true; - var arg0 = ReferenceEquals(_0, null) ? global::System.IntPtr.Zero : _0.__Instance; - Internal.cctor_1(__Instance, arg0); NativeToManagedMap[__Instance] = this; + var arg0 = ReferenceEquals(_0, null) ? global::System.IntPtr.Zero : _0.__Instance; + Internal.cctor_1((__Instance + __PointerAdjustment), arg0); } public CppSharp.Parser.AST.MacroDefinition getMacros(uint i) { - var __ret = Internal.getMacros_0(__Instance, i); + var __ret = Internal.getMacros_0((__Instance + __PointerAdjustment), i); CppSharp.Parser.AST.MacroDefinition __result0; if (__ret == IntPtr.Zero) __result0 = null; else if (CppSharp.Parser.AST.MacroDefinition.NativeToManagedMap.ContainsKey(__ret)) @@ -8967,26 +9199,26 @@ namespace CppSharp public void addMacros(CppSharp.Parser.AST.MacroDefinition s) { var arg0 = ReferenceEquals(s, null) ? global::System.IntPtr.Zero : s.__Instance; - Internal.addMacros_0(__Instance, arg0); + Internal.addMacros_0((__Instance + __PointerAdjustment), arg0); } public void clearMacros() { - Internal.clearMacros_0(__Instance); + Internal.clearMacros_0((__Instance + __PointerAdjustment)); } public string FileName { get { - var __ret = Internal.getFileName_0(__Instance); + var __ret = Internal.getFileName_0((__Instance + __PointerAdjustment)); return Marshal.PtrToStringAnsi(__ret); } set { var arg0 = Marshal.StringToHGlobalAnsi(value); - Internal.setFileName_0(__Instance, arg0); + Internal.setFileName_0((__Instance + __PointerAdjustment), arg0); Marshal.FreeHGlobal(arg0); } } @@ -8995,7 +9227,7 @@ namespace CppSharp { get { - var __ret = Internal.getMacrosCount_0(__Instance); + var __ret = Internal.getMacrosCount_0((__Instance + __PointerAdjustment)); return __ret; } } @@ -9089,19 +9321,21 @@ namespace CppSharp } public global::System.IntPtr __Instance { get; protected set; } + + protected int __PointerAdjustment; public static readonly System.Collections.Concurrent.ConcurrentDictionary NativeToManagedMap = new System.Collections.Concurrent.ConcurrentDictionary(); protected void*[] __OriginalVTables; protected bool __ownsNativeInstance; - public static NativeLibrary __CreateInstance(global::System.IntPtr native, bool ownsNativeInstance = false) + public static NativeLibrary __CreateInstance(global::System.IntPtr native, bool ownsNativeInstance = false, bool skipVTables = false) { - return new NativeLibrary((NativeLibrary.Internal*) native) { __ownsNativeInstance = ownsNativeInstance }; + return new NativeLibrary((NativeLibrary.Internal*) native, skipVTables) { __ownsNativeInstance = ownsNativeInstance }; } - public static NativeLibrary __CreateInstance(NativeLibrary.Internal native) + public static NativeLibrary __CreateInstance(NativeLibrary.Internal native, bool skipVTables = false) { - return new NativeLibrary(native); + return new NativeLibrary(native, skipVTables); } private static NativeLibrary.Internal* __CopyValue(NativeLibrary.Internal native) @@ -9111,15 +9345,17 @@ namespace CppSharp return (NativeLibrary.Internal*) ret; } - private NativeLibrary(NativeLibrary.Internal native) - : this(__CopyValue(native)) + private NativeLibrary(NativeLibrary.Internal native, bool skipVTables = false) + : this(__CopyValue(native), skipVTables) { __ownsNativeInstance = true; NativeToManagedMap[__Instance] = this; } - protected NativeLibrary(NativeLibrary.Internal* native, bool isInternalImpl = false) + protected NativeLibrary(NativeLibrary.Internal* native, bool skipVTables = false) { + if (native == null) + return; __Instance = new global::System.IntPtr(native); } @@ -9127,17 +9363,17 @@ namespace CppSharp { __Instance = Marshal.AllocHGlobal(64); __ownsNativeInstance = true; - Internal.ctor_0(__Instance); NativeToManagedMap[__Instance] = this; + Internal.ctor_0((__Instance + __PointerAdjustment)); } public NativeLibrary(CppSharp.Parser.AST.NativeLibrary _0) { __Instance = Marshal.AllocHGlobal(64); __ownsNativeInstance = true; - var arg0 = ReferenceEquals(_0, null) ? global::System.IntPtr.Zero : _0.__Instance; - Internal.cctor_1(__Instance, arg0); NativeToManagedMap[__Instance] = this; + var arg0 = ReferenceEquals(_0, null) ? global::System.IntPtr.Zero : _0.__Instance; + Internal.cctor_1((__Instance + __PointerAdjustment), arg0); } public void Dispose() @@ -9151,58 +9387,59 @@ namespace CppSharp throw new global::System.InvalidOperationException("Managed instances owned by native code cannot be disposed of."); CppSharp.Parser.AST.NativeLibrary __dummy; NativeToManagedMap.TryRemove(__Instance, out __dummy); - Internal.dtor_0(__Instance); - Marshal.FreeHGlobal(__Instance); + Internal.dtor_0((__Instance + __PointerAdjustment)); + if (__ownsNativeInstance) + Marshal.FreeHGlobal(__Instance); } public string getSymbols(uint i) { - var __ret = Internal.getSymbols_0(__Instance, i); + var __ret = Internal.getSymbols_0((__Instance + __PointerAdjustment), i); return Marshal.PtrToStringAnsi(__ret); } public void addSymbols(string s) { var arg0 = Marshal.StringToHGlobalAnsi(s); - Internal.addSymbols_0(__Instance, arg0); + Internal.addSymbols_0((__Instance + __PointerAdjustment), arg0); Marshal.FreeHGlobal(arg0); } public void clearSymbols() { - Internal.clearSymbols_0(__Instance); + Internal.clearSymbols_0((__Instance + __PointerAdjustment)); } public string getDependencies(uint i) { - var __ret = Internal.getDependencies_0(__Instance, i); + var __ret = Internal.getDependencies_0((__Instance + __PointerAdjustment), i); return Marshal.PtrToStringAnsi(__ret); } public void addDependencies(string s) { var arg0 = Marshal.StringToHGlobalAnsi(s); - Internal.addDependencies_0(__Instance, arg0); + Internal.addDependencies_0((__Instance + __PointerAdjustment), arg0); Marshal.FreeHGlobal(arg0); } public void clearDependencies() { - Internal.clearDependencies_0(__Instance); + Internal.clearDependencies_0((__Instance + __PointerAdjustment)); } public string FileName { get { - var __ret = Internal.getFileName_0(__Instance); + var __ret = Internal.getFileName_0((__Instance + __PointerAdjustment)); return Marshal.PtrToStringAnsi(__ret); } set { var arg0 = Marshal.StringToHGlobalAnsi(value); - Internal.setFileName_0(__Instance, arg0); + Internal.setFileName_0((__Instance + __PointerAdjustment), arg0); Marshal.FreeHGlobal(arg0); } } @@ -9211,7 +9448,7 @@ namespace CppSharp { get { - var __ret = Internal.getSymbolsCount_0(__Instance); + var __ret = Internal.getSymbolsCount_0((__Instance + __PointerAdjustment)); return __ret; } } @@ -9220,7 +9457,7 @@ namespace CppSharp { get { - var __ret = Internal.getDependenciesCount_0(__Instance); + var __ret = Internal.getDependenciesCount_0((__Instance + __PointerAdjustment)); return __ret; } } @@ -9281,19 +9518,21 @@ namespace CppSharp } public global::System.IntPtr __Instance { get; protected set; } + + protected int __PointerAdjustment; public static readonly System.Collections.Concurrent.ConcurrentDictionary NativeToManagedMap = new System.Collections.Concurrent.ConcurrentDictionary(); protected void*[] __OriginalVTables; protected bool __ownsNativeInstance; - public static ASTContext __CreateInstance(global::System.IntPtr native, bool ownsNativeInstance = false) + public static ASTContext __CreateInstance(global::System.IntPtr native, bool ownsNativeInstance = false, bool skipVTables = false) { - return new ASTContext((ASTContext.Internal*) native) { __ownsNativeInstance = ownsNativeInstance }; + return new ASTContext((ASTContext.Internal*) native, skipVTables) { __ownsNativeInstance = ownsNativeInstance }; } - public static ASTContext __CreateInstance(ASTContext.Internal native) + public static ASTContext __CreateInstance(ASTContext.Internal native, bool skipVTables = false) { - return new ASTContext(native); + return new ASTContext(native, skipVTables); } private static ASTContext.Internal* __CopyValue(ASTContext.Internal native) @@ -9303,15 +9542,17 @@ namespace CppSharp return (ASTContext.Internal*) ret; } - private ASTContext(ASTContext.Internal native) - : this(__CopyValue(native)) + private ASTContext(ASTContext.Internal native, bool skipVTables = false) + : this(__CopyValue(native), skipVTables) { __ownsNativeInstance = true; NativeToManagedMap[__Instance] = this; } - protected ASTContext(ASTContext.Internal* native, bool isInternalImpl = false) + protected ASTContext(ASTContext.Internal* native, bool skipVTables = false) { + if (native == null) + return; __Instance = new global::System.IntPtr(native); } @@ -9319,17 +9560,17 @@ namespace CppSharp { __Instance = Marshal.AllocHGlobal(24); __ownsNativeInstance = true; - Internal.ctor_0(__Instance); NativeToManagedMap[__Instance] = this; + Internal.ctor_0((__Instance + __PointerAdjustment)); } public ASTContext(CppSharp.Parser.AST.ASTContext _0) { __Instance = Marshal.AllocHGlobal(24); __ownsNativeInstance = true; - var arg0 = ReferenceEquals(_0, null) ? global::System.IntPtr.Zero : _0.__Instance; - Internal.cctor_2(__Instance, arg0); NativeToManagedMap[__Instance] = this; + var arg0 = ReferenceEquals(_0, null) ? global::System.IntPtr.Zero : _0.__Instance; + Internal.cctor_2((__Instance + __PointerAdjustment), arg0); } public void Dispose() @@ -9343,13 +9584,14 @@ namespace CppSharp throw new global::System.InvalidOperationException("Managed instances owned by native code cannot be disposed of."); CppSharp.Parser.AST.ASTContext __dummy; NativeToManagedMap.TryRemove(__Instance, out __dummy); - Internal.dtor_0(__Instance); - Marshal.FreeHGlobal(__Instance); + Internal.dtor_0((__Instance + __PointerAdjustment)); + if (__ownsNativeInstance) + Marshal.FreeHGlobal(__Instance); } public CppSharp.Parser.AST.TranslationUnit getTranslationUnits(uint i) { - var __ret = Internal.getTranslationUnits_0(__Instance, i); + var __ret = Internal.getTranslationUnits_0((__Instance + __PointerAdjustment), i); CppSharp.Parser.AST.TranslationUnit __result0; if (__ret == IntPtr.Zero) __result0 = null; else if (CppSharp.Parser.AST.TranslationUnit.NativeToManagedMap.ContainsKey(__ret)) @@ -9361,19 +9603,19 @@ namespace CppSharp public void addTranslationUnits(CppSharp.Parser.AST.TranslationUnit s) { var arg0 = ReferenceEquals(s, null) ? global::System.IntPtr.Zero : s.__Instance; - Internal.addTranslationUnits_0(__Instance, arg0); + Internal.addTranslationUnits_0((__Instance + __PointerAdjustment), arg0); } public void clearTranslationUnits() { - Internal.clearTranslationUnits_0(__Instance); + Internal.clearTranslationUnits_0((__Instance + __PointerAdjustment)); } public uint TranslationUnitsCount { get { - var __ret = Internal.getTranslationUnitsCount_0(__Instance); + var __ret = Internal.getTranslationUnitsCount_0((__Instance + __PointerAdjustment)); return __ret; } } @@ -9399,19 +9641,21 @@ namespace CppSharp } public global::System.IntPtr __Instance { get; protected set; } + + protected int __PointerAdjustment; public static readonly System.Collections.Concurrent.ConcurrentDictionary NativeToManagedMap = new System.Collections.Concurrent.ConcurrentDictionary(); protected void*[] __OriginalVTables; protected bool __ownsNativeInstance; - public static Comment __CreateInstance(global::System.IntPtr native, bool ownsNativeInstance = false) + public static Comment __CreateInstance(global::System.IntPtr native, bool ownsNativeInstance = false, bool skipVTables = false) { - return new Comment((Comment.Internal*) native) { __ownsNativeInstance = ownsNativeInstance }; + return new Comment((Comment.Internal*) native, skipVTables) { __ownsNativeInstance = ownsNativeInstance }; } - public static Comment __CreateInstance(Comment.Internal native) + public static Comment __CreateInstance(Comment.Internal native, bool skipVTables = false) { - return new Comment(native); + return new Comment(native, skipVTables); } private static Comment.Internal* __CopyValue(Comment.Internal native) @@ -9421,15 +9665,17 @@ namespace CppSharp return ret; } - private Comment(Comment.Internal native) - : this(__CopyValue(native)) + private Comment(Comment.Internal native, bool skipVTables = false) + : this(__CopyValue(native), skipVTables) { __ownsNativeInstance = true; NativeToManagedMap[__Instance] = this; } - protected Comment(Comment.Internal* native, bool isInternalImpl = false) + protected Comment(Comment.Internal* native, bool skipVTables = false) { + if (native == null) + return; __Instance = new global::System.IntPtr(native); } @@ -9437,17 +9683,17 @@ namespace CppSharp { __Instance = Marshal.AllocHGlobal(4); __ownsNativeInstance = true; - var arg0 = kind; - Internal.ctor_0(__Instance, arg0); NativeToManagedMap[__Instance] = this; + var arg0 = kind; + Internal.ctor_0((__Instance + __PointerAdjustment), arg0); } public Comment(CppSharp.Parser.AST.Comment _0) { __Instance = Marshal.AllocHGlobal(4); __ownsNativeInstance = true; - *((Comment.Internal*) __Instance) = *((Comment.Internal*) _0.__Instance); NativeToManagedMap[__Instance] = this; + *((Comment.Internal*) __Instance) = *((Comment.Internal*) _0.__Instance); } public void Dispose() @@ -9461,7 +9707,8 @@ namespace CppSharp throw new global::System.InvalidOperationException("Managed instances owned by native code cannot be disposed of."); CppSharp.Parser.AST.Comment __dummy; NativeToManagedMap.TryRemove(__Instance, out __dummy); - Marshal.FreeHGlobal(__Instance); + if (__ownsNativeInstance) + Marshal.FreeHGlobal(__Instance); } public CppSharp.Parser.AST.CommentKind Kind @@ -9502,14 +9749,14 @@ namespace CppSharp internal static extern void cctor_2(global::System.IntPtr instance, global::System.IntPtr _0); } - public static new BlockContentComment __CreateInstance(global::System.IntPtr native, bool ownsNativeInstance = false) + public static new BlockContentComment __CreateInstance(global::System.IntPtr native, bool ownsNativeInstance = false, bool skipVTables = false) { - return new BlockContentComment((BlockContentComment.Internal*) native) { __ownsNativeInstance = ownsNativeInstance }; + return new BlockContentComment((BlockContentComment.Internal*) native, skipVTables) { __ownsNativeInstance = ownsNativeInstance }; } - public static BlockContentComment __CreateInstance(BlockContentComment.Internal native) + public static BlockContentComment __CreateInstance(BlockContentComment.Internal native, bool skipVTables = false) { - return new BlockContentComment(native); + return new BlockContentComment(native, skipVTables); } private static BlockContentComment.Internal* __CopyValue(BlockContentComment.Internal native) @@ -9519,16 +9766,20 @@ namespace CppSharp return ret; } - private BlockContentComment(BlockContentComment.Internal native) - : this(__CopyValue(native)) + private BlockContentComment(BlockContentComment.Internal native, bool skipVTables = false) + : this(__CopyValue(native), skipVTables) { __ownsNativeInstance = true; NativeToManagedMap[__Instance] = this; } - protected BlockContentComment(BlockContentComment.Internal* native, bool isInternalImpl = false) - : base((CppSharp.Parser.AST.Comment.Internal*) native) + protected BlockContentComment(BlockContentComment.Internal* native, bool skipVTables = false) + : base((CppSharp.Parser.AST.Comment.Internal*) null) { + __PointerAdjustment = 0; + if (native == null) + return; + __Instance = new global::System.IntPtr(native); } public BlockContentComment() @@ -9536,8 +9787,8 @@ namespace CppSharp { __Instance = Marshal.AllocHGlobal(4); __ownsNativeInstance = true; - Internal.ctor_0(__Instance); NativeToManagedMap[__Instance] = this; + Internal.ctor_0((__Instance + __PointerAdjustment)); } public BlockContentComment(CppSharp.Parser.AST.CommentKind Kind) @@ -9545,9 +9796,9 @@ namespace CppSharp { __Instance = Marshal.AllocHGlobal(4); __ownsNativeInstance = true; - var arg0 = Kind; - Internal.ctor_1(__Instance, arg0); NativeToManagedMap[__Instance] = this; + var arg0 = Kind; + Internal.ctor_1((__Instance + __PointerAdjustment), arg0); } public BlockContentComment(CppSharp.Parser.AST.BlockContentComment _0) @@ -9555,8 +9806,8 @@ namespace CppSharp { __Instance = Marshal.AllocHGlobal(4); __ownsNativeInstance = true; - *((BlockContentComment.Internal*) __Instance) = *((BlockContentComment.Internal*) _0.__Instance); NativeToManagedMap[__Instance] = this; + *((BlockContentComment.Internal*) __Instance) = *((BlockContentComment.Internal*) _0.__Instance); } } @@ -9604,14 +9855,14 @@ namespace CppSharp internal static extern uint getBlocksCount_0(global::System.IntPtr instance); } - public static new FullComment __CreateInstance(global::System.IntPtr native, bool ownsNativeInstance = false) + public static new FullComment __CreateInstance(global::System.IntPtr native, bool ownsNativeInstance = false, bool skipVTables = false) { - return new FullComment((FullComment.Internal*) native) { __ownsNativeInstance = ownsNativeInstance }; + return new FullComment((FullComment.Internal*) native, skipVTables) { __ownsNativeInstance = ownsNativeInstance }; } - public static FullComment __CreateInstance(FullComment.Internal native) + public static FullComment __CreateInstance(FullComment.Internal native, bool skipVTables = false) { - return new FullComment(native); + return new FullComment(native, skipVTables); } private static FullComment.Internal* __CopyValue(FullComment.Internal native) @@ -9621,16 +9872,20 @@ namespace CppSharp return (FullComment.Internal*) ret; } - private FullComment(FullComment.Internal native) - : this(__CopyValue(native)) + private FullComment(FullComment.Internal native, bool skipVTables = false) + : this(__CopyValue(native), skipVTables) { __ownsNativeInstance = true; NativeToManagedMap[__Instance] = this; } - protected FullComment(FullComment.Internal* native, bool isInternalImpl = false) - : base((CppSharp.Parser.AST.Comment.Internal*) native) + protected FullComment(FullComment.Internal* native, bool skipVTables = false) + : base((CppSharp.Parser.AST.Comment.Internal*) null) { + __PointerAdjustment = 0; + if (native == null) + return; + __Instance = new global::System.IntPtr(native); } public FullComment() @@ -9638,8 +9893,8 @@ namespace CppSharp { __Instance = Marshal.AllocHGlobal(32); __ownsNativeInstance = true; - Internal.ctor_0(__Instance); NativeToManagedMap[__Instance] = this; + Internal.ctor_0((__Instance + __PointerAdjustment)); } public FullComment(CppSharp.Parser.AST.FullComment _0) @@ -9647,14 +9902,14 @@ namespace CppSharp { __Instance = Marshal.AllocHGlobal(32); __ownsNativeInstance = true; - var arg0 = ReferenceEquals(_0, null) ? global::System.IntPtr.Zero : _0.__Instance; - Internal.cctor_2(__Instance, arg0); NativeToManagedMap[__Instance] = this; + var arg0 = ReferenceEquals(_0, null) ? global::System.IntPtr.Zero : _0.__Instance; + Internal.cctor_2((__Instance + __PointerAdjustment), arg0); } public CppSharp.Parser.AST.BlockContentComment getBlocks(uint i) { - var __ret = Internal.getBlocks_0(__Instance, i); + var __ret = Internal.getBlocks_0((__Instance + __PointerAdjustment), i); CppSharp.Parser.AST.BlockContentComment __result0; if (__ret == IntPtr.Zero) __result0 = null; else if (CppSharp.Parser.AST.BlockContentComment.NativeToManagedMap.ContainsKey(__ret)) @@ -9666,19 +9921,19 @@ namespace CppSharp public void addBlocks(CppSharp.Parser.AST.BlockContentComment s) { var arg0 = ReferenceEquals(s, null) ? global::System.IntPtr.Zero : s.__Instance; - Internal.addBlocks_0(__Instance, arg0); + Internal.addBlocks_0((__Instance + __PointerAdjustment), arg0); } public void clearBlocks() { - Internal.clearBlocks_0(__Instance); + Internal.clearBlocks_0((__Instance + __PointerAdjustment)); } public uint BlocksCount { get { - var __ret = Internal.getBlocksCount_0(__Instance); + var __ret = Internal.getBlocksCount_0((__Instance + __PointerAdjustment)); return __ret; } } @@ -9768,19 +10023,21 @@ namespace CppSharp } public global::System.IntPtr __Instance { get; protected set; } + + protected int __PointerAdjustment; public static readonly System.Collections.Concurrent.ConcurrentDictionary NativeToManagedMap = new System.Collections.Concurrent.ConcurrentDictionary(); protected void*[] __OriginalVTables; protected bool __ownsNativeInstance; - public static Argument __CreateInstance(global::System.IntPtr native, bool ownsNativeInstance = false) + public static Argument __CreateInstance(global::System.IntPtr native, bool ownsNativeInstance = false, bool skipVTables = false) { - return new Argument((Argument.Internal*) native) { __ownsNativeInstance = ownsNativeInstance }; + return new Argument((Argument.Internal*) native, skipVTables) { __ownsNativeInstance = ownsNativeInstance }; } - public static Argument __CreateInstance(Argument.Internal native) + public static Argument __CreateInstance(Argument.Internal native, bool skipVTables = false) { - return new Argument(native); + return new Argument(native, skipVTables); } private static Argument.Internal* __CopyValue(Argument.Internal native) @@ -9790,15 +10047,17 @@ namespace CppSharp return (Argument.Internal*) ret; } - private Argument(Argument.Internal native) - : this(__CopyValue(native)) + private Argument(Argument.Internal native, bool skipVTables = false) + : this(__CopyValue(native), skipVTables) { __ownsNativeInstance = true; NativeToManagedMap[__Instance] = this; } - protected Argument(Argument.Internal* native, bool isInternalImpl = false) + protected Argument(Argument.Internal* native, bool skipVTables = false) { + if (native == null) + return; __Instance = new global::System.IntPtr(native); } @@ -9806,17 +10065,17 @@ namespace CppSharp { __Instance = Marshal.AllocHGlobal(8); __ownsNativeInstance = true; - Internal.ctor_0(__Instance); NativeToManagedMap[__Instance] = this; + Internal.ctor_0((__Instance + __PointerAdjustment)); } public Argument(CppSharp.Parser.AST.BlockCommandComment.Argument _0) { __Instance = Marshal.AllocHGlobal(8); __ownsNativeInstance = true; - var arg0 = ReferenceEquals(_0, null) ? global::System.IntPtr.Zero : _0.__Instance; - Internal.cctor_1(__Instance, arg0); NativeToManagedMap[__Instance] = this; + var arg0 = ReferenceEquals(_0, null) ? global::System.IntPtr.Zero : _0.__Instance; + Internal.cctor_1((__Instance + __PointerAdjustment), arg0); } public void Dispose() @@ -9830,35 +10089,36 @@ namespace CppSharp throw new global::System.InvalidOperationException("Managed instances owned by native code cannot be disposed of."); CppSharp.Parser.AST.BlockCommandComment.Argument __dummy; NativeToManagedMap.TryRemove(__Instance, out __dummy); - Internal.dtor_0(__Instance); - Marshal.FreeHGlobal(__Instance); + Internal.dtor_0((__Instance + __PointerAdjustment)); + if (__ownsNativeInstance) + Marshal.FreeHGlobal(__Instance); } public string Text { get { - var __ret = Internal.getText_0(__Instance); + var __ret = Internal.getText_0((__Instance + __PointerAdjustment)); return Marshal.PtrToStringAnsi(__ret); } set { var arg0 = Marshal.StringToHGlobalAnsi(value); - Internal.setText_0(__Instance, arg0); + Internal.setText_0((__Instance + __PointerAdjustment), arg0); Marshal.FreeHGlobal(arg0); } } } - public static new BlockCommandComment __CreateInstance(global::System.IntPtr native, bool ownsNativeInstance = false) + public static new BlockCommandComment __CreateInstance(global::System.IntPtr native, bool ownsNativeInstance = false, bool skipVTables = false) { - return new BlockCommandComment((BlockCommandComment.Internal*) native) { __ownsNativeInstance = ownsNativeInstance }; + return new BlockCommandComment((BlockCommandComment.Internal*) native, skipVTables) { __ownsNativeInstance = ownsNativeInstance }; } - public static BlockCommandComment __CreateInstance(BlockCommandComment.Internal native) + public static BlockCommandComment __CreateInstance(BlockCommandComment.Internal native, bool skipVTables = false) { - return new BlockCommandComment(native); + return new BlockCommandComment(native, skipVTables); } private static BlockCommandComment.Internal* __CopyValue(BlockCommandComment.Internal native) @@ -9868,16 +10128,20 @@ namespace CppSharp return (BlockCommandComment.Internal*) ret; } - private BlockCommandComment(BlockCommandComment.Internal native) - : this(__CopyValue(native)) + private BlockCommandComment(BlockCommandComment.Internal native, bool skipVTables = false) + : this(__CopyValue(native), skipVTables) { __ownsNativeInstance = true; NativeToManagedMap[__Instance] = this; } - protected BlockCommandComment(BlockCommandComment.Internal* native, bool isInternalImpl = false) - : base((CppSharp.Parser.AST.BlockContentComment.Internal*) native) + protected BlockCommandComment(BlockCommandComment.Internal* native, bool skipVTables = false) + : base((CppSharp.Parser.AST.BlockContentComment.Internal*) null) { + __PointerAdjustment = 0; + if (native == null) + return; + __Instance = new global::System.IntPtr(native); } public BlockCommandComment() @@ -9885,8 +10149,8 @@ namespace CppSharp { __Instance = Marshal.AllocHGlobal(32); __ownsNativeInstance = true; - Internal.ctor_0(__Instance); NativeToManagedMap[__Instance] = this; + Internal.ctor_0((__Instance + __PointerAdjustment)); } public BlockCommandComment(CppSharp.Parser.AST.CommentKind Kind) @@ -9894,9 +10158,9 @@ namespace CppSharp { __Instance = Marshal.AllocHGlobal(32); __ownsNativeInstance = true; - var arg0 = Kind; - Internal.ctor_1(__Instance, arg0); NativeToManagedMap[__Instance] = this; + var arg0 = Kind; + Internal.ctor_1((__Instance + __PointerAdjustment), arg0); } public BlockCommandComment(CppSharp.Parser.AST.BlockCommandComment _0) @@ -9904,34 +10168,34 @@ namespace CppSharp { __Instance = Marshal.AllocHGlobal(32); __ownsNativeInstance = true; - var arg0 = ReferenceEquals(_0, null) ? global::System.IntPtr.Zero : _0.__Instance; - Internal.cctor_3(__Instance, arg0); NativeToManagedMap[__Instance] = this; + var arg0 = ReferenceEquals(_0, null) ? global::System.IntPtr.Zero : _0.__Instance; + Internal.cctor_3((__Instance + __PointerAdjustment), arg0); } public CppSharp.Parser.AST.BlockCommandComment.Argument getArguments(uint i) { var __ret = new CppSharp.Parser.AST.BlockCommandComment.Argument.Internal(); - Internal.getArguments_0(new IntPtr(&__ret), __Instance, i); + Internal.getArguments_0(new IntPtr(&__ret), (__Instance + __PointerAdjustment), i); return CppSharp.Parser.AST.BlockCommandComment.Argument.__CreateInstance(__ret); } public void addArguments(CppSharp.Parser.AST.BlockCommandComment.Argument s) { var arg0 = ReferenceEquals(s, null) ? global::System.IntPtr.Zero : s.__Instance; - Internal.addArguments_0(__Instance, arg0); + Internal.addArguments_0((__Instance + __PointerAdjustment), arg0); } public void clearArguments() { - Internal.clearArguments_0(__Instance); + Internal.clearArguments_0((__Instance + __PointerAdjustment)); } public uint ArgumentsCount { get { - var __ret = Internal.getArgumentsCount_0(__Instance); + var __ret = Internal.getArgumentsCount_0((__Instance + __PointerAdjustment)); return __ret; } } @@ -9990,14 +10254,14 @@ namespace CppSharp InOut = 2 } - public static new ParamCommandComment __CreateInstance(global::System.IntPtr native, bool ownsNativeInstance = false) + public static new ParamCommandComment __CreateInstance(global::System.IntPtr native, bool ownsNativeInstance = false, bool skipVTables = false) { - return new ParamCommandComment((ParamCommandComment.Internal*) native) { __ownsNativeInstance = ownsNativeInstance }; + return new ParamCommandComment((ParamCommandComment.Internal*) native, skipVTables) { __ownsNativeInstance = ownsNativeInstance }; } - public static ParamCommandComment __CreateInstance(ParamCommandComment.Internal native) + public static ParamCommandComment __CreateInstance(ParamCommandComment.Internal native, bool skipVTables = false) { - return new ParamCommandComment(native); + return new ParamCommandComment(native, skipVTables); } private static ParamCommandComment.Internal* __CopyValue(ParamCommandComment.Internal native) @@ -10007,16 +10271,20 @@ namespace CppSharp return (ParamCommandComment.Internal*) ret; } - private ParamCommandComment(ParamCommandComment.Internal native) - : this(__CopyValue(native)) + private ParamCommandComment(ParamCommandComment.Internal native, bool skipVTables = false) + : this(__CopyValue(native), skipVTables) { __ownsNativeInstance = true; NativeToManagedMap[__Instance] = this; } - protected ParamCommandComment(ParamCommandComment.Internal* native, bool isInternalImpl = false) - : base((CppSharp.Parser.AST.BlockCommandComment.Internal*) native) + protected ParamCommandComment(ParamCommandComment.Internal* native, bool skipVTables = false) + : base((CppSharp.Parser.AST.BlockCommandComment.Internal*) null) { + __PointerAdjustment = 0; + if (native == null) + return; + __Instance = new global::System.IntPtr(native); } public ParamCommandComment() @@ -10024,8 +10292,8 @@ namespace CppSharp { __Instance = Marshal.AllocHGlobal(40); __ownsNativeInstance = true; - Internal.ctor_0(__Instance); NativeToManagedMap[__Instance] = this; + Internal.ctor_0((__Instance + __PointerAdjustment)); } public ParamCommandComment(CppSharp.Parser.AST.ParamCommandComment _0) @@ -10033,9 +10301,9 @@ namespace CppSharp { __Instance = Marshal.AllocHGlobal(40); __ownsNativeInstance = true; - var arg0 = ReferenceEquals(_0, null) ? global::System.IntPtr.Zero : _0.__Instance; - Internal.cctor_1(__Instance, arg0); NativeToManagedMap[__Instance] = this; + var arg0 = ReferenceEquals(_0, null) ? global::System.IntPtr.Zero : _0.__Instance; + Internal.cctor_1((__Instance + __PointerAdjustment), arg0); } public CppSharp.Parser.AST.ParamCommandComment.PassDirection Direction @@ -10112,14 +10380,14 @@ namespace CppSharp internal static extern uint getPositionCount_0(global::System.IntPtr instance); } - public static new TParamCommandComment __CreateInstance(global::System.IntPtr native, bool ownsNativeInstance = false) + public static new TParamCommandComment __CreateInstance(global::System.IntPtr native, bool ownsNativeInstance = false, bool skipVTables = false) { - return new TParamCommandComment((TParamCommandComment.Internal*) native) { __ownsNativeInstance = ownsNativeInstance }; + return new TParamCommandComment((TParamCommandComment.Internal*) native, skipVTables) { __ownsNativeInstance = ownsNativeInstance }; } - public static TParamCommandComment __CreateInstance(TParamCommandComment.Internal native) + public static TParamCommandComment __CreateInstance(TParamCommandComment.Internal native, bool skipVTables = false) { - return new TParamCommandComment(native); + return new TParamCommandComment(native, skipVTables); } private static TParamCommandComment.Internal* __CopyValue(TParamCommandComment.Internal native) @@ -10129,16 +10397,20 @@ namespace CppSharp return (TParamCommandComment.Internal*) ret; } - private TParamCommandComment(TParamCommandComment.Internal native) - : this(__CopyValue(native)) + private TParamCommandComment(TParamCommandComment.Internal native, bool skipVTables = false) + : this(__CopyValue(native), skipVTables) { __ownsNativeInstance = true; NativeToManagedMap[__Instance] = this; } - protected TParamCommandComment(TParamCommandComment.Internal* native, bool isInternalImpl = false) - : base((CppSharp.Parser.AST.BlockCommandComment.Internal*) native) + protected TParamCommandComment(TParamCommandComment.Internal* native, bool skipVTables = false) + : base((CppSharp.Parser.AST.BlockCommandComment.Internal*) null) { + __PointerAdjustment = 0; + if (native == null) + return; + __Instance = new global::System.IntPtr(native); } public TParamCommandComment() @@ -10146,8 +10418,8 @@ namespace CppSharp { __Instance = Marshal.AllocHGlobal(56); __ownsNativeInstance = true; - Internal.ctor_0(__Instance); NativeToManagedMap[__Instance] = this; + Internal.ctor_0((__Instance + __PointerAdjustment)); } public TParamCommandComment(CppSharp.Parser.AST.TParamCommandComment _0) @@ -10155,35 +10427,36 @@ namespace CppSharp { __Instance = Marshal.AllocHGlobal(56); __ownsNativeInstance = true; - var arg0 = ReferenceEquals(_0, null) ? global::System.IntPtr.Zero : _0.__Instance; - Internal.cctor_2(__Instance, arg0); NativeToManagedMap[__Instance] = this; + var arg0 = ReferenceEquals(_0, null) ? global::System.IntPtr.Zero : _0.__Instance; + Internal.cctor_2((__Instance + __PointerAdjustment), arg0); } public uint getPosition(uint i) { - var __ret = Internal.getPosition_0(__Instance, i); + var __ret = Internal.getPosition_0((__Instance + __PointerAdjustment), i); return __ret; } public void addPosition(ref uint s) { - fixed (uint* arg0 = &s) + fixed (uint* __refParamPtr0 = &s) { - Internal.addPosition_0(__Instance, arg0); + var arg0 = __refParamPtr0; + Internal.addPosition_0((__Instance + __PointerAdjustment), arg0); } } public void clearPosition() { - Internal.clearPosition_0(__Instance); + Internal.clearPosition_0((__Instance + __PointerAdjustment)); } public uint PositionCount { get { - var __ret = Internal.getPositionCount_0(__Instance); + var __ret = Internal.getPositionCount_0((__Instance + __PointerAdjustment)); return __ret; } } @@ -10223,14 +10496,14 @@ namespace CppSharp internal static extern void setText_0(global::System.IntPtr instance, global::System.IntPtr s); } - public static new VerbatimBlockLineComment __CreateInstance(global::System.IntPtr native, bool ownsNativeInstance = false) + public static new VerbatimBlockLineComment __CreateInstance(global::System.IntPtr native, bool ownsNativeInstance = false, bool skipVTables = false) { - return new VerbatimBlockLineComment((VerbatimBlockLineComment.Internal*) native) { __ownsNativeInstance = ownsNativeInstance }; + return new VerbatimBlockLineComment((VerbatimBlockLineComment.Internal*) native, skipVTables) { __ownsNativeInstance = ownsNativeInstance }; } - public static VerbatimBlockLineComment __CreateInstance(VerbatimBlockLineComment.Internal native) + public static VerbatimBlockLineComment __CreateInstance(VerbatimBlockLineComment.Internal native, bool skipVTables = false) { - return new VerbatimBlockLineComment(native); + return new VerbatimBlockLineComment(native, skipVTables); } private static VerbatimBlockLineComment.Internal* __CopyValue(VerbatimBlockLineComment.Internal native) @@ -10240,16 +10513,20 @@ namespace CppSharp return (VerbatimBlockLineComment.Internal*) ret; } - private VerbatimBlockLineComment(VerbatimBlockLineComment.Internal native) - : this(__CopyValue(native)) + private VerbatimBlockLineComment(VerbatimBlockLineComment.Internal native, bool skipVTables = false) + : this(__CopyValue(native), skipVTables) { __ownsNativeInstance = true; NativeToManagedMap[__Instance] = this; } - protected VerbatimBlockLineComment(VerbatimBlockLineComment.Internal* native, bool isInternalImpl = false) - : base((CppSharp.Parser.AST.Comment.Internal*) native) + protected VerbatimBlockLineComment(VerbatimBlockLineComment.Internal* native, bool skipVTables = false) + : base((CppSharp.Parser.AST.Comment.Internal*) null) { + __PointerAdjustment = 0; + if (native == null) + return; + __Instance = new global::System.IntPtr(native); } public VerbatimBlockLineComment() @@ -10257,8 +10534,8 @@ namespace CppSharp { __Instance = Marshal.AllocHGlobal(16); __ownsNativeInstance = true; - Internal.ctor_0(__Instance); NativeToManagedMap[__Instance] = this; + Internal.ctor_0((__Instance + __PointerAdjustment)); } public VerbatimBlockLineComment(CppSharp.Parser.AST.VerbatimBlockLineComment _0) @@ -10266,23 +10543,23 @@ namespace CppSharp { __Instance = Marshal.AllocHGlobal(16); __ownsNativeInstance = true; - var arg0 = ReferenceEquals(_0, null) ? global::System.IntPtr.Zero : _0.__Instance; - Internal.cctor_1(__Instance, arg0); NativeToManagedMap[__Instance] = this; + var arg0 = ReferenceEquals(_0, null) ? global::System.IntPtr.Zero : _0.__Instance; + Internal.cctor_1((__Instance + __PointerAdjustment), arg0); } public string Text { get { - var __ret = Internal.getText_0(__Instance); + var __ret = Internal.getText_0((__Instance + __PointerAdjustment)); return Marshal.PtrToStringAnsi(__ret); } set { var arg0 = Marshal.StringToHGlobalAnsi(value); - Internal.setText_0(__Instance, arg0); + Internal.setText_0((__Instance + __PointerAdjustment), arg0); Marshal.FreeHGlobal(arg0); } } @@ -10335,14 +10612,14 @@ namespace CppSharp internal static extern uint getLinesCount_0(global::System.IntPtr instance); } - public static new VerbatimBlockComment __CreateInstance(global::System.IntPtr native, bool ownsNativeInstance = false) + public static new VerbatimBlockComment __CreateInstance(global::System.IntPtr native, bool ownsNativeInstance = false, bool skipVTables = false) { - return new VerbatimBlockComment((VerbatimBlockComment.Internal*) native) { __ownsNativeInstance = ownsNativeInstance }; + return new VerbatimBlockComment((VerbatimBlockComment.Internal*) native, skipVTables) { __ownsNativeInstance = ownsNativeInstance }; } - public static VerbatimBlockComment __CreateInstance(VerbatimBlockComment.Internal native) + public static VerbatimBlockComment __CreateInstance(VerbatimBlockComment.Internal native, bool skipVTables = false) { - return new VerbatimBlockComment(native); + return new VerbatimBlockComment(native, skipVTables); } private static VerbatimBlockComment.Internal* __CopyValue(VerbatimBlockComment.Internal native) @@ -10352,16 +10629,20 @@ namespace CppSharp return (VerbatimBlockComment.Internal*) ret; } - private VerbatimBlockComment(VerbatimBlockComment.Internal native) - : this(__CopyValue(native)) + private VerbatimBlockComment(VerbatimBlockComment.Internal native, bool skipVTables = false) + : this(__CopyValue(native), skipVTables) { __ownsNativeInstance = true; NativeToManagedMap[__Instance] = this; } - protected VerbatimBlockComment(VerbatimBlockComment.Internal* native, bool isInternalImpl = false) - : base((CppSharp.Parser.AST.BlockCommandComment.Internal*) native) + protected VerbatimBlockComment(VerbatimBlockComment.Internal* native, bool skipVTables = false) + : base((CppSharp.Parser.AST.BlockCommandComment.Internal*) null) { + __PointerAdjustment = 0; + if (native == null) + return; + __Instance = new global::System.IntPtr(native); } public VerbatimBlockComment() @@ -10369,8 +10650,8 @@ namespace CppSharp { __Instance = Marshal.AllocHGlobal(56); __ownsNativeInstance = true; - Internal.ctor_0(__Instance); NativeToManagedMap[__Instance] = this; + Internal.ctor_0((__Instance + __PointerAdjustment)); } public VerbatimBlockComment(CppSharp.Parser.AST.VerbatimBlockComment _0) @@ -10378,14 +10659,14 @@ namespace CppSharp { __Instance = Marshal.AllocHGlobal(56); __ownsNativeInstance = true; - var arg0 = ReferenceEquals(_0, null) ? global::System.IntPtr.Zero : _0.__Instance; - Internal.cctor_2(__Instance, arg0); NativeToManagedMap[__Instance] = this; + var arg0 = ReferenceEquals(_0, null) ? global::System.IntPtr.Zero : _0.__Instance; + Internal.cctor_2((__Instance + __PointerAdjustment), arg0); } public CppSharp.Parser.AST.VerbatimBlockLineComment getLines(uint i) { - var __ret = Internal.getLines_0(__Instance, i); + var __ret = Internal.getLines_0((__Instance + __PointerAdjustment), i); CppSharp.Parser.AST.VerbatimBlockLineComment __result0; if (__ret == IntPtr.Zero) __result0 = null; else if (CppSharp.Parser.AST.VerbatimBlockLineComment.NativeToManagedMap.ContainsKey(__ret)) @@ -10397,19 +10678,19 @@ namespace CppSharp public void addLines(CppSharp.Parser.AST.VerbatimBlockLineComment s) { var arg0 = ReferenceEquals(s, null) ? global::System.IntPtr.Zero : s.__Instance; - Internal.addLines_0(__Instance, arg0); + Internal.addLines_0((__Instance + __PointerAdjustment), arg0); } public void clearLines() { - Internal.clearLines_0(__Instance); + Internal.clearLines_0((__Instance + __PointerAdjustment)); } public uint LinesCount { get { - var __ret = Internal.getLinesCount_0(__Instance); + var __ret = Internal.getLinesCount_0((__Instance + __PointerAdjustment)); return __ret; } } @@ -10452,14 +10733,14 @@ namespace CppSharp internal static extern void setText_0(global::System.IntPtr instance, global::System.IntPtr s); } - public static new VerbatimLineComment __CreateInstance(global::System.IntPtr native, bool ownsNativeInstance = false) + public static new VerbatimLineComment __CreateInstance(global::System.IntPtr native, bool ownsNativeInstance = false, bool skipVTables = false) { - return new VerbatimLineComment((VerbatimLineComment.Internal*) native) { __ownsNativeInstance = ownsNativeInstance }; + return new VerbatimLineComment((VerbatimLineComment.Internal*) native, skipVTables) { __ownsNativeInstance = ownsNativeInstance }; } - public static VerbatimLineComment __CreateInstance(VerbatimLineComment.Internal native) + public static VerbatimLineComment __CreateInstance(VerbatimLineComment.Internal native, bool skipVTables = false) { - return new VerbatimLineComment(native); + return new VerbatimLineComment(native, skipVTables); } private static VerbatimLineComment.Internal* __CopyValue(VerbatimLineComment.Internal native) @@ -10469,16 +10750,20 @@ namespace CppSharp return (VerbatimLineComment.Internal*) ret; } - private VerbatimLineComment(VerbatimLineComment.Internal native) - : this(__CopyValue(native)) + private VerbatimLineComment(VerbatimLineComment.Internal native, bool skipVTables = false) + : this(__CopyValue(native), skipVTables) { __ownsNativeInstance = true; NativeToManagedMap[__Instance] = this; } - protected VerbatimLineComment(VerbatimLineComment.Internal* native, bool isInternalImpl = false) - : base((CppSharp.Parser.AST.BlockCommandComment.Internal*) native) + protected VerbatimLineComment(VerbatimLineComment.Internal* native, bool skipVTables = false) + : base((CppSharp.Parser.AST.BlockCommandComment.Internal*) null) { + __PointerAdjustment = 0; + if (native == null) + return; + __Instance = new global::System.IntPtr(native); } public VerbatimLineComment() @@ -10486,8 +10771,8 @@ namespace CppSharp { __Instance = Marshal.AllocHGlobal(40); __ownsNativeInstance = true; - Internal.ctor_0(__Instance); NativeToManagedMap[__Instance] = this; + Internal.ctor_0((__Instance + __PointerAdjustment)); } public VerbatimLineComment(CppSharp.Parser.AST.VerbatimLineComment _0) @@ -10495,23 +10780,23 @@ namespace CppSharp { __Instance = Marshal.AllocHGlobal(40); __ownsNativeInstance = true; - var arg0 = ReferenceEquals(_0, null) ? global::System.IntPtr.Zero : _0.__Instance; - Internal.cctor_1(__Instance, arg0); NativeToManagedMap[__Instance] = this; + var arg0 = ReferenceEquals(_0, null) ? global::System.IntPtr.Zero : _0.__Instance; + Internal.cctor_1((__Instance + __PointerAdjustment), arg0); } public string Text { get { - var __ret = Internal.getText_0(__Instance); + var __ret = Internal.getText_0((__Instance + __PointerAdjustment)); return Marshal.PtrToStringAnsi(__ret); } set { var arg0 = Marshal.StringToHGlobalAnsi(value); - Internal.setText_0(__Instance, arg0); + Internal.setText_0((__Instance + __PointerAdjustment), arg0); Marshal.FreeHGlobal(arg0); } } @@ -10541,14 +10826,14 @@ namespace CppSharp internal static extern void cctor_2(global::System.IntPtr instance, global::System.IntPtr _0); } - public static new InlineContentComment __CreateInstance(global::System.IntPtr native, bool ownsNativeInstance = false) + public static new InlineContentComment __CreateInstance(global::System.IntPtr native, bool ownsNativeInstance = false, bool skipVTables = false) { - return new InlineContentComment((InlineContentComment.Internal*) native) { __ownsNativeInstance = ownsNativeInstance }; + return new InlineContentComment((InlineContentComment.Internal*) native, skipVTables) { __ownsNativeInstance = ownsNativeInstance }; } - public static InlineContentComment __CreateInstance(InlineContentComment.Internal native) + public static InlineContentComment __CreateInstance(InlineContentComment.Internal native, bool skipVTables = false) { - return new InlineContentComment(native); + return new InlineContentComment(native, skipVTables); } private static InlineContentComment.Internal* __CopyValue(InlineContentComment.Internal native) @@ -10558,16 +10843,20 @@ namespace CppSharp return ret; } - private InlineContentComment(InlineContentComment.Internal native) - : this(__CopyValue(native)) + private InlineContentComment(InlineContentComment.Internal native, bool skipVTables = false) + : this(__CopyValue(native), skipVTables) { __ownsNativeInstance = true; NativeToManagedMap[__Instance] = this; } - protected InlineContentComment(InlineContentComment.Internal* native, bool isInternalImpl = false) - : base((CppSharp.Parser.AST.Comment.Internal*) native) + protected InlineContentComment(InlineContentComment.Internal* native, bool skipVTables = false) + : base((CppSharp.Parser.AST.Comment.Internal*) null) { + __PointerAdjustment = 0; + if (native == null) + return; + __Instance = new global::System.IntPtr(native); } public InlineContentComment() @@ -10575,8 +10864,8 @@ namespace CppSharp { __Instance = Marshal.AllocHGlobal(4); __ownsNativeInstance = true; - Internal.ctor_0(__Instance); NativeToManagedMap[__Instance] = this; + Internal.ctor_0((__Instance + __PointerAdjustment)); } public InlineContentComment(CppSharp.Parser.AST.CommentKind Kind) @@ -10584,9 +10873,9 @@ namespace CppSharp { __Instance = Marshal.AllocHGlobal(4); __ownsNativeInstance = true; - var arg0 = Kind; - Internal.ctor_1(__Instance, arg0); NativeToManagedMap[__Instance] = this; + var arg0 = Kind; + Internal.ctor_1((__Instance + __PointerAdjustment), arg0); } public InlineContentComment(CppSharp.Parser.AST.InlineContentComment _0) @@ -10594,8 +10883,8 @@ namespace CppSharp { __Instance = Marshal.AllocHGlobal(4); __ownsNativeInstance = true; - *((InlineContentComment.Internal*) __Instance) = *((InlineContentComment.Internal*) _0.__Instance); NativeToManagedMap[__Instance] = this; + *((InlineContentComment.Internal*) __Instance) = *((InlineContentComment.Internal*) _0.__Instance); } } @@ -10646,14 +10935,14 @@ namespace CppSharp internal static extern uint getContentCount_0(global::System.IntPtr instance); } - public static new ParagraphComment __CreateInstance(global::System.IntPtr native, bool ownsNativeInstance = false) + public static new ParagraphComment __CreateInstance(global::System.IntPtr native, bool ownsNativeInstance = false, bool skipVTables = false) { - return new ParagraphComment((ParagraphComment.Internal*) native) { __ownsNativeInstance = ownsNativeInstance }; + return new ParagraphComment((ParagraphComment.Internal*) native, skipVTables) { __ownsNativeInstance = ownsNativeInstance }; } - public static ParagraphComment __CreateInstance(ParagraphComment.Internal native) + public static ParagraphComment __CreateInstance(ParagraphComment.Internal native, bool skipVTables = false) { - return new ParagraphComment(native); + return new ParagraphComment(native, skipVTables); } private static ParagraphComment.Internal* __CopyValue(ParagraphComment.Internal native) @@ -10663,16 +10952,20 @@ namespace CppSharp return (ParagraphComment.Internal*) ret; } - private ParagraphComment(ParagraphComment.Internal native) - : this(__CopyValue(native)) + private ParagraphComment(ParagraphComment.Internal native, bool skipVTables = false) + : this(__CopyValue(native), skipVTables) { __ownsNativeInstance = true; NativeToManagedMap[__Instance] = this; } - protected ParagraphComment(ParagraphComment.Internal* native, bool isInternalImpl = false) - : base((CppSharp.Parser.AST.BlockContentComment.Internal*) native) + protected ParagraphComment(ParagraphComment.Internal* native, bool skipVTables = false) + : base((CppSharp.Parser.AST.BlockContentComment.Internal*) null) { + __PointerAdjustment = 0; + if (native == null) + return; + __Instance = new global::System.IntPtr(native); } public ParagraphComment() @@ -10680,8 +10973,8 @@ namespace CppSharp { __Instance = Marshal.AllocHGlobal(32); __ownsNativeInstance = true; - Internal.ctor_0(__Instance); NativeToManagedMap[__Instance] = this; + Internal.ctor_0((__Instance + __PointerAdjustment)); } public ParagraphComment(CppSharp.Parser.AST.ParagraphComment _0) @@ -10689,14 +10982,14 @@ namespace CppSharp { __Instance = Marshal.AllocHGlobal(32); __ownsNativeInstance = true; - var arg0 = ReferenceEquals(_0, null) ? global::System.IntPtr.Zero : _0.__Instance; - Internal.cctor_2(__Instance, arg0); NativeToManagedMap[__Instance] = this; + var arg0 = ReferenceEquals(_0, null) ? global::System.IntPtr.Zero : _0.__Instance; + Internal.cctor_2((__Instance + __PointerAdjustment), arg0); } public CppSharp.Parser.AST.InlineContentComment getContent(uint i) { - var __ret = Internal.getContent_0(__Instance, i); + var __ret = Internal.getContent_0((__Instance + __PointerAdjustment), i); CppSharp.Parser.AST.InlineContentComment __result0; if (__ret == IntPtr.Zero) __result0 = null; else if (CppSharp.Parser.AST.InlineContentComment.NativeToManagedMap.ContainsKey(__ret)) @@ -10708,19 +11001,19 @@ namespace CppSharp public void addContent(CppSharp.Parser.AST.InlineContentComment s) { var arg0 = ReferenceEquals(s, null) ? global::System.IntPtr.Zero : s.__Instance; - Internal.addContent_0(__Instance, arg0); + Internal.addContent_0((__Instance + __PointerAdjustment), arg0); } public void clearContent() { - Internal.clearContent_0(__Instance); + Internal.clearContent_0((__Instance + __PointerAdjustment)); } public uint ContentCount { get { - var __ret = Internal.getContentCount_0(__Instance); + var __ret = Internal.getContentCount_0((__Instance + __PointerAdjustment)); return __ret; } } @@ -10826,19 +11119,21 @@ namespace CppSharp } public global::System.IntPtr __Instance { get; protected set; } + + protected int __PointerAdjustment; public static readonly System.Collections.Concurrent.ConcurrentDictionary NativeToManagedMap = new System.Collections.Concurrent.ConcurrentDictionary(); protected void*[] __OriginalVTables; protected bool __ownsNativeInstance; - public static Argument __CreateInstance(global::System.IntPtr native, bool ownsNativeInstance = false) + public static Argument __CreateInstance(global::System.IntPtr native, bool ownsNativeInstance = false, bool skipVTables = false) { - return new Argument((Argument.Internal*) native) { __ownsNativeInstance = ownsNativeInstance }; + return new Argument((Argument.Internal*) native, skipVTables) { __ownsNativeInstance = ownsNativeInstance }; } - public static Argument __CreateInstance(Argument.Internal native) + public static Argument __CreateInstance(Argument.Internal native, bool skipVTables = false) { - return new Argument(native); + return new Argument(native, skipVTables); } private static Argument.Internal* __CopyValue(Argument.Internal native) @@ -10848,15 +11143,17 @@ namespace CppSharp return (Argument.Internal*) ret; } - private Argument(Argument.Internal native) - : this(__CopyValue(native)) + private Argument(Argument.Internal native, bool skipVTables = false) + : this(__CopyValue(native), skipVTables) { __ownsNativeInstance = true; NativeToManagedMap[__Instance] = this; } - protected Argument(Argument.Internal* native, bool isInternalImpl = false) + protected Argument(Argument.Internal* native, bool skipVTables = false) { + if (native == null) + return; __Instance = new global::System.IntPtr(native); } @@ -10864,17 +11161,17 @@ namespace CppSharp { __Instance = Marshal.AllocHGlobal(8); __ownsNativeInstance = true; - Internal.ctor_0(__Instance); NativeToManagedMap[__Instance] = this; + Internal.ctor_0((__Instance + __PointerAdjustment)); } public Argument(CppSharp.Parser.AST.InlineCommandComment.Argument _0) { __Instance = Marshal.AllocHGlobal(8); __ownsNativeInstance = true; - var arg0 = ReferenceEquals(_0, null) ? global::System.IntPtr.Zero : _0.__Instance; - Internal.cctor_1(__Instance, arg0); NativeToManagedMap[__Instance] = this; + var arg0 = ReferenceEquals(_0, null) ? global::System.IntPtr.Zero : _0.__Instance; + Internal.cctor_1((__Instance + __PointerAdjustment), arg0); } public void Dispose() @@ -10888,35 +11185,36 @@ namespace CppSharp throw new global::System.InvalidOperationException("Managed instances owned by native code cannot be disposed of."); CppSharp.Parser.AST.InlineCommandComment.Argument __dummy; NativeToManagedMap.TryRemove(__Instance, out __dummy); - Internal.dtor_0(__Instance); - Marshal.FreeHGlobal(__Instance); + Internal.dtor_0((__Instance + __PointerAdjustment)); + if (__ownsNativeInstance) + Marshal.FreeHGlobal(__Instance); } public string Text { get { - var __ret = Internal.getText_0(__Instance); + var __ret = Internal.getText_0((__Instance + __PointerAdjustment)); return Marshal.PtrToStringAnsi(__ret); } set { var arg0 = Marshal.StringToHGlobalAnsi(value); - Internal.setText_0(__Instance, arg0); + Internal.setText_0((__Instance + __PointerAdjustment), arg0); Marshal.FreeHGlobal(arg0); } } } - public static new InlineCommandComment __CreateInstance(global::System.IntPtr native, bool ownsNativeInstance = false) + public static new InlineCommandComment __CreateInstance(global::System.IntPtr native, bool ownsNativeInstance = false, bool skipVTables = false) { - return new InlineCommandComment((InlineCommandComment.Internal*) native) { __ownsNativeInstance = ownsNativeInstance }; + return new InlineCommandComment((InlineCommandComment.Internal*) native, skipVTables) { __ownsNativeInstance = ownsNativeInstance }; } - public static InlineCommandComment __CreateInstance(InlineCommandComment.Internal native) + public static InlineCommandComment __CreateInstance(InlineCommandComment.Internal native, bool skipVTables = false) { - return new InlineCommandComment(native); + return new InlineCommandComment(native, skipVTables); } private static InlineCommandComment.Internal* __CopyValue(InlineCommandComment.Internal native) @@ -10926,16 +11224,20 @@ namespace CppSharp return (InlineCommandComment.Internal*) ret; } - private InlineCommandComment(InlineCommandComment.Internal native) - : this(__CopyValue(native)) + private InlineCommandComment(InlineCommandComment.Internal native, bool skipVTables = false) + : this(__CopyValue(native), skipVTables) { __ownsNativeInstance = true; NativeToManagedMap[__Instance] = this; } - protected InlineCommandComment(InlineCommandComment.Internal* native, bool isInternalImpl = false) - : base((CppSharp.Parser.AST.InlineContentComment.Internal*) native) + protected InlineCommandComment(InlineCommandComment.Internal* native, bool skipVTables = false) + : base((CppSharp.Parser.AST.InlineContentComment.Internal*) null) { + __PointerAdjustment = 0; + if (native == null) + return; + __Instance = new global::System.IntPtr(native); } public InlineCommandComment() @@ -10943,8 +11245,8 @@ namespace CppSharp { __Instance = Marshal.AllocHGlobal(32); __ownsNativeInstance = true; - Internal.ctor_0(__Instance); NativeToManagedMap[__Instance] = this; + Internal.ctor_0((__Instance + __PointerAdjustment)); } public InlineCommandComment(CppSharp.Parser.AST.InlineCommandComment _0) @@ -10952,34 +11254,34 @@ namespace CppSharp { __Instance = Marshal.AllocHGlobal(32); __ownsNativeInstance = true; - var arg0 = ReferenceEquals(_0, null) ? global::System.IntPtr.Zero : _0.__Instance; - Internal.cctor_2(__Instance, arg0); NativeToManagedMap[__Instance] = this; + var arg0 = ReferenceEquals(_0, null) ? global::System.IntPtr.Zero : _0.__Instance; + Internal.cctor_2((__Instance + __PointerAdjustment), arg0); } public CppSharp.Parser.AST.InlineCommandComment.Argument getArguments(uint i) { var __ret = new CppSharp.Parser.AST.InlineCommandComment.Argument.Internal(); - Internal.getArguments_0(new IntPtr(&__ret), __Instance, i); + Internal.getArguments_0(new IntPtr(&__ret), (__Instance + __PointerAdjustment), i); return CppSharp.Parser.AST.InlineCommandComment.Argument.__CreateInstance(__ret); } public void addArguments(CppSharp.Parser.AST.InlineCommandComment.Argument s) { var arg0 = ReferenceEquals(s, null) ? global::System.IntPtr.Zero : s.__Instance; - Internal.addArguments_0(__Instance, arg0); + Internal.addArguments_0((__Instance + __PointerAdjustment), arg0); } public void clearArguments() { - Internal.clearArguments_0(__Instance); + Internal.clearArguments_0((__Instance + __PointerAdjustment)); } public uint ArgumentsCount { get { - var __ret = Internal.getArgumentsCount_0(__Instance); + var __ret = Internal.getArgumentsCount_0((__Instance + __PointerAdjustment)); return __ret; } } @@ -11022,14 +11324,14 @@ namespace CppSharp internal static extern void cctor_2(global::System.IntPtr instance, global::System.IntPtr _0); } - public static new HTMLTagComment __CreateInstance(global::System.IntPtr native, bool ownsNativeInstance = false) + public static new HTMLTagComment __CreateInstance(global::System.IntPtr native, bool ownsNativeInstance = false, bool skipVTables = false) { - return new HTMLTagComment((HTMLTagComment.Internal*) native) { __ownsNativeInstance = ownsNativeInstance }; + return new HTMLTagComment((HTMLTagComment.Internal*) native, skipVTables) { __ownsNativeInstance = ownsNativeInstance }; } - public static HTMLTagComment __CreateInstance(HTMLTagComment.Internal native) + public static HTMLTagComment __CreateInstance(HTMLTagComment.Internal native, bool skipVTables = false) { - return new HTMLTagComment(native); + return new HTMLTagComment(native, skipVTables); } private static HTMLTagComment.Internal* __CopyValue(HTMLTagComment.Internal native) @@ -11039,16 +11341,20 @@ namespace CppSharp return ret; } - private HTMLTagComment(HTMLTagComment.Internal native) - : this(__CopyValue(native)) + private HTMLTagComment(HTMLTagComment.Internal native, bool skipVTables = false) + : this(__CopyValue(native), skipVTables) { __ownsNativeInstance = true; NativeToManagedMap[__Instance] = this; } - protected HTMLTagComment(HTMLTagComment.Internal* native, bool isInternalImpl = false) - : base((CppSharp.Parser.AST.InlineContentComment.Internal*) native) + protected HTMLTagComment(HTMLTagComment.Internal* native, bool skipVTables = false) + : base((CppSharp.Parser.AST.InlineContentComment.Internal*) null) { + __PointerAdjustment = 0; + if (native == null) + return; + __Instance = new global::System.IntPtr(native); } public HTMLTagComment() @@ -11056,8 +11362,8 @@ namespace CppSharp { __Instance = Marshal.AllocHGlobal(4); __ownsNativeInstance = true; - Internal.ctor_0(__Instance); NativeToManagedMap[__Instance] = this; + Internal.ctor_0((__Instance + __PointerAdjustment)); } public HTMLTagComment(CppSharp.Parser.AST.CommentKind Kind) @@ -11065,9 +11371,9 @@ namespace CppSharp { __Instance = Marshal.AllocHGlobal(4); __ownsNativeInstance = true; - var arg0 = Kind; - Internal.ctor_1(__Instance, arg0); NativeToManagedMap[__Instance] = this; + var arg0 = Kind; + Internal.ctor_1((__Instance + __PointerAdjustment), arg0); } public HTMLTagComment(CppSharp.Parser.AST.HTMLTagComment _0) @@ -11075,8 +11381,8 @@ namespace CppSharp { __Instance = Marshal.AllocHGlobal(4); __ownsNativeInstance = true; - *((HTMLTagComment.Internal*) __Instance) = *((HTMLTagComment.Internal*) _0.__Instance); NativeToManagedMap[__Instance] = this; + *((HTMLTagComment.Internal*) __Instance) = *((HTMLTagComment.Internal*) _0.__Instance); } } @@ -11176,19 +11482,21 @@ namespace CppSharp } public global::System.IntPtr __Instance { get; protected set; } + + protected int __PointerAdjustment; public static readonly System.Collections.Concurrent.ConcurrentDictionary NativeToManagedMap = new System.Collections.Concurrent.ConcurrentDictionary(); protected void*[] __OriginalVTables; protected bool __ownsNativeInstance; - public static Attribute __CreateInstance(global::System.IntPtr native, bool ownsNativeInstance = false) + public static Attribute __CreateInstance(global::System.IntPtr native, bool ownsNativeInstance = false, bool skipVTables = false) { - return new Attribute((Attribute.Internal*) native) { __ownsNativeInstance = ownsNativeInstance }; + return new Attribute((Attribute.Internal*) native, skipVTables) { __ownsNativeInstance = ownsNativeInstance }; } - public static Attribute __CreateInstance(Attribute.Internal native) + public static Attribute __CreateInstance(Attribute.Internal native, bool skipVTables = false) { - return new Attribute(native); + return new Attribute(native, skipVTables); } private static Attribute.Internal* __CopyValue(Attribute.Internal native) @@ -11198,15 +11506,17 @@ namespace CppSharp return (Attribute.Internal*) ret; } - private Attribute(Attribute.Internal native) - : this(__CopyValue(native)) + private Attribute(Attribute.Internal native, bool skipVTables = false) + : this(__CopyValue(native), skipVTables) { __ownsNativeInstance = true; NativeToManagedMap[__Instance] = this; } - protected Attribute(Attribute.Internal* native, bool isInternalImpl = false) + protected Attribute(Attribute.Internal* native, bool skipVTables = false) { + if (native == null) + return; __Instance = new global::System.IntPtr(native); } @@ -11214,17 +11524,17 @@ namespace CppSharp { __Instance = Marshal.AllocHGlobal(16); __ownsNativeInstance = true; - Internal.ctor_0(__Instance); NativeToManagedMap[__Instance] = this; + Internal.ctor_0((__Instance + __PointerAdjustment)); } public Attribute(CppSharp.Parser.AST.HTMLStartTagComment.Attribute _0) { __Instance = Marshal.AllocHGlobal(16); __ownsNativeInstance = true; - var arg0 = ReferenceEquals(_0, null) ? global::System.IntPtr.Zero : _0.__Instance; - Internal.cctor_1(__Instance, arg0); NativeToManagedMap[__Instance] = this; + var arg0 = ReferenceEquals(_0, null) ? global::System.IntPtr.Zero : _0.__Instance; + Internal.cctor_1((__Instance + __PointerAdjustment), arg0); } public void Dispose() @@ -11238,22 +11548,23 @@ namespace CppSharp throw new global::System.InvalidOperationException("Managed instances owned by native code cannot be disposed of."); CppSharp.Parser.AST.HTMLStartTagComment.Attribute __dummy; NativeToManagedMap.TryRemove(__Instance, out __dummy); - Internal.dtor_0(__Instance); - Marshal.FreeHGlobal(__Instance); + Internal.dtor_0((__Instance + __PointerAdjustment)); + if (__ownsNativeInstance) + Marshal.FreeHGlobal(__Instance); } public string Name { get { - var __ret = Internal.getName_0(__Instance); + var __ret = Internal.getName_0((__Instance + __PointerAdjustment)); return Marshal.PtrToStringAnsi(__ret); } set { var arg0 = Marshal.StringToHGlobalAnsi(value); - Internal.setName_0(__Instance, arg0); + Internal.setName_0((__Instance + __PointerAdjustment), arg0); Marshal.FreeHGlobal(arg0); } } @@ -11262,27 +11573,27 @@ namespace CppSharp { get { - var __ret = Internal.getValue_0(__Instance); + var __ret = Internal.getValue_0((__Instance + __PointerAdjustment)); return Marshal.PtrToStringAnsi(__ret); } set { var arg0 = Marshal.StringToHGlobalAnsi(value); - Internal.setValue_0(__Instance, arg0); + Internal.setValue_0((__Instance + __PointerAdjustment), arg0); Marshal.FreeHGlobal(arg0); } } } - public static new HTMLStartTagComment __CreateInstance(global::System.IntPtr native, bool ownsNativeInstance = false) + public static new HTMLStartTagComment __CreateInstance(global::System.IntPtr native, bool ownsNativeInstance = false, bool skipVTables = false) { - return new HTMLStartTagComment((HTMLStartTagComment.Internal*) native) { __ownsNativeInstance = ownsNativeInstance }; + return new HTMLStartTagComment((HTMLStartTagComment.Internal*) native, skipVTables) { __ownsNativeInstance = ownsNativeInstance }; } - public static HTMLStartTagComment __CreateInstance(HTMLStartTagComment.Internal native) + public static HTMLStartTagComment __CreateInstance(HTMLStartTagComment.Internal native, bool skipVTables = false) { - return new HTMLStartTagComment(native); + return new HTMLStartTagComment(native, skipVTables); } private static HTMLStartTagComment.Internal* __CopyValue(HTMLStartTagComment.Internal native) @@ -11292,16 +11603,20 @@ namespace CppSharp return (HTMLStartTagComment.Internal*) ret; } - private HTMLStartTagComment(HTMLStartTagComment.Internal native) - : this(__CopyValue(native)) + private HTMLStartTagComment(HTMLStartTagComment.Internal native, bool skipVTables = false) + : this(__CopyValue(native), skipVTables) { __ownsNativeInstance = true; NativeToManagedMap[__Instance] = this; } - protected HTMLStartTagComment(HTMLStartTagComment.Internal* native, bool isInternalImpl = false) - : base((CppSharp.Parser.AST.HTMLTagComment.Internal*) native) + protected HTMLStartTagComment(HTMLStartTagComment.Internal* native, bool skipVTables = false) + : base((CppSharp.Parser.AST.HTMLTagComment.Internal*) null) { + __PointerAdjustment = 0; + if (native == null) + return; + __Instance = new global::System.IntPtr(native); } public HTMLStartTagComment() @@ -11309,8 +11624,8 @@ namespace CppSharp { __Instance = Marshal.AllocHGlobal(40); __ownsNativeInstance = true; - Internal.ctor_0(__Instance); NativeToManagedMap[__Instance] = this; + Internal.ctor_0((__Instance + __PointerAdjustment)); } public HTMLStartTagComment(CppSharp.Parser.AST.HTMLStartTagComment _0) @@ -11318,41 +11633,41 @@ namespace CppSharp { __Instance = Marshal.AllocHGlobal(40); __ownsNativeInstance = true; - var arg0 = ReferenceEquals(_0, null) ? global::System.IntPtr.Zero : _0.__Instance; - Internal.cctor_1(__Instance, arg0); NativeToManagedMap[__Instance] = this; + var arg0 = ReferenceEquals(_0, null) ? global::System.IntPtr.Zero : _0.__Instance; + Internal.cctor_1((__Instance + __PointerAdjustment), arg0); } public CppSharp.Parser.AST.HTMLStartTagComment.Attribute getAttributes(uint i) { var __ret = new CppSharp.Parser.AST.HTMLStartTagComment.Attribute.Internal(); - Internal.getAttributes_0(new IntPtr(&__ret), __Instance, i); + Internal.getAttributes_0(new IntPtr(&__ret), (__Instance + __PointerAdjustment), i); return CppSharp.Parser.AST.HTMLStartTagComment.Attribute.__CreateInstance(__ret); } public void addAttributes(CppSharp.Parser.AST.HTMLStartTagComment.Attribute s) { var arg0 = ReferenceEquals(s, null) ? global::System.IntPtr.Zero : s.__Instance; - Internal.addAttributes_0(__Instance, arg0); + Internal.addAttributes_0((__Instance + __PointerAdjustment), arg0); } public void clearAttributes() { - Internal.clearAttributes_0(__Instance); + Internal.clearAttributes_0((__Instance + __PointerAdjustment)); } public string TagName { get { - var __ret = Internal.getTagName_0(__Instance); + var __ret = Internal.getTagName_0((__Instance + __PointerAdjustment)); return Marshal.PtrToStringAnsi(__ret); } set { var arg0 = Marshal.StringToHGlobalAnsi(value); - Internal.setTagName_0(__Instance, arg0); + Internal.setTagName_0((__Instance + __PointerAdjustment), arg0); Marshal.FreeHGlobal(arg0); } } @@ -11361,7 +11676,7 @@ namespace CppSharp { get { - var __ret = Internal.getAttributesCount_0(__Instance); + var __ret = Internal.getAttributesCount_0((__Instance + __PointerAdjustment)); return __ret; } } @@ -11401,14 +11716,14 @@ namespace CppSharp internal static extern void setTagName_0(global::System.IntPtr instance, global::System.IntPtr s); } - public static new HTMLEndTagComment __CreateInstance(global::System.IntPtr native, bool ownsNativeInstance = false) + public static new HTMLEndTagComment __CreateInstance(global::System.IntPtr native, bool ownsNativeInstance = false, bool skipVTables = false) { - return new HTMLEndTagComment((HTMLEndTagComment.Internal*) native) { __ownsNativeInstance = ownsNativeInstance }; + return new HTMLEndTagComment((HTMLEndTagComment.Internal*) native, skipVTables) { __ownsNativeInstance = ownsNativeInstance }; } - public static HTMLEndTagComment __CreateInstance(HTMLEndTagComment.Internal native) + public static HTMLEndTagComment __CreateInstance(HTMLEndTagComment.Internal native, bool skipVTables = false) { - return new HTMLEndTagComment(native); + return new HTMLEndTagComment(native, skipVTables); } private static HTMLEndTagComment.Internal* __CopyValue(HTMLEndTagComment.Internal native) @@ -11418,16 +11733,20 @@ namespace CppSharp return (HTMLEndTagComment.Internal*) ret; } - private HTMLEndTagComment(HTMLEndTagComment.Internal native) - : this(__CopyValue(native)) + private HTMLEndTagComment(HTMLEndTagComment.Internal native, bool skipVTables = false) + : this(__CopyValue(native), skipVTables) { __ownsNativeInstance = true; NativeToManagedMap[__Instance] = this; } - protected HTMLEndTagComment(HTMLEndTagComment.Internal* native, bool isInternalImpl = false) - : base((CppSharp.Parser.AST.HTMLTagComment.Internal*) native) + protected HTMLEndTagComment(HTMLEndTagComment.Internal* native, bool skipVTables = false) + : base((CppSharp.Parser.AST.HTMLTagComment.Internal*) null) { + __PointerAdjustment = 0; + if (native == null) + return; + __Instance = new global::System.IntPtr(native); } public HTMLEndTagComment() @@ -11435,8 +11754,8 @@ namespace CppSharp { __Instance = Marshal.AllocHGlobal(16); __ownsNativeInstance = true; - Internal.ctor_0(__Instance); NativeToManagedMap[__Instance] = this; + Internal.ctor_0((__Instance + __PointerAdjustment)); } public HTMLEndTagComment(CppSharp.Parser.AST.HTMLEndTagComment _0) @@ -11444,23 +11763,23 @@ namespace CppSharp { __Instance = Marshal.AllocHGlobal(16); __ownsNativeInstance = true; - var arg0 = ReferenceEquals(_0, null) ? global::System.IntPtr.Zero : _0.__Instance; - Internal.cctor_1(__Instance, arg0); NativeToManagedMap[__Instance] = this; + var arg0 = ReferenceEquals(_0, null) ? global::System.IntPtr.Zero : _0.__Instance; + Internal.cctor_1((__Instance + __PointerAdjustment), arg0); } public string TagName { get { - var __ret = Internal.getTagName_0(__Instance); + var __ret = Internal.getTagName_0((__Instance + __PointerAdjustment)); return Marshal.PtrToStringAnsi(__ret); } set { var arg0 = Marshal.StringToHGlobalAnsi(value); - Internal.setTagName_0(__Instance, arg0); + Internal.setTagName_0((__Instance + __PointerAdjustment), arg0); Marshal.FreeHGlobal(arg0); } } @@ -11500,14 +11819,14 @@ namespace CppSharp internal static extern void setText_0(global::System.IntPtr instance, global::System.IntPtr s); } - public static new TextComment __CreateInstance(global::System.IntPtr native, bool ownsNativeInstance = false) + public static new TextComment __CreateInstance(global::System.IntPtr native, bool ownsNativeInstance = false, bool skipVTables = false) { - return new TextComment((TextComment.Internal*) native) { __ownsNativeInstance = ownsNativeInstance }; + return new TextComment((TextComment.Internal*) native, skipVTables) { __ownsNativeInstance = ownsNativeInstance }; } - public static TextComment __CreateInstance(TextComment.Internal native) + public static TextComment __CreateInstance(TextComment.Internal native, bool skipVTables = false) { - return new TextComment(native); + return new TextComment(native, skipVTables); } private static TextComment.Internal* __CopyValue(TextComment.Internal native) @@ -11517,16 +11836,20 @@ namespace CppSharp return (TextComment.Internal*) ret; } - private TextComment(TextComment.Internal native) - : this(__CopyValue(native)) + private TextComment(TextComment.Internal native, bool skipVTables = false) + : this(__CopyValue(native), skipVTables) { __ownsNativeInstance = true; NativeToManagedMap[__Instance] = this; } - protected TextComment(TextComment.Internal* native, bool isInternalImpl = false) - : base((CppSharp.Parser.AST.InlineContentComment.Internal*) native) + protected TextComment(TextComment.Internal* native, bool skipVTables = false) + : base((CppSharp.Parser.AST.InlineContentComment.Internal*) null) { + __PointerAdjustment = 0; + if (native == null) + return; + __Instance = new global::System.IntPtr(native); } public TextComment() @@ -11534,8 +11857,8 @@ namespace CppSharp { __Instance = Marshal.AllocHGlobal(16); __ownsNativeInstance = true; - Internal.ctor_0(__Instance); NativeToManagedMap[__Instance] = this; + Internal.ctor_0((__Instance + __PointerAdjustment)); } public TextComment(CppSharp.Parser.AST.TextComment _0) @@ -11543,23 +11866,23 @@ namespace CppSharp { __Instance = Marshal.AllocHGlobal(16); __ownsNativeInstance = true; - var arg0 = ReferenceEquals(_0, null) ? global::System.IntPtr.Zero : _0.__Instance; - Internal.cctor_1(__Instance, arg0); NativeToManagedMap[__Instance] = this; + var arg0 = ReferenceEquals(_0, null) ? global::System.IntPtr.Zero : _0.__Instance; + Internal.cctor_1((__Instance + __PointerAdjustment), arg0); } public string Text { get { - var __ret = Internal.getText_0(__Instance); + var __ret = Internal.getText_0((__Instance + __PointerAdjustment)); return Marshal.PtrToStringAnsi(__ret); } set { var arg0 = Marshal.StringToHGlobalAnsi(value); - Internal.setText_0(__Instance, arg0); + Internal.setText_0((__Instance + __PointerAdjustment), arg0); Marshal.FreeHGlobal(arg0); } } @@ -11613,19 +11936,21 @@ namespace CppSharp } public global::System.IntPtr __Instance { get; protected set; } + + protected int __PointerAdjustment; public static readonly System.Collections.Concurrent.ConcurrentDictionary NativeToManagedMap = new System.Collections.Concurrent.ConcurrentDictionary(); protected void*[] __OriginalVTables; protected bool __ownsNativeInstance; - public static RawComment __CreateInstance(global::System.IntPtr native, bool ownsNativeInstance = false) + public static RawComment __CreateInstance(global::System.IntPtr native, bool ownsNativeInstance = false, bool skipVTables = false) { - return new RawComment((RawComment.Internal*) native) { __ownsNativeInstance = ownsNativeInstance }; + return new RawComment((RawComment.Internal*) native, skipVTables) { __ownsNativeInstance = ownsNativeInstance }; } - public static RawComment __CreateInstance(RawComment.Internal native) + public static RawComment __CreateInstance(RawComment.Internal native, bool skipVTables = false) { - return new RawComment(native); + return new RawComment(native, skipVTables); } private static RawComment.Internal* __CopyValue(RawComment.Internal native) @@ -11635,15 +11960,17 @@ namespace CppSharp return (RawComment.Internal*) ret; } - private RawComment(RawComment.Internal native) - : this(__CopyValue(native)) + private RawComment(RawComment.Internal native, bool skipVTables = false) + : this(__CopyValue(native), skipVTables) { __ownsNativeInstance = true; NativeToManagedMap[__Instance] = this; } - protected RawComment(RawComment.Internal* native, bool isInternalImpl = false) + protected RawComment(RawComment.Internal* native, bool skipVTables = false) { + if (native == null) + return; __Instance = new global::System.IntPtr(native); } @@ -11651,17 +11978,17 @@ namespace CppSharp { __Instance = Marshal.AllocHGlobal(32); __ownsNativeInstance = true; - Internal.ctor_0(__Instance); NativeToManagedMap[__Instance] = this; + Internal.ctor_0((__Instance + __PointerAdjustment)); } public RawComment(CppSharp.Parser.AST.RawComment _0) { __Instance = Marshal.AllocHGlobal(32); __ownsNativeInstance = true; - var arg0 = ReferenceEquals(_0, null) ? global::System.IntPtr.Zero : _0.__Instance; - Internal.cctor_1(__Instance, arg0); NativeToManagedMap[__Instance] = this; + var arg0 = ReferenceEquals(_0, null) ? global::System.IntPtr.Zero : _0.__Instance; + Internal.cctor_1((__Instance + __PointerAdjustment), arg0); } public void Dispose() @@ -11675,22 +12002,23 @@ namespace CppSharp throw new global::System.InvalidOperationException("Managed instances owned by native code cannot be disposed of."); CppSharp.Parser.AST.RawComment __dummy; NativeToManagedMap.TryRemove(__Instance, out __dummy); - Internal.dtor_0(__Instance); - Marshal.FreeHGlobal(__Instance); + Internal.dtor_0((__Instance + __PointerAdjustment)); + if (__ownsNativeInstance) + Marshal.FreeHGlobal(__Instance); } public string Text { get { - var __ret = Internal.getText_0(__Instance); + var __ret = Internal.getText_0((__Instance + __PointerAdjustment)); return Marshal.PtrToStringAnsi(__ret); } set { var arg0 = Marshal.StringToHGlobalAnsi(value); - Internal.setText_0(__Instance, arg0); + Internal.setText_0((__Instance + __PointerAdjustment), arg0); Marshal.FreeHGlobal(arg0); } } @@ -11699,14 +12027,14 @@ namespace CppSharp { get { - var __ret = Internal.getBriefText_0(__Instance); + var __ret = Internal.getBriefText_0((__Instance + __PointerAdjustment)); return Marshal.PtrToStringAnsi(__ret); } set { var arg0 = Marshal.StringToHGlobalAnsi(value); - Internal.setBriefText_0(__Instance, arg0); + Internal.setBriefText_0((__Instance + __PointerAdjustment), arg0); Marshal.FreeHGlobal(arg0); } } diff --git a/src/CppParser/Bindings/CSharp/x86_64-linux-gnu/CppParser.cs b/src/CppParser/Bindings/CSharp/x86_64-linux-gnu/CppParser.cs index 983c7012..cd91e42e 100644 --- a/src/CppParser/Bindings/CSharp/x86_64-linux-gnu/CppParser.cs +++ b/src/CppParser/Bindings/CSharp/x86_64-linux-gnu/CppParser.cs @@ -234,19 +234,21 @@ namespace CppSharp } public global::System.IntPtr __Instance { get; protected set; } + + protected int __PointerAdjustment; public static readonly System.Collections.Concurrent.ConcurrentDictionary NativeToManagedMap = new System.Collections.Concurrent.ConcurrentDictionary(); protected void*[] __OriginalVTables; protected bool __ownsNativeInstance; - public static ParserOptions __CreateInstance(global::System.IntPtr native, bool ownsNativeInstance = false) + public static ParserOptions __CreateInstance(global::System.IntPtr native, bool ownsNativeInstance = false, bool skipVTables = false) { - return new ParserOptions((ParserOptions.Internal*) native) { __ownsNativeInstance = ownsNativeInstance }; + return new ParserOptions((ParserOptions.Internal*) native, skipVTables) { __ownsNativeInstance = ownsNativeInstance }; } - public static ParserOptions __CreateInstance(ParserOptions.Internal native) + public static ParserOptions __CreateInstance(ParserOptions.Internal native, bool skipVTables = false) { - return new ParserOptions(native); + return new ParserOptions(native, skipVTables); } private static ParserOptions.Internal* __CopyValue(ParserOptions.Internal native) @@ -256,15 +258,17 @@ namespace CppSharp return (ParserOptions.Internal*) ret; } - private ParserOptions(ParserOptions.Internal native) - : this(__CopyValue(native)) + private ParserOptions(ParserOptions.Internal native, bool skipVTables = false) + : this(__CopyValue(native), skipVTables) { __ownsNativeInstance = true; NativeToManagedMap[__Instance] = this; } - protected ParserOptions(ParserOptions.Internal* native, bool isInternalImpl = false) + protected ParserOptions(ParserOptions.Internal* native, bool skipVTables = false) { + if (native == null) + return; __Instance = new global::System.IntPtr(native); } @@ -272,17 +276,17 @@ namespace CppSharp { __Instance = Marshal.AllocHGlobal(200); __ownsNativeInstance = true; - Internal.ctor_0(__Instance); NativeToManagedMap[__Instance] = this; + Internal.ctor_0((__Instance + __PointerAdjustment)); } public ParserOptions(CppSharp.Parser.ParserOptions _0) { __Instance = Marshal.AllocHGlobal(200); __ownsNativeInstance = true; - var arg0 = ReferenceEquals(_0, null) ? global::System.IntPtr.Zero : _0.__Instance; - Internal.cctor_1(__Instance, arg0); NativeToManagedMap[__Instance] = this; + var arg0 = ReferenceEquals(_0, null) ? global::System.IntPtr.Zero : _0.__Instance; + Internal.cctor_1((__Instance + __PointerAdjustment), arg0); } public void Dispose() @@ -296,123 +300,124 @@ namespace CppSharp throw new global::System.InvalidOperationException("Managed instances owned by native code cannot be disposed of."); CppSharp.Parser.ParserOptions __dummy; NativeToManagedMap.TryRemove(__Instance, out __dummy); - Internal.dtor_0(__Instance); - Marshal.FreeHGlobal(__Instance); + Internal.dtor_0((__Instance + __PointerAdjustment)); + if (__ownsNativeInstance) + Marshal.FreeHGlobal(__Instance); } public string getArguments(uint i) { - var __ret = Internal.getArguments_0(__Instance, i); + var __ret = Internal.getArguments_0((__Instance + __PointerAdjustment), i); return Marshal.PtrToStringAnsi(__ret); } public void addArguments(string s) { var arg0 = Marshal.StringToHGlobalAnsi(s); - Internal.addArguments_0(__Instance, arg0); + Internal.addArguments_0((__Instance + __PointerAdjustment), arg0); Marshal.FreeHGlobal(arg0); } public void clearArguments() { - Internal.clearArguments_0(__Instance); + Internal.clearArguments_0((__Instance + __PointerAdjustment)); } public string getIncludeDirs(uint i) { - var __ret = Internal.getIncludeDirs_0(__Instance, i); + var __ret = Internal.getIncludeDirs_0((__Instance + __PointerAdjustment), i); return Marshal.PtrToStringAnsi(__ret); } public void addIncludeDirs(string s) { var arg0 = Marshal.StringToHGlobalAnsi(s); - Internal.addIncludeDirs_0(__Instance, arg0); + Internal.addIncludeDirs_0((__Instance + __PointerAdjustment), arg0); Marshal.FreeHGlobal(arg0); } public void clearIncludeDirs() { - Internal.clearIncludeDirs_0(__Instance); + Internal.clearIncludeDirs_0((__Instance + __PointerAdjustment)); } public string getSystemIncludeDirs(uint i) { - var __ret = Internal.getSystemIncludeDirs_0(__Instance, i); + var __ret = Internal.getSystemIncludeDirs_0((__Instance + __PointerAdjustment), i); return Marshal.PtrToStringAnsi(__ret); } public void addSystemIncludeDirs(string s) { var arg0 = Marshal.StringToHGlobalAnsi(s); - Internal.addSystemIncludeDirs_0(__Instance, arg0); + Internal.addSystemIncludeDirs_0((__Instance + __PointerAdjustment), arg0); Marshal.FreeHGlobal(arg0); } public void clearSystemIncludeDirs() { - Internal.clearSystemIncludeDirs_0(__Instance); + Internal.clearSystemIncludeDirs_0((__Instance + __PointerAdjustment)); } public string getDefines(uint i) { - var __ret = Internal.getDefines_0(__Instance, i); + var __ret = Internal.getDefines_0((__Instance + __PointerAdjustment), i); return Marshal.PtrToStringAnsi(__ret); } public void addDefines(string s) { var arg0 = Marshal.StringToHGlobalAnsi(s); - Internal.addDefines_0(__Instance, arg0); + Internal.addDefines_0((__Instance + __PointerAdjustment), arg0); Marshal.FreeHGlobal(arg0); } public void clearDefines() { - Internal.clearDefines_0(__Instance); + Internal.clearDefines_0((__Instance + __PointerAdjustment)); } public string getUndefines(uint i) { - var __ret = Internal.getUndefines_0(__Instance, i); + var __ret = Internal.getUndefines_0((__Instance + __PointerAdjustment), i); return Marshal.PtrToStringAnsi(__ret); } public void addUndefines(string s) { var arg0 = Marshal.StringToHGlobalAnsi(s); - Internal.addUndefines_0(__Instance, arg0); + Internal.addUndefines_0((__Instance + __PointerAdjustment), arg0); Marshal.FreeHGlobal(arg0); } public void clearUndefines() { - Internal.clearUndefines_0(__Instance); + Internal.clearUndefines_0((__Instance + __PointerAdjustment)); } public string getLibraryDirs(uint i) { - var __ret = Internal.getLibraryDirs_0(__Instance, i); + var __ret = Internal.getLibraryDirs_0((__Instance + __PointerAdjustment), i); return Marshal.PtrToStringAnsi(__ret); } public void addLibraryDirs(string s) { var arg0 = Marshal.StringToHGlobalAnsi(s); - Internal.addLibraryDirs_0(__Instance, arg0); + Internal.addLibraryDirs_0((__Instance + __PointerAdjustment), arg0); Marshal.FreeHGlobal(arg0); } public void clearLibraryDirs() { - Internal.clearLibraryDirs_0(__Instance); + Internal.clearLibraryDirs_0((__Instance + __PointerAdjustment)); } public uint ArgumentsCount { get { - var __ret = Internal.getArgumentsCount_0(__Instance); + var __ret = Internal.getArgumentsCount_0((__Instance + __PointerAdjustment)); return __ret; } } @@ -421,14 +426,14 @@ namespace CppSharp { get { - var __ret = Internal.getFileName_0(__Instance); + var __ret = Internal.getFileName_0((__Instance + __PointerAdjustment)); return Marshal.PtrToStringAnsi(__ret); } set { var arg0 = Marshal.StringToHGlobalAnsi(value); - Internal.setFileName_0(__Instance, arg0); + Internal.setFileName_0((__Instance + __PointerAdjustment), arg0); Marshal.FreeHGlobal(arg0); } } @@ -437,7 +442,7 @@ namespace CppSharp { get { - var __ret = Internal.getIncludeDirsCount_0(__Instance); + var __ret = Internal.getIncludeDirsCount_0((__Instance + __PointerAdjustment)); return __ret; } } @@ -446,7 +451,7 @@ namespace CppSharp { get { - var __ret = Internal.getSystemIncludeDirsCount_0(__Instance); + var __ret = Internal.getSystemIncludeDirsCount_0((__Instance + __PointerAdjustment)); return __ret; } } @@ -455,7 +460,7 @@ namespace CppSharp { get { - var __ret = Internal.getDefinesCount_0(__Instance); + var __ret = Internal.getDefinesCount_0((__Instance + __PointerAdjustment)); return __ret; } } @@ -464,7 +469,7 @@ namespace CppSharp { get { - var __ret = Internal.getUndefinesCount_0(__Instance); + var __ret = Internal.getUndefinesCount_0((__Instance + __PointerAdjustment)); return __ret; } } @@ -473,7 +478,7 @@ namespace CppSharp { get { - var __ret = Internal.getLibraryDirsCount_0(__Instance); + var __ret = Internal.getLibraryDirsCount_0((__Instance + __PointerAdjustment)); return __ret; } } @@ -482,14 +487,14 @@ namespace CppSharp { get { - var __ret = Internal.getTargetTriple_0(__Instance); + var __ret = Internal.getTargetTriple_0((__Instance + __PointerAdjustment)); return Marshal.PtrToStringAnsi(__ret); } set { var arg0 = Marshal.StringToHGlobalAnsi(value); - Internal.setTargetTriple_0(__Instance, arg0); + Internal.setTargetTriple_0((__Instance + __PointerAdjustment), arg0); Marshal.FreeHGlobal(arg0); } } @@ -673,19 +678,21 @@ namespace CppSharp } public global::System.IntPtr __Instance { get; protected set; } + + protected int __PointerAdjustment; public static readonly System.Collections.Concurrent.ConcurrentDictionary NativeToManagedMap = new System.Collections.Concurrent.ConcurrentDictionary(); protected void*[] __OriginalVTables; protected bool __ownsNativeInstance; - public static ParserDiagnostic __CreateInstance(global::System.IntPtr native, bool ownsNativeInstance = false) + public static ParserDiagnostic __CreateInstance(global::System.IntPtr native, bool ownsNativeInstance = false, bool skipVTables = false) { - return new ParserDiagnostic((ParserDiagnostic.Internal*) native) { __ownsNativeInstance = ownsNativeInstance }; + return new ParserDiagnostic((ParserDiagnostic.Internal*) native, skipVTables) { __ownsNativeInstance = ownsNativeInstance }; } - public static ParserDiagnostic __CreateInstance(ParserDiagnostic.Internal native) + public static ParserDiagnostic __CreateInstance(ParserDiagnostic.Internal native, bool skipVTables = false) { - return new ParserDiagnostic(native); + return new ParserDiagnostic(native, skipVTables); } private static ParserDiagnostic.Internal* __CopyValue(ParserDiagnostic.Internal native) @@ -695,15 +702,17 @@ namespace CppSharp return (ParserDiagnostic.Internal*) ret; } - private ParserDiagnostic(ParserDiagnostic.Internal native) - : this(__CopyValue(native)) + private ParserDiagnostic(ParserDiagnostic.Internal native, bool skipVTables = false) + : this(__CopyValue(native), skipVTables) { __ownsNativeInstance = true; NativeToManagedMap[__Instance] = this; } - protected ParserDiagnostic(ParserDiagnostic.Internal* native, bool isInternalImpl = false) + protected ParserDiagnostic(ParserDiagnostic.Internal* native, bool skipVTables = false) { + if (native == null) + return; __Instance = new global::System.IntPtr(native); } @@ -711,17 +720,17 @@ namespace CppSharp { __Instance = Marshal.AllocHGlobal(32); __ownsNativeInstance = true; - Internal.ctor_0(__Instance); NativeToManagedMap[__Instance] = this; + Internal.ctor_0((__Instance + __PointerAdjustment)); } public ParserDiagnostic(CppSharp.Parser.ParserDiagnostic _0) { __Instance = Marshal.AllocHGlobal(32); __ownsNativeInstance = true; - var arg0 = ReferenceEquals(_0, null) ? global::System.IntPtr.Zero : _0.__Instance; - Internal.cctor_1(__Instance, arg0); NativeToManagedMap[__Instance] = this; + var arg0 = ReferenceEquals(_0, null) ? global::System.IntPtr.Zero : _0.__Instance; + Internal.cctor_1((__Instance + __PointerAdjustment), arg0); } public void Dispose() @@ -735,22 +744,23 @@ namespace CppSharp throw new global::System.InvalidOperationException("Managed instances owned by native code cannot be disposed of."); CppSharp.Parser.ParserDiagnostic __dummy; NativeToManagedMap.TryRemove(__Instance, out __dummy); - Internal.dtor_0(__Instance); - Marshal.FreeHGlobal(__Instance); + Internal.dtor_0((__Instance + __PointerAdjustment)); + if (__ownsNativeInstance) + Marshal.FreeHGlobal(__Instance); } public string FileName { get { - var __ret = Internal.getFileName_0(__Instance); + var __ret = Internal.getFileName_0((__Instance + __PointerAdjustment)); return Marshal.PtrToStringAnsi(__ret); } set { var arg0 = Marshal.StringToHGlobalAnsi(value); - Internal.setFileName_0(__Instance, arg0); + Internal.setFileName_0((__Instance + __PointerAdjustment), arg0); Marshal.FreeHGlobal(arg0); } } @@ -759,14 +769,14 @@ namespace CppSharp { get { - var __ret = Internal.getMessage_0(__Instance); + var __ret = Internal.getMessage_0((__Instance + __PointerAdjustment)); return Marshal.PtrToStringAnsi(__ret); } set { var arg0 = Marshal.StringToHGlobalAnsi(value); - Internal.setMessage_0(__Instance, arg0); + Internal.setMessage_0((__Instance + __PointerAdjustment), arg0); Marshal.FreeHGlobal(arg0); } } @@ -865,19 +875,21 @@ namespace CppSharp } public global::System.IntPtr __Instance { get; protected set; } + + protected int __PointerAdjustment; public static readonly System.Collections.Concurrent.ConcurrentDictionary NativeToManagedMap = new System.Collections.Concurrent.ConcurrentDictionary(); protected void*[] __OriginalVTables; protected bool __ownsNativeInstance; - public static ParserResult __CreateInstance(global::System.IntPtr native, bool ownsNativeInstance = false) + public static ParserResult __CreateInstance(global::System.IntPtr native, bool ownsNativeInstance = false, bool skipVTables = false) { - return new ParserResult((ParserResult.Internal*) native) { __ownsNativeInstance = ownsNativeInstance }; + return new ParserResult((ParserResult.Internal*) native, skipVTables) { __ownsNativeInstance = ownsNativeInstance }; } - public static ParserResult __CreateInstance(ParserResult.Internal native) + public static ParserResult __CreateInstance(ParserResult.Internal native, bool skipVTables = false) { - return new ParserResult(native); + return new ParserResult(native, skipVTables); } private static ParserResult.Internal* __CopyValue(ParserResult.Internal native) @@ -887,15 +899,17 @@ namespace CppSharp return (ParserResult.Internal*) ret; } - private ParserResult(ParserResult.Internal native) - : this(__CopyValue(native)) + private ParserResult(ParserResult.Internal native, bool skipVTables = false) + : this(__CopyValue(native), skipVTables) { __ownsNativeInstance = true; NativeToManagedMap[__Instance] = this; } - protected ParserResult(ParserResult.Internal* native, bool isInternalImpl = false) + protected ParserResult(ParserResult.Internal* native, bool skipVTables = false) { + if (native == null) + return; __Instance = new global::System.IntPtr(native); } @@ -903,17 +917,17 @@ namespace CppSharp { __Instance = Marshal.AllocHGlobal(56); __ownsNativeInstance = true; - Internal.ctor_0(__Instance); NativeToManagedMap[__Instance] = this; + Internal.ctor_0((__Instance + __PointerAdjustment)); } public ParserResult(CppSharp.Parser.ParserResult _0) { __Instance = Marshal.AllocHGlobal(56); __ownsNativeInstance = true; - var arg0 = ReferenceEquals(_0, null) ? global::System.IntPtr.Zero : _0.__Instance; - Internal.cctor_1(__Instance, arg0); NativeToManagedMap[__Instance] = this; + var arg0 = ReferenceEquals(_0, null) ? global::System.IntPtr.Zero : _0.__Instance; + Internal.cctor_1((__Instance + __PointerAdjustment), arg0); } public void Dispose() @@ -927,33 +941,34 @@ namespace CppSharp throw new global::System.InvalidOperationException("Managed instances owned by native code cannot be disposed of."); CppSharp.Parser.ParserResult __dummy; NativeToManagedMap.TryRemove(__Instance, out __dummy); - Internal.dtor_0(__Instance); - Marshal.FreeHGlobal(__Instance); + Internal.dtor_0((__Instance + __PointerAdjustment)); + if (__ownsNativeInstance) + Marshal.FreeHGlobal(__Instance); } public CppSharp.Parser.ParserDiagnostic getDiagnostics(uint i) { var __ret = new CppSharp.Parser.ParserDiagnostic.Internal(); - Internal.getDiagnostics_0(new IntPtr(&__ret), __Instance, i); + Internal.getDiagnostics_0(new IntPtr(&__ret), (__Instance + __PointerAdjustment), i); return CppSharp.Parser.ParserDiagnostic.__CreateInstance(__ret); } public void addDiagnostics(CppSharp.Parser.ParserDiagnostic s) { var arg0 = ReferenceEquals(s, null) ? global::System.IntPtr.Zero : s.__Instance; - Internal.addDiagnostics_0(__Instance, arg0); + Internal.addDiagnostics_0((__Instance + __PointerAdjustment), arg0); } public void clearDiagnostics() { - Internal.clearDiagnostics_0(__Instance); + Internal.clearDiagnostics_0((__Instance + __PointerAdjustment)); } public uint DiagnosticsCount { get { - var __ret = Internal.getDiagnosticsCount_0(__Instance); + var __ret = Internal.getDiagnosticsCount_0((__Instance + __PointerAdjustment)); return __ret; } } @@ -1035,19 +1050,21 @@ namespace CppSharp } public global::System.IntPtr __Instance { get; protected set; } + + protected int __PointerAdjustment; public static readonly System.Collections.Concurrent.ConcurrentDictionary NativeToManagedMap = new System.Collections.Concurrent.ConcurrentDictionary(); protected void*[] __OriginalVTables; protected bool __ownsNativeInstance; - public static ClangParser __CreateInstance(global::System.IntPtr native, bool ownsNativeInstance = false) + public static ClangParser __CreateInstance(global::System.IntPtr native, bool ownsNativeInstance = false, bool skipVTables = false) { - return new ClangParser((ClangParser.Internal*) native) { __ownsNativeInstance = ownsNativeInstance }; + return new ClangParser((ClangParser.Internal*) native, skipVTables) { __ownsNativeInstance = ownsNativeInstance }; } - public static ClangParser __CreateInstance(ClangParser.Internal native) + public static ClangParser __CreateInstance(ClangParser.Internal native, bool skipVTables = false) { - return new ClangParser(native); + return new ClangParser(native, skipVTables); } private static ClangParser.Internal* __CopyValue(ClangParser.Internal native) @@ -1057,15 +1074,17 @@ namespace CppSharp return ret; } - private ClangParser(ClangParser.Internal native) - : this(__CopyValue(native)) + private ClangParser(ClangParser.Internal native, bool skipVTables = false) + : this(__CopyValue(native), skipVTables) { __ownsNativeInstance = true; NativeToManagedMap[__Instance] = this; } - protected ClangParser(ClangParser.Internal* native, bool isInternalImpl = false) + protected ClangParser(ClangParser.Internal* native, bool skipVTables = false) { + if (native == null) + return; __Instance = new global::System.IntPtr(native); } @@ -1080,8 +1099,8 @@ namespace CppSharp { __Instance = Marshal.AllocHGlobal(0); __ownsNativeInstance = true; - *((ClangParser.Internal*) __Instance) = *((ClangParser.Internal*) _0.__Instance); NativeToManagedMap[__Instance] = this; + *((ClangParser.Internal*) __Instance) = *((ClangParser.Internal*) _0.__Instance); } public void Dispose() @@ -1095,7 +1114,8 @@ namespace CppSharp throw new global::System.InvalidOperationException("Managed instances owned by native code cannot be disposed of."); CppSharp.Parser.ClangParser __dummy; NativeToManagedMap.TryRemove(__Instance, out __dummy); - Marshal.FreeHGlobal(__Instance); + if (__ownsNativeInstance) + Marshal.FreeHGlobal(__Instance); } public static CppSharp.Parser.ParserResult ParseHeader(CppSharp.Parser.ParserOptions Opts) diff --git a/src/CppParser/Bindings/CSharp/x86_64-linux-gnu/Sources.cs b/src/CppParser/Bindings/CSharp/x86_64-linux-gnu/Sources.cs index 7693db9c..a24bbc0c 100644 --- a/src/CppParser/Bindings/CSharp/x86_64-linux-gnu/Sources.cs +++ b/src/CppParser/Bindings/CSharp/x86_64-linux-gnu/Sources.cs @@ -37,23 +37,23 @@ namespace CppSharp private SourceLocation.Internal __instance; public SourceLocation.Internal __Instance { get { return __instance; } } - public static SourceLocation __CreateInstance(global::System.IntPtr native) + public static SourceLocation __CreateInstance(global::System.IntPtr native, bool skipVTables = false) { - return new SourceLocation((SourceLocation.Internal*) native); + return new SourceLocation((SourceLocation.Internal*) native, skipVTables); } - public static SourceLocation __CreateInstance(SourceLocation.Internal native) + public static SourceLocation __CreateInstance(SourceLocation.Internal native, bool skipVTables = false) { - return new SourceLocation(native); + return new SourceLocation(native, skipVTables); } - private SourceLocation(SourceLocation.Internal native) + private SourceLocation(SourceLocation.Internal native, bool skipVTables = false) : this() { __instance = native; } - private SourceLocation(SourceLocation.Internal* native, bool isInternalImpl = false) : this() + private SourceLocation(SourceLocation.Internal* native, bool skipVTables = false) : this() { __instance = *native; } diff --git a/src/CppParser/Bindings/CSharp/x86_64-linux-gnu/Target.cs b/src/CppParser/Bindings/CSharp/x86_64-linux-gnu/Target.cs index b673c277..377920b5 100644 --- a/src/CppParser/Bindings/CSharp/x86_64-linux-gnu/Target.cs +++ b/src/CppParser/Bindings/CSharp/x86_64-linux-gnu/Target.cs @@ -171,19 +171,21 @@ namespace CppSharp } public global::System.IntPtr __Instance { get; protected set; } + + protected int __PointerAdjustment; public static readonly System.Collections.Concurrent.ConcurrentDictionary NativeToManagedMap = new System.Collections.Concurrent.ConcurrentDictionary(); protected void*[] __OriginalVTables; protected bool __ownsNativeInstance; - public static ParserTargetInfo __CreateInstance(global::System.IntPtr native, bool ownsNativeInstance = false) + public static ParserTargetInfo __CreateInstance(global::System.IntPtr native, bool ownsNativeInstance = false, bool skipVTables = false) { - return new ParserTargetInfo((ParserTargetInfo.Internal*) native) { __ownsNativeInstance = ownsNativeInstance }; + return new ParserTargetInfo((ParserTargetInfo.Internal*) native, skipVTables) { __ownsNativeInstance = ownsNativeInstance }; } - public static ParserTargetInfo __CreateInstance(ParserTargetInfo.Internal native) + public static ParserTargetInfo __CreateInstance(ParserTargetInfo.Internal native, bool skipVTables = false) { - return new ParserTargetInfo(native); + return new ParserTargetInfo(native, skipVTables); } private static ParserTargetInfo.Internal* __CopyValue(ParserTargetInfo.Internal native) @@ -193,15 +195,17 @@ namespace CppSharp return (ParserTargetInfo.Internal*) ret; } - private ParserTargetInfo(ParserTargetInfo.Internal native) - : this(__CopyValue(native)) + private ParserTargetInfo(ParserTargetInfo.Internal native, bool skipVTables = false) + : this(__CopyValue(native), skipVTables) { __ownsNativeInstance = true; NativeToManagedMap[__Instance] = this; } - protected ParserTargetInfo(ParserTargetInfo.Internal* native, bool isInternalImpl = false) + protected ParserTargetInfo(ParserTargetInfo.Internal* native, bool skipVTables = false) { + if (native == null) + return; __Instance = new global::System.IntPtr(native); } @@ -209,17 +213,17 @@ namespace CppSharp { __Instance = Marshal.AllocHGlobal(160); __ownsNativeInstance = true; - Internal.ctor_0(__Instance); NativeToManagedMap[__Instance] = this; + Internal.ctor_0((__Instance + __PointerAdjustment)); } public ParserTargetInfo(CppSharp.Parser.ParserTargetInfo _0) { __Instance = Marshal.AllocHGlobal(160); __ownsNativeInstance = true; - var arg0 = ReferenceEquals(_0, null) ? global::System.IntPtr.Zero : _0.__Instance; - Internal.cctor_1(__Instance, arg0); NativeToManagedMap[__Instance] = this; + var arg0 = ReferenceEquals(_0, null) ? global::System.IntPtr.Zero : _0.__Instance; + Internal.cctor_1((__Instance + __PointerAdjustment), arg0); } public void Dispose() @@ -233,22 +237,23 @@ namespace CppSharp throw new global::System.InvalidOperationException("Managed instances owned by native code cannot be disposed of."); CppSharp.Parser.ParserTargetInfo __dummy; NativeToManagedMap.TryRemove(__Instance, out __dummy); - Internal.dtor_0(__Instance); - Marshal.FreeHGlobal(__Instance); + Internal.dtor_0((__Instance + __PointerAdjustment)); + if (__ownsNativeInstance) + Marshal.FreeHGlobal(__Instance); } public string ABI { get { - var __ret = Internal.getABI_0(__Instance); + var __ret = Internal.getABI_0((__Instance + __PointerAdjustment)); return Marshal.PtrToStringAnsi(__ret); } set { var arg0 = Marshal.StringToHGlobalAnsi(value); - Internal.setABI_0(__Instance, arg0); + Internal.setABI_0((__Instance + __PointerAdjustment), arg0); Marshal.FreeHGlobal(arg0); } }