internal override void ResolveParent(PEReader buff, bool isExtern) { if (parent != null) { return; } CIx cIx = CIx.ResolutionScope; if (isExtern) { cIx = CIx.Implementation; } parent = (ClassRef)buff.GetCodedElement(cIx, resScopeIx); parent.ResolveParent(buff, isExtern); parent = (ClassRef)buff.GetCodedElement(cIx, resScopeIx); if (parent == null) { return; } NestedClassRef existing = parent.GetNestedClass(Name); if (existing == null) { scope = parent.GetScope(); parent.AddToClassList(this); } else if (isExtern) { buff.InsertInTable(MDTable.ExportedType, Row, existing); } else { buff.InsertInTable(MDTable.TypeRef, Row, existing); } }
internal uint CodedIndexSize(CIx code) { if (lgeCIx[(uint)code]) { return(4); } return(2); }
internal sealed override uint GetCodedIx(CIx code) { switch (code) { case (CIx.HasCustomAttr): return(17); case (CIx.Implementation): return(2); } return(0); }
internal sealed override uint GetCodedIx(CIx code) { switch (code) { case (CIx.HasCustomAttr): return(14); case (CIx.HasDeclSecurity): return(2); } return(0); }
internal sealed override uint GetCodedIx(CIx code) { switch (code) { case (CIx.HasCustomAttr): return(7); case (CIx.ResolutionScope): return(0); } return(0); }
internal sealed override uint GetCodedIx(CIx code) { switch (code) { case (CIx.HasCustomAttr): return(10); case (CIx.HasSemantics): return(0); } return(0); }
internal sealed override uint GetCodedIx(CIx code) { switch (code) { case (CIx.TypeDefOrRef): return(2); case (CIx.HasCustomAttr): return(13); case (CIx.MemberRefParent): return(4); } return(0); }
internal sealed override uint GetCodedIx(CIx code) { switch (code) { case (CIx.HasCustomAttr): return(12); case (CIx.MemberRefParent): return(2); case (CIx.ResolutionScope): return(1); } return(0); }
internal sealed override uint GetCodedIx(CIx code) { switch (code) { case (CIx.HasCustomAttr): return(6); case (CIx.MethodDefOrRef): return(1); case (CIx.CustomAttributeType): return(3); } return(0); }
internal sealed override uint GetCodedIx(CIx code) { switch (code) { case (CIx.HasConstant): return(0); case (CIx.HasCustomAttr): return(1); case (CIx.HasFieldMarshal): return(0); case (CIx.MemberForwarded): return(0); } return(0); }
internal void WriteCodedIndex(CIx code, MetaDataElement elem, PEWriter output) { uint ix = 0; if (elem != null) { ix = (elem.Row << CIxShiftMap[(uint)code]) | elem.GetCodedIx(code); // Console.WriteLine("coded index = " + ix + " row = " + elem.Row); //} else { // Console.WriteLine("elem for coded index is null"); } if (lgeCIx[(uint)code]) { output.Write(ix); } else { output.Write((ushort)ix); } }
internal sealed override uint GetCodedIx(CIx code) { switch (code) { case (CIx.HasCustomAttr): return(0); case (CIx.HasDeclSecurity): return(1); case (CIx.MemberRefParent): return(3); case (CIx.MethodDefOrRef): return(0); case (CIx.MemberForwarded): return(1); case (CIx.CustomAttributeType): return(2); case (CIx.TypeOrMethodDef): return(1); } return(0); }
internal virtual void ResolveParent(PEReader buff, bool isExtern) { CIx cIx = CIx.ResolutionScope; if (isExtern) { cIx = CIx.Implementation; } if (scope != null) { return; } MetaDataElement parentScope = buff.GetCodedElement(cIx, resScopeIx); if (parentScope is Module) { // special code for glitch in Everett ilasm ClassDef newDef = new ClassDef((PEFile)parentScope, 0, NameSpace, Name); ((Module)parentScope).AddToClassList(newDef); buff.InsertInTable(MDTable.TypeRef, Row, newDef); } else { scope = (ReferenceScope)buff.GetCodedElement(cIx, resScopeIx); ClassRef existing = (ClassRef)scope.GetExistingClass(NameSpace, Name); if (existing == null) { scope.AddToClassList(this); } else { if (isExtern) { buff.InsertInTable(MDTable.ExportedType, Row, existing); } else { buff.InsertInTable(MDTable.TypeRef, Row, existing); } } } }
internal void WriteCodedIndex(CIx code, MetaDataElement elem) { metaData.WriteCodedIndex(code,elem,this); }
internal sealed override uint GetCodedIx(CIx code) { return (uint)tabIx; }
internal override sealed uint GetCodedIx(CIx code) { return 5; }
internal void WriteCodedIndex(CIx code, MetaDataElement elem) { Contract.Requires(elem != null); metaData.WriteCodedIndex(code, elem, this); }
internal sealed override uint GetCodedIx(CIx code) { return((uint)tabIx); }
internal override sealed uint GetCodedIx(CIx code) { switch (code) { case (CIx.HasCustomAttr) : return 10; case (CIx.HasSemantics) : return 0; } return 0; }
internal uint CodedIndexSize(CIx code) { if (lgeCIx[(uint)code]) return 4; return 2; }
internal sealed override uint GetCodedIx(CIx code) { switch (code) { case (CIx.HasCustomAttr) : return 16; case (CIx.Implementation) : return 0; } return 0; }
internal sealed override uint GetCodedIx(CIx code) { return 6; }
internal sealed override uint GetCodedIx(CIx code) { switch (code) { case (CIx.HasCustomAttr) : return 6; case (CIx.MethodDefOrRef) : return 1; case (CIx.CustomAttributeType) : return 3; } return 0; }
internal sealed override uint GetCodedIx(CIx code) { switch (code) { case (CIx.HasCustomAttr) : return 9; case (CIx.HasConst) : return 2; case (CIx.HasSemantics) : return 1; } return 0; }
internal sealed override uint GetCodedIx(CIx code) { switch (code) { case (CIx.HasCustomAttr) : return 7; case (CIx.ResolutionScope) : return 0; } return 0; }
internal virtual uint GetCodedIx(CIx code) { return 0; }
internal sealed override uint GetCodedIx(CIx code) { switch (code) { case (CIx.TypeDefOrRef) : return 0; case (CIx.HasCustomAttr) : return 3; case (CIx.HasDeclSecurity) : return 0; case (CIx.TypeOrMethodDef) : return 0; } return 0; }
internal sealed override uint GetCodedIx (CIx code) { switch (code) { case (CIx.TypeDefOrRef): return 2; case (CIx.MemberRefParent): return 4; case (CIx.HasCustomAttr): return 13; } return 0; }
internal sealed override uint GetCodedIx(CIx code) { return(6); }
internal sealed override uint GetCodedIx(CIx code) { switch (code) { case (CIx.HasCustomAttr) : return 14; case (CIx.HasDeclSecurity) : return 2; } return 0; }
internal override sealed uint GetCodedIx(CIx code) { switch (code) { case (CIx.HasCustomAttr) : return 4; case (CIx.HasConstant) : return 1; case (CIx.HasFieldMarshal) : return 1; } return 0; }
internal sealed override uint GetCodedIx(CIx code) { switch (code) { case (CIx.HasCustomAttr) : return 12; case (CIx.MemberRefParent) : return 2; case (CIx.ResolutionScope) : return 1; } return 0; }
internal uint CodedIndex(CIx code, uint ix) { ix >>= MetaData.CIxShiftMap[(uint)code]; return ix; }
internal sealed override uint GetCodedIx(CIx code) { switch (code) { case (CIx.HasConst) : return 0; case (CIx.HasCustomAttr) : return 1; case (CIx.HasFieldMarshal) : return 0; case (CIx.MemberForwarded) : return 0; } return 0; }
internal MDTable CodedTable(CIx code, uint ix) { uint mask = (uint)MetaData.CIxBitMasks[MetaData.CIxShiftMap[(uint)code]]; return (MDTable)MetaData.CIxTables[(int)code][(ix & mask)]; }
internal sealed override uint GetCodedIx(CIx code) { switch (code) { case (CIx.HasCustomAttr) : return 0; case (CIx.HasDeclSecurity) : return 1; case (CIx.MemberRefParent) : return 3; case (CIx.MethodDefOrRef) : return 0; case (CIx.MemberForwarded) : return 1; case (CIx.CustomAttributeType) : return 2; case (CIx.TypeOrMethodDef) : return 1; } return 0; }
internal MetaDataElement GetCodedElement(CIx code, uint ix) { uint mask = (uint)MetaData.CIxBitMasks[MetaData.CIxShiftMap[(uint)code]]; int tabIx = MetaData.CIxTables[(int)code][(ix & mask)]; ix >>= MetaData.CIxShiftMap[(uint)code]; if (ix == 0) return null; MetaDataElement elem = (MetaDataElement)tables[tabIx][(int)ix-1]; if ((elem != null) && (elem.unresolved)) { elem.Resolve(this); elem = (MetaDataElement)tables[tabIx][(int)ix-1]; } return elem; }
internal sealed override uint GetCodedIx(CIx code) { switch (code) { case (CIx.ResolutionScope) : return 2; case (CIx.HasCustomAttr) : return 15; case (CIx.Implementation) : return 1; } return 0; }
internal uint GetCodedIndex(CIx codedIx) { if (md.lgeCIx[(int)codedIx]) return ReadUInt32(); return ReadUInt16(); }
internal void WriteCodedIndex(CIx code, MetaDataElement elem, FileImage output) { uint ix = 0; if (elem != null) { ix = (elem.Row << CIxShiftMap[(uint)code]) | elem.GetCodedIx(code); // Console.WriteLine("coded index = " + ix + " row = " + elem.Row); //} else { // Console.WriteLine("elem for coded index is null"); } if (lgeCIx[(uint)code]) output.Write(ix); else output.Write((ushort)ix); }
internal uint MakeCodedIndex(CIx code, MDTable tab, uint ix) { ix <<= MetaData.CIxShiftMap[(uint)code]; ix &= (uint)tab; return ix; }
internal sealed override uint GetCodedIx(CIx code) { switch (code) { case (CIx.HasCustomAttr) : return 19; } return 0; }
internal override sealed uint GetCodedIx(CIx code) { switch (code) { case (CIx.TypeDefOrRef) : return 1; case (CIx.HasCustomAttr) : return 2; case (CIx.MemberRefParent) : return 1; case (CIx.ResolutionScope) : return 3; } return 0; }