/// <summary> /// Alias: PTR_HOST_MEMBER_TADDR /// </summary> internal static unsafe Pointer <byte> FieldOffset <TField>(TField *field, int offset) where TField : unmanaged { // m_methodTable.GetValue(PTR_HOST_MEMBER_TADDR(MethodDescChunk, this, m_methodTable)); //const int MT_FIELD_OFS = 0; //return (MethodTable*) (MT_FIELD_OFS + ((long) MethodTableRaw)); // // Construct a pointer to a member of the given type. // #define PTR_HOST_MEMBER_TADDR(type, host, memb) \ // (PTR_HOST_TO_TADDR(host) + (TADDR)offsetof(type, memb)) return((Pointer <byte>)(offset + ((long)field))); }
/// <summary> /// Alias: PTR_HOST_MEMBER_TADDR /// </summary> internal static unsafe Pointer <byte> FieldOffset <TClr, TField>(TField *field, string name, bool isProperty = false) where TField : unmanaged { return(FieldOffset(field, OffsetOf <TClr>(name, OffsetOfType.Marshal, isProperty))); }