Exemplo n.º 1
0
 internal sealed override void BuildTables(MetaDataOut md)
 {
     md.AddToTable(MDTable.Field, this);
     nameIx = md.AddToStringsHeap(name);
     if (!type.isDef())
     {
         type.BuildMDTables(md);
     }
     if (initVal != null)
     {
         FieldRVA rva = new FieldRVA(this, initVal);
         rva.BuildMDTables(md);
     }
     if (constVal != null)
     {
         ConstantElem constElem = new ConstantElem(this, constVal);
         constElem.BuildMDTables(md);
     }
     if (hasOffset)
     {
         FieldLayout layout = new FieldLayout(this, offset);
         layout.BuildMDTables(md);
     }
     if (marshalType != null)
     {
         FieldMarshal marshalInfo = new FieldMarshal(this, marshalType);
         marshalInfo.BuildMDTables(md);
     }
 }
Exemplo n.º 2
0
 internal static void Read(PEReader buff, TableRow[] layouts)
 {
     for (int i = 0; i < layouts.Length; i++)
     {
         layouts[i] = new FieldLayout(buff);
     }
 }
Exemplo n.º 3
0
 internal void CalcElemSize()
 {
     elemSize[(int)MDTable.Assembly]             = Assembly.Size(this);
     elemSize[(int)MDTable.AssemblyOS]           = 12;
     elemSize[(int)MDTable.AssemblyProcessor]    = 4;
     elemSize[(int)MDTable.AssemblyRefOS]        = 12 + TableIndexSize(MDTable.AssemblyRef);
     elemSize[(int)MDTable.AssemblyRefProcessor] = 4 + TableIndexSize(MDTable.AssemblyRef);
     elemSize[(int)MDTable.Module]                 = Module.Size(this);
     elemSize[(int)MDTable.TypeRef]                = ClassRef.Size(this);
     elemSize[(int)MDTable.TypeDef]                = ClassDef.Size(this);
     elemSize[(int)MDTable.Field]                  = FieldDef.Size(this);
     elemSize[(int)MDTable.Method]                 = MethodDef.Size(this);
     elemSize[(int)MDTable.Param]                  = Param.Size(this);
     elemSize[(int)MDTable.InterfaceImpl]          = InterfaceImpl.Size(this);
     elemSize[(int)MDTable.MemberRef]              = FieldRef.Size(this);
     elemSize[(int)MDTable.Constant]               = ConstantElem.Size(this);
     elemSize[(int)MDTable.CustomAttribute]        = CustomAttribute.Size(this);
     elemSize[(int)MDTable.FieldMarshal]           = FieldMarshal.Size(this);
     elemSize[(int)MDTable.DeclSecurity]           = DeclSecurity.Size(this);
     elemSize[(int)MDTable.ClassLayout]            = ClassLayout.Size(this);
     elemSize[(int)MDTable.FieldLayout]            = FieldLayout.Size(this);
     elemSize[(int)MDTable.StandAloneSig]          = Signature.Size(this);
     elemSize[(int)MDTable.EventMap]               = MapElem.Size(this, MDTable.EventMap);
     elemSize[(int)MDTable.Event]                  = Event.Size(this);
     elemSize[(int)MDTable.PropertyMap]            = MapElem.Size(this, MDTable.PropertyMap);
     elemSize[(int)MDTable.Property]               = Property.Size(this);
     elemSize[(int)MDTable.MethodSemantics]        = MethodSemantics.Size(this);
     elemSize[(int)MDTable.MethodImpl]             = MethodImpl.Size(this);
     elemSize[(int)MDTable.ModuleRef]              = ModuleRef.Size(this);
     elemSize[(int)MDTable.TypeSpec]               = TypeSpec.Size(this);
     elemSize[(int)MDTable.ImplMap]                = ImplMap.Size(this);
     elemSize[(int)MDTable.FieldRVA]               = FieldRVA.Size(this);
     elemSize[(int)MDTable.Assembly]               = Assembly.Size(this);
     elemSize[(int)MDTable.AssemblyRef]            = AssemblyRef.Size(this);
     elemSize[(int)MDTable.File]                   = FileRef.Size(this);
     elemSize[(int)MDTable.ExportedType]           = ExternClass.Size(this);
     elemSize[(int)MDTable.ManifestResource]       = ManifestResource.Size(this);
     elemSize[(int)MDTable.NestedClass]            = MapElem.Size(this, MDTable.NestedClass);
     elemSize[(int)MDTable.GenericParam]           = GenericParam.Size(this);
     elemSize[(int)MDTable.GenericParamConstraint] = GenericParamConstraint.Size(this);
     elemSize[(int)MDTable.MethodSpec]             = MethodSpec.Size(this);
 }
Exemplo n.º 4
0
 internal static void Read(PEReader buff, TableRow[] layouts)
 {
     for (int i = 0; i < layouts.Length; i++)
         layouts[i] = new FieldLayout(buff);
 }
Exemplo n.º 5
0
 internal override sealed void BuildTables(MetaDataOut md)
 {
     md.AddToTable(MDTable.Field, this);
     nameIx = md.AddToStringsHeap(name);
     if (!type.isDef()) type.BuildMDTables(md);
     if (initVal != null)
     {
         FieldRVA rva = new FieldRVA(this, initVal);
         rva.BuildMDTables(md);
     }
     if (constVal != null)
     {
         ConstantElem constElem = new ConstantElem(this, constVal);
         constElem.BuildMDTables(md);
     }
     if (hasOffset)
     {
         FieldLayout layout = new FieldLayout(this, offset);
         layout.BuildMDTables(md);
     }
     if (marshalType != null)
     {
         FieldMarshal marshalInfo = new FieldMarshal(this, marshalType);
         marshalInfo.BuildMDTables(md);
     }
 }