Terraria v1.4.4.9
Terraria source code documentation
Loading...
Searching...
No Matches
MetadataReader.cs
Go to the documentation of this file.
7using System.Text;
8
10
11public sealed class MetadataReader
12{
40
41 internal readonly NamespaceCache NamespaceCache;
42
43 internal readonly MemoryBlock Block;
44
45 internal readonly int WinMDMscorlibRef;
46
47 private readonly object _memoryOwnerObj;
48
50
52
53 private readonly string _versionString;
54
55 private readonly MetadataKind _metadataKind;
56
58
60
62
64
66
68
69 internal bool IsMinimalDelta;
70
71 private readonly TableMask _sortedTables;
72
73 internal int[] TableRowCounts;
74
76
78
80
82
84
86
88
90
92
94
96
98
100
102
104
106
108
110
112
114
116
118
120
122
124
126
128
130
132
134
136
138
140
142
144
146
148
150
152
154
156
158
160
162
164
166
168
170
172
174
176
178
180
181 internal const string ClrPrefix = "<CLR>";
182
183 internal static readonly byte[] WinRTPrefix = new byte[7] { 60, 87, 105, 110, 82, 84, 62 };
184
185 private static string[] s_projectedTypeNames;
186
188
189 internal bool UseFieldPtrTable => FieldPtrTable.NumberOfRows > 0;
190
191 internal bool UseMethodPtrTable => MethodPtrTable.NumberOfRows > 0;
192
193 internal bool UseParamPtrTable => ParamPtrTable.NumberOfRows > 0;
194
195 internal bool UseEventPtrTable => EventPtrTable.NumberOfRows > 0;
196
197 internal bool UsePropertyPtrTable => PropertyPtrTable.NumberOfRows > 0;
198
199 public unsafe byte* MetadataPointer => Block.Pointer;
200
202
204
206
208
210
212
214
215 public bool IsAssembly => AssemblyTable.NumberOfRows == 1;
216
218
220
222
224
226
228
230
232
234
236
238
240
242
244
246
248
250
252
254
256
258 {
259 string @string = GetString(nameHandle);
260 string cultureName = ((!cultureHandle.IsNil) ? GetString(cultureHandle) : null);
263 {
264 Version = version,
265 CultureName = cultureName,
266 HashAlgorithm = (System.Configuration.Assemblies.AssemblyHashAlgorithm)assemblyHashAlgorithm,
267 Flags = GetAssemblyNameFlags(flags),
268 ContentType = GetContentTypeFromAssemblyFlags(flags)
269 };
270 if ((flags & AssemblyFlags.PublicKey) != 0)
271 {
272 assemblyName.SetPublicKey(array);
273 }
274 else
275 {
276 assemblyName.SetPublicKeyToken(array);
277 }
278 return assemblyName;
279 }
280
282 {
284 if ((flags & AssemblyFlags.PublicKey) != 0)
285 {
287 }
288 if ((flags & AssemblyFlags.Retargetable) != 0)
289 {
290 assemblyNameFlags |= AssemblyNameFlags.Retargetable;
291 }
292 if ((flags & AssemblyFlags.EnableJitCompileTracking) != 0)
293 {
294 assemblyNameFlags |= AssemblyNameFlags.EnableJITcompileTracking;
295 }
296 if ((flags & AssemblyFlags.DisableJitCompileOptimizer) != 0)
297 {
298 assemblyNameFlags |= AssemblyNameFlags.EnableJITcompileOptimizer;
299 }
300 return assemblyNameFlags;
301 }
302
304 {
305 return (AssemblyContentType)((int)(flags & AssemblyFlags.ContentTypeMask) >> 9);
306 }
307
308 public unsafe MetadataReader(byte* metadata, int length)
310 {
311 }
312
313 public unsafe MetadataReader(byte* metadata, int length, MetadataReaderOptions options)
314 : this(metadata, length, options, null, null)
315 {
316 }
317
319 : this(metadata, length, options, utf8Decoder, null)
320 {
321 }
322
324 {
325 if (length < 0)
326 {
327 Throw.ArgumentOutOfRange("length");
328 }
329 if (metadata == null)
330 {
331 Throw.ArgumentNull("metadata");
332 }
333 if (utf8Decoder == null)
334 {
336 }
337 if (!(utf8Decoder.Encoding is UTF8Encoding))
338 {
340 }
341 Block = new MemoryBlock(metadata, length);
351 if (standalonePdbStream.Length > 0)
352 {
353 int pdbStreamOffset = (int)(standalonePdbStream.Pointer - metadata);
355 }
356 else
357 {
359 }
363 if (standalonePdbStream.Length == 0 && ModuleTable.NumberOfRows < 1)
364 {
366 }
367 NamespaceCache = new NamespaceCache(this);
368 if (_metadataKind != 0)
369 {
371 }
372 }
373
375 {
376 if (memReader.RemainingBytes < 16)
377 {
379 }
380 uint num = memReader.ReadUInt32();
381 if (num != 1112167234)
382 {
384 }
385 memReader.ReadUInt16();
386 memReader.ReadUInt16();
387 memReader.ReadUInt32();
388 int num2 = memReader.ReadInt32();
389 if (memReader.RemainingBytes < num2)
390 {
392 }
393 versionString = memReader.GetMemoryBlockAt(0, num2).PeekUtf8NullTerminated(0, null, UTF8Decoder, out var _);
394 memReader.Offset += num2;
395 }
396
398 {
399 if ((_options & MetadataReaderOptions.Default) == 0)
400 {
401 return MetadataKind.Ecma335;
402 }
403 if (!versionString.Contains("WindowsRuntime"))
404 {
405 return MetadataKind.Ecma335;
406 }
407 if (versionString.Contains("CLR"))
408 {
409 return MetadataKind.ManagedWindowsMetadata;
410 }
411 return MetadataKind.WindowsMetadata;
412 }
413
415 {
416 memReader.ReadUInt16();
417 int num = memReader.ReadInt16();
418 StreamHeader[] array = new StreamHeader[num];
419 for (int i = 0; i < array.Length; i++)
420 {
421 if (memReader.RemainingBytes < 8)
422 {
424 }
425 array[i].Offset = memReader.ReadUInt32();
426 array[i].Size = memReader.ReadInt32();
427 array[i].Name = memReader.ReadUtf8NullTerminated();
428 if (!memReader.TryAlign(4) || memReader.RemainingBytes == 0)
429 {
431 }
432 }
433 return array;
434 }
435
437 {
441 for (int i = 0; i < streamHeaders.Length; i++)
442 {
444 switch (streamHeader.Name)
445 {
446 case "#Strings":
447 if (metadataRoot.Length < streamHeader.Offset + streamHeader.Size)
448 {
450 }
451 StringHeap = new StringHeap(metadataRoot.GetMemoryBlockAt((int)streamHeader.Offset, streamHeader.Size), _metadataKind);
452 break;
453 case "#Blob":
454 if (metadataRoot.Length < streamHeader.Offset + streamHeader.Size)
455 {
457 }
458 BlobHeap = new BlobHeap(metadataRoot.GetMemoryBlockAt((int)streamHeader.Offset, streamHeader.Size), _metadataKind);
459 break;
460 case "#GUID":
461 if (metadataRoot.Length < streamHeader.Offset + streamHeader.Size)
462 {
464 }
465 GuidHeap = new GuidHeap(metadataRoot.GetMemoryBlockAt((int)streamHeader.Offset, streamHeader.Size));
466 break;
467 case "#US":
468 if (metadataRoot.Length < streamHeader.Offset + streamHeader.Size)
469 {
471 }
472 UserStringHeap = new UserStringHeap(metadataRoot.GetMemoryBlockAt((int)streamHeader.Offset, streamHeader.Size));
473 break;
474 case "#~":
475 if (metadataRoot.Length < streamHeader.Offset + streamHeader.Size)
476 {
478 }
480 metadataTableStream = metadataRoot.GetMemoryBlockAt((int)streamHeader.Offset, streamHeader.Size);
481 break;
482 case "#-":
483 if (metadataRoot.Length < streamHeader.Offset + streamHeader.Size)
484 {
486 }
488 metadataTableStream = metadataRoot.GetMemoryBlockAt((int)streamHeader.Offset, streamHeader.Size);
489 break;
490 case "#JTD":
491 if (metadataRoot.Length < streamHeader.Offset + streamHeader.Size)
492 {
494 }
495 IsMinimalDelta = true;
496 break;
497 case "#Pdb":
498 if (metadataRoot.Length < streamHeader.Offset + streamHeader.Size)
499 {
501 }
502 standalonePdbStream = metadataRoot.GetMemoryBlockAt((int)streamHeader.Offset, streamHeader.Size);
503 break;
504 }
505 }
507 {
509 }
510 }
511
513 {
514 if (reader.RemainingBytes < 24)
515 {
517 }
518 reader.ReadUInt32();
519 reader.ReadByte();
520 reader.ReadByte();
521 heapSizes = (HeapSizes)reader.ReadByte();
522 reader.ReadByte();
523 ulong num = reader.ReadUInt64();
524 sortedTables = (TableMask)reader.ReadUInt64();
525 ulong num2 = 71811071505072127uL;
526 if ((num & ~num2) != 0L)
527 {
529 }
530 if (_metadataStreamKind == MetadataStreamKind.Compressed && (num & 0x804800A8u) != 0L)
531 {
533 }
535 if ((heapSizes & HeapSizes.ExtraData) == HeapSizes.ExtraData)
536 {
537 reader.ReadUInt32();
538 }
539 }
540
542 {
543 ulong num = 1uL;
544 int[] array = new int[MetadataTokens.TableCount];
545 for (int i = 0; i < array.Length; i++)
546 {
547 if ((presentTableMask & num) != 0L)
548 {
549 if (memReader.RemainingBytes < 4)
550 {
552 }
553 uint num2 = memReader.ReadUInt32();
554 if (num2 > 16777215)
555 {
557 }
558 array[i] = (int)num2;
559 }
560 num <<= 1;
561 }
562 return array;
563 }
564
583
585 {
586 if ((long)rowCounts[(uint)index] >= 65536L || IsMinimalDelta)
587 {
588 return 4;
589 }
590 return 2;
591 }
592
594 {
597 int methodRefSize = ((GetReferenceSize(rowCounts, TableIndex.MethodPtr) > 2) ? 4 : GetReferenceSize(rowCounts, TableIndex.MethodDef));
600 int propertyRefSize = ((GetReferenceSize(rowCounts, TableIndex.PropertyPtr) > 2) ? 4 : GetReferenceSize(rowCounts, TableIndex.Property));
601 int typeDefOrRefRefSize = ComputeCodedTokenSize(16384, rowCounts, TableMask.TypeRef | TableMask.TypeDef | TableMask.TypeSpec);
602 int hasConstantRefSize = ComputeCodedTokenSize(16384, rowCounts, TableMask.Field | TableMask.Param | TableMask.Property);
603 int hasCustomAttributeRefSize = ComputeCodedTokenSize(2048, rowCounts, TableMask.Module | TableMask.TypeRef | TableMask.TypeDef | TableMask.Field | TableMask.MethodDef | TableMask.Param | TableMask.InterfaceImpl | TableMask.MemberRef | TableMask.DeclSecurity | TableMask.StandAloneSig | TableMask.Event | TableMask.Property | TableMask.ModuleRef | TableMask.TypeSpec | TableMask.Assembly | TableMask.AssemblyRef | TableMask.File | TableMask.ExportedType | TableMask.ManifestResource | TableMask.GenericParam | TableMask.MethodSpec | TableMask.GenericParamConstraint);
605 int hasDeclSecurityRefSize = ComputeCodedTokenSize(16384, rowCounts, TableMask.TypeDef | TableMask.MethodDef | TableMask.Assembly);
606 int memberRefParentRefSize = ComputeCodedTokenSize(8192, rowCounts, TableMask.TypeRef | TableMask.TypeDef | TableMask.MethodDef | TableMask.ModuleRef | TableMask.TypeSpec);
608 int methodDefOrRefRefSize = ComputeCodedTokenSize(32768, rowCounts, TableMask.MethodDef | TableMask.MemberRef);
610 int implementationRefSize = ComputeCodedTokenSize(16384, rowCounts, TableMask.AssemblyRef | TableMask.File | TableMask.ExportedType);
612 int resolutionScopeRefSize = ComputeCodedTokenSize(16384, rowCounts, TableMask.Module | TableMask.TypeRef | TableMask.ModuleRef | TableMask.AssemblyRef);
614 int stringHeapRefSize = (((heapSizes & HeapSizes.StringHeapLarge) == HeapSizes.StringHeapLarge) ? 4 : 2);
615 int guidHeapRefSize = (((heapSizes & HeapSizes.GuidHeapLarge) == HeapSizes.GuidHeapLarge) ? 4 : 2);
616 int blobHeapRefSize = (((heapSizes & HeapSizes.BlobHeapLarge) == HeapSizes.BlobHeapLarge) ? 4 : 2);
617 int num = 0;
619 num += ModuleTable.Block.Length;
627 num += FieldTable.Block.Length;
635 num += ParamTable.Block.Length;
659 num += EventTable.Block.Length;
679 num += EncLogTable.Block.Length;
681 num += EncMapTable.Block.Length;
695 num += FileTable.Block.Length;
710 int hasCustomDebugInformationRefSize = ComputeCodedTokenSize(2048, rowCounts2, TableMask.Module | TableMask.TypeRef | TableMask.TypeDef | TableMask.Field | TableMask.MethodDef | TableMask.Param | TableMask.InterfaceImpl | TableMask.MemberRef | TableMask.DeclSecurity | TableMask.StandAloneSig | TableMask.Event | TableMask.Property | TableMask.ModuleRef | TableMask.TypeSpec | TableMask.Assembly | TableMask.AssemblyRef | TableMask.File | TableMask.ExportedType | TableMask.ManifestResource | TableMask.GenericParam | TableMask.MethodSpec | TableMask.GenericParamConstraint | TableMask.Document | TableMask.LocalScope | TableMask.LocalVariable | TableMask.LocalConstant | TableMask.ImportScope);
727 if (num > metadataTablesMemoryBlock.Length)
728 {
730 }
731 }
732
734 {
735 int[] array = new int[local.Length];
736 for (int i = 0; i < (int)firstLocalTableIndex; i++)
737 {
738 array[i] = external[i];
739 }
740 for (int j = (int)firstLocalTableIndex; j < array.Length; j++)
741 {
742 array[j] = local[j];
743 }
744 return array;
745 }
746
748 {
749 if (IsMinimalDelta)
750 {
751 return 4;
752 }
753 bool flag = true;
754 ulong num = (ulong)tablesReferenced;
755 for (int i = 0; i < MetadataTokens.TableCount; i++)
756 {
757 if ((num & 1) != 0L)
758 {
759 flag = flag && rowCounts[i] < largeRowSize;
760 }
761 num >>= 1;
762 }
763 if (!flag)
764 {
765 return 4;
766 }
767 return 2;
768 }
769
771 {
772 return (_sortedTables & index) != 0;
773 }
774
776 {
777 int rowId = typeDef.RowId;
779 if (firstFieldRowId == 0)
780 {
781 firstFieldRowId = 1;
782 lastFieldRowId = 0;
783 }
784 else if (rowId == TypeDefTable.NumberOfRows)
785 {
786 lastFieldRowId = (UseFieldPtrTable ? FieldPtrTable.NumberOfRows : FieldTable.NumberOfRows);
787 }
788 else
789 {
791 }
792 }
793
795 {
796 int rowId = typeDef.RowId;
798 if (firstMethodRowId == 0)
799 {
801 lastMethodRowId = 0;
802 }
803 else if (rowId == TypeDefTable.NumberOfRows)
804 {
805 lastMethodRowId = (UseMethodPtrTable ? MethodPtrTable.NumberOfRows : MethodDefTable.NumberOfRows);
806 }
807 else
808 {
810 }
811 }
812
814 {
816 if (num == 0)
817 {
818 firstEventRowId = 1;
819 lastEventRowId = 0;
820 return;
821 }
823 if (num == EventMapTable.NumberOfRows)
824 {
825 lastEventRowId = (UseEventPtrTable ? EventPtrTable.NumberOfRows : EventTable.NumberOfRows);
826 }
827 else
828 {
830 }
831 }
832
834 {
836 if (num == 0)
837 {
840 return;
841 }
844 {
845 lastPropertyRowId = (UsePropertyPtrTable ? PropertyPtrTable.NumberOfRows : PropertyTable.NumberOfRows);
846 }
847 else
848 {
850 }
851 }
852
854 {
855 int rowId = methodDef.RowId;
857 if (firstParamRowId == 0)
858 {
859 firstParamRowId = 1;
860 lastParamRowId = 0;
861 }
862 else if (rowId == MethodDefTable.NumberOfRows)
863 {
864 lastParamRowId = (UseParamPtrTable ? ParamPtrTable.NumberOfRows : ParamTable.NumberOfRows);
865 }
866 else
867 {
869 }
870 }
871
873 {
874 int rowId = scope.RowId;
876 if (firstVariableRowId == 0)
877 {
880 }
881 else if (rowId == LocalScopeTable.NumberOfRows)
882 {
884 }
885 else
886 {
888 }
889 }
890
892 {
893 int rowId = scope.RowId;
895 if (firstConstantRowId == 0)
896 {
899 }
900 else if (rowId == LocalScopeTable.NumberOfRows)
901 {
903 }
904 else
905 {
907 }
908 }
909
918
920 {
922 }
923
925 {
926 if (handle.HasFullName)
927 {
928 return StringHeap.GetString(handle.GetFullName(), UTF8Decoder);
929 }
931 }
932
934 {
935 return BlobHeap.GetBytes(handle);
936 }
937
943
948
953
955 {
957 }
958
960 {
961 return GuidHeap.GetGuid(handle);
962 }
963
972
977
982
988
994
996 {
997 if (_metadataKind == MetadataKind.Ecma335)
998 {
999 return (uint)handle.RowId;
1000 }
1002 }
1003
1008
1010 {
1011 if (_metadataKind == MetadataKind.Ecma335)
1012 {
1013 return (uint)handle.RowId;
1014 }
1016 }
1017
1019 {
1020 return new ExportedType(this, handle.RowId);
1021 }
1022
1027
1032
1034 {
1035 if (_metadataKind == MetadataKind.Ecma335)
1036 {
1037 return (uint)handle.RowId;
1038 }
1039 return TreatmentAndRowId(1, handle.RowId);
1040 }
1041
1046
1048 {
1049 return new Constant(this, handle.RowId);
1050 }
1051
1056
1058 {
1059 if (_metadataKind == MetadataKind.Ecma335)
1060 {
1061 return (uint)handle.RowId;
1062 }
1064 }
1065
1070
1072 {
1073 if (_metadataKind == MetadataKind.Ecma335)
1074 {
1075 return (uint)handle.RowId;
1076 }
1078 }
1079
1084
1089
1094
1099
1101 {
1102 if (_metadataKind == MetadataKind.Ecma335)
1103 {
1104 return (uint)handle.RowId;
1105 }
1107 }
1108
1113
1115 {
1116 return new Parameter(this, handle);
1117 }
1118
1123
1128
1133
1135 {
1136 return new AssemblyFile(this, handle);
1137 }
1138
1143
1148
1153
1158
1164
1170
1172 {
1174 }
1175
1177 {
1178 return new Document(this, handle);
1179 }
1180
1185
1190
1192 {
1193 return new LocalScope(this, handle);
1194 }
1195
1197 {
1198 return new LocalVariable(this, handle);
1199 }
1200
1202 {
1203 return new LocalConstant(this, handle);
1204 }
1205
1207 {
1208 return new ImportScope(this, handle);
1209 }
1210
1215
1220
1225
1230
1258
1271
1273 {
1277 if (num < 0)
1278 {
1279 return TypeDefTreatment.None;
1280 }
1281 StringHandle @namespace = TypeDefTable.GetNamespace(typeDef);
1282 if (StringHeap.EqualsRaw(@namespace, StringHeap.GetVirtualString(s_projectionInfos[num].ClrNamespace)))
1283 {
1284 return s_projectionInfos[num].Treatment;
1285 }
1286 if (StringHeap.EqualsRaw(@namespace, s_projectionInfos[num].WinRTNamespace))
1287 {
1288 return s_projectionInfos[num].Treatment | TypeDefTreatment.MarkInternalFlag;
1289 }
1290 return TypeDefTreatment.None;
1291 }
1292
1294 {
1297 if (num >= 0 && StringHeap.EqualsRaw(TypeRefTable.GetNamespace(typeRef), s_projectionInfos[num].WinRTNamespace))
1298 {
1299 isIDisposable = s_projectionInfos[num].IsIDisposable;
1300 return num;
1301 }
1302 isIDisposable = false;
1303 return -1;
1304 }
1305
1310
1315
1320
1322 {
1323 return s_projectionInfos[projectionIndex].SignatureTreatment;
1324 }
1325
1326 private static void InitializeProjectedTypes()
1327 {
1328 if (s_projectedTypeNames == null || s_projectionInfos == null)
1329 {
1334 AssemblyReferenceHandle.VirtualIndex clrAssembly5 = AssemblyReferenceHandle.VirtualIndex.System_Runtime_InteropServices_WindowsRuntime;
1336 string[] array = new string[50];
1338 int num = 0;
1339 int num2 = 0;
1340 array[num++] = "AttributeTargets";
1341 array2[num2++] = new ProjectionInfo("Windows.Foundation.Metadata", StringHandle.VirtualIndex.System, StringHandle.VirtualIndex.AttributeTargets, clrAssembly2);
1342 array[num++] = "AttributeUsageAttribute";
1343 array2[num2++] = new ProjectionInfo("Windows.Foundation.Metadata", StringHandle.VirtualIndex.System, StringHandle.VirtualIndex.AttributeUsageAttribute, clrAssembly2, TypeDefTreatment.RedirectedToClrAttribute);
1344 array[num++] = "Color";
1345 array2[num2++] = new ProjectionInfo("Windows.UI", StringHandle.VirtualIndex.Windows_UI, StringHandle.VirtualIndex.Color, clrAssembly);
1346 array[num++] = "CornerRadius";
1347 array2[num2++] = new ProjectionInfo("Windows.UI.Xaml", StringHandle.VirtualIndex.Windows_UI_Xaml, StringHandle.VirtualIndex.CornerRadius, clrAssembly4);
1348 array[num++] = "DateTime";
1349 array2[num2++] = new ProjectionInfo("Windows.Foundation", StringHandle.VirtualIndex.System, StringHandle.VirtualIndex.DateTimeOffset, clrAssembly2);
1350 array[num++] = "Duration";
1351 array2[num2++] = new ProjectionInfo("Windows.UI.Xaml", StringHandle.VirtualIndex.Windows_UI_Xaml, StringHandle.VirtualIndex.Duration, clrAssembly4);
1352 array[num++] = "DurationType";
1353 array2[num2++] = new ProjectionInfo("Windows.UI.Xaml", StringHandle.VirtualIndex.Windows_UI_Xaml, StringHandle.VirtualIndex.DurationType, clrAssembly4);
1354 array[num++] = "EventHandler`1";
1355 array2[num2++] = new ProjectionInfo("Windows.Foundation", StringHandle.VirtualIndex.System, StringHandle.VirtualIndex.EventHandler1, clrAssembly2);
1356 array[num++] = "EventRegistrationToken";
1357 array2[num2++] = new ProjectionInfo("Windows.Foundation", StringHandle.VirtualIndex.System_Runtime_InteropServices_WindowsRuntime, StringHandle.VirtualIndex.EventRegistrationToken, clrAssembly5);
1358 array[num++] = "GeneratorPosition";
1359 array2[num2++] = new ProjectionInfo("Windows.UI.Xaml.Controls.Primitives", StringHandle.VirtualIndex.Windows_UI_Xaml_Controls_Primitives, StringHandle.VirtualIndex.GeneratorPosition, clrAssembly4);
1360 array[num++] = "GridLength";
1361 array2[num2++] = new ProjectionInfo("Windows.UI.Xaml", StringHandle.VirtualIndex.Windows_UI_Xaml, StringHandle.VirtualIndex.GridLength, clrAssembly4);
1362 array[num++] = "GridUnitType";
1363 array2[num2++] = new ProjectionInfo("Windows.UI.Xaml", StringHandle.VirtualIndex.Windows_UI_Xaml, StringHandle.VirtualIndex.GridUnitType, clrAssembly4);
1364 array[num++] = "HResult";
1365 array2[num2++] = new ProjectionInfo("Windows.Foundation", StringHandle.VirtualIndex.System, StringHandle.VirtualIndex.Exception, clrAssembly2, TypeDefTreatment.RedirectedToClrType, TypeRefSignatureTreatment.ProjectedToClass);
1366 array[num++] = "IBindableIterable";
1367 array2[num2++] = new ProjectionInfo("Windows.UI.Xaml.Interop", StringHandle.VirtualIndex.System_Collections, StringHandle.VirtualIndex.IEnumerable, clrAssembly2);
1368 array[num++] = "IBindableVector";
1369 array2[num2++] = new ProjectionInfo("Windows.UI.Xaml.Interop", StringHandle.VirtualIndex.System_Collections, StringHandle.VirtualIndex.IList, clrAssembly2);
1370 array[num++] = "IClosable";
1371 array2[num2++] = new ProjectionInfo("Windows.Foundation", StringHandle.VirtualIndex.System, StringHandle.VirtualIndex.IDisposable, clrAssembly2, TypeDefTreatment.RedirectedToClrType, TypeRefSignatureTreatment.None, isIDisposable: true);
1372 array[num++] = "ICommand";
1373 array2[num2++] = new ProjectionInfo("Windows.UI.Xaml.Input", StringHandle.VirtualIndex.System_Windows_Input, StringHandle.VirtualIndex.ICommand, clrAssembly3);
1374 array[num++] = "IIterable`1";
1375 array2[num2++] = new ProjectionInfo("Windows.Foundation.Collections", StringHandle.VirtualIndex.System_Collections_Generic, StringHandle.VirtualIndex.IEnumerable1, clrAssembly2);
1376 array[num++] = "IKeyValuePair`2";
1377 array2[num2++] = new ProjectionInfo("Windows.Foundation.Collections", StringHandle.VirtualIndex.System_Collections_Generic, StringHandle.VirtualIndex.KeyValuePair2, clrAssembly2, TypeDefTreatment.RedirectedToClrType, TypeRefSignatureTreatment.ProjectedToValueType);
1378 array[num++] = "IMapView`2";
1379 array2[num2++] = new ProjectionInfo("Windows.Foundation.Collections", StringHandle.VirtualIndex.System_Collections_Generic, StringHandle.VirtualIndex.IReadOnlyDictionary2, clrAssembly2);
1380 array[num++] = "IMap`2";
1381 array2[num2++] = new ProjectionInfo("Windows.Foundation.Collections", StringHandle.VirtualIndex.System_Collections_Generic, StringHandle.VirtualIndex.IDictionary2, clrAssembly2);
1382 array[num++] = "INotifyCollectionChanged";
1383 array2[num2++] = new ProjectionInfo("Windows.UI.Xaml.Interop", StringHandle.VirtualIndex.System_Collections_Specialized, StringHandle.VirtualIndex.INotifyCollectionChanged, clrAssembly3);
1384 array[num++] = "INotifyPropertyChanged";
1385 array2[num2++] = new ProjectionInfo("Windows.UI.Xaml.Data", StringHandle.VirtualIndex.System_ComponentModel, StringHandle.VirtualIndex.INotifyPropertyChanged, clrAssembly3);
1386 array[num++] = "IReference`1";
1387 array2[num2++] = new ProjectionInfo("Windows.Foundation", StringHandle.VirtualIndex.System, StringHandle.VirtualIndex.Nullable1, clrAssembly2, TypeDefTreatment.RedirectedToClrType, TypeRefSignatureTreatment.ProjectedToValueType);
1388 array[num++] = "IVectorView`1";
1389 array2[num2++] = new ProjectionInfo("Windows.Foundation.Collections", StringHandle.VirtualIndex.System_Collections_Generic, StringHandle.VirtualIndex.IReadOnlyList1, clrAssembly2);
1390 array[num++] = "IVector`1";
1391 array2[num2++] = new ProjectionInfo("Windows.Foundation.Collections", StringHandle.VirtualIndex.System_Collections_Generic, StringHandle.VirtualIndex.IList1, clrAssembly2);
1392 array[num++] = "KeyTime";
1393 array2[num2++] = new ProjectionInfo("Windows.UI.Xaml.Media.Animation", StringHandle.VirtualIndex.Windows_UI_Xaml_Media_Animation, StringHandle.VirtualIndex.KeyTime, clrAssembly4);
1394 array[num++] = "Matrix";
1395 array2[num2++] = new ProjectionInfo("Windows.UI.Xaml.Media", StringHandle.VirtualIndex.Windows_UI_Xaml_Media, StringHandle.VirtualIndex.Matrix, clrAssembly4);
1396 array[num++] = "Matrix3D";
1397 array2[num2++] = new ProjectionInfo("Windows.UI.Xaml.Media.Media3D", StringHandle.VirtualIndex.Windows_UI_Xaml_Media_Media3D, StringHandle.VirtualIndex.Matrix3D, clrAssembly4);
1398 array[num++] = "Matrix3x2";
1399 array2[num2++] = new ProjectionInfo("Windows.Foundation.Numerics", StringHandle.VirtualIndex.System_Numerics, StringHandle.VirtualIndex.Matrix3x2, clrAssembly6);
1400 array[num++] = "Matrix4x4";
1401 array2[num2++] = new ProjectionInfo("Windows.Foundation.Numerics", StringHandle.VirtualIndex.System_Numerics, StringHandle.VirtualIndex.Matrix4x4, clrAssembly6);
1402 array[num++] = "NotifyCollectionChangedAction";
1403 array2[num2++] = new ProjectionInfo("Windows.UI.Xaml.Interop", StringHandle.VirtualIndex.System_Collections_Specialized, StringHandle.VirtualIndex.NotifyCollectionChangedAction, clrAssembly3);
1404 array[num++] = "NotifyCollectionChangedEventArgs";
1405 array2[num2++] = new ProjectionInfo("Windows.UI.Xaml.Interop", StringHandle.VirtualIndex.System_Collections_Specialized, StringHandle.VirtualIndex.NotifyCollectionChangedEventArgs, clrAssembly3);
1406 array[num++] = "NotifyCollectionChangedEventHandler";
1407 array2[num2++] = new ProjectionInfo("Windows.UI.Xaml.Interop", StringHandle.VirtualIndex.System_Collections_Specialized, StringHandle.VirtualIndex.NotifyCollectionChangedEventHandler, clrAssembly3);
1408 array[num++] = "Plane";
1409 array2[num2++] = new ProjectionInfo("Windows.Foundation.Numerics", StringHandle.VirtualIndex.System_Numerics, StringHandle.VirtualIndex.Plane, clrAssembly6);
1410 array[num++] = "Point";
1411 array2[num2++] = new ProjectionInfo("Windows.Foundation", StringHandle.VirtualIndex.Windows_Foundation, StringHandle.VirtualIndex.Point, clrAssembly);
1412 array[num++] = "PropertyChangedEventArgs";
1413 array2[num2++] = new ProjectionInfo("Windows.UI.Xaml.Data", StringHandle.VirtualIndex.System_ComponentModel, StringHandle.VirtualIndex.PropertyChangedEventArgs, clrAssembly3);
1414 array[num++] = "PropertyChangedEventHandler";
1415 array2[num2++] = new ProjectionInfo("Windows.UI.Xaml.Data", StringHandle.VirtualIndex.System_ComponentModel, StringHandle.VirtualIndex.PropertyChangedEventHandler, clrAssembly3);
1416 array[num++] = "Quaternion";
1417 array2[num2++] = new ProjectionInfo("Windows.Foundation.Numerics", StringHandle.VirtualIndex.System_Numerics, StringHandle.VirtualIndex.Quaternion, clrAssembly6);
1418 array[num++] = "Rect";
1419 array2[num2++] = new ProjectionInfo("Windows.Foundation", StringHandle.VirtualIndex.Windows_Foundation, StringHandle.VirtualIndex.Rect, clrAssembly);
1420 array[num++] = "RepeatBehavior";
1421 array2[num2++] = new ProjectionInfo("Windows.UI.Xaml.Media.Animation", StringHandle.VirtualIndex.Windows_UI_Xaml_Media_Animation, StringHandle.VirtualIndex.RepeatBehavior, clrAssembly4);
1422 array[num++] = "RepeatBehaviorType";
1423 array2[num2++] = new ProjectionInfo("Windows.UI.Xaml.Media.Animation", StringHandle.VirtualIndex.Windows_UI_Xaml_Media_Animation, StringHandle.VirtualIndex.RepeatBehaviorType, clrAssembly4);
1424 array[num++] = "Size";
1425 array2[num2++] = new ProjectionInfo("Windows.Foundation", StringHandle.VirtualIndex.Windows_Foundation, StringHandle.VirtualIndex.Size, clrAssembly);
1426 array[num++] = "Thickness";
1427 array2[num2++] = new ProjectionInfo("Windows.UI.Xaml", StringHandle.VirtualIndex.Windows_UI_Xaml, StringHandle.VirtualIndex.Thickness, clrAssembly4);
1428 array[num++] = "TimeSpan";
1429 array2[num2++] = new ProjectionInfo("Windows.Foundation", StringHandle.VirtualIndex.System, StringHandle.VirtualIndex.TimeSpan, clrAssembly2);
1430 array[num++] = "TypeName";
1431 array2[num2++] = new ProjectionInfo("Windows.UI.Xaml.Interop", StringHandle.VirtualIndex.System, StringHandle.VirtualIndex.Type, clrAssembly2, TypeDefTreatment.RedirectedToClrType, TypeRefSignatureTreatment.ProjectedToClass);
1432 array[num++] = "Uri";
1433 array2[num2++] = new ProjectionInfo("Windows.Foundation", StringHandle.VirtualIndex.System, StringHandle.VirtualIndex.Uri, clrAssembly2);
1434 array[num++] = "Vector2";
1435 array2[num2++] = new ProjectionInfo("Windows.Foundation.Numerics", StringHandle.VirtualIndex.System_Numerics, StringHandle.VirtualIndex.Vector2, clrAssembly6);
1436 array[num++] = "Vector3";
1437 array2[num2++] = new ProjectionInfo("Windows.Foundation.Numerics", StringHandle.VirtualIndex.System_Numerics, StringHandle.VirtualIndex.Vector3, clrAssembly6);
1438 array[num++] = "Vector4";
1439 array2[num2++] = new ProjectionInfo("Windows.Foundation.Numerics", StringHandle.VirtualIndex.System_Numerics, StringHandle.VirtualIndex.Vector4, clrAssembly6);
1442 }
1443 }
1444
1445 internal static string[] GetProjectedTypeNames()
1446 {
1448 return s_projectedTypeNames;
1449 }
1450
1451 private static uint TreatmentAndRowId(byte treatment, int rowId)
1452 {
1453 return (uint)((treatment << 24) | rowId);
1454 }
1455
1456 [MethodImpl(MethodImplOptions.NoInlining)]
1458 {
1462 if ((flags & TypeAttributes.WindowsRuntime) == 0)
1463 {
1464 typeDefTreatment = ((_metadataKind == MetadataKind.ManagedWindowsMetadata && IsClrImplementationType(handle)) ? TypeDefTreatment.UnmangleWinRTName : TypeDefTreatment.None);
1465 }
1466 else
1467 {
1468 if (_metadataKind != MetadataKind.WindowsMetadata)
1469 {
1470 typeDefTreatment = ((_metadataKind == MetadataKind.ManagedWindowsMetadata && NeedsWinRTPrefix(flags, extends)) ? TypeDefTreatment.PrefixWinRTName : TypeDefTreatment.None);
1471 }
1472 else
1473 {
1475 if (typeDefTreatment != 0)
1476 {
1477 return TreatmentAndRowId((byte)typeDefTreatment, handle.RowId);
1478 }
1479 typeDefTreatment = ((extends.Kind != HandleKind.TypeReference || !IsSystemAttribute((TypeReferenceHandle)extends)) ? TypeDefTreatment.NormalNonAttribute : TypeDefTreatment.NormalAttribute);
1480 }
1481 if ((typeDefTreatment == TypeDefTreatment.PrefixWinRTName || typeDefTreatment == TypeDefTreatment.NormalNonAttribute) && (flags & TypeAttributes.ClassSemanticsMask) == 0 && HasAttribute(handle, "Windows.UI.Xaml", "TreatAsAbstractComposableClassAttribute"))
1482 {
1483 typeDefTreatment |= TypeDefTreatment.MarkAbstractFlag;
1484 }
1485 }
1486 return TreatmentAndRowId((byte)typeDefTreatment, handle.RowId);
1487 }
1488
1490 {
1492 if ((flags & (TypeAttributes.VisibilityMask | TypeAttributes.SpecialName)) != TypeAttributes.SpecialName)
1493 {
1494 return false;
1495 }
1497 }
1498
1509
1511 {
1513 {
1515 if (StringHeap.EqualsRaw(name, "MulticastDelegate"))
1516 {
1517 return TypeRefTreatment.SystemDelegate;
1518 }
1519 if (StringHeap.EqualsRaw(name, "Attribute"))
1520 {
1521 return TypeRefTreatment.SystemAttribute;
1522 }
1523 }
1524 return TypeRefTreatment.None;
1525 }
1526
1528 {
1530 {
1531 return StringHeap.EqualsRaw(TypeRefTable.GetName(handle), "Attribute");
1532 }
1533 return false;
1534 }
1535
1537 {
1538 if ((flags & (TypeAttributes.VisibilityMask | TypeAttributes.ClassSemanticsMask)) != TypeAttributes.Public)
1539 {
1540 return false;
1541 }
1542 if (extends.Kind != HandleKind.TypeReference)
1543 {
1544 return false;
1545 }
1548 {
1550 if (StringHeap.EqualsRaw(name, "MulticastDelegate") || StringHeap.EqualsRaw(name, "ValueType") || StringHeap.EqualsRaw(name, "Attribute"))
1551 {
1552 return false;
1553 }
1554 }
1555 return true;
1556 }
1557
1559 {
1563 if ((flags & TypeAttributes.WindowsRuntime) != 0)
1564 {
1566 {
1567 methodDefTreatment = MethodDefTreatment.Implementation;
1568 }
1569 else if (flags.IsNested())
1570 {
1571 methodDefTreatment = MethodDefTreatment.Implementation;
1572 }
1573 else if ((flags & TypeAttributes.ClassSemanticsMask) != 0)
1574 {
1575 methodDefTreatment = MethodDefTreatment.InterfaceMethod;
1576 }
1577 else if (_metadataKind == MetadataKind.ManagedWindowsMetadata && (flags & TypeAttributes.Public) == 0)
1578 {
1579 methodDefTreatment = MethodDefTreatment.Implementation;
1580 }
1581 else
1582 {
1585 if (extends.Kind == HandleKind.TypeReference)
1586 {
1588 {
1589 case TypeRefTreatment.SystemAttribute:
1590 methodDefTreatment = MethodDefTreatment.AttributeMethod;
1591 break;
1592 case TypeRefTreatment.SystemDelegate:
1593 methodDefTreatment = MethodDefTreatment.DelegateMethod | MethodDefTreatment.MarkPublicFlag;
1594 break;
1595 }
1596 }
1597 }
1598 }
1600 {
1601 bool flag = false;
1602 bool flag2 = false;
1603 bool isIDisposable = false;
1605 {
1607 if (!(methodImplementation.MethodBody == methodDef))
1608 {
1609 continue;
1610 }
1613 {
1614 flag = true;
1615 if (isIDisposable)
1616 {
1617 break;
1618 }
1619 }
1620 else
1621 {
1622 flag2 = true;
1623 }
1624 }
1625 if (isIDisposable)
1626 {
1627 methodDefTreatment = MethodDefTreatment.DisposeMethod;
1628 }
1629 else if (flag && !flag2)
1630 {
1631 methodDefTreatment = MethodDefTreatment.HiddenInterfaceImplementation;
1632 }
1633 }
1635 {
1637 }
1638 return TreatmentAndRowId((byte)methodDefTreatment, methodDef.RowId);
1639 }
1640
1642 {
1645 {
1647 {
1648 if (StringHeap.EqualsRaw(typeName, "TreatAsPublicMethodAttribute"))
1649 {
1650 methodDefTreatment |= MethodDefTreatment.MarkPublicFlag;
1651 }
1652 if (StringHeap.EqualsRaw(typeName, "TreatAsAbstractMethodAttribute"))
1653 {
1654 methodDefTreatment |= MethodDefTreatment.MarkAbstractFlag;
1655 }
1656 }
1657 }
1658 return methodDefTreatment;
1659 }
1660
1680
1687
1689 {
1690 isIDisposable = false;
1693 if (@class.Kind == HandleKind.TypeReference)
1694 {
1695 typeRef = (TypeReferenceHandle)@class;
1696 }
1697 else
1698 {
1699 if (@class.Kind != HandleKind.TypeSpecification)
1700 {
1701 return false;
1702 }
1705 if (blobReader.Length < 2 || blobReader.ReadByte() != 21 || blobReader.ReadByte() != 18)
1706 {
1707 return false;
1708 }
1709 EntityHandle entityHandle = blobReader.ReadTypeHandle();
1710 if (entityHandle.Kind != HandleKind.TypeReference)
1711 {
1712 return false;
1713 }
1715 }
1717 }
1718
1720 {
1721 for (int i = 1; i <= AssemblyRefTable.NumberOfNonVirtualRows; i++)
1722 {
1723 if (StringHeap.EqualsRaw(AssemblyRefTable.GetName(i), "mscorlib"))
1724 {
1725 return i;
1726 }
1727 }
1729 }
1730
1732 {
1735 {
1737 }
1739 if (StringHeap.EqualsRaw(TypeDefTable.GetNamespace(typeDefinitionHandle), "Windows.Foundation.Metadata"))
1740 {
1742 {
1743 return CustomAttributeValueTreatment.AttributeUsageVersionAttribute;
1744 }
1745 if (StringHeap.EqualsRaw(TypeDefTable.GetName(typeDefinitionHandle), "DeprecatedAttribute"))
1746 {
1747 return CustomAttributeValueTreatment.AttributeUsageDeprecatedAttribute;
1748 }
1749 }
1750 if (!HasAttribute(typeDefinitionHandle, "Windows.Foundation.Metadata", "AllowMultipleAttribute"))
1751 {
1752 return CustomAttributeValueTreatment.AttributeUsageAllowSingle;
1753 }
1754 return CustomAttributeValueTreatment.AttributeUsageAllowMultiple;
1755 }
1756
1758 {
1759 if (targetType.Kind != HandleKind.TypeDefinition)
1760 {
1761 return false;
1762 }
1764 if (constructor.Kind != HandleKind.MemberReference)
1765 {
1766 return false;
1767 }
1769 if (@class.Kind != HandleKind.TypeReference)
1770 {
1771 return false;
1772 }
1774 if (StringHeap.EqualsRaw(TypeRefTable.GetName(handle), "AttributeUsageAttribute"))
1775 {
1776 return StringHeap.EqualsRaw(TypeRefTable.GetNamespace(handle), "Windows.Foundation.Metadata");
1777 }
1778 return false;
1779 }
1780
1781 private bool HasAttribute(EntityHandle token, string asciiNamespaceName, string asciiTypeName)
1782 {
1784 {
1786 {
1787 return true;
1788 }
1789 }
1790 return false;
1791 }
1792
1794 {
1795 namespaceName = (typeName = default(StringHandle));
1797 if (attributeTypeRaw.IsNil)
1798 {
1799 return false;
1800 }
1801 if (attributeTypeRaw.Kind == HandleKind.TypeReference)
1802 {
1805 if (!resolutionScope.IsNil && resolutionScope.Kind == HandleKind.TypeReference)
1806 {
1807 return false;
1808 }
1809 typeName = TypeRefTable.GetName(handle);
1811 }
1812 else
1813 {
1814 if (attributeTypeRaw.Kind != HandleKind.TypeDefinition)
1815 {
1816 return false;
1817 }
1819 if (TypeDefTable.GetFlags(handle2).IsNested())
1820 {
1821 return false;
1822 }
1823 typeName = TypeDefTable.GetName(handle2);
1825 }
1826 return true;
1827 }
1828
1830 {
1832 if (constructor.Kind == HandleKind.MethodDefinition)
1833 {
1835 }
1836 if (constructor.Kind == HandleKind.MemberReference)
1837 {
1839 HandleKind kind = @class.Kind;
1840 if (kind == HandleKind.TypeReference || kind == HandleKind.TypeDefinition)
1841 {
1842 return @class;
1843 }
1844 }
1845 return default(EntityHandle);
1846 }
1847}
bool TryGetValue(TKey key, [MaybeNullWhen(false)] out TValue value)
bool ICollection< KeyValuePair< TKey, TValue > >. Contains(KeyValuePair< TKey, TValue > keyValuePair)
void Add(TKey key, TValue value)
static ImmutableArray< byte > DangerousCreateFromUnderlyingArray(ref byte[]? array)
string GetFullName(NamespaceDefinitionHandle handle)
NamespaceData GetNamespaceData(NamespaceDefinitionHandle handle)
void GetLocalVariableRange(LocalScopeHandle scope, out int firstVariableRowId, out int lastVariableRowId)
bool GetAttributeTypeNameRaw(CustomAttributeHandle caHandle, out StringHandle namespaceName, out StringHandle typeName)
GenericParameterConstraint GetGenericParameterConstraint(GenericParameterConstraintHandle handle)
ExportedType GetExportedType(ExportedTypeHandle handle)
DeclarativeSecurityAttribute GetDeclarativeSecurityAttribute(DeclarativeSecurityAttributeHandle handle)
readonly DebugMetadataHeader _debugMetadataHeader
void ReadMetadataTableHeader(ref BlobReader reader, out HeapSizes heapSizes, out int[] metadataTableRowCounts, out TableMask sortedTables)
MemberReferenceHandleCollection MemberReferences
CustomDebugInformationTableReader CustomDebugInformationTable
MethodDefinitionHandleCollection MethodDefinitions
MethodSemanticsTableReader MethodSemanticsTable
TypeSpecification GetTypeSpecification(TypeSpecificationHandle handle)
CustomDebugInformationHandleCollection GetCustomDebugInformation(EntityHandle handle)
StandaloneSignature GetStandaloneSignature(StandaloneSignatureHandle handle)
uint CalculateMemberRefTreatmentAndRowId(MemberReferenceHandle handle)
ImportScope GetImportScope(ImportScopeHandle handle)
MetadataKind GetMetadataKind(string versionString)
int ComputeCodedTokenSize(int largeRowSize, int[] rowCounts, TableMask tablesReferenced)
uint GetFieldDefTreatmentAndRowId(FieldDefinitionHandle handle)
CustomAttributeTableReader CustomAttributeTable
bool IsWindowsAttributeUsageAttribute(EntityHandle targetType, CustomAttributeHandle attributeHandle)
uint CalculateTypeRefTreatmentAndRowId(TypeReferenceHandle handle)
string GetUserString(UserStringHandle handle)
MethodDebugInformationHandleCollection MethodDebugInformation
void GetLocalConstantRange(LocalScopeHandle scope, out int firstConstantRowId, out int lastConstantRowId)
AssemblyRefOSTableReader AssemblyRefOSTable
AssemblyReferenceHandleCollection AssemblyReferences
readonly MetadataStreamKind _metadataStreamKind
NamespaceDefinition GetNamespaceDefinition(NamespaceDefinitionHandle handle)
EventDefinitionHandleCollection EventDefinitions
LocalConstant GetLocalConstant(LocalConstantHandle handle)
TypeDefTreatment GetWellKnownTypeDefinitionTreatment(TypeDefinitionHandle typeDef)
TypeReferenceHandleCollection TypeReferences
LocalScope GetLocalScope(LocalScopeHandle handle)
MemberReference GetMemberReference(MemberReferenceHandle handle)
PropertyDefinition GetPropertyDefinition(PropertyDefinitionHandle handle)
PropertyDefinitionHandleCollection PropertyDefinitions
string GetString(StringHandle handle)
unsafe MetadataReader(byte *metadata, int length, MetadataReaderOptions options)
ManifestResource GetManifestResource(ManifestResourceHandle handle)
InterfaceImplTableReader InterfaceImplTable
LocalConstantTableReader LocalConstantTable
ManifestResourceHandleCollection ManifestResources
BlobReader GetBlobReader(StringHandle handle)
int GetReferenceSize(int[] rowCounts, TableIndex index)
static uint TreatmentAndRowId(byte treatment, int rowId)
AssemblyNameFlags GetAssemblyNameFlags(AssemblyFlags flags)
FieldDefinition GetFieldDefinition(FieldDefinitionHandle handle)
MethodDebugInformationTableReader MethodDebugInformationTable
AssemblyFile GetAssemblyFile(AssemblyFileHandle handle)
string GetString(DocumentNameBlobHandle handle)
uint CalculateTypeDefTreatmentAndRowId(TypeDefinitionHandle handle)
TypeDefinitionHandle GetDeclaringType(MethodDefinitionHandle methodDef)
DeclarativeSecurityAttributeHandleCollection DeclarativeSecurityAttributes
static TypeRefSignatureTreatment GetProjectedSignatureTreatment(int projectionIndex)
TypeRefTreatment GetSpecialTypeRefTreatment(TypeReferenceHandle handle)
bool IsSystemAttribute(TypeReferenceHandle handle)
void GetParameterRange(MethodDefinitionHandle methodDef, out int firstParamRowId, out int lastParamRowId)
GenericParamConstraintTableReader GenericParamConstraintTable
AssemblyContentType GetContentTypeFromAssemblyFlags(AssemblyFlags flags)
bool ImplementsRedirectedInterface(MemberReferenceHandle memberRef, out bool isIDisposable)
ExportedTypeHandleCollection ExportedTypes
void GetFieldRange(TypeDefinitionHandle typeDef, out int firstFieldRowId, out int lastFieldRowId)
Parameter GetParameter(ParameterHandle handle)
bool HasAttribute(EntityHandle token, string asciiNamespaceName, string asciiTypeName)
Document GetDocument(DocumentHandle handle)
CustomDebugInformation GetCustomDebugInformation(CustomDebugInformationHandle handle)
StreamHeader[] ReadStreamHeaders(ref BlobReader memReader)
static void ReadStandalonePortablePdbStream(MemoryBlock pdbStreamBlock, int pdbStreamOffset, out DebugMetadataHeader debugMetadataHeader, out int[] externalTableRowCounts)
LocalVariableTableReader LocalVariableTable
void GetMethodRange(TypeDefinitionHandle typeDef, out int firstMethodRowId, out int lastMethodRowId)
void GetPropertyRange(TypeDefinitionHandle typeDef, out int firstPropertyRowId, out int lastPropertyRowId)
AssemblyRefProcessorTableReader AssemblyRefProcessorTable
ManifestResourceTableReader ManifestResourceTable
void GetEventRange(TypeDefinitionHandle typeDef, out int firstEventRowId, out int lastEventRowId)
TypeDefinitionHandleCollection TypeDefinitions
MethodDefTreatment GetMethodTreatmentFromCustomAttributes(MethodDefinitionHandle methodDef)
uint GetMemberRefTreatmentAndRowId(MemberReferenceHandle handle)
AssemblyName GetAssemblyName(StringHandle nameHandle, Version version, StringHandle cultureHandle, BlobHandle publicKeyOrTokenHandle, AssemblyHashAlgorithm assemblyHashAlgorithm, AssemblyFlags flags)
static AssemblyReferenceHandle GetProjectedAssemblyRef(int projectionIndex)
AssemblyReference GetAssemblyReference(AssemblyReferenceHandle handle)
MethodDebugInformation GetMethodDebugInformation(MethodDefinitionHandle handle)
uint GetTypeDefTreatmentAndRowId(TypeDefinitionHandle handle)
static int[] ReadMetadataTableRowCounts(ref BlobReader memReader, ulong presentTableMask)
void InitializeTableReaders(MemoryBlock metadataTablesMemoryBlock, HeapSizes heapSizes, int[] rowCounts, int[] externalRowCountsOpt)
TypeDefinitionHandle GetDeclaringType(FieldDefinitionHandle fieldDef)
BlobReader GetBlobReader(BlobHandle handle)
bool NeedsWinRTPrefix(TypeAttributes flags, EntityHandle extends)
GenericParameter GetGenericParameter(GenericParameterHandle handle)
ImmutableArray< byte > GetBlobContent(BlobHandle handle)
EntityHandle GetAttributeTypeRaw(CustomAttributeHandle handle)
unsafe MetadataReader(byte *metadata, int length)
CustomDebugInformationHandleCollection CustomDebugInformation
uint CalculateFieldDefTreatmentAndRowId(FieldDefinitionHandle handle)
MethodSpecification GetMethodSpecification(MethodSpecificationHandle handle)
unsafe MetadataReader(byte *metadata, int length, MetadataReaderOptions options, MetadataStringDecoder? utf8Decoder, object? memoryOwner)
CustomAttributeValueTreatment CalculateCustomAttributeValueTreatment(CustomAttributeHandle handle)
EventDefinition GetEventDefinition(EventDefinitionHandle handle)
readonly MetadataReaderOptions _options
LocalVariableHandleCollection LocalVariables
uint CalculateMethodDefTreatmentAndRowId(MethodDefinitionHandle methodDef)
unsafe MetadataReader(byte *metadata, int length, MetadataReaderOptions options, MetadataStringDecoder? utf8Decoder)
LocalScopeHandleCollection GetLocalScopes(MethodDefinitionHandle handle)
StandAloneSigTableReader StandAloneSigTable
string GetString(NamespaceDefinitionHandle handle)
static int[] CombineRowCounts(int[] local, int[] external, TableIndex firstLocalTableIndex)
bool IsClrImplementationType(TypeDefinitionHandle typeDef)
CustomAttribute GetCustomAttribute(CustomAttributeHandle handle)
Constant GetConstant(ConstantHandle handle)
LocalConstantHandleCollection LocalConstants
uint GetTypeRefTreatmentAndRowId(TypeReferenceHandle handle)
uint GetCustomAttributeTreatmentAndRowId(CustomAttributeHandle handle)
Dictionary< TypeDefinitionHandle, ImmutableArray< TypeDefinitionHandle > > _lazyNestedTypesMap
CustomAttributeHandleCollection CustomAttributes
MethodImplementation GetMethodImplementation(MethodImplementationHandle handle)
InterfaceImplementation GetInterfaceImplementation(InterfaceImplementationHandle handle)
static StringHandle GetProjectedName(int projectionIndex)
CustomAttributeHandleCollection GetCustomAttributes(EntityHandle handle)
MethodDebugInformation GetMethodDebugInformation(MethodDebugInformationHandle handle)
LocalVariable GetLocalVariable(LocalVariableHandle handle)
TypeDefinition GetTypeDefinition(TypeDefinitionHandle handle)
StateMachineMethodTableReader StateMachineMethodTable
AssemblyProcessorTableReader AssemblyProcessorTable
uint GetMethodDefTreatmentAndRowId(MethodDefinitionHandle handle)
FieldDefinitionHandleCollection FieldDefinitions
int GetProjectionIndexForTypeReference(TypeReferenceHandle typeRef, out bool isIDisposable)
ModuleReference GetModuleReference(ModuleReferenceHandle handle)
MethodDefinition GetMethodDefinition(MethodDefinitionHandle handle)
static StringHandle GetProjectedNamespace(int projectionIndex)
AssemblyFileHandleCollection AssemblyFiles
LocalScopeHandleCollection GetLocalScopes(MethodDebugInformationHandle handle)
TypeReference GetTypeReference(TypeReferenceHandle handle)
void InitializeStreamReaders(in MemoryBlock metadataRoot, StreamHeader[] streamHeaders, out MetadataStreamKind metadataStreamKind, out MemoryBlock metadataTableStream, out MemoryBlock standalonePdbStream)
void ReadMetadataHeader(ref BlobReader memReader, out string versionString)
ImmutableArray< TypeDefinitionHandle > GetNestedTypes(TypeDefinitionHandle typeDef)
static void ArgumentNull(string parameterName)
Definition Throw.cs:110
static void ArgumentOutOfRange(string parameterName)
Definition Throw.cs:145
static void InvalidArgument(string message, string parameterName)
Definition Throw.cs:19
static string TableRowCountSpaceTooSmall
Definition SR.cs:66
static string InvalidRowCount
Definition SR.cs:142
static string InvalidMetadataStreamFormat
Definition SR.cs:90
static string NotEnoughSpaceForVersionString
Definition SR.cs:76
static string NotEnoughSpaceForMetadataStream
Definition SR.cs:88
static string MetadataTablesTooSmall
Definition SR.cs:92
static string Format(string resourceFormat, object p1)
Definition SR.cs:118
static string NotEnoughSpaceForStreamHeaderName
Definition SR.cs:80
static string InvalidEntryPointToken
Definition SR.cs:144
static string MetadataSignature
Definition SR.cs:74
static string StandaloneDebugMetadataImageDoesNotContainModuleTable
Definition SR.cs:40
static string ModuleTableInvalidNumberOfRows
Definition SR.cs:60
static string MetadataHeaderTooSmall
Definition SR.cs:72
static string UnknownTables
Definition SR.cs:62
static string NotEnoughSpaceForGUIDStream
Definition SR.cs:86
static string WinMDMissingMscorlibRef
Definition SR.cs:96
static string StreamHeaderTooSmall
Definition SR.cs:78
static string MetadataImageDoesNotRepresentAnAssembly
Definition SR.cs:38
static string NotEnoughSpaceForStringStream
Definition SR.cs:82
static string MetadataTableHeaderTooSmall
Definition SR.cs:94
static string MetadataStringDecoderEncodingMustBeUtf8
Definition SR.cs:126
static string IllegalTablesInCompressedMetadataStream
Definition SR.cs:64
static string NotEnoughSpaceForBlobStream
Definition SR.cs:84
Definition SR.cs:7
static AssemblyReferenceHandle FromVirtualIndex(VirtualIndex virtualIndex)
unsafe MemoryBlock GetMemoryBlockAt(int offset, int length)
BlobReader GetBlobReader(BlobHandle handle)
Definition BlobHeap.cs:98
byte[] GetBytes(BlobHandle handle)
Definition BlobHeap.cs:59
MemoryBlock GetMemoryBlock(BlobHandle handle)
Definition BlobHeap.cs:75
string GetDocumentName(DocumentNameBlobHandle handle)
Definition BlobHeap.cs:137
FieldAttributes GetFlags(FieldDefinitionHandle handle)
StringHandle GetName(FieldDefinitionHandle handle)
EntityHandle GetClass(MemberReferenceHandle handle)
bool StartsWithRaw(StringHandle rawHandle, string asciiPrefix)
int BinarySearchRaw(string[] asciiKeys, StringHandle rawHandle)
BlobReader GetBlobReader(StringHandle handle)
string GetString(StringHandle handle, MetadataStringDecoder utf8Decoder)
Definition StringHeap.cs:53
static string GetVirtualString(StringHandle.VirtualIndex index)
Definition StringHeap.cs:71
bool EqualsRaw(StringHandle rawHandle, string asciiString)
EntityHandle GetExtends(TypeDefinitionHandle handle)
TypeDefinitionHandle FindTypeContainingMethod(int methodDefOrPtrRowId, int numberOfMethods)
StringHandle GetNamespace(TypeDefinitionHandle handle)
StringHandle GetName(TypeDefinitionHandle handle)
TypeAttributes GetFlags(TypeDefinitionHandle handle)
TypeDefinitionHandle FindTypeContainingField(int fieldDefOrPtrRowId, int numberOfFields)
EntityHandle GetResolutionScope(TypeReferenceHandle handle)
StringHandle GetName(TypeReferenceHandle handle)
StringHandle GetNamespace(TypeReferenceHandle handle)
BlobHandle GetSignature(TypeSpecificationHandle handle)
readonly AssemblyReferenceHandle.VirtualIndex AssemblyRef
ProjectionInfo(string winRtNamespace, StringHandle.VirtualIndex clrNamespace, StringHandle.VirtualIndex clrName, AssemblyReferenceHandle.VirtualIndex clrAssembly, TypeDefTreatment treatment=TypeDefTreatment.RedirectedToClrType, TypeRefSignatureTreatment signatureTreatment=TypeRefSignatureTreatment.None, bool isIDisposable=false)
readonly TypeRefSignatureTreatment SignatureTreatment
static MethodDebugInformationHandle FromRowId(int rowId)
static MethodDefinitionHandle FromRowId(int rowId)
static StringHandle FromVirtualIndex(VirtualIndex virtualIndex)