1 // Auto-generated file - DO NOT EDIT!
2 // Please edit md-schema.xml or tabs-decoder.xsl if you want to make changes.
6 namespace Mono
.PEToolkit
.Metadata
{
13 public sealed class TabsDecoder
{
24 public static MDToken
DecodeToken(CodedTokenId id
, int data
)
26 MDToken res
= new MDToken();
33 case CodedTokenId
.TypeDefOrRef
:
35 rid
= (int) ((uint) data
>> 2);
39 tok
= TokenType
.TypeDef
;
43 tok
= TokenType
.TypeRef
;
47 tok
= TokenType
.TypeSpec
;
51 throw new BadMetaDataException("Invalid coded token for TypeDefOrRef, unknown table tag - " + tag
);
53 res
= new MDToken(tok
, rid
);
56 case CodedTokenId
.HasConstant
:
58 rid
= (int) ((uint) data
>> 2);
62 tok
= TokenType
.FieldDef
;
66 tok
= TokenType
.ParamDef
;
70 tok
= TokenType
.Property
;
74 throw new BadMetaDataException("Invalid coded token for HasConstant, unknown table tag - " + tag
);
76 res
= new MDToken(tok
, rid
);
79 case CodedTokenId
.HasCustomAttribute
:
81 rid
= (int) ((uint) data
>> 5);
85 tok
= TokenType
.MethodDef
;
89 tok
= TokenType
.FieldDef
;
93 tok
= TokenType
.TypeRef
;
97 tok
= TokenType
.TypeDef
;
101 tok
= TokenType
.ParamDef
;
105 tok
= TokenType
.InterfaceImpl
;
109 tok
= TokenType
.MemberRef
;
113 tok
= TokenType
.Module
;
117 tok
= TokenType
.Permission
;
121 tok
= TokenType
.Property
;
125 tok
= TokenType
.Event
;
129 tok
= TokenType
.Signature
;
133 tok
= TokenType
.ModuleRef
;
137 tok
= TokenType
.TypeSpec
;
141 tok
= TokenType
.Assembly
;
145 tok
= TokenType
.AssemblyRef
;
149 tok
= TokenType
.File
;
153 tok
= TokenType
.ExportedType
;
157 tok
= TokenType
.ManifestResource
;
161 throw new BadMetaDataException("Invalid coded token for HasCustomAttribute, unknown table tag - " + tag
);
163 res
= new MDToken(tok
, rid
);
166 case CodedTokenId
.HasFieldMarshal
:
168 rid
= (int) ((uint) data
>> 1);
172 tok
= TokenType
.FieldDef
;
176 tok
= TokenType
.ParamDef
;
180 throw new BadMetaDataException("Invalid coded token for HasFieldMarshal, unknown table tag - " + tag
);
182 res
= new MDToken(tok
, rid
);
185 case CodedTokenId
.HasDeclSecurity
:
187 rid
= (int) ((uint) data
>> 2);
191 tok
= TokenType
.TypeDef
;
195 tok
= TokenType
.MethodDef
;
199 tok
= TokenType
.Assembly
;
203 throw new BadMetaDataException("Invalid coded token for HasDeclSecurity, unknown table tag - " + tag
);
205 res
= new MDToken(tok
, rid
);
208 case CodedTokenId
.MemberRefParent
:
210 rid
= (int) ((uint) data
>> 3);
214 tok
= TokenType
.TypeDef
;
218 tok
= TokenType
.TypeRef
;
222 tok
= TokenType
.ModuleRef
;
226 tok
= TokenType
.MethodDef
;
230 tok
= TokenType
.TypeSpec
;
234 throw new BadMetaDataException("Invalid coded token for MemberRefParent, unknown table tag - " + tag
);
236 res
= new MDToken(tok
, rid
);
239 case CodedTokenId
.HasSemantics
:
241 rid
= (int) ((uint) data
>> 1);
245 tok
= TokenType
.Event
;
249 tok
= TokenType
.Property
;
253 throw new BadMetaDataException("Invalid coded token for HasSemantics, unknown table tag - " + tag
);
255 res
= new MDToken(tok
, rid
);
258 case CodedTokenId
.MethodDefOrRef
:
260 rid
= (int) ((uint) data
>> 1);
264 tok
= TokenType
.MethodDef
;
268 tok
= TokenType
.MemberRef
;
272 throw new BadMetaDataException("Invalid coded token for MethodDefOrRef, unknown table tag - " + tag
);
274 res
= new MDToken(tok
, rid
);
277 case CodedTokenId
.MemberForwarded
:
279 rid
= (int) ((uint) data
>> 1);
283 tok
= TokenType
.FieldDef
;
287 tok
= TokenType
.MethodDef
;
291 throw new BadMetaDataException("Invalid coded token for MemberForwarded, unknown table tag - " + tag
);
293 res
= new MDToken(tok
, rid
);
296 case CodedTokenId
.Implementation
:
298 rid
= (int) ((uint) data
>> 2);
302 tok
= TokenType
.File
;
306 tok
= TokenType
.AssemblyRef
;
310 tok
= TokenType
.ExportedType
;
314 throw new BadMetaDataException("Invalid coded token for Implementation, unknown table tag - " + tag
);
316 res
= new MDToken(tok
, rid
);
319 case CodedTokenId
.CustomAttributeType
:
321 rid
= (int) ((uint) data
>> 3);
325 tok
= TokenType
.TypeRef
;
329 tok
= TokenType
.TypeDef
;
333 tok
= TokenType
.MethodDef
;
337 tok
= TokenType
.MemberRef
;
341 tok
= TokenType
.String
;
345 throw new BadMetaDataException("Invalid coded token for CustomAttributeType, unknown table tag - " + tag
);
347 res
= new MDToken(tok
, rid
);
350 case CodedTokenId
.ResolutionScope
:
352 rid
= (int) ((uint) data
>> 2);
356 tok
= TokenType
.Module
;
360 tok
= TokenType
.ModuleRef
;
364 tok
= TokenType
.AssemblyRef
;
368 tok
= TokenType
.TypeRef
;
372 throw new BadMetaDataException("Invalid coded token for ResolutionScope, unknown table tag - " + tag
);
374 res
= new MDToken(tok
, rid
);
384 private static int GetCodedIndexSize(TablesHeap heap
, CodedTokenId id
, int [] rows
)
390 case CodedTokenId
.TypeDefOrRef
:
391 res
= MDUtils
.Max(rows
[(int) TableId
.TypeDef
], rows
[(int) TableId
.TypeRef
], rows
[(int) TableId
.TypeSpec
]);
392 res
= res
< (1 << (16 - 2)) ? 2 : 4;
395 case CodedTokenId
.HasConstant
:
396 res
= MDUtils
.Max(rows
[(int) TableId
.Field
], rows
[(int) TableId
.Param
], rows
[(int) TableId
.Property
]);
397 res
= res
< (1 << (16 - 2)) ? 2 : 4;
400 case CodedTokenId
.HasCustomAttribute
:
401 res
= MDUtils
.Max(rows
[(int) TableId
.Method
], rows
[(int) TableId
.Field
], rows
[(int) TableId
.TypeRef
], rows
[(int) TableId
.TypeDef
], rows
[(int) TableId
.Param
], rows
[(int) TableId
.InterfaceImpl
], rows
[(int) TableId
.MemberRef
], rows
[(int) TableId
.Module
], rows
[(int) TableId
.DeclSecurity
], rows
[(int) TableId
.Property
], rows
[(int) TableId
.Event
], rows
[(int) TableId
.StandAloneSig
], rows
[(int) TableId
.ModuleRef
], rows
[(int) TableId
.TypeSpec
], rows
[(int) TableId
.Assembly
], rows
[(int) TableId
.AssemblyRef
], rows
[(int) TableId
.File
], rows
[(int) TableId
.ExportedType
], rows
[(int) TableId
.ManifestResource
]);
402 res
= res
< (1 << (16 - 5)) ? 2 : 4;
405 case CodedTokenId
.HasFieldMarshal
:
406 res
= MDUtils
.Max(rows
[(int) TableId
.Field
], rows
[(int) TableId
.Param
]);
407 res
= res
< (1 << (16 - 1)) ? 2 : 4;
410 case CodedTokenId
.HasDeclSecurity
:
411 res
= MDUtils
.Max(rows
[(int) TableId
.TypeDef
], rows
[(int) TableId
.Method
], rows
[(int) TableId
.Assembly
]);
412 res
= res
< (1 << (16 - 2)) ? 2 : 4;
415 case CodedTokenId
.MemberRefParent
:
416 res
= MDUtils
.Max(rows
[(int) TableId
.TypeDef
], rows
[(int) TableId
.TypeRef
], rows
[(int) TableId
.ModuleRef
], rows
[(int) TableId
.Method
], rows
[(int) TableId
.TypeSpec
]);
417 res
= res
< (1 << (16 - 3)) ? 2 : 4;
420 case CodedTokenId
.HasSemantics
:
421 res
= MDUtils
.Max(rows
[(int) TableId
.Event
], rows
[(int) TableId
.Property
]);
422 res
= res
< (1 << (16 - 1)) ? 2 : 4;
425 case CodedTokenId
.MethodDefOrRef
:
426 res
= MDUtils
.Max(rows
[(int) TableId
.Method
], rows
[(int) TableId
.MemberRef
]);
427 res
= res
< (1 << (16 - 1)) ? 2 : 4;
430 case CodedTokenId
.MemberForwarded
:
431 res
= MDUtils
.Max(rows
[(int) TableId
.Field
], rows
[(int) TableId
.Method
]);
432 res
= res
< (1 << (16 - 1)) ? 2 : 4;
435 case CodedTokenId
.Implementation
:
436 res
= MDUtils
.Max(rows
[(int) TableId
.File
], rows
[(int) TableId
.AssemblyRef
], rows
[(int) TableId
.ExportedType
]);
437 res
= res
< (1 << (16 - 2)) ? 2 : 4;
440 case CodedTokenId
.CustomAttributeType
:
441 res
= MDUtils
.Max(rows
[(int) TableId
.TypeRef
], rows
[(int) TableId
.TypeDef
], rows
[(int) TableId
.Method
], rows
[(int) TableId
.MemberRef
], (heap
.StringsIndexSize
> 2 ? 1 << 17 : 1));
442 res
= res
< (1 << (16 - 3)) ? 2 : 4;
445 case CodedTokenId
.ResolutionScope
:
446 res
= MDUtils
.Max(rows
[(int) TableId
.Module
], rows
[(int) TableId
.ModuleRef
], rows
[(int) TableId
.AssemblyRef
], rows
[(int) TableId
.TypeRef
]);
447 res
= res
< (1 << (16 - 2)) ? 2 : 4;
458 private static int GetIndexSize(TableId tab
, int [] rows
)
460 // Index is 2 bytes wide if table has less than 2^16 rows
461 // otherwise it's 4 bytes wide.
462 return ((uint) rows
[(int) tab
]) < (1 << 16) ? 2 : 4;
466 private static void AllocBuff(ref byte [] buff
, int size
)
468 if (buff
== null || buff
.Length
< size
) {
469 buff
= new byte [(size
+ 4) & ~
3];
471 Array
.Clear(buff
, 0, size
);
477 unsafe public static int DecodePhysicalTables(TablesHeap heap
, byte [] data
, int offs
, int [] rows
)
479 int rowSize
; // expanded row size (all indices are dwords)
480 int fldSize
; // physical field size
484 int si
= heap
.StringsIndexSize
;
485 int gi
= heap
.GUIDIndexSize
;
486 int bi
= heap
.BlobIndexSize
;
488 if (heap
.HasModule
) {
489 rowSize
= sizeof (ushort) + 4 + 4 + 4 + 4;
490 nRows
= rows
[(int) TableId
.Module
];
491 AllocBuff(ref buff
, rowSize
* nRows
);
494 MDTable tab
= new ModuleTable(heap
);
496 for (int i
= nRows
; --i
>= 0;) {
498 // Generation, ushort
499 fldSize
= sizeof (ushort);
500 Array
.Copy(data
, offs
, buff
, dest
, fldSize
);
502 dest
+= sizeof (ushort);
504 // Name, index(#Strings)
506 Array
.Copy(data
, offs
, buff
, dest
, fldSize
);
510 // Mvid, index(#GUID)
512 Array
.Copy(data
, offs
, buff
, dest
, fldSize
);
516 // EncId, index(#GUID)
518 Array
.Copy(data
, offs
, buff
, dest
, fldSize
);
522 // EncBaseId, index(#GUID)
524 Array
.Copy(data
, offs
, buff
, dest
, fldSize
);
530 tab
.FromRawData(buff
, 0, nRows
);
533 if (heap
.HasTypeRef
) {
535 nRows
= rows
[(int) TableId
.TypeRef
];
536 AllocBuff(ref buff
, rowSize
* nRows
);
539 MDTable tab
= new TypeRefTable(heap
);
541 for (int i
= nRows
; --i
>= 0;) {
543 // ResolutionScope, coded-index(ResolutionScope)
544 fldSize
= GetCodedIndexSize(heap
, CodedTokenId
.ResolutionScope
, rows
);
545 Array
.Copy(data
, offs
, buff
, dest
, fldSize
);
549 // Name, index(#Strings)
551 Array
.Copy(data
, offs
, buff
, dest
, fldSize
);
555 // Namespace, index(#Strings)
557 Array
.Copy(data
, offs
, buff
, dest
, fldSize
);
563 tab
.FromRawData(buff
, 0, nRows
);
566 if (heap
.HasTypeDef
) {
567 rowSize
= sizeof (uint) + 4 + 4 + 4 + 4 + 4;
568 nRows
= rows
[(int) TableId
.TypeDef
];
569 AllocBuff(ref buff
, rowSize
* nRows
);
572 MDTable tab
= new TypeDefTable(heap
);
574 for (int i
= nRows
; --i
>= 0;) {
577 fldSize
= sizeof (uint);
578 Array
.Copy(data
, offs
, buff
, dest
, fldSize
);
580 dest
+= sizeof (uint);
582 // Name, index(#Strings)
584 Array
.Copy(data
, offs
, buff
, dest
, fldSize
);
588 // Namespace, index(#Strings)
590 Array
.Copy(data
, offs
, buff
, dest
, fldSize
);
594 // Extends, coded-index(TypeDefOrRef)
595 fldSize
= GetCodedIndexSize(heap
, CodedTokenId
.TypeDefOrRef
, rows
);
596 Array
.Copy(data
, offs
, buff
, dest
, fldSize
);
600 // FieldList, index(Field)
601 fldSize
= GetIndexSize(TableId
.Field
, rows
);
602 Array
.Copy(data
, offs
, buff
, dest
, fldSize
);
606 // MethodList, index(Method)
607 fldSize
= GetIndexSize(TableId
.Method
, rows
);
608 Array
.Copy(data
, offs
, buff
, dest
, fldSize
);
614 tab
.FromRawData(buff
, 0, nRows
);
617 if (heap
.HasFieldPtr
) {
619 nRows
= rows
[(int) TableId
.FieldPtr
];
620 AllocBuff(ref buff
, rowSize
* nRows
);
623 MDTable tab
= new FieldPtrTable(heap
);
625 for (int i
= nRows
; --i
>= 0;) {
627 // Field, index(Field)
628 fldSize
= GetIndexSize(TableId
.Field
, rows
);
629 Array
.Copy(data
, offs
, buff
, dest
, fldSize
);
635 tab
.FromRawData(buff
, 0, nRows
);
639 rowSize
= sizeof (ushort) + 4 + 4;
640 nRows
= rows
[(int) TableId
.Field
];
641 AllocBuff(ref buff
, rowSize
* nRows
);
644 MDTable tab
= new FieldTable(heap
);
646 for (int i
= nRows
; --i
>= 0;) {
649 fldSize
= sizeof (ushort);
650 Array
.Copy(data
, offs
, buff
, dest
, fldSize
);
652 dest
+= sizeof (ushort);
654 // Name, index(#Strings)
656 Array
.Copy(data
, offs
, buff
, dest
, fldSize
);
660 // Signature, index(#Blob)
662 Array
.Copy(data
, offs
, buff
, dest
, fldSize
);
668 tab
.FromRawData(buff
, 0, nRows
);
671 if (heap
.HasMethodPtr
) {
673 nRows
= rows
[(int) TableId
.MethodPtr
];
674 AllocBuff(ref buff
, rowSize
* nRows
);
677 MDTable tab
= new MethodPtrTable(heap
);
679 for (int i
= nRows
; --i
>= 0;) {
681 // Method, index(Method)
682 fldSize
= GetIndexSize(TableId
.Method
, rows
);
683 Array
.Copy(data
, offs
, buff
, dest
, fldSize
);
689 tab
.FromRawData(buff
, 0, nRows
);
692 if (heap
.HasMethod
) {
693 rowSize
= RVA
.Size
+ sizeof (ushort) + sizeof (ushort) + 4 + 4 + 4;
694 nRows
= rows
[(int) TableId
.Method
];
695 AllocBuff(ref buff
, rowSize
* nRows
);
698 MDTable tab
= new MethodTable(heap
);
700 for (int i
= nRows
; --i
>= 0;) {
704 Array
.Copy(data
, offs
, buff
, dest
, fldSize
);
709 fldSize
= sizeof (ushort);
710 Array
.Copy(data
, offs
, buff
, dest
, fldSize
);
712 dest
+= sizeof (ushort);
715 fldSize
= sizeof (ushort);
716 Array
.Copy(data
, offs
, buff
, dest
, fldSize
);
718 dest
+= sizeof (ushort);
720 // Name, index(#Strings)
722 Array
.Copy(data
, offs
, buff
, dest
, fldSize
);
726 // Signature, index(#Blob)
728 Array
.Copy(data
, offs
, buff
, dest
, fldSize
);
732 // ParamList, index(Param)
733 fldSize
= GetIndexSize(TableId
.Param
, rows
);
734 Array
.Copy(data
, offs
, buff
, dest
, fldSize
);
740 tab
.FromRawData(buff
, 0, nRows
);
743 if (heap
.HasParamPtr
) {
745 nRows
= rows
[(int) TableId
.ParamPtr
];
746 AllocBuff(ref buff
, rowSize
* nRows
);
749 MDTable tab
= new ParamPtrTable(heap
);
751 for (int i
= nRows
; --i
>= 0;) {
753 // Param, index(Param)
754 fldSize
= GetIndexSize(TableId
.Param
, rows
);
755 Array
.Copy(data
, offs
, buff
, dest
, fldSize
);
761 tab
.FromRawData(buff
, 0, nRows
);
765 rowSize
= sizeof (ushort) + sizeof (ushort) + 4;
766 nRows
= rows
[(int) TableId
.Param
];
767 AllocBuff(ref buff
, rowSize
* nRows
);
770 MDTable tab
= new ParamTable(heap
);
772 for (int i
= nRows
; --i
>= 0;) {
775 fldSize
= sizeof (ushort);
776 Array
.Copy(data
, offs
, buff
, dest
, fldSize
);
778 dest
+= sizeof (ushort);
781 fldSize
= sizeof (ushort);
782 Array
.Copy(data
, offs
, buff
, dest
, fldSize
);
784 dest
+= sizeof (ushort);
786 // Name, index(#Strings)
788 Array
.Copy(data
, offs
, buff
, dest
, fldSize
);
794 tab
.FromRawData(buff
, 0, nRows
);
797 if (heap
.HasInterfaceImpl
) {
799 nRows
= rows
[(int) TableId
.InterfaceImpl
];
800 AllocBuff(ref buff
, rowSize
* nRows
);
803 MDTable tab
= new InterfaceImplTable(heap
);
805 for (int i
= nRows
; --i
>= 0;) {
807 // Class, index(TypeDef)
808 fldSize
= GetIndexSize(TableId
.TypeDef
, rows
);
809 Array
.Copy(data
, offs
, buff
, dest
, fldSize
);
813 // Interface, coded-index(TypeDefOrRef)
814 fldSize
= GetCodedIndexSize(heap
, CodedTokenId
.TypeDefOrRef
, rows
);
815 Array
.Copy(data
, offs
, buff
, dest
, fldSize
);
821 tab
.FromRawData(buff
, 0, nRows
);
824 if (heap
.HasMemberRef
) {
826 nRows
= rows
[(int) TableId
.MemberRef
];
827 AllocBuff(ref buff
, rowSize
* nRows
);
830 MDTable tab
= new MemberRefTable(heap
);
832 for (int i
= nRows
; --i
>= 0;) {
834 // Class, coded-index(MemberRefParent)
835 fldSize
= GetCodedIndexSize(heap
, CodedTokenId
.MemberRefParent
, rows
);
836 Array
.Copy(data
, offs
, buff
, dest
, fldSize
);
840 // Name, index(#Strings)
842 Array
.Copy(data
, offs
, buff
, dest
, fldSize
);
846 // Signature, index(#Blob)
848 Array
.Copy(data
, offs
, buff
, dest
, fldSize
);
854 tab
.FromRawData(buff
, 0, nRows
);
857 if (heap
.HasConstant
) {
858 rowSize
= sizeof (short) + 4 + 4;
859 nRows
= rows
[(int) TableId
.Constant
];
860 AllocBuff(ref buff
, rowSize
* nRows
);
863 MDTable tab
= new ConstantTable(heap
);
865 for (int i
= nRows
; --i
>= 0;) {
868 fldSize
= sizeof (short);
869 Array
.Copy(data
, offs
, buff
, dest
, fldSize
);
871 dest
+= sizeof (short);
873 // Parent, coded-index(HasConstant)
874 fldSize
= GetCodedIndexSize(heap
, CodedTokenId
.HasConstant
, rows
);
875 Array
.Copy(data
, offs
, buff
, dest
, fldSize
);
879 // Value, index(#Blob)
881 Array
.Copy(data
, offs
, buff
, dest
, fldSize
);
887 tab
.FromRawData(buff
, 0, nRows
);
890 if (heap
.HasCustomAttribute
) {
892 nRows
= rows
[(int) TableId
.CustomAttribute
];
893 AllocBuff(ref buff
, rowSize
* nRows
);
896 MDTable tab
= new CustomAttributeTable(heap
);
898 for (int i
= nRows
; --i
>= 0;) {
900 // Parent, coded-index(HasCustomAttribute)
901 fldSize
= GetCodedIndexSize(heap
, CodedTokenId
.HasCustomAttribute
, rows
);
902 Array
.Copy(data
, offs
, buff
, dest
, fldSize
);
906 // Type, coded-index(CustomAttributeType)
907 fldSize
= GetCodedIndexSize(heap
, CodedTokenId
.CustomAttributeType
, rows
);
908 Array
.Copy(data
, offs
, buff
, dest
, fldSize
);
912 // Value, index(#Blob)
914 Array
.Copy(data
, offs
, buff
, dest
, fldSize
);
920 tab
.FromRawData(buff
, 0, nRows
);
923 if (heap
.HasFieldMarshal
) {
925 nRows
= rows
[(int) TableId
.FieldMarshal
];
926 AllocBuff(ref buff
, rowSize
* nRows
);
929 MDTable tab
= new FieldMarshalTable(heap
);
931 for (int i
= nRows
; --i
>= 0;) {
933 // Parent, coded-index(HasFieldMarshal)
934 fldSize
= GetCodedIndexSize(heap
, CodedTokenId
.HasFieldMarshal
, rows
);
935 Array
.Copy(data
, offs
, buff
, dest
, fldSize
);
939 // NativeType, index(#Blob)
941 Array
.Copy(data
, offs
, buff
, dest
, fldSize
);
947 tab
.FromRawData(buff
, 0, nRows
);
950 if (heap
.HasDeclSecurity
) {
951 rowSize
= sizeof (short) + 4 + 4;
952 nRows
= rows
[(int) TableId
.DeclSecurity
];
953 AllocBuff(ref buff
, rowSize
* nRows
);
956 MDTable tab
= new DeclSecurityTable(heap
);
958 for (int i
= nRows
; --i
>= 0;) {
961 fldSize
= sizeof (short);
962 Array
.Copy(data
, offs
, buff
, dest
, fldSize
);
964 dest
+= sizeof (short);
966 // Parent, coded-index(HasDeclSecurity)
967 fldSize
= GetCodedIndexSize(heap
, CodedTokenId
.HasDeclSecurity
, rows
);
968 Array
.Copy(data
, offs
, buff
, dest
, fldSize
);
972 // PermissionSet, index(#Blob)
974 Array
.Copy(data
, offs
, buff
, dest
, fldSize
);
980 tab
.FromRawData(buff
, 0, nRows
);
983 if (heap
.HasClassLayout
) {
984 rowSize
= sizeof (short) + sizeof (int) + 4;
985 nRows
= rows
[(int) TableId
.ClassLayout
];
986 AllocBuff(ref buff
, rowSize
* nRows
);
989 MDTable tab
= new ClassLayoutTable(heap
);
991 for (int i
= nRows
; --i
>= 0;) {
993 // PackingSize, short
994 fldSize
= sizeof (short);
995 Array
.Copy(data
, offs
, buff
, dest
, fldSize
);
997 dest
+= sizeof (short);
1000 fldSize
= sizeof (int);
1001 Array
.Copy(data
, offs
, buff
, dest
, fldSize
);
1003 dest
+= sizeof (int);
1005 // Parent, index(TypeDef)
1006 fldSize
= GetIndexSize(TableId
.TypeDef
, rows
);
1007 Array
.Copy(data
, offs
, buff
, dest
, fldSize
);
1013 tab
.FromRawData(buff
, 0, nRows
);
1016 if (heap
.HasFieldLayout
) {
1017 rowSize
= sizeof (int) + 4;
1018 nRows
= rows
[(int) TableId
.FieldLayout
];
1019 AllocBuff(ref buff
, rowSize
* nRows
);
1022 MDTable tab
= new FieldLayoutTable(heap
);
1024 for (int i
= nRows
; --i
>= 0;) {
1027 fldSize
= sizeof (int);
1028 Array
.Copy(data
, offs
, buff
, dest
, fldSize
);
1030 dest
+= sizeof (int);
1032 // Field, index(Field)
1033 fldSize
= GetIndexSize(TableId
.Field
, rows
);
1034 Array
.Copy(data
, offs
, buff
, dest
, fldSize
);
1040 tab
.FromRawData(buff
, 0, nRows
);
1043 if (heap
.HasStandAloneSig
) {
1045 nRows
= rows
[(int) TableId
.StandAloneSig
];
1046 AllocBuff(ref buff
, rowSize
* nRows
);
1049 MDTable tab
= new StandAloneSigTable(heap
);
1051 for (int i
= nRows
; --i
>= 0;) {
1053 // Signature, index(#Blob)
1055 Array
.Copy(data
, offs
, buff
, dest
, fldSize
);
1061 tab
.FromRawData(buff
, 0, nRows
);
1064 if (heap
.HasEventMap
) {
1066 nRows
= rows
[(int) TableId
.EventMap
];
1067 AllocBuff(ref buff
, rowSize
* nRows
);
1070 MDTable tab
= new EventMapTable(heap
);
1072 for (int i
= nRows
; --i
>= 0;) {
1074 // Parent, index(TypeDef)
1075 fldSize
= GetIndexSize(TableId
.TypeDef
, rows
);
1076 Array
.Copy(data
, offs
, buff
, dest
, fldSize
);
1080 // EventList, index(Event)
1081 fldSize
= GetIndexSize(TableId
.Event
, rows
);
1082 Array
.Copy(data
, offs
, buff
, dest
, fldSize
);
1088 tab
.FromRawData(buff
, 0, nRows
);
1091 if (heap
.HasEventPtr
) {
1093 nRows
= rows
[(int) TableId
.EventPtr
];
1094 AllocBuff(ref buff
, rowSize
* nRows
);
1097 MDTable tab
= new EventPtrTable(heap
);
1099 for (int i
= nRows
; --i
>= 0;) {
1101 // Event, index(Event)
1102 fldSize
= GetIndexSize(TableId
.Event
, rows
);
1103 Array
.Copy(data
, offs
, buff
, dest
, fldSize
);
1109 tab
.FromRawData(buff
, 0, nRows
);
1112 if (heap
.HasEvent
) {
1113 rowSize
= sizeof (short) + 4 + 4;
1114 nRows
= rows
[(int) TableId
.Event
];
1115 AllocBuff(ref buff
, rowSize
* nRows
);
1118 MDTable tab
= new EventTable(heap
);
1120 for (int i
= nRows
; --i
>= 0;) {
1122 // EventFlags, short
1123 fldSize
= sizeof (short);
1124 Array
.Copy(data
, offs
, buff
, dest
, fldSize
);
1126 dest
+= sizeof (short);
1128 // Name, index(#Strings)
1130 Array
.Copy(data
, offs
, buff
, dest
, fldSize
);
1134 // EventType, coded-index(TypeDefOrRef)
1135 fldSize
= GetCodedIndexSize(heap
, CodedTokenId
.TypeDefOrRef
, rows
);
1136 Array
.Copy(data
, offs
, buff
, dest
, fldSize
);
1142 tab
.FromRawData(buff
, 0, nRows
);
1145 if (heap
.HasPropertyMap
) {
1147 nRows
= rows
[(int) TableId
.PropertyMap
];
1148 AllocBuff(ref buff
, rowSize
* nRows
);
1151 MDTable tab
= new PropertyMapTable(heap
);
1153 for (int i
= nRows
; --i
>= 0;) {
1155 // Parent, index(TypeDef)
1156 fldSize
= GetIndexSize(TableId
.TypeDef
, rows
);
1157 Array
.Copy(data
, offs
, buff
, dest
, fldSize
);
1161 // PropertyList, index(Property)
1162 fldSize
= GetIndexSize(TableId
.Property
, rows
);
1163 Array
.Copy(data
, offs
, buff
, dest
, fldSize
);
1169 tab
.FromRawData(buff
, 0, nRows
);
1172 if (heap
.HasPropertyPtr
) {
1174 nRows
= rows
[(int) TableId
.PropertyPtr
];
1175 AllocBuff(ref buff
, rowSize
* nRows
);
1178 MDTable tab
= new PropertyPtrTable(heap
);
1180 for (int i
= nRows
; --i
>= 0;) {
1182 // Property, index(Property)
1183 fldSize
= GetIndexSize(TableId
.Property
, rows
);
1184 Array
.Copy(data
, offs
, buff
, dest
, fldSize
);
1190 tab
.FromRawData(buff
, 0, nRows
);
1193 if (heap
.HasProperty
) {
1194 rowSize
= sizeof (ushort) + 4 + 4;
1195 nRows
= rows
[(int) TableId
.Property
];
1196 AllocBuff(ref buff
, rowSize
* nRows
);
1199 MDTable tab
= new PropertyTable(heap
);
1201 for (int i
= nRows
; --i
>= 0;) {
1204 fldSize
= sizeof (ushort);
1205 Array
.Copy(data
, offs
, buff
, dest
, fldSize
);
1207 dest
+= sizeof (ushort);
1209 // Name, index(#Strings)
1211 Array
.Copy(data
, offs
, buff
, dest
, fldSize
);
1215 // Type, index(#Blob)
1217 Array
.Copy(data
, offs
, buff
, dest
, fldSize
);
1223 tab
.FromRawData(buff
, 0, nRows
);
1226 if (heap
.HasMethodSemantics
) {
1227 rowSize
= sizeof (ushort) + 4 + 4;
1228 nRows
= rows
[(int) TableId
.MethodSemantics
];
1229 AllocBuff(ref buff
, rowSize
* nRows
);
1232 MDTable tab
= new MethodSemanticsTable(heap
);
1234 for (int i
= nRows
; --i
>= 0;) {
1236 // Semantics, ushort
1237 fldSize
= sizeof (ushort);
1238 Array
.Copy(data
, offs
, buff
, dest
, fldSize
);
1240 dest
+= sizeof (ushort);
1242 // Method, index(Method)
1243 fldSize
= GetIndexSize(TableId
.Method
, rows
);
1244 Array
.Copy(data
, offs
, buff
, dest
, fldSize
);
1248 // Association, coded-index(HasSemantics)
1249 fldSize
= GetCodedIndexSize(heap
, CodedTokenId
.HasSemantics
, rows
);
1250 Array
.Copy(data
, offs
, buff
, dest
, fldSize
);
1256 tab
.FromRawData(buff
, 0, nRows
);
1259 if (heap
.HasMethodImpl
) {
1260 rowSize
= 4 + 4 + 4;
1261 nRows
= rows
[(int) TableId
.MethodImpl
];
1262 AllocBuff(ref buff
, rowSize
* nRows
);
1265 MDTable tab
= new MethodImplTable(heap
);
1267 for (int i
= nRows
; --i
>= 0;) {
1269 // Class, index(TypeDef)
1270 fldSize
= GetIndexSize(TableId
.TypeDef
, rows
);
1271 Array
.Copy(data
, offs
, buff
, dest
, fldSize
);
1275 // MethodBody, coded-index(MethodDefOrRef)
1276 fldSize
= GetCodedIndexSize(heap
, CodedTokenId
.MethodDefOrRef
, rows
);
1277 Array
.Copy(data
, offs
, buff
, dest
, fldSize
);
1281 // MethodDeclaration, coded-index(MethodDefOrRef)
1282 fldSize
= GetCodedIndexSize(heap
, CodedTokenId
.MethodDefOrRef
, rows
);
1283 Array
.Copy(data
, offs
, buff
, dest
, fldSize
);
1289 tab
.FromRawData(buff
, 0, nRows
);
1292 if (heap
.HasModuleRef
) {
1294 nRows
= rows
[(int) TableId
.ModuleRef
];
1295 AllocBuff(ref buff
, rowSize
* nRows
);
1298 MDTable tab
= new ModuleRefTable(heap
);
1300 for (int i
= nRows
; --i
>= 0;) {
1302 // Name, index(#Strings)
1304 Array
.Copy(data
, offs
, buff
, dest
, fldSize
);
1310 tab
.FromRawData(buff
, 0, nRows
);
1313 if (heap
.HasTypeSpec
) {
1315 nRows
= rows
[(int) TableId
.TypeSpec
];
1316 AllocBuff(ref buff
, rowSize
* nRows
);
1319 MDTable tab
= new TypeSpecTable(heap
);
1321 for (int i
= nRows
; --i
>= 0;) {
1323 // Signature, index(#Blob)
1325 Array
.Copy(data
, offs
, buff
, dest
, fldSize
);
1331 tab
.FromRawData(buff
, 0, nRows
);
1334 if (heap
.HasImplMap
) {
1335 rowSize
= sizeof (ushort) + 4 + 4 + 4;
1336 nRows
= rows
[(int) TableId
.ImplMap
];
1337 AllocBuff(ref buff
, rowSize
* nRows
);
1340 MDTable tab
= new ImplMapTable(heap
);
1342 for (int i
= nRows
; --i
>= 0;) {
1344 // MappingFlags, ushort
1345 fldSize
= sizeof (ushort);
1346 Array
.Copy(data
, offs
, buff
, dest
, fldSize
);
1348 dest
+= sizeof (ushort);
1350 // MemberForwarded, coded-index(MemberForwarded)
1351 fldSize
= GetCodedIndexSize(heap
, CodedTokenId
.MemberForwarded
, rows
);
1352 Array
.Copy(data
, offs
, buff
, dest
, fldSize
);
1356 // ImportName, index(#Strings)
1358 Array
.Copy(data
, offs
, buff
, dest
, fldSize
);
1362 // ImportScope, index(ModuleRef)
1363 fldSize
= GetIndexSize(TableId
.ModuleRef
, rows
);
1364 Array
.Copy(data
, offs
, buff
, dest
, fldSize
);
1370 tab
.FromRawData(buff
, 0, nRows
);
1373 if (heap
.HasFieldRVA
) {
1374 rowSize
= RVA
.Size
+ 4;
1375 nRows
= rows
[(int) TableId
.FieldRVA
];
1376 AllocBuff(ref buff
, rowSize
* nRows
);
1379 MDTable tab
= new FieldRVATable(heap
);
1381 for (int i
= nRows
; --i
>= 0;) {
1385 Array
.Copy(data
, offs
, buff
, dest
, fldSize
);
1389 // Field, index(Field)
1390 fldSize
= GetIndexSize(TableId
.Field
, rows
);
1391 Array
.Copy(data
, offs
, buff
, dest
, fldSize
);
1397 tab
.FromRawData(buff
, 0, nRows
);
1400 if (heap
.HasENCLog
) {
1401 rowSize
= sizeof (uint) + sizeof (uint);
1402 nRows
= rows
[(int) TableId
.ENCLog
];
1403 AllocBuff(ref buff
, rowSize
* nRows
);
1406 MDTable tab
= new ENCLogTable(heap
);
1408 for (int i
= nRows
; --i
>= 0;) {
1411 fldSize
= sizeof (uint);
1412 Array
.Copy(data
, offs
, buff
, dest
, fldSize
);
1414 dest
+= sizeof (uint);
1417 fldSize
= sizeof (uint);
1418 Array
.Copy(data
, offs
, buff
, dest
, fldSize
);
1420 dest
+= sizeof (uint);
1424 tab
.FromRawData(buff
, 0, nRows
);
1427 if (heap
.HasENCMap
) {
1428 rowSize
= sizeof (uint);
1429 nRows
= rows
[(int) TableId
.ENCMap
];
1430 AllocBuff(ref buff
, rowSize
* nRows
);
1433 MDTable tab
= new ENCMapTable(heap
);
1435 for (int i
= nRows
; --i
>= 0;) {
1438 fldSize
= sizeof (uint);
1439 Array
.Copy(data
, offs
, buff
, dest
, fldSize
);
1441 dest
+= sizeof (uint);
1445 tab
.FromRawData(buff
, 0, nRows
);
1448 if (heap
.HasAssembly
) {
1449 rowSize
= sizeof (int) + sizeof (short) + sizeof (short) + sizeof (short) + sizeof (short) + sizeof (uint) + 4 + 4 + 4;
1450 nRows
= rows
[(int) TableId
.Assembly
];
1451 AllocBuff(ref buff
, rowSize
* nRows
);
1454 MDTable tab
= new AssemblyTable(heap
);
1456 for (int i
= nRows
; --i
>= 0;) {
1459 fldSize
= sizeof (int);
1460 Array
.Copy(data
, offs
, buff
, dest
, fldSize
);
1462 dest
+= sizeof (int);
1464 // MajorVersion, short
1465 fldSize
= sizeof (short);
1466 Array
.Copy(data
, offs
, buff
, dest
, fldSize
);
1468 dest
+= sizeof (short);
1470 // MinorVersion, short
1471 fldSize
= sizeof (short);
1472 Array
.Copy(data
, offs
, buff
, dest
, fldSize
);
1474 dest
+= sizeof (short);
1476 // BuildNumber, short
1477 fldSize
= sizeof (short);
1478 Array
.Copy(data
, offs
, buff
, dest
, fldSize
);
1480 dest
+= sizeof (short);
1482 // RevisionNumber, short
1483 fldSize
= sizeof (short);
1484 Array
.Copy(data
, offs
, buff
, dest
, fldSize
);
1486 dest
+= sizeof (short);
1489 fldSize
= sizeof (uint);
1490 Array
.Copy(data
, offs
, buff
, dest
, fldSize
);
1492 dest
+= sizeof (uint);
1494 // PublicKey, index(#Blob)
1496 Array
.Copy(data
, offs
, buff
, dest
, fldSize
);
1500 // Name, index(#Strings)
1502 Array
.Copy(data
, offs
, buff
, dest
, fldSize
);
1506 // Culture, index(#Strings)
1508 Array
.Copy(data
, offs
, buff
, dest
, fldSize
);
1514 tab
.FromRawData(buff
, 0, nRows
);
1517 if (heap
.HasAssemblyProcessor
) {
1518 rowSize
= sizeof (int);
1519 nRows
= rows
[(int) TableId
.AssemblyProcessor
];
1520 AllocBuff(ref buff
, rowSize
* nRows
);
1523 MDTable tab
= new AssemblyProcessorTable(heap
);
1525 for (int i
= nRows
; --i
>= 0;) {
1528 fldSize
= sizeof (int);
1529 Array
.Copy(data
, offs
, buff
, dest
, fldSize
);
1531 dest
+= sizeof (int);
1535 tab
.FromRawData(buff
, 0, nRows
);
1538 if (heap
.HasAssemblyOS
) {
1539 rowSize
= sizeof (int) + sizeof (int) + sizeof (int);
1540 nRows
= rows
[(int) TableId
.AssemblyOS
];
1541 AllocBuff(ref buff
, rowSize
* nRows
);
1544 MDTable tab
= new AssemblyOSTable(heap
);
1546 for (int i
= nRows
; --i
>= 0;) {
1548 // OSPlatformID, int
1549 fldSize
= sizeof (int);
1550 Array
.Copy(data
, offs
, buff
, dest
, fldSize
);
1552 dest
+= sizeof (int);
1554 // OSMajorVersion, int
1555 fldSize
= sizeof (int);
1556 Array
.Copy(data
, offs
, buff
, dest
, fldSize
);
1558 dest
+= sizeof (int);
1560 // OSMinorVersion, int
1561 fldSize
= sizeof (int);
1562 Array
.Copy(data
, offs
, buff
, dest
, fldSize
);
1564 dest
+= sizeof (int);
1568 tab
.FromRawData(buff
, 0, nRows
);
1571 if (heap
.HasAssemblyRef
) {
1572 rowSize
= sizeof (short) + sizeof (short) + sizeof (short) + sizeof (short) + sizeof (uint) + 4 + 4 + 4 + 4;
1573 nRows
= rows
[(int) TableId
.AssemblyRef
];
1574 AllocBuff(ref buff
, rowSize
* nRows
);
1577 MDTable tab
= new AssemblyRefTable(heap
);
1579 for (int i
= nRows
; --i
>= 0;) {
1581 // MajorVersion, short
1582 fldSize
= sizeof (short);
1583 Array
.Copy(data
, offs
, buff
, dest
, fldSize
);
1585 dest
+= sizeof (short);
1587 // MinorVersion, short
1588 fldSize
= sizeof (short);
1589 Array
.Copy(data
, offs
, buff
, dest
, fldSize
);
1591 dest
+= sizeof (short);
1593 // BuildNumber, short
1594 fldSize
= sizeof (short);
1595 Array
.Copy(data
, offs
, buff
, dest
, fldSize
);
1597 dest
+= sizeof (short);
1599 // RevisionNumber, short
1600 fldSize
= sizeof (short);
1601 Array
.Copy(data
, offs
, buff
, dest
, fldSize
);
1603 dest
+= sizeof (short);
1606 fldSize
= sizeof (uint);
1607 Array
.Copy(data
, offs
, buff
, dest
, fldSize
);
1609 dest
+= sizeof (uint);
1611 // PublicKeyOrToken, index(#Blob)
1613 Array
.Copy(data
, offs
, buff
, dest
, fldSize
);
1617 // Name, index(#Strings)
1619 Array
.Copy(data
, offs
, buff
, dest
, fldSize
);
1623 // Culture, index(#Strings)
1625 Array
.Copy(data
, offs
, buff
, dest
, fldSize
);
1629 // HashValue, index(#Blob)
1631 Array
.Copy(data
, offs
, buff
, dest
, fldSize
);
1637 tab
.FromRawData(buff
, 0, nRows
);
1640 if (heap
.HasAssemblyRefProcessor
) {
1641 rowSize
= sizeof (int) + 4;
1642 nRows
= rows
[(int) TableId
.AssemblyRefProcessor
];
1643 AllocBuff(ref buff
, rowSize
* nRows
);
1646 MDTable tab
= new AssemblyRefProcessorTable(heap
);
1648 for (int i
= nRows
; --i
>= 0;) {
1651 fldSize
= sizeof (int);
1652 Array
.Copy(data
, offs
, buff
, dest
, fldSize
);
1654 dest
+= sizeof (int);
1656 // AssemblyRef, index(AssemblyRef)
1657 fldSize
= GetIndexSize(TableId
.AssemblyRef
, rows
);
1658 Array
.Copy(data
, offs
, buff
, dest
, fldSize
);
1664 tab
.FromRawData(buff
, 0, nRows
);
1667 if (heap
.HasAssemblyRefOS
) {
1668 rowSize
= sizeof (int) + sizeof (int) + sizeof (int) + 4;
1669 nRows
= rows
[(int) TableId
.AssemblyRefOS
];
1670 AllocBuff(ref buff
, rowSize
* nRows
);
1673 MDTable tab
= new AssemblyRefOSTable(heap
);
1675 for (int i
= nRows
; --i
>= 0;) {
1677 // OSPlatformID, int
1678 fldSize
= sizeof (int);
1679 Array
.Copy(data
, offs
, buff
, dest
, fldSize
);
1681 dest
+= sizeof (int);
1683 // OSMajorVersion, int
1684 fldSize
= sizeof (int);
1685 Array
.Copy(data
, offs
, buff
, dest
, fldSize
);
1687 dest
+= sizeof (int);
1689 // OSMinorVersion, int
1690 fldSize
= sizeof (int);
1691 Array
.Copy(data
, offs
, buff
, dest
, fldSize
);
1693 dest
+= sizeof (int);
1695 // AssemblyRef, index(AssemblyRef)
1696 fldSize
= GetIndexSize(TableId
.AssemblyRef
, rows
);
1697 Array
.Copy(data
, offs
, buff
, dest
, fldSize
);
1703 tab
.FromRawData(buff
, 0, nRows
);
1707 rowSize
= sizeof (uint) + 4 + 4;
1708 nRows
= rows
[(int) TableId
.File
];
1709 AllocBuff(ref buff
, rowSize
* nRows
);
1712 MDTable tab
= new FileTable(heap
);
1714 for (int i
= nRows
; --i
>= 0;) {
1717 fldSize
= sizeof (uint);
1718 Array
.Copy(data
, offs
, buff
, dest
, fldSize
);
1720 dest
+= sizeof (uint);
1722 // Name, index(#Strings)
1724 Array
.Copy(data
, offs
, buff
, dest
, fldSize
);
1728 // HashValue, index(#Blob)
1730 Array
.Copy(data
, offs
, buff
, dest
, fldSize
);
1736 tab
.FromRawData(buff
, 0, nRows
);
1739 if (heap
.HasExportedType
) {
1740 rowSize
= sizeof (uint) + 4 + 4 + 4 + 4;
1741 nRows
= rows
[(int) TableId
.ExportedType
];
1742 AllocBuff(ref buff
, rowSize
* nRows
);
1745 MDTable tab
= new ExportedTypeTable(heap
);
1747 for (int i
= nRows
; --i
>= 0;) {
1750 fldSize
= sizeof (uint);
1751 Array
.Copy(data
, offs
, buff
, dest
, fldSize
);
1753 dest
+= sizeof (uint);
1755 // TypeDefId, index(TypeDef)
1756 fldSize
= GetIndexSize(TableId
.TypeDef
, rows
);
1757 Array
.Copy(data
, offs
, buff
, dest
, fldSize
);
1761 // TypeName, index(#Strings)
1763 Array
.Copy(data
, offs
, buff
, dest
, fldSize
);
1767 // TypeNamespace, index(#Strings)
1769 Array
.Copy(data
, offs
, buff
, dest
, fldSize
);
1773 // Implementation, coded-index(Implementation)
1774 fldSize
= GetCodedIndexSize(heap
, CodedTokenId
.Implementation
, rows
);
1775 Array
.Copy(data
, offs
, buff
, dest
, fldSize
);
1781 tab
.FromRawData(buff
, 0, nRows
);
1784 if (heap
.HasManifestResource
) {
1785 rowSize
= sizeof (int) + sizeof (uint) + 4 + 4;
1786 nRows
= rows
[(int) TableId
.ManifestResource
];
1787 AllocBuff(ref buff
, rowSize
* nRows
);
1790 MDTable tab
= new ManifestResourceTable(heap
);
1792 for (int i
= nRows
; --i
>= 0;) {
1795 fldSize
= sizeof (int);
1796 Array
.Copy(data
, offs
, buff
, dest
, fldSize
);
1798 dest
+= sizeof (int);
1801 fldSize
= sizeof (uint);
1802 Array
.Copy(data
, offs
, buff
, dest
, fldSize
);
1804 dest
+= sizeof (uint);
1806 // Name, index(#Strings)
1808 Array
.Copy(data
, offs
, buff
, dest
, fldSize
);
1812 // Implementation, coded-index(Implementation)
1813 fldSize
= GetCodedIndexSize(heap
, CodedTokenId
.Implementation
, rows
);
1814 Array
.Copy(data
, offs
, buff
, dest
, fldSize
);
1820 tab
.FromRawData(buff
, 0, nRows
);
1823 if (heap
.HasNestedClass
) {
1825 nRows
= rows
[(int) TableId
.NestedClass
];
1826 AllocBuff(ref buff
, rowSize
* nRows
);
1829 MDTable tab
= new NestedClassTable(heap
);
1831 for (int i
= nRows
; --i
>= 0;) {
1833 // NestedClass, index(TypeDef)
1834 fldSize
= GetIndexSize(TableId
.TypeDef
, rows
);
1835 Array
.Copy(data
, offs
, buff
, dest
, fldSize
);
1839 // EnclosingClass, index(TypeDef)
1840 fldSize
= GetIndexSize(TableId
.TypeDef
, rows
);
1841 Array
.Copy(data
, offs
, buff
, dest
, fldSize
);
1847 tab
.FromRawData(buff
, 0, nRows
);
1850 if (heap
.HasTypeTyPar
) {
1851 rowSize
= sizeof (ushort) + 4 + 4 + 4;
1852 nRows
= rows
[(int) TableId
.TypeTyPar
];
1853 AllocBuff(ref buff
, rowSize
* nRows
);
1856 MDTable tab
= new TypeTyParTable(heap
);
1858 for (int i
= nRows
; --i
>= 0;) {
1861 fldSize
= sizeof (ushort);
1862 Array
.Copy(data
, offs
, buff
, dest
, fldSize
);
1864 dest
+= sizeof (ushort);
1866 // Class, index(TypeDef)
1867 fldSize
= GetIndexSize(TableId
.TypeDef
, rows
);
1868 Array
.Copy(data
, offs
, buff
, dest
, fldSize
);
1872 // Bound, coded-index(TypeDefOrRef)
1873 fldSize
= GetCodedIndexSize(heap
, CodedTokenId
.TypeDefOrRef
, rows
);
1874 Array
.Copy(data
, offs
, buff
, dest
, fldSize
);
1878 // Name, index(#Strings)
1880 Array
.Copy(data
, offs
, buff
, dest
, fldSize
);
1886 tab
.FromRawData(buff
, 0, nRows
);
1889 if (heap
.HasMethodTyPar
) {
1890 rowSize
= sizeof (ushort) + 4 + 4 + 4;
1891 nRows
= rows
[(int) TableId
.MethodTyPar
];
1892 AllocBuff(ref buff
, rowSize
* nRows
);
1895 MDTable tab
= new MethodTyParTable(heap
);
1897 for (int i
= nRows
; --i
>= 0;) {
1900 fldSize
= sizeof (ushort);
1901 Array
.Copy(data
, offs
, buff
, dest
, fldSize
);
1903 dest
+= sizeof (ushort);
1905 // Method, index(Method)
1906 fldSize
= GetIndexSize(TableId
.Method
, rows
);
1907 Array
.Copy(data
, offs
, buff
, dest
, fldSize
);
1911 // Bound, coded-index(TypeDefOrRef)
1912 fldSize
= GetCodedIndexSize(heap
, CodedTokenId
.TypeDefOrRef
, rows
);
1913 Array
.Copy(data
, offs
, buff
, dest
, fldSize
);
1917 // Name, index(#Strings)
1919 Array
.Copy(data
, offs
, buff
, dest
, fldSize
);
1925 tab
.FromRawData(buff
, 0, nRows
);