Пример #1
0
 public PInvokeImplementation(MetaDataMember member, PInvokeImplAttributes attributes, ModuleReference moduleRef, string entrypoint)
     : base(new MetaDataRow((uint)attributes, (uint) 0, (uint) 0, moduleRef.TableIndex))
 {
     this._member      = member;
     this._importScope = moduleRef;
     this._entrypoint  = entrypoint;
 }
Пример #2
0
 public PInvokeImplementation(MetaDataMember member, PInvokeImplAttributes attributes, ModuleReference moduleRef, string entrypoint)
     : base(new MetaDataRow((uint)attributes, (uint)0, (uint)0, moduleRef.TableIndex))
 {
     this._member = member;
     this._importScope = moduleRef;
     this._entrypoint = entrypoint;
 }
Пример #3
0
 public bool ValidateReference(MetaDataMember member)
 {
     if (member.ToString() == _tokenResolver.ResolveMember(member._metadatatoken).ToString())
     {
         return(false);
     }
     return(true);
 }
Пример #4
0
        internal MetaDataMember CreateMember(Type type, MetaDataRow row, MetaDataTableType table, int index)
        {
            MetaDataMember member = (MetaDataMember)Activator.CreateInstance(type, row);

            member._table         = table;
            member._netheader     = tablesHeap._netheader;
            member._metadatatoken = (uint)(((int)table) << 24 | index);
            return(member);
        }
Пример #5
0
 public override void ClearCache()
 {
     if (_stream != null)
     {
         _stream.Dispose();
     }
     _stream         = null;
     _name           = null;
     _implementation = null;
 }
Пример #6
0
 public void AddMember(MetaDataMember member)
 {
     //member._metadatatoken = (uint)(((uint)_type << 24) + Members.Count + 1);
     //
     //var mdrow = member.MetaDataRow;
     //mdrow.Offset = 0;
     //member.MetaDataRow = mdrow;
     //
     //_rowAmount++;
     //member._netheader = TablesHeap._netheader;
     //Array.Resize(ref _members, Members.Count + 1);
     //Members[Members.Count - 1] = member;
 }
Пример #7
0
 public void RemoveMember(MetaDataMember member)
 {
     //uint index = member.TableIndex - 1;
     //member._netheader = null;
     //for (uint i = index; i < Members.Count - 1; i++)
     //{
     //    _members[i] = _members[i + 1];
     //    _members[i]._metadatatoken--;
     //}
     //Members[_members.Count - 1] = null;
     //_rowAmount--;
     //Array.Resize(ref _members, Members.Count - 1);
 }
Пример #8
0
        public uint GetCodedIndex(MetaDataMember member)
        {
            if (member == null)
            {
                return(0);
            }

            MetaDataTable table = _tables.FirstOrDefault(t => t != null && t.Type == member.TableType);

            if (table == null)
            {
                throw new ArgumentException("Member does not belong to the metadata table group.");
            }

            uint rowIndex   = ((uint)(member._metadatatoken - ((uint)table.Type << 24)));
            uint tableIndex = (uint)Array.IndexOf(_tables, table);

            return((rowIndex << _bits) | tableIndex);
        }
Пример #9
0
        public static MemberRange <T> CreateRange <T>(MetaDataMember member, int mdrowIndex, MetaDataTable targetTable) where T : MetaDataMember
        {
            MemberRange <T> range = new MemberRange <T>();

            range.Start = Convert.ToInt32(member.MetaDataRow.Parts[mdrowIndex]) - 1;

            if (targetTable == null)
            {
                range.Length = 0;
                return(range);
            }

            range.TargetTable = targetTable;

            int memberIndex = (int)(member._metadatatoken | (0xFF << 24)) - (0xFF << 24);

            if (member.Table != null)
            {
                if (memberIndex == member.Table.AmountOfRows)
                {
                    range.Length = targetTable.AmountOfRows - range.Start;
                }
                else
                {
                    int nextIndex = Convert.ToInt32(member.Table.Members[memberIndex].MetaDataRow.Parts[mdrowIndex]) - 1;
                    range.Length = nextIndex - range.Start;
                }
            }

            if (range.Length > targetTable.AmountOfRows - range.Start)
            {
                range.Length = 0;
            }

            return(range);
        }
Пример #10
0
 public override void LoadCache()
 {
     _value = Value;
     _parent = Parent;
 }
Пример #11
0
 public override void ClearCache()
 {
     _method = null;
     _association = null;
 }
Пример #12
0
 public Constant(MetaDataMember parent, ElementType type, uint signature)
     : base(new MetaDataRow((byte)type, 0U, signature))
 {
 }
Пример #13
0
 public MethodSemantics(MethodDefinition method, MetaDataMember association, MethodSemanticsAttributes attributes)
     : base(new MetaDataRow((uint)attributes, method.TableIndex, (uint) 0))
 {
     this._method      = method;
     this._association = association;
 }
Пример #14
0
 public override void LoadCache()
 {
     _method      = Method;
     _association = Association;
 }
Пример #15
0
 public CustomAttribute(MetaDataMember parent, MethodReference constructor, uint value)
     : base(new MetaDataRow(0U,0U, value))
 {
     this._parent = parent;
     this._constructor = constructor;
 }
Пример #16
0
 public override void ClearCache()
 {
     _value = null;
     _parent = null;
 }
Пример #17
0
 public SecurityDeclaration(SecurityAction Action, MetaDataMember parent, uint permissionSet)
     : base(new MetaDataRow((ushort)Action, 0U, permissionSet))
 {
 }
Пример #18
0
 public override void LoadCache()
 {
     _parent = Parent;
 }
Пример #19
0
 public override void ClearCache()
 {
     _implementation = null;
 }
Пример #20
0
 public override void LoadCache()
 {
     _implementation = Implementation;
 }
Пример #21
0
 public override void LoadCache()
 {
     _implementation = Implementation;
 }
Пример #22
0
 public override void ClearCache()
 {
     _implementation = null;
 }
Пример #23
0
 public FieldMarshal(MetaDataMember parent, uint nativeType)
     : base(new MetaDataRow((uint) 0, nativeType))
 {
     this._parent = parent;
 }
Пример #24
0
 public override void LoadCache()
 {
     _parent = Parent;
     _constructor = Constructor;
     _signature = Signature;
 }
Пример #25
0
 public override void ClearCache()
 {
     _parent = null;
     _constructor = null;
     _signature = null;
 }
Пример #26
0
 public override void LoadCache()
 {
     _member      = Member;
     _entrypoint  = Entrypoint;
     _importScope = ImportScope;
 }
Пример #27
0
 public override void LoadCache()
 {
     _stream         = Stream;
     _name           = Name;
     _implementation = Implementation;
 }
Пример #28
0
 public Constant(MetaDataMember parent, ElementType type, uint signature)
     : base(new MetaDataRow((byte)type, 0U, signature))
 {
 }
Пример #29
0
 public FieldMarshal(MetaDataMember parent, uint nativeType)
     : base(new MetaDataRow((uint)0, nativeType))
 {
     this._parent = parent;
 }
Пример #30
0
 public override void LoadCache()
 {
     _value = Value;
     _parent = Parent;
 }
Пример #31
0
 public SecurityDeclaration(SecurityAction Action, MetaDataMember parent, uint permissionSet)
     : base(new MetaDataRow((ushort)Action, 0U, permissionSet))
 {
 }
Пример #32
0
 public override void ClearCache()
 {
     _method      = null;
     _association = null;
 }
Пример #33
0
 public override void LoadCache()
 {
     _parent = Parent;
 }
Пример #34
0
 public MethodSemantics(MethodDefinition method, MetaDataMember association, MethodSemanticsAttributes attributes)
     : base(new MetaDataRow((uint)attributes, method.TableIndex, (uint)0))
 {
     this._method = method;
     this._association = association;
 }
Пример #35
0
 public override void ClearCache()
 {
     _parent      = null;
     _constructor = null;
     _signature   = null;
 }
Пример #36
0
 public override void LoadCache()
 {
     _method = Method;
     _association = Association;
 }
Пример #37
0
 public override void ClearCache()
 {
     if (_stream != null)
         _stream.Dispose();
     _stream = null;
     _name = null;
     _implementation = null;
 }
Пример #38
0
 public override void ClearCache()
 {
     _value = null;
     _parent = null;
 }
Пример #39
0
 public ManifestResource(string name, ManifestResourceAttributes attributes, MetaDataMember implementation, uint offset)
     : base(new MetaDataRow(offset, (uint)attributes, 0U, 0U))
 {
     this._name = name;
     this._implementation = implementation;
 }
Пример #40
0
 public CustomAttribute(MetaDataMember parent, MethodReference constructor, uint value)
     : base(new MetaDataRow(0U, 0U, value))
 {
     this._parent      = parent;
     this._constructor = constructor;
 }
Пример #41
0
 public ManifestResource(string name, ManifestResourceAttributes attributes, MetaDataMember implementation, uint offset)
     : base(new MetaDataRow(offset, (uint)attributes, 0U, 0U))
 {
     this._name           = name;
     this._implementation = implementation;
 }
Пример #42
0
 public override void LoadCache()
 {
     _parent      = Parent;
     _constructor = Constructor;
     _signature   = Signature;
 }
Пример #43
0
 public override void ClearCache()
 {
     _member = null;
     _entrypoint = null;
     _importScope = null;
 }
Пример #44
0
 public override void LoadCache()
 {
     _stream = Stream;
     _name = Name;
     _implementation = Implementation;
 }
Пример #45
0
 public override void LoadCache()
 {
     _member = Member;
     _entrypoint = Entrypoint;
     _importScope = ImportScope;
 }
Пример #46
0
 public bool ValidateReference(MetaDataMember member)
 {
     if (member.ToString() == _tokenResolver.ResolveMember(member._metadatatoken).ToString())
         return false;
     return true;
 }
Пример #47
0
 public override void ClearCache()
 {
     _member      = null;
     _entrypoint  = null;
     _importScope = null;
 }