1 // Auto-generated file - DO NOT EDIT!
2 // Please edit md-schema.xml or rows.xsl if you want to make changes.
7 namespace Mono
.PEToolkit
.Metadata
{
12 /// Represents row in Module table.
15 /// See Partition II, Metadata; section 21.27
17 public class ModuleRow
: Row
{
19 private MDTable table
;
22 public ushort Generation
;
32 public ModuleRow(MDTable parent
)
39 /// Row in Module table has 5 columns.
41 public virtual int NumberOfColumns
{
49 /// Logical size of this instance in bytes.
51 public virtual int Size
{
60 public virtual MDTable Table
{
68 /// Logical size of this type of row in bytes.
70 unsafe public static int LogicalSize
{
72 return sizeof (ushort) + 4 + 4 + 4 + 4;
78 /// Fills the row from the array of bytes.
80 unsafe public void FromRawData(byte [] buff
, int offs
)
82 if (buff
== null) throw new Exception("buff == null");
83 if (offs
+ Size
> buff
.Length
) throw new Exception("bounds");
86 this.Generation
= LEBitConverter
.ToUInt16(buff
, offs
);
87 offs
+= sizeof (ushort);
88 this.Name
= LEBitConverter
.ToInt32(buff
, offs
);
90 this.Mvid
= LEBitConverter
.ToInt32(buff
, offs
);
92 this.EncId
= LEBitConverter
.ToInt32(buff
, offs
);
94 this.EncBaseId
= LEBitConverter
.ToInt32(buff
, offs
);
102 public void Dump(TextWriter writer
) {
103 string dump
= String
.Format(
104 "Generation : {0}" + Environment
.NewLine
+
105 "Name : {1}" + Environment
.NewLine
+
106 "Mvid : {2}" + Environment
.NewLine
+
107 "EncId : {3}" + Environment
.NewLine
+
108 "EncBaseId : {4}" + Environment
.NewLine
,
110 (Table
== null) ? Name
.ToString() : "\"" + ((Table
.Heap
.Stream
.Root
.Streams
["#Strings"] as MDStream
).Heap
as StringsHeap
) [Name
] + "\" (#Strings[0x" + Name
.ToString("X") + "])",
111 "#GUID[" + Mvid
.ToString() + "]",
112 "#GUID[" + EncId
.ToString() + "]",
113 "#GUID[" + EncBaseId
.ToString() + "]"
115 writer
.WriteLine(dump
);
121 public override string ToString()
123 StringWriter sw
= new StringWriter();
125 return sw
.ToString();
133 /// Represents row in TypeRef table.
136 /// See Partition II, Metadata; section 21.35
138 public class TypeRefRow
: Row
{
140 private MDTable table
;
143 public MDToken ResolutionScope
;
145 public int Namespace
;
151 public TypeRefRow(MDTable parent
)
158 /// Row in TypeRef table has 3 columns.
160 public virtual int NumberOfColumns
{
168 /// Logical size of this instance in bytes.
170 public virtual int Size
{
179 public virtual MDTable Table
{
187 /// Logical size of this type of row in bytes.
189 unsafe public static int LogicalSize
{
197 /// Fills the row from the array of bytes.
199 unsafe public void FromRawData(byte [] buff
, int offs
)
201 if (buff
== null) throw new Exception("buff == null");
202 if (offs
+ Size
> buff
.Length
) throw new Exception("bounds");
205 this.ResolutionScope
= TabsDecoder
.DecodeToken(CodedTokenId
.ResolutionScope
, LEBitConverter
.ToInt32(buff
, offs
));
207 this.Name
= LEBitConverter
.ToInt32(buff
, offs
);
209 this.Namespace
= LEBitConverter
.ToInt32(buff
, offs
);
217 public void Dump(TextWriter writer
) {
218 string dump
= String
.Format(
219 "ResolutionScope : {0}" + Environment
.NewLine
+
220 "Name : {1}" + Environment
.NewLine
+
221 "Namespace : {2}" + Environment
.NewLine
,
222 this.ResolutionScope
,
223 (Table
== null) ? Name
.ToString() : "\"" + ((Table
.Heap
.Stream
.Root
.Streams
["#Strings"] as MDStream
).Heap
as StringsHeap
) [Name
] + "\" (#Strings[0x" + Name
.ToString("X") + "])",
224 (Table
== null) ? Namespace
.ToString() : "\"" + ((Table
.Heap
.Stream
.Root
.Streams
["#Strings"] as MDStream
).Heap
as StringsHeap
) [Namespace
] + "\" (#Strings[0x" + Namespace
.ToString("X") + "])"
226 writer
.WriteLine(dump
);
232 public override string ToString()
234 StringWriter sw
= new StringWriter();
236 return sw
.ToString();
244 /// Represents row in TypeDef table.
247 /// See Partition II, Metadata; section 21.34
249 public class TypeDefRow
: Row
{
251 private MDTable table
;
254 public System
.Reflection
.TypeAttributes Flags
;
256 public int Namespace
;
257 public MDToken Extends
;
258 public int FieldList
;
259 public int MethodList
;
265 public TypeDefRow(MDTable parent
)
272 /// Row in TypeDef table has 6 columns.
274 public virtual int NumberOfColumns
{
282 /// Logical size of this instance in bytes.
284 public virtual int Size
{
293 public virtual MDTable Table
{
301 /// Logical size of this type of row in bytes.
303 unsafe public static int LogicalSize
{
305 return sizeof (uint) + 4 + 4 + 4 + 4 + 4;
311 /// Fills the row from the array of bytes.
313 unsafe public void FromRawData(byte [] buff
, int offs
)
315 if (buff
== null) throw new Exception("buff == null");
316 if (offs
+ Size
> buff
.Length
) throw new Exception("bounds");
319 this.Flags
= (System
.Reflection
.TypeAttributes
) LEBitConverter
.ToUInt32(buff
, offs
);
320 offs
+= sizeof (uint);
321 this.Name
= LEBitConverter
.ToInt32(buff
, offs
);
323 this.Namespace
= LEBitConverter
.ToInt32(buff
, offs
);
325 this.Extends
= TabsDecoder
.DecodeToken(CodedTokenId
.TypeDefOrRef
, LEBitConverter
.ToInt32(buff
, offs
));
327 this.FieldList
= LEBitConverter
.ToInt32(buff
, offs
);
329 this.MethodList
= LEBitConverter
.ToInt32(buff
, offs
);
337 public void Dump(TextWriter writer
) {
338 string dump
= String
.Format(
339 "Flags : {0}" + Environment
.NewLine
+
340 "Name : {1}" + Environment
.NewLine
+
341 "Namespace : {2}" + Environment
.NewLine
+
342 "Extends : {3}" + Environment
.NewLine
+
343 "FieldList : {4}" + Environment
.NewLine
+
344 "MethodList : {5}" + Environment
.NewLine
,
346 (Table
== null) ? Name
.ToString() : "\"" + ((Table
.Heap
.Stream
.Root
.Streams
["#Strings"] as MDStream
).Heap
as StringsHeap
) [Name
] + "\" (#Strings[0x" + Name
.ToString("X") + "])",
347 (Table
== null) ? Namespace
.ToString() : "\"" + ((Table
.Heap
.Stream
.Root
.Streams
["#Strings"] as MDStream
).Heap
as StringsHeap
) [Namespace
] + "\" (#Strings[0x" + Namespace
.ToString("X") + "])",
349 "Field[" + FieldList
.ToString() + "]",
350 "Method[" + MethodList
.ToString() + "]"
352 writer
.WriteLine(dump
);
358 public override string ToString()
360 StringWriter sw
= new StringWriter();
362 return sw
.ToString();
370 /// Represents row in FieldPtr table.
375 public class FieldPtrRow
: Row
{
377 private MDTable table
;
386 public FieldPtrRow(MDTable parent
)
393 /// Row in FieldPtr table has 1 columns.
395 public virtual int NumberOfColumns
{
403 /// Logical size of this instance in bytes.
405 public virtual int Size
{
414 public virtual MDTable Table
{
422 /// Logical size of this type of row in bytes.
424 unsafe public static int LogicalSize
{
432 /// Fills the row from the array of bytes.
434 unsafe public void FromRawData(byte [] buff
, int offs
)
436 if (buff
== null) throw new Exception("buff == null");
437 if (offs
+ Size
> buff
.Length
) throw new Exception("bounds");
440 this.Field
= LEBitConverter
.ToInt32(buff
, offs
);
448 public void Dump(TextWriter writer
) {
449 string dump
= String
.Format(
450 "Field : {0}" + Environment
.NewLine
,
451 "Field[" + Field
.ToString() + "]"
453 writer
.WriteLine(dump
);
459 public override string ToString()
461 StringWriter sw
= new StringWriter();
463 return sw
.ToString();
471 /// Represents row in Field table.
474 /// See Partition II, Metadata; section 21.15
476 public class FieldRow
: Row
{
478 private MDTable table
;
481 public System
.Reflection
.FieldAttributes Flags
;
483 public int Signature
;
489 public FieldRow(MDTable parent
)
496 /// Row in Field table has 3 columns.
498 public virtual int NumberOfColumns
{
506 /// Logical size of this instance in bytes.
508 public virtual int Size
{
517 public virtual MDTable Table
{
525 /// Logical size of this type of row in bytes.
527 unsafe public static int LogicalSize
{
529 return sizeof (ushort) + 4 + 4;
535 /// Fills the row from the array of bytes.
537 unsafe public void FromRawData(byte [] buff
, int offs
)
539 if (buff
== null) throw new Exception("buff == null");
540 if (offs
+ Size
> buff
.Length
) throw new Exception("bounds");
543 this.Flags
= (System
.Reflection
.FieldAttributes
) LEBitConverter
.ToUInt16(buff
, offs
);
544 offs
+= sizeof (ushort);
545 this.Name
= LEBitConverter
.ToInt32(buff
, offs
);
547 this.Signature
= LEBitConverter
.ToInt32(buff
, offs
);
555 public void Dump(TextWriter writer
) {
556 string dump
= String
.Format(
557 "Flags : {0}" + Environment
.NewLine
+
558 "Name : {1}" + Environment
.NewLine
+
559 "Signature : {2}" + Environment
.NewLine
,
561 (Table
== null) ? Name
.ToString() : "\"" + ((Table
.Heap
.Stream
.Root
.Streams
["#Strings"] as MDStream
).Heap
as StringsHeap
) [Name
] + "\" (#Strings[0x" + Name
.ToString("X") + "])",
562 "#Blob[" + Signature
.ToString() + "]"
564 writer
.WriteLine(dump
);
570 public override string ToString()
572 StringWriter sw
= new StringWriter();
574 return sw
.ToString();
582 /// Represents row in MethodPtr table.
587 public class MethodPtrRow
: Row
{
589 private MDTable table
;
594 public MethodPtrRow()
598 public MethodPtrRow(MDTable parent
)
605 /// Row in MethodPtr table has 1 columns.
607 public virtual int NumberOfColumns
{
615 /// Logical size of this instance in bytes.
617 public virtual int Size
{
626 public virtual MDTable Table
{
634 /// Logical size of this type of row in bytes.
636 unsafe public static int LogicalSize
{
644 /// Fills the row from the array of bytes.
646 unsafe public void FromRawData(byte [] buff
, int offs
)
648 if (buff
== null) throw new Exception("buff == null");
649 if (offs
+ Size
> buff
.Length
) throw new Exception("bounds");
652 this.Method
= LEBitConverter
.ToInt32(buff
, offs
);
660 public void Dump(TextWriter writer
) {
661 string dump
= String
.Format(
662 "Method : {0}" + Environment
.NewLine
,
663 "Method[" + Method
.ToString() + "]"
665 writer
.WriteLine(dump
);
671 public override string ToString()
673 StringWriter sw
= new StringWriter();
675 return sw
.ToString();
683 /// Represents row in Method table.
686 /// See Partition II, Metadata; section 21.24
688 public class MethodRow
: Row
{
690 private MDTable table
;
694 public System
.Reflection
.MethodImplAttributes ImplFlags
;
695 public System
.Reflection
.MethodAttributes Flags
;
697 public int Signature
;
698 public int ParamList
;
704 public MethodRow(MDTable parent
)
711 /// Row in Method table has 6 columns.
713 public virtual int NumberOfColumns
{
721 /// Logical size of this instance in bytes.
723 public virtual int Size
{
732 public virtual MDTable Table
{
740 /// Logical size of this type of row in bytes.
742 unsafe public static int LogicalSize
{
744 return RVA
.Size
+ sizeof (ushort) + sizeof (ushort) + 4 + 4 + 4;
750 /// Fills the row from the array of bytes.
752 unsafe public void FromRawData(byte [] buff
, int offs
)
754 if (buff
== null) throw new Exception("buff == null");
755 if (offs
+ Size
> buff
.Length
) throw new Exception("bounds");
758 this.RVA
= LEBitConverter
.ToUInt32(buff
, offs
);
760 this.ImplFlags
= (System
.Reflection
.MethodImplAttributes
) LEBitConverter
.ToUInt16(buff
, offs
);
761 offs
+= sizeof (ushort);
762 this.Flags
= (System
.Reflection
.MethodAttributes
) LEBitConverter
.ToUInt16(buff
, offs
);
763 offs
+= sizeof (ushort);
764 this.Name
= LEBitConverter
.ToInt32(buff
, offs
);
766 this.Signature
= LEBitConverter
.ToInt32(buff
, offs
);
768 this.ParamList
= LEBitConverter
.ToInt32(buff
, offs
);
776 public void Dump(TextWriter writer
) {
777 string dump
= String
.Format(
778 "RVA : {0}" + Environment
.NewLine
+
779 "ImplFlags : {1}" + Environment
.NewLine
+
780 "Flags : {2}" + Environment
.NewLine
+
781 "Name : {3}" + Environment
.NewLine
+
782 "Signature : {4}" + Environment
.NewLine
+
783 "ParamList : {5}" + Environment
.NewLine
,
787 (Table
== null) ? Name
.ToString() : "\"" + ((Table
.Heap
.Stream
.Root
.Streams
["#Strings"] as MDStream
).Heap
as StringsHeap
) [Name
] + "\" (#Strings[0x" + Name
.ToString("X") + "])",
788 "#Blob[" + Signature
.ToString() + "]",
789 "Param[" + ParamList
.ToString() + "]"
791 writer
.WriteLine(dump
);
797 public override string ToString()
799 StringWriter sw
= new StringWriter();
801 return sw
.ToString();
809 /// Represents row in ParamPtr table.
814 public class ParamPtrRow
: Row
{
816 private MDTable table
;
825 public ParamPtrRow(MDTable parent
)
832 /// Row in ParamPtr table has 1 columns.
834 public virtual int NumberOfColumns
{
842 /// Logical size of this instance in bytes.
844 public virtual int Size
{
853 public virtual MDTable Table
{
861 /// Logical size of this type of row in bytes.
863 unsafe public static int LogicalSize
{
871 /// Fills the row from the array of bytes.
873 unsafe public void FromRawData(byte [] buff
, int offs
)
875 if (buff
== null) throw new Exception("buff == null");
876 if (offs
+ Size
> buff
.Length
) throw new Exception("bounds");
879 this.Param
= LEBitConverter
.ToInt32(buff
, offs
);
887 public void Dump(TextWriter writer
) {
888 string dump
= String
.Format(
889 "Param : {0}" + Environment
.NewLine
,
890 "Param[" + Param
.ToString() + "]"
892 writer
.WriteLine(dump
);
898 public override string ToString()
900 StringWriter sw
= new StringWriter();
902 return sw
.ToString();
910 /// Represents row in Param table.
913 /// See Partition II, Metadata; section 21.30
915 public class ParamRow
: Row
{
917 private MDTable table
;
920 public System
.Reflection
.ParameterAttributes Flags
;
921 public ushort Sequence
;
928 public ParamRow(MDTable parent
)
935 /// Row in Param table has 3 columns.
937 public virtual int NumberOfColumns
{
945 /// Logical size of this instance in bytes.
947 public virtual int Size
{
956 public virtual MDTable Table
{
964 /// Logical size of this type of row in bytes.
966 unsafe public static int LogicalSize
{
968 return sizeof (ushort) + sizeof (ushort) + 4;
974 /// Fills the row from the array of bytes.
976 unsafe public void FromRawData(byte [] buff
, int offs
)
978 if (buff
== null) throw new Exception("buff == null");
979 if (offs
+ Size
> buff
.Length
) throw new Exception("bounds");
982 this.Flags
= (System
.Reflection
.ParameterAttributes
) LEBitConverter
.ToUInt16(buff
, offs
);
983 offs
+= sizeof (ushort);
984 this.Sequence
= LEBitConverter
.ToUInt16(buff
, offs
);
985 offs
+= sizeof (ushort);
986 this.Name
= LEBitConverter
.ToInt32(buff
, offs
);
994 public void Dump(TextWriter writer
) {
995 string dump
= String
.Format(
996 "Flags : {0}" + Environment
.NewLine
+
997 "Sequence : {1}" + Environment
.NewLine
+
998 "Name : {2}" + Environment
.NewLine
,
1001 (Table
== null) ? Name
.ToString() : "\"" + ((Table
.Heap
.Stream
.Root
.Streams
["#Strings"] as MDStream
).Heap
as StringsHeap
) [Name
] + "\" (#Strings[0x" + Name
.ToString("X") + "])"
1003 writer
.WriteLine(dump
);
1009 public override string ToString()
1011 StringWriter sw
= new StringWriter();
1013 return sw
.ToString();
1021 /// Represents row in InterfaceImpl table.
1024 /// See Partition II, Metadata; section 21.21
1026 public class InterfaceImplRow
: Row
{
1028 private MDTable table
;
1032 public MDToken Interface
;
1034 public InterfaceImplRow()
1038 public InterfaceImplRow(MDTable parent
)
1045 /// Row in InterfaceImpl table has 2 columns.
1047 public virtual int NumberOfColumns
{
1055 /// Logical size of this instance in bytes.
1057 public virtual int Size
{
1066 public virtual MDTable Table
{
1074 /// Logical size of this type of row in bytes.
1076 unsafe public static int LogicalSize
{
1084 /// Fills the row from the array of bytes.
1086 unsafe public void FromRawData(byte [] buff
, int offs
)
1088 if (buff
== null) throw new Exception("buff == null");
1089 if (offs
+ Size
> buff
.Length
) throw new Exception("bounds");
1092 this.Class
= LEBitConverter
.ToInt32(buff
, offs
);
1094 this.Interface
= TabsDecoder
.DecodeToken(CodedTokenId
.TypeDefOrRef
, LEBitConverter
.ToInt32(buff
, offs
));
1102 public void Dump(TextWriter writer
) {
1103 string dump
= String
.Format(
1104 "Class : {0}" + Environment
.NewLine
+
1105 "Interface : {1}" + Environment
.NewLine
,
1106 "TypeDef[" + Class
.ToString() + "]",
1109 writer
.WriteLine(dump
);
1115 public override string ToString()
1117 StringWriter sw
= new StringWriter();
1119 return sw
.ToString();
1127 /// Represents row in MemberRef table.
1130 /// See Partition II, Metadata; section 21.23
1132 public class MemberRefRow
: Row
{
1134 private MDTable table
;
1137 public MDToken Class
;
1139 public int Signature
;
1141 public MemberRefRow()
1145 public MemberRefRow(MDTable parent
)
1152 /// Row in MemberRef table has 3 columns.
1154 public virtual int NumberOfColumns
{
1162 /// Logical size of this instance in bytes.
1164 public virtual int Size
{
1173 public virtual MDTable Table
{
1181 /// Logical size of this type of row in bytes.
1183 unsafe public static int LogicalSize
{
1191 /// Fills the row from the array of bytes.
1193 unsafe public void FromRawData(byte [] buff
, int offs
)
1195 if (buff
== null) throw new Exception("buff == null");
1196 if (offs
+ Size
> buff
.Length
) throw new Exception("bounds");
1199 this.Class
= TabsDecoder
.DecodeToken(CodedTokenId
.MemberRefParent
, LEBitConverter
.ToInt32(buff
, offs
));
1201 this.Name
= LEBitConverter
.ToInt32(buff
, offs
);
1203 this.Signature
= LEBitConverter
.ToInt32(buff
, offs
);
1211 public void Dump(TextWriter writer
) {
1212 string dump
= String
.Format(
1213 "Class : {0}" + Environment
.NewLine
+
1214 "Name : {1}" + Environment
.NewLine
+
1215 "Signature : {2}" + Environment
.NewLine
,
1217 (Table
== null) ? Name
.ToString() : "\"" + ((Table
.Heap
.Stream
.Root
.Streams
["#Strings"] as MDStream
).Heap
as StringsHeap
) [Name
] + "\" (#Strings[0x" + Name
.ToString("X") + "])",
1218 "#Blob[" + Signature
.ToString() + "]"
1220 writer
.WriteLine(dump
);
1226 public override string ToString()
1228 StringWriter sw
= new StringWriter();
1230 return sw
.ToString();
1238 /// Represents row in Constant table.
1241 /// See Partition II, Metadata; section 21.9
1243 public class ConstantRow
: Row
{
1245 private MDTable table
;
1248 public ElementType Type
;
1249 public MDToken Parent
;
1252 public ConstantRow()
1256 public ConstantRow(MDTable parent
)
1263 /// Row in Constant table has 3 columns.
1265 public virtual int NumberOfColumns
{
1273 /// Logical size of this instance in bytes.
1275 public virtual int Size
{
1284 public virtual MDTable Table
{
1292 /// Logical size of this type of row in bytes.
1294 unsafe public static int LogicalSize
{
1296 return sizeof (short) + 4 + 4;
1302 /// Fills the row from the array of bytes.
1304 unsafe public void FromRawData(byte [] buff
, int offs
)
1306 if (buff
== null) throw new Exception("buff == null");
1307 if (offs
+ Size
> buff
.Length
) throw new Exception("bounds");
1310 this.Type
= (ElementType
) LEBitConverter
.ToInt16(buff
, offs
);
1311 offs
+= sizeof (short);
1312 this.Parent
= TabsDecoder
.DecodeToken(CodedTokenId
.HasConstant
, LEBitConverter
.ToInt32(buff
, offs
));
1314 this.Value
= LEBitConverter
.ToInt32(buff
, offs
);
1322 public void Dump(TextWriter writer
) {
1323 string dump
= String
.Format(
1324 "Type : {0}" + Environment
.NewLine
+
1325 "Parent : {1}" + Environment
.NewLine
+
1326 "Value : {2}" + Environment
.NewLine
,
1329 "#Blob[" + Value
.ToString() + "]"
1331 writer
.WriteLine(dump
);
1337 public override string ToString()
1339 StringWriter sw
= new StringWriter();
1341 return sw
.ToString();
1349 /// Represents row in CustomAttribute table.
1352 /// See Partition II, Metadata; section 21.10
1354 public class CustomAttributeRow
: Row
{
1356 private MDTable table
;
1359 public MDToken Parent
;
1360 public MDToken Type
;
1363 public CustomAttributeRow()
1367 public CustomAttributeRow(MDTable parent
)
1374 /// Row in CustomAttribute table has 3 columns.
1376 public virtual int NumberOfColumns
{
1384 /// Logical size of this instance in bytes.
1386 public virtual int Size
{
1395 public virtual MDTable Table
{
1403 /// Logical size of this type of row in bytes.
1405 unsafe public static int LogicalSize
{
1413 /// Fills the row from the array of bytes.
1415 unsafe public void FromRawData(byte [] buff
, int offs
)
1417 if (buff
== null) throw new Exception("buff == null");
1418 if (offs
+ Size
> buff
.Length
) throw new Exception("bounds");
1421 this.Parent
= TabsDecoder
.DecodeToken(CodedTokenId
.HasCustomAttribute
, LEBitConverter
.ToInt32(buff
, offs
));
1423 this.Type
= TabsDecoder
.DecodeToken(CodedTokenId
.CustomAttributeType
, LEBitConverter
.ToInt32(buff
, offs
));
1425 this.Value
= LEBitConverter
.ToInt32(buff
, offs
);
1433 public void Dump(TextWriter writer
) {
1434 string dump
= String
.Format(
1435 "Parent : {0}" + Environment
.NewLine
+
1436 "Type : {1}" + Environment
.NewLine
+
1437 "Value : {2}" + Environment
.NewLine
,
1440 "#Blob[" + Value
.ToString() + "]"
1442 writer
.WriteLine(dump
);
1448 public override string ToString()
1450 StringWriter sw
= new StringWriter();
1452 return sw
.ToString();
1460 /// Represents row in FieldMarshal table.
1463 /// See Partition II, Metadata; section 21.17
1465 public class FieldMarshalRow
: Row
{
1467 private MDTable table
;
1470 public MDToken Parent
;
1471 public int NativeType
;
1473 public FieldMarshalRow()
1477 public FieldMarshalRow(MDTable parent
)
1484 /// Row in FieldMarshal table has 2 columns.
1486 public virtual int NumberOfColumns
{
1494 /// Logical size of this instance in bytes.
1496 public virtual int Size
{
1505 public virtual MDTable Table
{
1513 /// Logical size of this type of row in bytes.
1515 unsafe public static int LogicalSize
{
1523 /// Fills the row from the array of bytes.
1525 unsafe public void FromRawData(byte [] buff
, int offs
)
1527 if (buff
== null) throw new Exception("buff == null");
1528 if (offs
+ Size
> buff
.Length
) throw new Exception("bounds");
1531 this.Parent
= TabsDecoder
.DecodeToken(CodedTokenId
.HasFieldMarshal
, LEBitConverter
.ToInt32(buff
, offs
));
1533 this.NativeType
= LEBitConverter
.ToInt32(buff
, offs
);
1541 public void Dump(TextWriter writer
) {
1542 string dump
= String
.Format(
1543 "Parent : {0}" + Environment
.NewLine
+
1544 "NativeType : {1}" + Environment
.NewLine
,
1546 "#Blob[" + NativeType
.ToString() + "]"
1548 writer
.WriteLine(dump
);
1554 public override string ToString()
1556 StringWriter sw
= new StringWriter();
1558 return sw
.ToString();
1566 /// Represents row in DeclSecurity table.
1569 /// See Partition II, Metadata; section 21.11
1571 public class DeclSecurityRow
: Row
{
1573 private MDTable table
;
1576 public short Action
;
1577 public MDToken Parent
;
1578 public int PermissionSet
;
1580 public DeclSecurityRow()
1584 public DeclSecurityRow(MDTable parent
)
1591 /// Row in DeclSecurity table has 3 columns.
1593 public virtual int NumberOfColumns
{
1601 /// Logical size of this instance in bytes.
1603 public virtual int Size
{
1612 public virtual MDTable Table
{
1620 /// Logical size of this type of row in bytes.
1622 unsafe public static int LogicalSize
{
1624 return sizeof (short) + 4 + 4;
1630 /// Fills the row from the array of bytes.
1632 unsafe public void FromRawData(byte [] buff
, int offs
)
1634 if (buff
== null) throw new Exception("buff == null");
1635 if (offs
+ Size
> buff
.Length
) throw new Exception("bounds");
1638 this.Action
= LEBitConverter
.ToInt16(buff
, offs
);
1639 offs
+= sizeof (short);
1640 this.Parent
= TabsDecoder
.DecodeToken(CodedTokenId
.HasDeclSecurity
, LEBitConverter
.ToInt32(buff
, offs
));
1642 this.PermissionSet
= LEBitConverter
.ToInt32(buff
, offs
);
1650 public void Dump(TextWriter writer
) {
1651 string dump
= String
.Format(
1652 "Action : {0}" + Environment
.NewLine
+
1653 "Parent : {1}" + Environment
.NewLine
+
1654 "PermissionSet : {2}" + Environment
.NewLine
,
1657 "#Blob[" + PermissionSet
.ToString() + "]"
1659 writer
.WriteLine(dump
);
1665 public override string ToString()
1667 StringWriter sw
= new StringWriter();
1669 return sw
.ToString();
1677 /// Represents row in ClassLayout table.
1680 /// See Partition II, Metadata; section 21.8
1682 public class ClassLayoutRow
: Row
{
1684 private MDTable table
;
1687 public short PackingSize
;
1688 public int ClassSize
;
1691 public ClassLayoutRow()
1695 public ClassLayoutRow(MDTable parent
)
1702 /// Row in ClassLayout table has 3 columns.
1704 public virtual int NumberOfColumns
{
1712 /// Logical size of this instance in bytes.
1714 public virtual int Size
{
1723 public virtual MDTable Table
{
1731 /// Logical size of this type of row in bytes.
1733 unsafe public static int LogicalSize
{
1735 return sizeof (short) + sizeof (int) + 4;
1741 /// Fills the row from the array of bytes.
1743 unsafe public void FromRawData(byte [] buff
, int offs
)
1745 if (buff
== null) throw new Exception("buff == null");
1746 if (offs
+ Size
> buff
.Length
) throw new Exception("bounds");
1749 this.PackingSize
= LEBitConverter
.ToInt16(buff
, offs
);
1750 offs
+= sizeof (short);
1751 this.ClassSize
= LEBitConverter
.ToInt32(buff
, offs
);
1752 offs
+= sizeof (int);
1753 this.Parent
= LEBitConverter
.ToInt32(buff
, offs
);
1761 public void Dump(TextWriter writer
) {
1762 string dump
= String
.Format(
1763 "PackingSize : {0}" + Environment
.NewLine
+
1764 "ClassSize : {1}" + Environment
.NewLine
+
1765 "Parent : {2}" + Environment
.NewLine
,
1768 "TypeDef[" + Parent
.ToString() + "]"
1770 writer
.WriteLine(dump
);
1776 public override string ToString()
1778 StringWriter sw
= new StringWriter();
1780 return sw
.ToString();
1788 /// Represents row in FieldLayout table.
1791 /// See Partition II, Metadata; section 21.16
1793 public class FieldLayoutRow
: Row
{
1795 private MDTable table
;
1801 public FieldLayoutRow()
1805 public FieldLayoutRow(MDTable parent
)
1812 /// Row in FieldLayout table has 2 columns.
1814 public virtual int NumberOfColumns
{
1822 /// Logical size of this instance in bytes.
1824 public virtual int Size
{
1833 public virtual MDTable Table
{
1841 /// Logical size of this type of row in bytes.
1843 unsafe public static int LogicalSize
{
1845 return sizeof (int) + 4;
1851 /// Fills the row from the array of bytes.
1853 unsafe public void FromRawData(byte [] buff
, int offs
)
1855 if (buff
== null) throw new Exception("buff == null");
1856 if (offs
+ Size
> buff
.Length
) throw new Exception("bounds");
1859 this.Offset
= LEBitConverter
.ToInt32(buff
, offs
);
1860 offs
+= sizeof (int);
1861 this.Field
= LEBitConverter
.ToInt32(buff
, offs
);
1869 public void Dump(TextWriter writer
) {
1870 string dump
= String
.Format(
1871 "Offset : {0}" + Environment
.NewLine
+
1872 "Field : {1}" + Environment
.NewLine
,
1874 "Field[" + Field
.ToString() + "]"
1876 writer
.WriteLine(dump
);
1882 public override string ToString()
1884 StringWriter sw
= new StringWriter();
1886 return sw
.ToString();
1894 /// Represents row in StandAloneSig table.
1897 /// See Partition II, Metadata; section 21.33
1899 public class StandAloneSigRow
: Row
{
1901 private MDTable table
;
1904 public int Signature
;
1906 public StandAloneSigRow()
1910 public StandAloneSigRow(MDTable parent
)
1917 /// Row in StandAloneSig table has 1 columns.
1919 public virtual int NumberOfColumns
{
1927 /// Logical size of this instance in bytes.
1929 public virtual int Size
{
1938 public virtual MDTable Table
{
1946 /// Logical size of this type of row in bytes.
1948 unsafe public static int LogicalSize
{
1956 /// Fills the row from the array of bytes.
1958 unsafe public void FromRawData(byte [] buff
, int offs
)
1960 if (buff
== null) throw new Exception("buff == null");
1961 if (offs
+ Size
> buff
.Length
) throw new Exception("bounds");
1964 this.Signature
= LEBitConverter
.ToInt32(buff
, offs
);
1972 public void Dump(TextWriter writer
) {
1973 string dump
= String
.Format(
1974 "Signature : {0}" + Environment
.NewLine
,
1975 "#Blob[" + Signature
.ToString() + "]"
1977 writer
.WriteLine(dump
);
1983 public override string ToString()
1985 StringWriter sw
= new StringWriter();
1987 return sw
.ToString();
1995 /// Represents row in EventMap table.
1998 /// See Partition II, Metadata; section 21.12
2000 public class EventMapRow
: Row
{
2002 private MDTable table
;
2006 public int EventList
;
2008 public EventMapRow()
2012 public EventMapRow(MDTable parent
)
2019 /// Row in EventMap table has 2 columns.
2021 public virtual int NumberOfColumns
{
2029 /// Logical size of this instance in bytes.
2031 public virtual int Size
{
2040 public virtual MDTable Table
{
2048 /// Logical size of this type of row in bytes.
2050 unsafe public static int LogicalSize
{
2058 /// Fills the row from the array of bytes.
2060 unsafe public void FromRawData(byte [] buff
, int offs
)
2062 if (buff
== null) throw new Exception("buff == null");
2063 if (offs
+ Size
> buff
.Length
) throw new Exception("bounds");
2066 this.Parent
= LEBitConverter
.ToInt32(buff
, offs
);
2068 this.EventList
= LEBitConverter
.ToInt32(buff
, offs
);
2076 public void Dump(TextWriter writer
) {
2077 string dump
= String
.Format(
2078 "Parent : {0}" + Environment
.NewLine
+
2079 "EventList : {1}" + Environment
.NewLine
,
2080 "TypeDef[" + Parent
.ToString() + "]",
2081 "Event[" + EventList
.ToString() + "]"
2083 writer
.WriteLine(dump
);
2089 public override string ToString()
2091 StringWriter sw
= new StringWriter();
2093 return sw
.ToString();
2101 /// Represents row in EventPtr table.
2106 public class EventPtrRow
: Row
{
2108 private MDTable table
;
2113 public EventPtrRow()
2117 public EventPtrRow(MDTable parent
)
2124 /// Row in EventPtr table has 1 columns.
2126 public virtual int NumberOfColumns
{
2134 /// Logical size of this instance in bytes.
2136 public virtual int Size
{
2145 public virtual MDTable Table
{
2153 /// Logical size of this type of row in bytes.
2155 unsafe public static int LogicalSize
{
2163 /// Fills the row from the array of bytes.
2165 unsafe public void FromRawData(byte [] buff
, int offs
)
2167 if (buff
== null) throw new Exception("buff == null");
2168 if (offs
+ Size
> buff
.Length
) throw new Exception("bounds");
2171 this.Event
= LEBitConverter
.ToInt32(buff
, offs
);
2179 public void Dump(TextWriter writer
) {
2180 string dump
= String
.Format(
2181 "Event : {0}" + Environment
.NewLine
,
2182 "Event[" + Event
.ToString() + "]"
2184 writer
.WriteLine(dump
);
2190 public override string ToString()
2192 StringWriter sw
= new StringWriter();
2194 return sw
.ToString();
2202 /// Represents row in Event table.
2205 /// See Partition II, Metadata; section 21.13
2207 public class EventRow
: Row
{
2209 private MDTable table
;
2212 public System
.Reflection
.EventAttributes EventFlags
;
2214 public MDToken EventType
;
2220 public EventRow(MDTable parent
)
2227 /// Row in Event table has 3 columns.
2229 public virtual int NumberOfColumns
{
2237 /// Logical size of this instance in bytes.
2239 public virtual int Size
{
2248 public virtual MDTable Table
{
2256 /// Logical size of this type of row in bytes.
2258 unsafe public static int LogicalSize
{
2260 return sizeof (short) + 4 + 4;
2266 /// Fills the row from the array of bytes.
2268 unsafe public void FromRawData(byte [] buff
, int offs
)
2270 if (buff
== null) throw new Exception("buff == null");
2271 if (offs
+ Size
> buff
.Length
) throw new Exception("bounds");
2274 this.EventFlags
= (System
.Reflection
.EventAttributes
) LEBitConverter
.ToInt16(buff
, offs
);
2275 offs
+= sizeof (short);
2276 this.Name
= LEBitConverter
.ToInt32(buff
, offs
);
2278 this.EventType
= TabsDecoder
.DecodeToken(CodedTokenId
.TypeDefOrRef
, LEBitConverter
.ToInt32(buff
, offs
));
2286 public void Dump(TextWriter writer
) {
2287 string dump
= String
.Format(
2288 "EventFlags : {0}" + Environment
.NewLine
+
2289 "Name : {1}" + Environment
.NewLine
+
2290 "EventType : {2}" + Environment
.NewLine
,
2292 (Table
== null) ? Name
.ToString() : "\"" + ((Table
.Heap
.Stream
.Root
.Streams
["#Strings"] as MDStream
).Heap
as StringsHeap
) [Name
] + "\" (#Strings[0x" + Name
.ToString("X") + "])",
2295 writer
.WriteLine(dump
);
2301 public override string ToString()
2303 StringWriter sw
= new StringWriter();
2305 return sw
.ToString();
2313 /// Represents row in PropertyMap table.
2316 /// See Partition II, Metadata; section 21.32
2318 public class PropertyMapRow
: Row
{
2320 private MDTable table
;
2324 public int PropertyList
;
2326 public PropertyMapRow()
2330 public PropertyMapRow(MDTable parent
)
2337 /// Row in PropertyMap table has 2 columns.
2339 public virtual int NumberOfColumns
{
2347 /// Logical size of this instance in bytes.
2349 public virtual int Size
{
2358 public virtual MDTable Table
{
2366 /// Logical size of this type of row in bytes.
2368 unsafe public static int LogicalSize
{
2376 /// Fills the row from the array of bytes.
2378 unsafe public void FromRawData(byte [] buff
, int offs
)
2380 if (buff
== null) throw new Exception("buff == null");
2381 if (offs
+ Size
> buff
.Length
) throw new Exception("bounds");
2384 this.Parent
= LEBitConverter
.ToInt32(buff
, offs
);
2386 this.PropertyList
= LEBitConverter
.ToInt32(buff
, offs
);
2394 public void Dump(TextWriter writer
) {
2395 string dump
= String
.Format(
2396 "Parent : {0}" + Environment
.NewLine
+
2397 "PropertyList : {1}" + Environment
.NewLine
,
2398 "TypeDef[" + Parent
.ToString() + "]",
2399 "Property[" + PropertyList
.ToString() + "]"
2401 writer
.WriteLine(dump
);
2407 public override string ToString()
2409 StringWriter sw
= new StringWriter();
2411 return sw
.ToString();
2419 /// Represents row in PropertyPtr table.
2424 public class PropertyPtrRow
: Row
{
2426 private MDTable table
;
2429 public int Property
;
2431 public PropertyPtrRow()
2435 public PropertyPtrRow(MDTable parent
)
2442 /// Row in PropertyPtr table has 1 columns.
2444 public virtual int NumberOfColumns
{
2452 /// Logical size of this instance in bytes.
2454 public virtual int Size
{
2463 public virtual MDTable Table
{
2471 /// Logical size of this type of row in bytes.
2473 unsafe public static int LogicalSize
{
2481 /// Fills the row from the array of bytes.
2483 unsafe public void FromRawData(byte [] buff
, int offs
)
2485 if (buff
== null) throw new Exception("buff == null");
2486 if (offs
+ Size
> buff
.Length
) throw new Exception("bounds");
2489 this.Property
= LEBitConverter
.ToInt32(buff
, offs
);
2497 public void Dump(TextWriter writer
) {
2498 string dump
= String
.Format(
2499 "Property : {0}" + Environment
.NewLine
,
2500 "Property[" + Property
.ToString() + "]"
2502 writer
.WriteLine(dump
);
2508 public override string ToString()
2510 StringWriter sw
= new StringWriter();
2512 return sw
.ToString();
2520 /// Represents row in Property table.
2523 /// See Partition II, Metadata; section 21.30
2525 public class PropertyRow
: Row
{
2527 private MDTable table
;
2530 public System
.Reflection
.PropertyAttributes Flags
;
2534 public PropertyRow()
2538 public PropertyRow(MDTable parent
)
2545 /// Row in Property table has 3 columns.
2547 public virtual int NumberOfColumns
{
2555 /// Logical size of this instance in bytes.
2557 public virtual int Size
{
2566 public virtual MDTable Table
{
2574 /// Logical size of this type of row in bytes.
2576 unsafe public static int LogicalSize
{
2578 return sizeof (ushort) + 4 + 4;
2584 /// Fills the row from the array of bytes.
2586 unsafe public void FromRawData(byte [] buff
, int offs
)
2588 if (buff
== null) throw new Exception("buff == null");
2589 if (offs
+ Size
> buff
.Length
) throw new Exception("bounds");
2592 this.Flags
= (System
.Reflection
.PropertyAttributes
) LEBitConverter
.ToUInt16(buff
, offs
);
2593 offs
+= sizeof (ushort);
2594 this.Name
= LEBitConverter
.ToInt32(buff
, offs
);
2596 this.Type
= LEBitConverter
.ToInt32(buff
, offs
);
2604 public void Dump(TextWriter writer
) {
2605 string dump
= String
.Format(
2606 "Flags : {0}" + Environment
.NewLine
+
2607 "Name : {1}" + Environment
.NewLine
+
2608 "Type : {2}" + Environment
.NewLine
,
2610 (Table
== null) ? Name
.ToString() : "\"" + ((Table
.Heap
.Stream
.Root
.Streams
["#Strings"] as MDStream
).Heap
as StringsHeap
) [Name
] + "\" (#Strings[0x" + Name
.ToString("X") + "])",
2611 "#Blob[" + Type
.ToString() + "]"
2613 writer
.WriteLine(dump
);
2619 public override string ToString()
2621 StringWriter sw
= new StringWriter();
2623 return sw
.ToString();
2631 /// Represents row in MethodSemantics table.
2634 /// See Partition II, Metadata; section 21.26
2636 public class MethodSemanticsRow
: Row
{
2638 private MDTable table
;
2641 public MethodSemanticsAttributes Semantics
;
2643 public MDToken Association
;
2645 public MethodSemanticsRow()
2649 public MethodSemanticsRow(MDTable parent
)
2656 /// Row in MethodSemantics table has 3 columns.
2658 public virtual int NumberOfColumns
{
2666 /// Logical size of this instance in bytes.
2668 public virtual int Size
{
2677 public virtual MDTable Table
{
2685 /// Logical size of this type of row in bytes.
2687 unsafe public static int LogicalSize
{
2689 return sizeof (ushort) + 4 + 4;
2695 /// Fills the row from the array of bytes.
2697 unsafe public void FromRawData(byte [] buff
, int offs
)
2699 if (buff
== null) throw new Exception("buff == null");
2700 if (offs
+ Size
> buff
.Length
) throw new Exception("bounds");
2703 this.Semantics
= (MethodSemanticsAttributes
) LEBitConverter
.ToUInt16(buff
, offs
);
2704 offs
+= sizeof (ushort);
2705 this.Method
= LEBitConverter
.ToInt32(buff
, offs
);
2707 this.Association
= TabsDecoder
.DecodeToken(CodedTokenId
.HasSemantics
, LEBitConverter
.ToInt32(buff
, offs
));
2715 public void Dump(TextWriter writer
) {
2716 string dump
= String
.Format(
2717 "Semantics : {0}" + Environment
.NewLine
+
2718 "Method : {1}" + Environment
.NewLine
+
2719 "Association : {2}" + Environment
.NewLine
,
2720 (int)this.Semantics
,
2721 "Method[" + Method
.ToString() + "]",
2724 writer
.WriteLine(dump
);
2730 public override string ToString()
2732 StringWriter sw
= new StringWriter();
2734 return sw
.ToString();
2742 /// Represents row in MethodImpl table.
2745 /// See Partition II, Metadata; section 21.25
2747 public class MethodImplRow
: Row
{
2749 private MDTable table
;
2753 public MDToken MethodBody
;
2754 public MDToken MethodDeclaration
;
2756 public MethodImplRow()
2760 public MethodImplRow(MDTable parent
)
2767 /// Row in MethodImpl table has 3 columns.
2769 public virtual int NumberOfColumns
{
2777 /// Logical size of this instance in bytes.
2779 public virtual int Size
{
2788 public virtual MDTable Table
{
2796 /// Logical size of this type of row in bytes.
2798 unsafe public static int LogicalSize
{
2806 /// Fills the row from the array of bytes.
2808 unsafe public void FromRawData(byte [] buff
, int offs
)
2810 if (buff
== null) throw new Exception("buff == null");
2811 if (offs
+ Size
> buff
.Length
) throw new Exception("bounds");
2814 this.Class
= LEBitConverter
.ToInt32(buff
, offs
);
2816 this.MethodBody
= TabsDecoder
.DecodeToken(CodedTokenId
.MethodDefOrRef
, LEBitConverter
.ToInt32(buff
, offs
));
2818 this.MethodDeclaration
= TabsDecoder
.DecodeToken(CodedTokenId
.MethodDefOrRef
, LEBitConverter
.ToInt32(buff
, offs
));
2826 public void Dump(TextWriter writer
) {
2827 string dump
= String
.Format(
2828 "Class : {0}" + Environment
.NewLine
+
2829 "MethodBody : {1}" + Environment
.NewLine
+
2830 "MethodDeclaration : {2}" + Environment
.NewLine
,
2831 "TypeDef[" + Class
.ToString() + "]",
2833 this.MethodDeclaration
2835 writer
.WriteLine(dump
);
2841 public override string ToString()
2843 StringWriter sw
= new StringWriter();
2845 return sw
.ToString();
2853 /// Represents row in ModuleRef table.
2856 /// See Partition II, Metadata; section 21.28
2858 public class ModuleRefRow
: Row
{
2860 private MDTable table
;
2865 public ModuleRefRow()
2869 public ModuleRefRow(MDTable parent
)
2876 /// Row in ModuleRef table has 1 columns.
2878 public virtual int NumberOfColumns
{
2886 /// Logical size of this instance in bytes.
2888 public virtual int Size
{
2897 public virtual MDTable Table
{
2905 /// Logical size of this type of row in bytes.
2907 unsafe public static int LogicalSize
{
2915 /// Fills the row from the array of bytes.
2917 unsafe public void FromRawData(byte [] buff
, int offs
)
2919 if (buff
== null) throw new Exception("buff == null");
2920 if (offs
+ Size
> buff
.Length
) throw new Exception("bounds");
2923 this.Name
= LEBitConverter
.ToInt32(buff
, offs
);
2931 public void Dump(TextWriter writer
) {
2932 string dump
= String
.Format(
2933 "Name : {0}" + Environment
.NewLine
,
2934 (Table
== null) ? Name
.ToString() : "\"" + ((Table
.Heap
.Stream
.Root
.Streams
["#Strings"] as MDStream
).Heap
as StringsHeap
) [Name
] + "\" (#Strings[0x" + Name
.ToString("X") + "])"
2936 writer
.WriteLine(dump
);
2942 public override string ToString()
2944 StringWriter sw
= new StringWriter();
2946 return sw
.ToString();
2954 /// Represents row in TypeSpec table.
2957 /// See Partition II, Metadata; section 21.36
2959 public class TypeSpecRow
: Row
{
2961 private MDTable table
;
2964 public int Signature
;
2966 public TypeSpecRow()
2970 public TypeSpecRow(MDTable parent
)
2977 /// Row in TypeSpec table has 1 columns.
2979 public virtual int NumberOfColumns
{
2987 /// Logical size of this instance in bytes.
2989 public virtual int Size
{
2998 public virtual MDTable Table
{
3006 /// Logical size of this type of row in bytes.
3008 unsafe public static int LogicalSize
{
3016 /// Fills the row from the array of bytes.
3018 unsafe public void FromRawData(byte [] buff
, int offs
)
3020 if (buff
== null) throw new Exception("buff == null");
3021 if (offs
+ Size
> buff
.Length
) throw new Exception("bounds");
3024 this.Signature
= LEBitConverter
.ToInt32(buff
, offs
);
3032 public void Dump(TextWriter writer
) {
3033 string dump
= String
.Format(
3034 "Signature : {0}" + Environment
.NewLine
,
3035 "#Blob[" + Signature
.ToString() + "]"
3037 writer
.WriteLine(dump
);
3043 public override string ToString()
3045 StringWriter sw
= new StringWriter();
3047 return sw
.ToString();
3055 /// Represents row in ImplMap table.
3058 /// See Partition II, Metadata; section 21.20
3060 public class ImplMapRow
: Row
{
3062 private MDTable table
;
3065 public PInvokeAttributes MappingFlags
;
3066 public MDToken MemberForwarded
;
3067 public int ImportName
;
3068 public int ImportScope
;
3074 public ImplMapRow(MDTable parent
)
3081 /// Row in ImplMap table has 4 columns.
3083 public virtual int NumberOfColumns
{
3091 /// Logical size of this instance in bytes.
3093 public virtual int Size
{
3102 public virtual MDTable Table
{
3110 /// Logical size of this type of row in bytes.
3112 unsafe public static int LogicalSize
{
3114 return sizeof (ushort) + 4 + 4 + 4;
3120 /// Fills the row from the array of bytes.
3122 unsafe public void FromRawData(byte [] buff
, int offs
)
3124 if (buff
== null) throw new Exception("buff == null");
3125 if (offs
+ Size
> buff
.Length
) throw new Exception("bounds");
3128 this.MappingFlags
= (PInvokeAttributes
) LEBitConverter
.ToUInt16(buff
, offs
);
3129 offs
+= sizeof (ushort);
3130 this.MemberForwarded
= TabsDecoder
.DecodeToken(CodedTokenId
.MemberForwarded
, LEBitConverter
.ToInt32(buff
, offs
));
3132 this.ImportName
= LEBitConverter
.ToInt32(buff
, offs
);
3134 this.ImportScope
= LEBitConverter
.ToInt32(buff
, offs
);
3142 public void Dump(TextWriter writer
) {
3143 string dump
= String
.Format(
3144 "MappingFlags : {0}" + Environment
.NewLine
+
3145 "MemberForwarded : {1}" + Environment
.NewLine
+
3146 "ImportName : {2}" + Environment
.NewLine
+
3147 "ImportScope : {3}" + Environment
.NewLine
,
3149 this.MemberForwarded
,
3150 (Table
== null) ? ImportName
.ToString() : "\"" + ((Table
.Heap
.Stream
.Root
.Streams
["#Strings"] as MDStream
).Heap
as StringsHeap
) [ImportName
] + "\" (#Strings[0x" + ImportName
.ToString("X") + "])",
3151 "ModuleRef[" + ImportScope
.ToString() + "]"
3153 writer
.WriteLine(dump
);
3159 public override string ToString()
3161 StringWriter sw
= new StringWriter();
3163 return sw
.ToString();
3171 /// Represents row in FieldRVA table.
3174 /// See Partition II, Metadata; section 21.18
3176 public class FieldRVARow
: Row
{
3178 private MDTable table
;
3184 public FieldRVARow()
3188 public FieldRVARow(MDTable parent
)
3195 /// Row in FieldRVA table has 2 columns.
3197 public virtual int NumberOfColumns
{
3205 /// Logical size of this instance in bytes.
3207 public virtual int Size
{
3216 public virtual MDTable Table
{
3224 /// Logical size of this type of row in bytes.
3226 unsafe public static int LogicalSize
{
3228 return RVA
.Size
+ 4;
3234 /// Fills the row from the array of bytes.
3236 unsafe public void FromRawData(byte [] buff
, int offs
)
3238 if (buff
== null) throw new Exception("buff == null");
3239 if (offs
+ Size
> buff
.Length
) throw new Exception("bounds");
3242 this.RVA
= LEBitConverter
.ToUInt32(buff
, offs
);
3244 this.Field
= LEBitConverter
.ToInt32(buff
, offs
);
3252 public void Dump(TextWriter writer
) {
3253 string dump
= String
.Format(
3254 "RVA : {0}" + Environment
.NewLine
+
3255 "Field : {1}" + Environment
.NewLine
,
3257 "Field[" + Field
.ToString() + "]"
3259 writer
.WriteLine(dump
);
3265 public override string ToString()
3267 StringWriter sw
= new StringWriter();
3269 return sw
.ToString();
3277 /// Represents row in ENCLog table.
3282 public class ENCLogRow
: Row
{
3284 private MDTable table
;
3288 public uint FuncCode
;
3294 public ENCLogRow(MDTable parent
)
3301 /// Row in ENCLog table has 2 columns.
3303 public virtual int NumberOfColumns
{
3311 /// Logical size of this instance in bytes.
3313 public virtual int Size
{
3322 public virtual MDTable Table
{
3330 /// Logical size of this type of row in bytes.
3332 unsafe public static int LogicalSize
{
3334 return sizeof (uint) + sizeof (uint);
3340 /// Fills the row from the array of bytes.
3342 unsafe public void FromRawData(byte [] buff
, int offs
)
3344 if (buff
== null) throw new Exception("buff == null");
3345 if (offs
+ Size
> buff
.Length
) throw new Exception("bounds");
3348 this.Token
= LEBitConverter
.ToUInt32(buff
, offs
);
3349 offs
+= sizeof (uint);
3350 this.FuncCode
= LEBitConverter
.ToUInt32(buff
, offs
);
3358 public void Dump(TextWriter writer
) {
3359 string dump
= String
.Format(
3360 "Token : {0}" + Environment
.NewLine
+
3361 "FuncCode : {1}" + Environment
.NewLine
,
3365 writer
.WriteLine(dump
);
3371 public override string ToString()
3373 StringWriter sw
= new StringWriter();
3375 return sw
.ToString();
3383 /// Represents row in ENCMap table.
3388 public class ENCMapRow
: Row
{
3390 private MDTable table
;
3399 public ENCMapRow(MDTable parent
)
3406 /// Row in ENCMap table has 1 columns.
3408 public virtual int NumberOfColumns
{
3416 /// Logical size of this instance in bytes.
3418 public virtual int Size
{
3427 public virtual MDTable Table
{
3435 /// Logical size of this type of row in bytes.
3437 unsafe public static int LogicalSize
{
3439 return sizeof (uint);
3445 /// Fills the row from the array of bytes.
3447 unsafe public void FromRawData(byte [] buff
, int offs
)
3449 if (buff
== null) throw new Exception("buff == null");
3450 if (offs
+ Size
> buff
.Length
) throw new Exception("bounds");
3453 this.Token
= LEBitConverter
.ToUInt32(buff
, offs
);
3461 public void Dump(TextWriter writer
) {
3462 string dump
= String
.Format(
3463 "Token : {0}" + Environment
.NewLine
,
3466 writer
.WriteLine(dump
);
3472 public override string ToString()
3474 StringWriter sw
= new StringWriter();
3476 return sw
.ToString();
3484 /// Represents row in Assembly table.
3487 /// See Partition II, Metadata; section 21.2
3489 public class AssemblyRow
: Row
{
3491 private MDTable table
;
3494 public System
.Configuration
.Assemblies
.AssemblyHashAlgorithm HashAlgId
;
3495 public short MajorVersion
;
3496 public short MinorVersion
;
3497 public short BuildNumber
;
3498 public short RevisionNumber
;
3499 public AssemblyFlags Flags
;
3500 public int PublicKey
;
3504 public AssemblyRow()
3508 public AssemblyRow(MDTable parent
)
3515 /// Row in Assembly table has 9 columns.
3517 public virtual int NumberOfColumns
{
3525 /// Logical size of this instance in bytes.
3527 public virtual int Size
{
3536 public virtual MDTable Table
{
3544 /// Logical size of this type of row in bytes.
3546 unsafe public static int LogicalSize
{
3548 return sizeof (int) + sizeof (short) + sizeof (short) + sizeof (short) + sizeof (short) + sizeof (uint) + 4 + 4 + 4;
3554 /// Fills the row from the array of bytes.
3556 unsafe public void FromRawData(byte [] buff
, int offs
)
3558 if (buff
== null) throw new Exception("buff == null");
3559 if (offs
+ Size
> buff
.Length
) throw new Exception("bounds");
3562 this.HashAlgId
= (System
.Configuration
.Assemblies
.AssemblyHashAlgorithm
) LEBitConverter
.ToInt32(buff
, offs
);
3563 offs
+= sizeof (int);
3564 this.MajorVersion
= LEBitConverter
.ToInt16(buff
, offs
);
3565 offs
+= sizeof (short);
3566 this.MinorVersion
= LEBitConverter
.ToInt16(buff
, offs
);
3567 offs
+= sizeof (short);
3568 this.BuildNumber
= LEBitConverter
.ToInt16(buff
, offs
);
3569 offs
+= sizeof (short);
3570 this.RevisionNumber
= LEBitConverter
.ToInt16(buff
, offs
);
3571 offs
+= sizeof (short);
3572 this.Flags
= (AssemblyFlags
) LEBitConverter
.ToUInt32(buff
, offs
);
3573 offs
+= sizeof (uint);
3574 this.PublicKey
= LEBitConverter
.ToInt32(buff
, offs
);
3576 this.Name
= LEBitConverter
.ToInt32(buff
, offs
);
3578 this.Culture
= LEBitConverter
.ToInt32(buff
, offs
);
3586 public void Dump(TextWriter writer
) {
3587 string dump
= String
.Format(
3588 "HashAlgId : {0}" + Environment
.NewLine
+
3589 "MajorVersion : {1}" + Environment
.NewLine
+
3590 "MinorVersion : {2}" + Environment
.NewLine
+
3591 "BuildNumber : {3}" + Environment
.NewLine
+
3592 "RevisionNumber : {4}" + Environment
.NewLine
+
3593 "Flags : {5}" + Environment
.NewLine
+
3594 "PublicKey : {6}" + Environment
.NewLine
+
3595 "Name : {7}" + Environment
.NewLine
+
3596 "Culture : {8}" + Environment
.NewLine
,
3601 this.RevisionNumber
,
3603 "#Blob[" + PublicKey
.ToString() + "]",
3604 (Table
== null) ? Name
.ToString() : "\"" + ((Table
.Heap
.Stream
.Root
.Streams
["#Strings"] as MDStream
).Heap
as StringsHeap
) [Name
] + "\" (#Strings[0x" + Name
.ToString("X") + "])",
3605 (Table
== null) ? Culture
.ToString() : "\"" + ((Table
.Heap
.Stream
.Root
.Streams
["#Strings"] as MDStream
).Heap
as StringsHeap
) [Culture
] + "\" (#Strings[0x" + Culture
.ToString("X") + "])"
3607 writer
.WriteLine(dump
);
3613 public override string ToString()
3615 StringWriter sw
= new StringWriter();
3617 return sw
.ToString();
3625 /// Represents row in AssemblyProcessor table.
3628 /// See Partition II, Metadata; section 21.4
3630 public class AssemblyProcessorRow
: Row
{
3632 private MDTable table
;
3635 public int Processor
;
3637 public AssemblyProcessorRow()
3641 public AssemblyProcessorRow(MDTable parent
)
3648 /// Row in AssemblyProcessor table has 1 columns.
3650 public virtual int NumberOfColumns
{
3658 /// Logical size of this instance in bytes.
3660 public virtual int Size
{
3669 public virtual MDTable Table
{
3677 /// Logical size of this type of row in bytes.
3679 unsafe public static int LogicalSize
{
3681 return sizeof (int);
3687 /// Fills the row from the array of bytes.
3689 unsafe public void FromRawData(byte [] buff
, int offs
)
3691 if (buff
== null) throw new Exception("buff == null");
3692 if (offs
+ Size
> buff
.Length
) throw new Exception("bounds");
3695 this.Processor
= LEBitConverter
.ToInt32(buff
, offs
);
3703 public void Dump(TextWriter writer
) {
3704 string dump
= String
.Format(
3705 "Processor : {0}" + Environment
.NewLine
,
3708 writer
.WriteLine(dump
);
3714 public override string ToString()
3716 StringWriter sw
= new StringWriter();
3718 return sw
.ToString();
3726 /// Represents row in AssemblyOS table.
3729 /// See Partition II, Metadata; section 21.3
3731 public class AssemblyOSRow
: Row
{
3733 private MDTable table
;
3736 public int OSPlatformID
;
3737 public int OSMajorVersion
;
3738 public int OSMinorVersion
;
3740 public AssemblyOSRow()
3744 public AssemblyOSRow(MDTable parent
)
3751 /// Row in AssemblyOS table has 3 columns.
3753 public virtual int NumberOfColumns
{
3761 /// Logical size of this instance in bytes.
3763 public virtual int Size
{
3772 public virtual MDTable Table
{
3780 /// Logical size of this type of row in bytes.
3782 unsafe public static int LogicalSize
{
3784 return sizeof (int) + sizeof (int) + sizeof (int);
3790 /// Fills the row from the array of bytes.
3792 unsafe public void FromRawData(byte [] buff
, int offs
)
3794 if (buff
== null) throw new Exception("buff == null");
3795 if (offs
+ Size
> buff
.Length
) throw new Exception("bounds");
3798 this.OSPlatformID
= LEBitConverter
.ToInt32(buff
, offs
);
3799 offs
+= sizeof (int);
3800 this.OSMajorVersion
= LEBitConverter
.ToInt32(buff
, offs
);
3801 offs
+= sizeof (int);
3802 this.OSMinorVersion
= LEBitConverter
.ToInt32(buff
, offs
);
3810 public void Dump(TextWriter writer
) {
3811 string dump
= String
.Format(
3812 "OSPlatformID : {0}" + Environment
.NewLine
+
3813 "OSMajorVersion : {1}" + Environment
.NewLine
+
3814 "OSMinorVersion : {2}" + Environment
.NewLine
,
3816 this.OSMajorVersion
,
3819 writer
.WriteLine(dump
);
3825 public override string ToString()
3827 StringWriter sw
= new StringWriter();
3829 return sw
.ToString();
3837 /// Represents row in AssemblyRef table.
3840 /// See Partition II, Metadata; section 21.5
3842 public class AssemblyRefRow
: Row
{
3844 private MDTable table
;
3847 public short MajorVersion
;
3848 public short MinorVersion
;
3849 public short BuildNumber
;
3850 public short RevisionNumber
;
3851 public AssemblyFlags Flags
;
3852 public int PublicKeyOrToken
;
3855 public int HashValue
;
3857 public AssemblyRefRow()
3861 public AssemblyRefRow(MDTable parent
)
3868 /// Row in AssemblyRef table has 9 columns.
3870 public virtual int NumberOfColumns
{
3878 /// Logical size of this instance in bytes.
3880 public virtual int Size
{
3889 public virtual MDTable Table
{
3897 /// Logical size of this type of row in bytes.
3899 unsafe public static int LogicalSize
{
3901 return sizeof (short) + sizeof (short) + sizeof (short) + sizeof (short) + sizeof (uint) + 4 + 4 + 4 + 4;
3907 /// Fills the row from the array of bytes.
3909 unsafe public void FromRawData(byte [] buff
, int offs
)
3911 if (buff
== null) throw new Exception("buff == null");
3912 if (offs
+ Size
> buff
.Length
) throw new Exception("bounds");
3915 this.MajorVersion
= LEBitConverter
.ToInt16(buff
, offs
);
3916 offs
+= sizeof (short);
3917 this.MinorVersion
= LEBitConverter
.ToInt16(buff
, offs
);
3918 offs
+= sizeof (short);
3919 this.BuildNumber
= LEBitConverter
.ToInt16(buff
, offs
);
3920 offs
+= sizeof (short);
3921 this.RevisionNumber
= LEBitConverter
.ToInt16(buff
, offs
);
3922 offs
+= sizeof (short);
3923 this.Flags
= (AssemblyFlags
) LEBitConverter
.ToUInt32(buff
, offs
);
3924 offs
+= sizeof (uint);
3925 this.PublicKeyOrToken
= LEBitConverter
.ToInt32(buff
, offs
);
3927 this.Name
= LEBitConverter
.ToInt32(buff
, offs
);
3929 this.Culture
= LEBitConverter
.ToInt32(buff
, offs
);
3931 this.HashValue
= LEBitConverter
.ToInt32(buff
, offs
);
3939 public void Dump(TextWriter writer
) {
3940 string dump
= String
.Format(
3941 "MajorVersion : {0}" + Environment
.NewLine
+
3942 "MinorVersion : {1}" + Environment
.NewLine
+
3943 "BuildNumber : {2}" + Environment
.NewLine
+
3944 "RevisionNumber : {3}" + Environment
.NewLine
+
3945 "Flags : {4}" + Environment
.NewLine
+
3946 "PublicKeyOrToken : {5}" + Environment
.NewLine
+
3947 "Name : {6}" + Environment
.NewLine
+
3948 "Culture : {7}" + Environment
.NewLine
+
3949 "HashValue : {8}" + Environment
.NewLine
,
3953 this.RevisionNumber
,
3955 "#Blob[" + PublicKeyOrToken
.ToString() + "]",
3956 (Table
== null) ? Name
.ToString() : "\"" + ((Table
.Heap
.Stream
.Root
.Streams
["#Strings"] as MDStream
).Heap
as StringsHeap
) [Name
] + "\" (#Strings[0x" + Name
.ToString("X") + "])",
3957 (Table
== null) ? Culture
.ToString() : "\"" + ((Table
.Heap
.Stream
.Root
.Streams
["#Strings"] as MDStream
).Heap
as StringsHeap
) [Culture
] + "\" (#Strings[0x" + Culture
.ToString("X") + "])",
3958 "#Blob[" + HashValue
.ToString() + "]"
3960 writer
.WriteLine(dump
);
3966 public override string ToString()
3968 StringWriter sw
= new StringWriter();
3970 return sw
.ToString();
3978 /// Represents row in AssemblyRefProcessor table.
3981 /// See Partition II, Metadata; section 21.7
3983 public class AssemblyRefProcessorRow
: Row
{
3985 private MDTable table
;
3988 public int Processor
;
3989 public int AssemblyRef
;
3991 public AssemblyRefProcessorRow()
3995 public AssemblyRefProcessorRow(MDTable parent
)
4002 /// Row in AssemblyRefProcessor table has 2 columns.
4004 public virtual int NumberOfColumns
{
4012 /// Logical size of this instance in bytes.
4014 public virtual int Size
{
4023 public virtual MDTable Table
{
4031 /// Logical size of this type of row in bytes.
4033 unsafe public static int LogicalSize
{
4035 return sizeof (int) + 4;
4041 /// Fills the row from the array of bytes.
4043 unsafe public void FromRawData(byte [] buff
, int offs
)
4045 if (buff
== null) throw new Exception("buff == null");
4046 if (offs
+ Size
> buff
.Length
) throw new Exception("bounds");
4049 this.Processor
= LEBitConverter
.ToInt32(buff
, offs
);
4050 offs
+= sizeof (int);
4051 this.AssemblyRef
= LEBitConverter
.ToInt32(buff
, offs
);
4059 public void Dump(TextWriter writer
) {
4060 string dump
= String
.Format(
4061 "Processor : {0}" + Environment
.NewLine
+
4062 "AssemblyRef : {1}" + Environment
.NewLine
,
4064 "AssemblyRef[" + AssemblyRef
.ToString() + "]"
4066 writer
.WriteLine(dump
);
4072 public override string ToString()
4074 StringWriter sw
= new StringWriter();
4076 return sw
.ToString();
4084 /// Represents row in AssemblyRefOS table.
4087 /// See Partition II, Metadata; section 21.6
4089 public class AssemblyRefOSRow
: Row
{
4091 private MDTable table
;
4094 public int OSPlatformID
;
4095 public int OSMajorVersion
;
4096 public int OSMinorVersion
;
4097 public int AssemblyRef
;
4099 public AssemblyRefOSRow()
4103 public AssemblyRefOSRow(MDTable parent
)
4110 /// Row in AssemblyRefOS table has 4 columns.
4112 public virtual int NumberOfColumns
{
4120 /// Logical size of this instance in bytes.
4122 public virtual int Size
{
4131 public virtual MDTable Table
{
4139 /// Logical size of this type of row in bytes.
4141 unsafe public static int LogicalSize
{
4143 return sizeof (int) + sizeof (int) + sizeof (int) + 4;
4149 /// Fills the row from the array of bytes.
4151 unsafe public void FromRawData(byte [] buff
, int offs
)
4153 if (buff
== null) throw new Exception("buff == null");
4154 if (offs
+ Size
> buff
.Length
) throw new Exception("bounds");
4157 this.OSPlatformID
= LEBitConverter
.ToInt32(buff
, offs
);
4158 offs
+= sizeof (int);
4159 this.OSMajorVersion
= LEBitConverter
.ToInt32(buff
, offs
);
4160 offs
+= sizeof (int);
4161 this.OSMinorVersion
= LEBitConverter
.ToInt32(buff
, offs
);
4162 offs
+= sizeof (int);
4163 this.AssemblyRef
= LEBitConverter
.ToInt32(buff
, offs
);
4171 public void Dump(TextWriter writer
) {
4172 string dump
= String
.Format(
4173 "OSPlatformID : {0}" + Environment
.NewLine
+
4174 "OSMajorVersion : {1}" + Environment
.NewLine
+
4175 "OSMinorVersion : {2}" + Environment
.NewLine
+
4176 "AssemblyRef : {3}" + Environment
.NewLine
,
4178 this.OSMajorVersion
,
4179 this.OSMinorVersion
,
4180 "AssemblyRef[" + AssemblyRef
.ToString() + "]"
4182 writer
.WriteLine(dump
);
4188 public override string ToString()
4190 StringWriter sw
= new StringWriter();
4192 return sw
.ToString();
4200 /// Represents row in File table.
4203 /// See Partition II, Metadata; section 21.19
4205 public class FileRow
: Row
{
4207 private MDTable table
;
4210 public System
.IO
.FileAttributes Flags
;
4212 public int HashValue
;
4218 public FileRow(MDTable parent
)
4225 /// Row in File table has 3 columns.
4227 public virtual int NumberOfColumns
{
4235 /// Logical size of this instance in bytes.
4237 public virtual int Size
{
4246 public virtual MDTable Table
{
4254 /// Logical size of this type of row in bytes.
4256 unsafe public static int LogicalSize
{
4258 return sizeof (uint) + 4 + 4;
4264 /// Fills the row from the array of bytes.
4266 unsafe public void FromRawData(byte [] buff
, int offs
)
4268 if (buff
== null) throw new Exception("buff == null");
4269 if (offs
+ Size
> buff
.Length
) throw new Exception("bounds");
4272 this.Flags
= (System
.IO
.FileAttributes
) LEBitConverter
.ToUInt32(buff
, offs
);
4273 offs
+= sizeof (uint);
4274 this.Name
= LEBitConverter
.ToInt32(buff
, offs
);
4276 this.HashValue
= LEBitConverter
.ToInt32(buff
, offs
);
4284 public void Dump(TextWriter writer
) {
4285 string dump
= String
.Format(
4286 "Flags : {0}" + Environment
.NewLine
+
4287 "Name : {1}" + Environment
.NewLine
+
4288 "HashValue : {2}" + Environment
.NewLine
,
4290 (Table
== null) ? Name
.ToString() : "\"" + ((Table
.Heap
.Stream
.Root
.Streams
["#Strings"] as MDStream
).Heap
as StringsHeap
) [Name
] + "\" (#Strings[0x" + Name
.ToString("X") + "])",
4291 "#Blob[" + HashValue
.ToString() + "]"
4293 writer
.WriteLine(dump
);
4299 public override string ToString()
4301 StringWriter sw
= new StringWriter();
4303 return sw
.ToString();
4311 /// Represents row in ExportedType table.
4314 /// See Partition II, Metadata; section 21.14
4316 public class ExportedTypeRow
: Row
{
4318 private MDTable table
;
4321 public System
.Reflection
.TypeAttributes Flags
;
4322 public int TypeDefId
;
4323 public int TypeName
;
4324 public int TypeNamespace
;
4325 public MDToken Implementation
;
4327 public ExportedTypeRow()
4331 public ExportedTypeRow(MDTable parent
)
4338 /// Row in ExportedType table has 5 columns.
4340 public virtual int NumberOfColumns
{
4348 /// Logical size of this instance in bytes.
4350 public virtual int Size
{
4359 public virtual MDTable Table
{
4367 /// Logical size of this type of row in bytes.
4369 unsafe public static int LogicalSize
{
4371 return sizeof (uint) + 4 + 4 + 4 + 4;
4377 /// Fills the row from the array of bytes.
4379 unsafe public void FromRawData(byte [] buff
, int offs
)
4381 if (buff
== null) throw new Exception("buff == null");
4382 if (offs
+ Size
> buff
.Length
) throw new Exception("bounds");
4385 this.Flags
= (System
.Reflection
.TypeAttributes
) LEBitConverter
.ToUInt32(buff
, offs
);
4386 offs
+= sizeof (uint);
4387 this.TypeDefId
= LEBitConverter
.ToInt32(buff
, offs
);
4389 this.TypeName
= LEBitConverter
.ToInt32(buff
, offs
);
4391 this.TypeNamespace
= LEBitConverter
.ToInt32(buff
, offs
);
4393 this.Implementation
= TabsDecoder
.DecodeToken(CodedTokenId
.Implementation
, LEBitConverter
.ToInt32(buff
, offs
));
4401 public void Dump(TextWriter writer
) {
4402 string dump
= String
.Format(
4403 "Flags : {0}" + Environment
.NewLine
+
4404 "TypeDefId : {1}" + Environment
.NewLine
+
4405 "TypeName : {2}" + Environment
.NewLine
+
4406 "TypeNamespace : {3}" + Environment
.NewLine
+
4407 "Implementation : {4}" + Environment
.NewLine
,
4409 "TypeDef[" + TypeDefId
.ToString() + "]",
4410 (Table
== null) ? TypeName
.ToString() : "\"" + ((Table
.Heap
.Stream
.Root
.Streams
["#Strings"] as MDStream
).Heap
as StringsHeap
) [TypeName
] + "\" (#Strings[0x" + TypeName
.ToString("X") + "])",
4411 (Table
== null) ? TypeNamespace
.ToString() : "\"" + ((Table
.Heap
.Stream
.Root
.Streams
["#Strings"] as MDStream
).Heap
as StringsHeap
) [TypeNamespace
] + "\" (#Strings[0x" + TypeNamespace
.ToString("X") + "])",
4414 writer
.WriteLine(dump
);
4420 public override string ToString()
4422 StringWriter sw
= new StringWriter();
4424 return sw
.ToString();
4432 /// Represents row in ManifestResource table.
4435 /// See Partition II, Metadata; section 21.22
4437 public class ManifestResourceRow
: Row
{
4439 private MDTable table
;
4443 public ManifestResourceAttributes Flags
;
4445 public MDToken Implementation
;
4447 public ManifestResourceRow()
4451 public ManifestResourceRow(MDTable parent
)
4458 /// Row in ManifestResource table has 4 columns.
4460 public virtual int NumberOfColumns
{
4468 /// Logical size of this instance in bytes.
4470 public virtual int Size
{
4479 public virtual MDTable Table
{
4487 /// Logical size of this type of row in bytes.
4489 unsafe public static int LogicalSize
{
4491 return sizeof (int) + sizeof (uint) + 4 + 4;
4497 /// Fills the row from the array of bytes.
4499 unsafe public void FromRawData(byte [] buff
, int offs
)
4501 if (buff
== null) throw new Exception("buff == null");
4502 if (offs
+ Size
> buff
.Length
) throw new Exception("bounds");
4505 this.Offset
= LEBitConverter
.ToInt32(buff
, offs
);
4506 offs
+= sizeof (int);
4507 this.Flags
= (ManifestResourceAttributes
) LEBitConverter
.ToUInt32(buff
, offs
);
4508 offs
+= sizeof (uint);
4509 this.Name
= LEBitConverter
.ToInt32(buff
, offs
);
4511 this.Implementation
= TabsDecoder
.DecodeToken(CodedTokenId
.Implementation
, LEBitConverter
.ToInt32(buff
, offs
));
4519 public void Dump(TextWriter writer
) {
4520 string dump
= String
.Format(
4521 "Offset : {0}" + Environment
.NewLine
+
4522 "Flags : {1}" + Environment
.NewLine
+
4523 "Name : {2}" + Environment
.NewLine
+
4524 "Implementation : {3}" + Environment
.NewLine
,
4527 (Table
== null) ? Name
.ToString() : "\"" + ((Table
.Heap
.Stream
.Root
.Streams
["#Strings"] as MDStream
).Heap
as StringsHeap
) [Name
] + "\" (#Strings[0x" + Name
.ToString("X") + "])",
4530 writer
.WriteLine(dump
);
4536 public override string ToString()
4538 StringWriter sw
= new StringWriter();
4540 return sw
.ToString();
4548 /// Represents row in NestedClass table.
4551 /// See Partition II, Metadata; section 21.29
4553 public class NestedClassRow
: Row
{
4555 private MDTable table
;
4558 public int NestedClass
;
4559 public int EnclosingClass
;
4561 public NestedClassRow()
4565 public NestedClassRow(MDTable parent
)
4572 /// Row in NestedClass table has 2 columns.
4574 public virtual int NumberOfColumns
{
4582 /// Logical size of this instance in bytes.
4584 public virtual int Size
{
4593 public virtual MDTable Table
{
4601 /// Logical size of this type of row in bytes.
4603 unsafe public static int LogicalSize
{
4611 /// Fills the row from the array of bytes.
4613 unsafe public void FromRawData(byte [] buff
, int offs
)
4615 if (buff
== null) throw new Exception("buff == null");
4616 if (offs
+ Size
> buff
.Length
) throw new Exception("bounds");
4619 this.NestedClass
= LEBitConverter
.ToInt32(buff
, offs
);
4621 this.EnclosingClass
= LEBitConverter
.ToInt32(buff
, offs
);
4629 public void Dump(TextWriter writer
) {
4630 string dump
= String
.Format(
4631 "NestedClass : {0}" + Environment
.NewLine
+
4632 "EnclosingClass : {1}" + Environment
.NewLine
,
4633 "TypeDef[" + NestedClass
.ToString() + "]",
4634 "TypeDef[" + EnclosingClass
.ToString() + "]"
4636 writer
.WriteLine(dump
);
4642 public override string ToString()
4644 StringWriter sw
= new StringWriter();
4646 return sw
.ToString();
4654 /// Represents row in TypeTyPar table.
4659 public class TypeTyParRow
: Row
{
4661 private MDTable table
;
4664 public ushort Number
;
4666 public MDToken Bound
;
4669 public TypeTyParRow()
4673 public TypeTyParRow(MDTable parent
)
4680 /// Row in TypeTyPar table has 4 columns.
4682 public virtual int NumberOfColumns
{
4690 /// Logical size of this instance in bytes.
4692 public virtual int Size
{
4701 public virtual MDTable Table
{
4709 /// Logical size of this type of row in bytes.
4711 unsafe public static int LogicalSize
{
4713 return sizeof (ushort) + 4 + 4 + 4;
4719 /// Fills the row from the array of bytes.
4721 unsafe public void FromRawData(byte [] buff
, int offs
)
4723 if (buff
== null) throw new Exception("buff == null");
4724 if (offs
+ Size
> buff
.Length
) throw new Exception("bounds");
4727 this.Number
= LEBitConverter
.ToUInt16(buff
, offs
);
4728 offs
+= sizeof (ushort);
4729 this.Class
= LEBitConverter
.ToInt32(buff
, offs
);
4731 this.Bound
= TabsDecoder
.DecodeToken(CodedTokenId
.TypeDefOrRef
, LEBitConverter
.ToInt32(buff
, offs
));
4733 this.Name
= LEBitConverter
.ToInt32(buff
, offs
);
4741 public void Dump(TextWriter writer
) {
4742 string dump
= String
.Format(
4743 "Number : {0}" + Environment
.NewLine
+
4744 "Class : {1}" + Environment
.NewLine
+
4745 "Bound : {2}" + Environment
.NewLine
+
4746 "Name : {3}" + Environment
.NewLine
,
4748 "TypeDef[" + Class
.ToString() + "]",
4750 (Table
== null) ? Name
.ToString() : "\"" + ((Table
.Heap
.Stream
.Root
.Streams
["#Strings"] as MDStream
).Heap
as StringsHeap
) [Name
] + "\" (#Strings[0x" + Name
.ToString("X") + "])"
4752 writer
.WriteLine(dump
);
4758 public override string ToString()
4760 StringWriter sw
= new StringWriter();
4762 return sw
.ToString();
4770 /// Represents row in MethodTyPar table.
4775 public class MethodTyParRow
: Row
{
4777 private MDTable table
;
4780 public ushort Number
;
4782 public MDToken Bound
;
4785 public MethodTyParRow()
4789 public MethodTyParRow(MDTable parent
)
4796 /// Row in MethodTyPar table has 4 columns.
4798 public virtual int NumberOfColumns
{
4806 /// Logical size of this instance in bytes.
4808 public virtual int Size
{
4817 public virtual MDTable Table
{
4825 /// Logical size of this type of row in bytes.
4827 unsafe public static int LogicalSize
{
4829 return sizeof (ushort) + 4 + 4 + 4;
4835 /// Fills the row from the array of bytes.
4837 unsafe public void FromRawData(byte [] buff
, int offs
)
4839 if (buff
== null) throw new Exception("buff == null");
4840 if (offs
+ Size
> buff
.Length
) throw new Exception("bounds");
4843 this.Number
= LEBitConverter
.ToUInt16(buff
, offs
);
4844 offs
+= sizeof (ushort);
4845 this.Method
= LEBitConverter
.ToInt32(buff
, offs
);
4847 this.Bound
= TabsDecoder
.DecodeToken(CodedTokenId
.TypeDefOrRef
, LEBitConverter
.ToInt32(buff
, offs
));
4849 this.Name
= LEBitConverter
.ToInt32(buff
, offs
);
4857 public void Dump(TextWriter writer
) {
4858 string dump
= String
.Format(
4859 "Number : {0}" + Environment
.NewLine
+
4860 "Method : {1}" + Environment
.NewLine
+
4861 "Bound : {2}" + Environment
.NewLine
+
4862 "Name : {3}" + Environment
.NewLine
,
4864 "Method[" + Method
.ToString() + "]",
4866 (Table
== null) ? Name
.ToString() : "\"" + ((Table
.Heap
.Stream
.Root
.Streams
["#Strings"] as MDStream
).Heap
as StringsHeap
) [Name
] + "\" (#Strings[0x" + Name
.ToString("X") + "])"
4868 writer
.WriteLine(dump
);
4874 public override string ToString()
4876 StringWriter sw
= new StringWriter();
4878 return sw
.ToString();