internal static void Read(PEReader buff, TableRow[] layouts) { Contract.Requires(buff != null); Contract.Requires(layouts != null); for (int i = 0; i < layouts.Length; i++) { layouts[i] = new ClassLayout(buff); } }
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); }
/// <summary> /// Add layout information for this class. This class must have the /// sequential or explicit attribute. /// </summary> /// <param name="packSize">packing size (.pack)</param> /// <param name="classSize">class size (.size)</param> public void AddLayoutInfo(int packSize, int classSize) { Layout = new ClassLayout(packSize, classSize, this); }