413 references to MetadataTokens
Microsoft.Cci.Extensions (2)
Extensions\CSharp\CSharpCciExtensions.cs (2)
862TypeDefinition typeDefinition = metadataReader.GetTypeDefinition(MetadataTokens.TypeDefinitionHandle(rowId)); 887GenericParameter genericParameter = metadataReader.GetGenericParameter(MetadataTokens.GenericParameterHandle(rowId));
Microsoft.CodeAnalysis (141)
Emit\EditAndContinue\DefinitionMap.cs (9)
126=> MetadataTokens.EntityHandle(SourceToMetadataSymbolMatcher.MapDefinition(def)?.GetInternalSymbol()?.MetadataToken ?? 0); 151handle = MetadataTokens.MethodDefinitionHandle(methodIndex); 176return MetadataTokens.MethodDefinitionHandle(methodRowId); 184return (MethodDefinitionHandle)MetadataTokens.EntityHandle(peMethod.MetadataToken); 241int methodIndex = MetadataTokens.GetRowNumber(methodHandle); 300MetadataTokens.GetToken(methodHandle), 385MetadataTokens.GetToken(localSignature), 671var methodRowId = MetadataTokens.GetRowNumber(methodHandle); 693provider = Baseline.DebugInformationProvider(MetadataTokens.MethodDefinitionHandle(methodRowId));
Emit\EditAndContinue\DeletedPEMethodDefinition.cs (1)
36=> MetadataTokens.MethodDefinitionHandle(_oldMethod.MetadataToken);
Emit\EditAndContinue\DeltaMetadataWriter.cs (53)
145var sizes = new int[MetadataTokens.TableCount]; 175addedOrChangedMethodsByIndex.Add(MetadataTokens.GetRowNumber(GetMethodDefinitionHandle(pair.Key)), pair.Value); 180var tableSizes = new int[MetadataTokens.TableCount]; 284methods.Add(MetadataTokens.MethodDefinitionHandle(_methodDefs.GetRowId(def))); 317return MetadataTokens.EventDefinitionHandle(_eventDefs.GetRowId(def)); 327return MetadataTokens.FieldDefinitionHandle(_fieldDefs.GetRowId(def)); 338handle = MetadataTokens.TypeDefinitionHandle(rowId); 344return MetadataTokens.TypeDefinitionHandle(_typeDefs.GetRowId(def)); 349return _typeDefs.GetDefinition(MetadataTokens.GetRowNumber(handle)); 360handle = MetadataTokens.MethodDefinitionHandle(rowId); 365=> MetadataTokens.MethodDefinitionHandle(_methodDefs.GetRowId(def)); 368=> _methodDefs.GetDefinition(MetadataTokens.GetRowNumber(index)); 374=> MetadataTokens.PropertyDefinitionHandle(_propertyDefs.GetRowId(def)); 380=> MetadataTokens.ParameterHandle(_parameterDefs.GetRowId(def)); 411return MetadataTokens.AssemblyReferenceHandle(_assemblyRefIndex.GetOrAdd(identity)); 421return MetadataTokens.ModuleReferenceHandle(_moduleRefIndex.GetOrAdd(reference)); 431return MetadataTokens.MemberReferenceHandle(_memberRefIndex.GetOrAdd(reference)); 441return MetadataTokens.MethodSpecificationHandle(_methodSpecIndex.GetOrAdd(reference)); 455handle = MetadataTokens.TypeReferenceHandle(index); 461return MetadataTokens.TypeReferenceHandle(_typeRefIndex.GetOrAdd(reference)); 471return MetadataTokens.TypeSpecificationHandle(_typeSpecIndex.GetOrAdd(reference)); 481return MetadataTokens.StandaloneSignatureHandle(_standAloneSignatureIndex.GetOrAdd(blobIndex)); 750if (_previousGeneration.OriginalMetadata.MetadataReader.GetTableRowCount(TableIndex.MethodDef) >= MetadataTokens.GetRowNumber(handle)) 783_existingParameterDefs.Add(paramDef, MetadataTokens.GetRowNumber(param)); 963int xOrdinal = MetadataTokens.GetRowNumber(_previousGeneration.OriginalMetadata.MetadataReader.GetCustomAttributes(x.parentHandle).FirstOrDefault()); 964int yOrdinal = MetadataTokens.GetRowNumber(_previousGeneration.OriginalMetadata.MetadataReader.GetCustomAttributes(y.parentHandle).FirstOrDefault()); 1002_customAttributeRowIds.Add(MetadataTokens.GetRowNumber(handle)); 1057_ = MetadataTokens.TryGetTableIndex(parentHandle.Kind, out var parentTableIndex); 1058var deletedParentHandle = MetadataTokens.EntityHandle(parentTableIndex, 0); 1059var deletedMemberRefHandle = MetadataTokens.EntityHandle(TableIndex.MemberRef, 0); 1115entity: MetadataTokens.CustomAttributeHandle(rowId), 1144int typeRowId = MetadataTokens.GetRowNumber(GetTypeDefinitionHandle(member.ContainingTypeDefinition)); 1148entity: MetadataTokens.Handle(mapTable, mapRowId), 1153entity: MetadataTokens.Handle(table, index.GetRowId(member)), 1174entity: MetadataTokens.Handle(tableIndex, index.GetRowId(member)), 1192entity: MetadataTokens.MethodDefinitionHandle(_methodDefs.GetRowId(methodDef)), 1196entity: MetadataTokens.ParameterHandle(parameterFirstId + i), 1204paramEncMapRows.Add(MetadataTokens.GetRowNumber(param)); 1218entity: MetadataTokens.Handle(tableIndex, index.GetRowId(member)), 1233entity: MetadataTokens.Handle(tableIndex, firstRowId + i), 1402tokens.Add(MetadataTokens.Handle(tableIndex, firstRowId + i)); 1411tokens.Add(MetadataTokens.Handle(tableIndex, index.GetRowId(member))); 1419tokens.Add(MetadataTokens.Handle(tableIndex, row)); 1428declaringType: MetadataTokens.TypeDefinitionHandle(typeId), 1429eventList: MetadataTokens.EventDefinitionHandle(_eventMap.GetRowId(typeId))); 1438declaringType: MetadataTokens.TypeDefinitionHandle(typeId), 1439propertyList: MetadataTokens.PropertyDefinitionHandle(_propertyMap.GetRowId(typeId))); 1612index = MetadataTokens.GetRowNumber(handle); 1624index = MetadataTokens.GetRowNumber(handle); 1636index = MetadataTokens.GetRowNumber(handle); 1644index = MetadataTokens.GetRowNumber(deletedHandle); 1655index = MetadataTokens.GetRowNumber(handle); 1667index = MetadataTokens.GetRowNumber(handle);
Emit\EditAndContinue\EmitBaseline.cs (5)
65private static readonly ImmutableArray<int> s_emptyTableSizes = ImmutableArray.Create(new int[MetadataTokens.TableCount]); 337Debug.Assert(tableEntriesAdded.Length == MetadataTokens.TableCount); 491var sizes = new int[MetadataTokens.TableCount]; 537var methodImpl = reader.GetMethodImplementation(MetadataTokens.MethodImplementationHandle(row)); 543int methodDefRow = MetadataTokens.GetRowNumber(methodImpl.MethodBody);
MetadataReader\PEModule.cs (1)
2666int rid = MetadataTokens.GetRowNumber(typeDef);
NativePdbWriter\PdbWriter.cs (6)
101int methodToken = MetadataTokens.GetToken(methodHandle); 120UsingNamespace("@" + MetadataTokens.GetToken(_metadataWriter.GetMethodHandle(forwardToMethod)), methodBody.MethodDefinition); 137MetadataTokens.GetToken(_metadataWriter.GetMethodHandle(asyncMoveNextInfo.KickoffMethod)), 512MetadataTokens.GetToken(signatureHandle)); 526localSignatureHandleOpt.IsNil ? 0 : MetadataTokens.GetToken(localSignatureHandleOpt)); 730int token = MetadataTokens.GetToken(_metadataWriter.GetDefinitionHandle(definition.Definition));
NativePdbWriter\SymWriterMetadataProvider.cs (2)
74declaringTypeToken = MetadataTokens.GetToken(_writer.GetTypeHandle(m.GetContainingType(_writer.Context))); 87enclosingTypeToken = MetadataTokens.GetToken(_writer.GetTypeHandle(nt.GetContainingType(_writer.Context)));
PEWriter\FullMetadataWriter.cs (21)
133handle = MetadataTokens.TypeDefinitionHandle(index); 139return MetadataTokens.TypeDefinitionHandle(_typeDefs[def]); 144return _typeDefs[MetadataTokens.GetRowNumber(handle)]; 154return MetadataTokens.EventDefinitionHandle(_eventDefs[def]); 164return MetadataTokens.FieldDefinitionHandle(_fieldDefs[def]); 176handle = MetadataTokens.MethodDefinitionHandle(index); 182return MetadataTokens.MethodDefinitionHandle(_methodDefs[def]); 187return _methodDefs[MetadataTokens.GetRowNumber(handle)]; 197return MetadataTokens.PropertyDefinitionHandle(_propertyDefs[def]); 207return MetadataTokens.ParameterHandle(_parameterDefs[def]); 222return MetadataTokens.FieldDefinitionHandle(_fieldDefIndex[typeDef]); 227return MetadataTokens.MethodDefinitionHandle(_methodDefIndex[typeDef]); 232return MetadataTokens.ParameterHandle(_parameterListIndex[methodDef]); 237return MetadataTokens.AssemblyReferenceHandle(_assemblyRefIndex.GetOrAdd(reference.Identity)); 247return MetadataTokens.ModuleReferenceHandle(_moduleRefIndex.GetOrAdd(reference)); 257return MetadataTokens.MemberReferenceHandle(_memberRefIndex.GetOrAdd(reference)); 267return MetadataTokens.MethodSpecificationHandle(_methodSpecIndex.GetOrAdd(reference)); 281handle = MetadataTokens.TypeReferenceHandle(index); 287return MetadataTokens.TypeReferenceHandle(_typeRefIndex.GetOrAdd(reference)); 297return MetadataTokens.TypeSpecificationHandle(_typeSpecIndex.GetOrAdd(reference)); 307return MetadataTokens.StandaloneSignatureHandle(_standAloneSignatureIndex.GetOrAdd(blobIndex));
PEWriter\MetadataWriter.cs (13)
852return MetadataTokens.AssemblyFileHandle(index); 857return MetadataTokens.AssemblyFileHandle(_fileRefIndex[mref.Name]); 1628return GetTypeDef(MetadataTokens.TypeDefinitionHandle(token)); 1634return GetMethodDef(MetadataTokens.MethodDefinitionHandle(token)); 1640return GetTypeDef(MetadataTokens.TypeDefinitionHandle(token)).AsNestedTypeReference; 2105var parentHandle = MetadataTokens.Handle(tableIndex, parentRowId++); 2261implementation = MetadataTokens.ExportedTypeHandle(exportedType.ParentIndex + 1); 2274typeDefinitionId: exportedType.IsForwarder ? 0 : MetadataTokens.GetToken(exportedType.Type.TypeDef)); 2982var aggregateMethodRid = MetadataTokens.GetRowNumber(GetMethodDefinitionHandle(method)); 3273token = MetadataTokens.GetRowNumber(handle); 3281token = MetadataTokens.GetRowNumber(handle) + LiftedVariableBaseIndex; 3299writer.WriteInt32(token == 0 ? MetadataTokens.GetToken(ResolveEntityHandleFromPseudoToken(pseudoToken)) : token); 3332writer.WriteInt32(MetadataTokens.GetToken(handle));
PEWriter\MetadataWriter.DynamicAnalysis.cs (8)
87index = MetadataTokens.BlobHandle(_blobHeapSize); 114result = MetadataTokens.GuidHandle((_guidWriter.Count >> 4) + 1); 245writer.WriteCompressedInteger(MetadataTokens.GetHeapOffset(partIndex)); 311int heapOffset = MetadataTokens.GetHeapOffset(entry.Value); 345writer.WriteReference(MetadataTokens.GetHeapOffset(row.Name), isSmall: (sizes.BlobIndexSize == 2)); 346writer.WriteReference(MetadataTokens.GetHeapOffset(row.HashAlgorithm), isSmall: (sizes.GuidIndexSize == 2)); 347writer.WriteReference(MetadataTokens.GetHeapOffset(row.Hash), isSmall: (sizes.BlobIndexSize == 2)); 355writer.WriteReference(MetadataTokens.GetHeapOffset(row.Spans), isSmall: (sizes.BlobIndexSize == 2));
PEWriter\MetadataWriter.PortablePdb.cs (19)
68var methodHandle = MetadataTokens.MethodDefinitionHandle(methodRid); 165MetadataTokens.LocalVariableHandle(MetadataTokens.GetRowNumber(handle) + 1); 168MetadataTokens.LocalConstantHandle(MetadataTokens.GetRowNumber(handle) + 1); 322private static readonly ImportScopeHandle ModuleImportScopeHandle = MetadataTokens.ImportScopeHandle(1); 328writer.WriteCompressedInteger(MetadataTokens.GetHeapOffset(_debugMetadataOpt.GetOrAddBlobUTF8(alias.Name))); 329writer.WriteCompressedInteger(MetadataTokens.GetRowNumber(GetOrAddAssemblyReferenceHandle(alias.Assembly))); 342writer.WriteCompressedInteger(MetadataTokens.GetHeapOffset(_debugMetadataOpt.GetOrAddBlobUTF8(import.AliasOpt))); 343writer.WriteCompressedInteger(MetadataTokens.GetHeapOffset(_debugMetadataOpt.GetOrAddBlobUTF8(import.TargetXmlNamespaceOpt))); 354writer.WriteCompressedInteger(MetadataTokens.GetHeapOffset(_debugMetadataOpt.GetOrAddBlobUTF8(import.AliasOpt))); 372writer.WriteCompressedInteger(MetadataTokens.GetHeapOffset(_debugMetadataOpt.GetOrAddBlobUTF8(import.AliasOpt))); 380writer.WriteCompressedInteger(MetadataTokens.GetRowNumber(GetAssemblyReferenceHandle(import.TargetAssemblyOpt))); 388writer.WriteCompressedInteger(MetadataTokens.GetHeapOffset(_debugMetadataOpt.GetOrAddBlobUTF8(import.AliasOpt))); 399writer.WriteCompressedInteger(MetadataTokens.GetHeapOffset(_debugMetadataOpt.GetOrAddBlobUTF8(namespaceName))); 408writer.WriteCompressedInteger(MetadataTokens.GetHeapOffset(_debugMetadataOpt.GetOrAddBlobUTF8(import.AliasOpt))); 644writer.WriteCompressedInteger(MetadataTokens.GetRowNumber(localSignatureHandleOpt)); 662writer.WriteCompressedInteger(MetadataTokens.GetRowNumber(documentHandle)); 1025builder.WriteCompressedInteger(MetadataTokens.GetRowNumber(handle));
PEWriter\PeWriter.cs (1)
125nativePdbWriterOpt?.SetEntryPoint(MetadataTokens.GetToken(debugEntryPointHandle));
src\Dependencies\CodeAnalysis.Debugging\CustomDebugInfoEncoder.cs (2)
74(mh, builder) => builder.WriteInt32(MetadataTokens.GetToken(mh))); 82(mh, builder) => builder.WriteInt32(MetadataTokens.GetToken(mh)));
Microsoft.CodeAnalysis.CSharp (8)
Symbols\Metadata\PE\PEAssemblySymbol.cs (1)
130return MetadataTokens.GetToken(_assembly.Handle);
Symbols\Metadata\PE\PEEventSymbol.cs (1)
240get { return MetadataTokens.GetToken(_handle); }
Symbols\Metadata\PE\PEFieldSymbol.cs (1)
188get { return MetadataTokens.GetToken(_handle); }
Symbols\Metadata\PE\PEMethodSymbol.cs (1)
450public override int MetadataToken => MetadataTokens.GetToken(_handle);
Symbols\Metadata\PE\PENamedTypeSymbol.cs (1)
430get { return MetadataTokens.GetToken(_handle); }
Symbols\Metadata\PE\PEParameterSymbol.cs (1)
477get { return MetadataTokens.GetToken(_handle); }
Symbols\Metadata\PE\PEPropertySymbol.cs (1)
438get { return MetadataTokens.GetToken(_handle); }
Symbols\Metadata\PE\PETypeParameterSymbol.cs (1)
127get { return MetadataTokens.GetToken(_handle); }
Microsoft.CodeAnalysis.CSharp.Emit.UnitTests (6)
CodeGen\CodeGenFunctionPointersTests.cs (2)
12730fieldList: MetadataTokens.FieldDefinitionHandle(1), 12738fieldList: MetadataTokens.FieldDefinitionHandle(1),
Emit\EmitMetadataTests.cs (4)
254var file1 = reader.GetAssemblyFile(MetadataTokens.AssemblyFileHandle(1)); 255var file2 = reader.GetAssemblyFile(MetadataTokens.AssemblyFileHandle(2)); 263var moduleRefName = reader.GetModuleReference(MetadataTokens.ModuleReferenceHandle(1)).Name; 268select $"{reader.GetString(et.NamespaceDefinition)}.{reader.GetString(et.Name)} 0x{MetadataTokens.GetToken(et.Implementation):X8} ({et.Implementation.Kind}) 0x{(int)et.Attributes:X4}";
Microsoft.CodeAnalysis.CSharp.Emit2.UnitTests (15)
Emit\EditAndContinue\EditAndContinueStateMachineTests.cs (5)
288diff1.VerifyPdb(new[] { MetadataTokens.MethodDefinitionHandle(4) }, @" 2364diff1.VerifyPdb(Enumerable.Range(1, 20).Select(MetadataTokens.MethodDefinitionHandle), @" 8225diff1.VerifyPdb(new[] { MetadataTokens.MethodDefinitionHandle(9) }, @" 8417diff2.VerifyPdb(new[] { MetadataTokens.MethodDefinitionHandle(9) }, @" 8600diff3.VerifyPdb(new[] { MetadataTokens.MethodDefinitionHandle(15) }, @"
Emit\EditAndContinue\EditAndContinueTestBase.cs (2)
149return new EditAndContinueLogEntry(MetadataTokens.Handle(table, rowNumber), operation); 154return MetadataTokens.Handle(table, rowNumber);
Emit\EditAndContinue\EditAndContinueTests.cs (6)
36yield return $"[0x{MetadataTokens.GetToken(typeRef.ResolutionScope):x8}] {readers.GetString(typeRef.Namespace)}.{readers.GetString(typeRef.Name)}"; 325var s = MetadataTokens.StringHandle(0); 328var b = MetadataTokens.BlobHandle(0); 331var us = MetadataTokens.UserStringHandle(0); 8834m => testData0.GetMethodData(methodNames0[MetadataTokens.GetRowNumber(m) - 1]).GetEncDebugInfo()); 12507var handle = MetadataTokens.BlobHandle(1);
PDB\PDBTests.cs (1)
687var methodDef = mdReader.GetMethodDefinition((MethodDefinitionHandle)MetadataTokens.Handle(peEntryPointToken));
PDB\TypeDefinitionDocumentTests.cs (1)
500var doc = pdbReader.GetDocument(MetadataTokens.DocumentHandle(documentRow));
Microsoft.CodeAnalysis.CSharp.Emit3.UnitTests (14)
Attributes\AttributeTests_Assembly.cs (14)
604var file1 = reader.GetAssemblyFile(MetadataTokens.AssemblyFileHandle(1)); 608var file2 = reader.GetAssemblyFile(MetadataTokens.AssemblyFileHandle(2)); 635var file1 = reader.GetAssemblyFile(MetadataTokens.AssemblyFileHandle(1)); 639var file2 = reader.GetAssemblyFile(MetadataTokens.AssemblyFileHandle(2)); 665var file1 = reader.GetAssemblyFile(MetadataTokens.AssemblyFileHandle(1)); 669var file2 = reader.GetAssemblyFile(MetadataTokens.AssemblyFileHandle(2)); 695var file1 = reader.GetAssemblyFile(MetadataTokens.AssemblyFileHandle(1)); 699var file2 = reader.GetAssemblyFile(MetadataTokens.AssemblyFileHandle(2)); 723var file1 = reader.GetAssemblyFile(MetadataTokens.AssemblyFileHandle(1)); 727var file2 = reader.GetAssemblyFile(MetadataTokens.AssemblyFileHandle(2)); 752var file1 = reader.GetAssemblyFile(MetadataTokens.AssemblyFileHandle(1)); 758var file2 = reader.GetAssemblyFile(MetadataTokens.AssemblyFileHandle(2)); 785var file1 = reader.GetAssemblyFile(MetadataTokens.AssemblyFileHandle(1)); 792var file2 = reader.GetAssemblyFile(MetadataTokens.AssemblyFileHandle(2));
Microsoft.CodeAnalysis.CSharp.Test.Utilities (3)
CSharpTestBase.cs (3)
1988return "\"" + reader.GetUserString((UserStringHandle)MetadataTokens.Handle((int)token)) + "\""; 1993Symbol reference = _decoder.GetSymbolForILToken(MetadataTokens.EntityHandle((int)token)); 2003symbol = _decoder.GetSymbolForILToken(MetadataTokens.EntityHandle((int)type));
Microsoft.CodeAnalysis.Debugging.Package (2)
CustomDebugInfoEncoder.cs (2)
74(mh, builder) => builder.WriteInt32(MetadataTokens.GetToken(mh))); 82(mh, builder) => builder.WriteInt32(MetadataTokens.GetToken(mh)));
Microsoft.CodeAnalysis.EditorFeatures.UnitTests (4)
Emit\CompilationOutputFilesTests.cs (2)
46var localSig = encReader.GetLocalSignature(MetadataTokens.MethodDefinitionHandle(1)); 47Assert.Equal(MetadataTokens.StandaloneSignatureHandle(1), localSig);
Emit\CompilationOutputsTests.cs (2)
82var localSig = encReader.GetLocalSignature(MetadataTokens.MethodDefinitionHandle(1)); 83Assert.Equal(MetadataTokens.StandaloneSignatureHandle(1), localSig);
Microsoft.CodeAnalysis.ExpressionEvaluator.ExpressionCompiler (4)
MethodContextReuseConstraints.cs (2)
24Debug.Assert(MetadataTokens.Handle(methodToken).Kind == HandleKind.MethodDefinition); 36Debug.Assert(MetadataTokens.Handle(methodToken).Kind == HandleKind.MethodDefinition);
PDB\MethodDebugInfo.Portable.cs (2)
95var globalHandle = (MethodDefinitionHandle)MetadataTokens.EntityHandle(methodToken); 111return MetadataTokens.MethodDefinitionHandle(rowId);
Microsoft.CodeAnalysis.ExpressionEvaluator.FunctionResolver (1)
MetadataResolver.cs (1)
352_onFunctionResolved(_module, request, token: MetadataTokens.GetToken(handle), version: 1, ilOffset: 0);
Microsoft.CodeAnalysis.ExpressionEvaluator.FunctionResolver.UnitTests (1)
FunctionResolverTestBase.cs (1)
37return GetMethodSignature(reader, MetadataTokens.MethodDefinitionHandle(token));
Microsoft.CodeAnalysis.Features (11)
EditAndContinue\EditAndContinueMethodDebugInfoReader.cs (3)
59var symMethod = (ISymUnmanagedMethod2)_symReader.GetMethodByVersion(MetadataTokens.GetToken(methodHandle), _version); 62return symMethod == null ? default : MetadataTokens.StandaloneSignatureHandle(symMethod.GetLocalSignatureToken()); 67var methodToken = MetadataTokens.GetToken(methodHandle);
EditAndContinue\EditSession.cs (3)
134var highestEmittedTypeDefRow = emitResult.ChangedTypes.Max(t => MetadataTokens.GetRowNumber(t)); 1062var updatedMethodTokens = emitResult.UpdatedMethods.SelectAsArray(h => MetadataTokens.GetToken(h)); 1063var changedTypeTokens = emitResult.ChangedTypes.SelectAsArray(h => MetadataTokens.GetToken(h));
PdbSourceDocument\PdbSourceDocumentMetadataAsSourceFileProvider.cs (2)
122var handle = MetadataTokens.EntityHandle(symbolToFind.MetadataToken); 171handle = MetadataTokens.EntityHandle(newSymbol.MetadataToken);
PdbSourceDocument\SymbolSourceDocumentFinder.cs (1)
168docList.Add(MetadataTokens.DocumentHandle(reader.ReadCompressedInteger()));
src\Dependencies\CodeAnalysis.Debugging\CustomDebugInfoEncoder.cs (2)
74(mh, builder) => builder.WriteInt32(MetadataTokens.GetToken(mh))); 82(mh, builder) => builder.WriteInt32(MetadataTokens.GetToken(mh)));
Microsoft.CodeAnalysis.Features.Test.Utilities (3)
EditAndContinue\EditAndContinueWorkspaceTestBase.cs (3)
389=> new(MetadataTokens.Handle(table, rowNumber), operation); 402MetadataTokens.TryGetTableIndex(row.Handle.Kind, out tableIndex); 406MetadataTokens.GetRowNumber(row.Handle),
Microsoft.CodeAnalysis.Features.UnitTests (5)
EditAndContinue\EditAndContinueMethodDebugInfoReaderTests.cs (5)
87var debugInfo = reader.GetDebugInfo(MetadataTokens.MethodDefinitionHandle(5)); 93var localSig = reader.GetLocalSignature(MetadataTokens.MethodDefinitionHandle(5)); 94Assert.Equal(MetadataTokens.StandaloneSignatureHandle(1), localSig); 97debugInfo = reader.GetDebugInfo(MetadataTokens.MethodDefinitionHandle(1)); 103localSig = reader.GetLocalSignature(MetadataTokens.MethodDefinitionHandle(1));
Microsoft.CodeAnalysis.Test.Utilities (18)
Compilation\CompilationDifference.cs (2)
95string actualPdb = PdbToXmlConverter.DeltaPdbToXml(new ImmutableMemoryStream(PdbDelta), new[] { MetadataTokens.GetToken(methodToken) }); 177EmitResult.UpdatedMethods.Select(methodHandle => $"0x{MetadataTokens.GetToken(methodHandle):X8}"));
CompilationVerifier.cs (1)
637var methodToken = MetadataTokens.GetToken(_testData.MetadataWriter.GetMethodDefinitionOrReferenceHandle(methodDef));
Metadata\DynamicAnalysisDataReader.cs (6)
110var name = MetadataTokens.BlobHandle(ReadReference(ref reader, isBlobHeapSmall)); 111var hashAlgorithm = MetadataTokens.GuidHandle(ReadReference(ref reader, isGuidHeapSmall)); 112var hash = MetadataTokens.BlobHandle(ReadReference(ref reader, isBlobHeapSmall)); 123methodsBuilder.Add(new DynamicAnalysisMethod(MetadataTokens.BlobHandle(ReadReference(ref reader, isBlobHeapSmall)))); 275int offset = (MetadataTokens.GetHeapOffset(handle) - 1) * GuidSize; 292int offset = MetadataTokens.GetHeapOffset(handle);
Metadata\MetadataReaderUtils.cs (7)
30yield return MetadataTokens.ConstantHandle(i); 38yield return MetadataTokens.ParameterHandle(i); 46yield return MetadataTokens.GenericParameterHandle(i); 54yield return MetadataTokens.GenericParameterConstraintHandle(i); 62yield return MetadataTokens.ModuleReferenceHandle(i); 89int index = MetadataTokens.GetHeapOffset(handle); 95return reader.GetString(MetadataTokens.StringHandle(index));
Metadata\MetadataValidation.cs (2)
180var mvidOffset1 = mdReader1.GetHeapMetadataOffset(HeapIndex.Guid) + 16 * (MetadataTokens.GetHeapOffset(mvidIndex1) - 1); 181var mvidOffset2 = mdReader2.GetHeapMetadataOffset(HeapIndex.Guid) + 16 * (MetadataTokens.GetHeapOffset(mvidIndex2) - 1);
Microsoft.CodeAnalysis.UnitTests (2)
Emit\CustomDebugInfoTests.cs (2)
513cdiEncoder.AddForwardModuleInfo(MetadataTokens.MethodDefinitionHandle(0x123456)); 542cdiEncoder.AddForwardMethodInfo(MetadataTokens.MethodDefinitionHandle(0x123456));
Microsoft.CodeAnalysis.VisualBasic (8)
Symbols\Metadata\PE\PEAssemblySymbol.vb (1)
146Return MetadataTokens.GetToken(_assembly.Handle)
Symbols\Metadata\PE\PEEventSymbol.vb (1)
137Return MetadataTokens.GetToken(_handle)
Symbols\Metadata\PE\PEFieldSymbol.vb (1)
80Return MetadataTokens.GetToken(_handle)
Symbols\Metadata\PE\PEMethodSymbol.vb (1)
323Return MetadataTokens.GetToken(_handle)
Symbols\Metadata\PE\PENamedTypeSymbol.vb (1)
244Return MetadataTokens.GetToken(_handle)
Symbols\Metadata\PE\PEParameterSymbol.vb (1)
290Return MetadataTokens.GetToken(_handle)
Symbols\Metadata\PE\PEPropertySymbol.vb (1)
163Return MetadataTokens.GetToken(_handle)
Symbols\Metadata\PE\PETypeParameterSymbol.vb (1)
122Return MetadataTokens.GetToken(_handle)
Microsoft.CodeAnalysis.VisualBasic.Emit.UnitTests (26)
Attributes\AssemblyAttributes.vb (14)
794Dim file1 = reader.GetAssemblyFile(MetadataTokens.AssemblyFileHandle(1)) 798Dim file2 = reader.GetAssemblyFile(MetadataTokens.AssemblyFileHandle(2)) 825Dim file1 = reader.GetAssemblyFile(MetadataTokens.AssemblyFileHandle(1)) 829Dim file2 = reader.GetAssemblyFile(MetadataTokens.AssemblyFileHandle(2)) 856Dim file1 = reader.GetAssemblyFile(MetadataTokens.AssemblyFileHandle(1)) 860Dim file2 = reader.GetAssemblyFile(MetadataTokens.AssemblyFileHandle(2)) 887Dim file1 = reader.GetAssemblyFile(MetadataTokens.AssemblyFileHandle(1)) 891Dim file2 = reader.GetAssemblyFile(MetadataTokens.AssemblyFileHandle(2)) 917Dim file1 = reader.GetAssemblyFile(MetadataTokens.AssemblyFileHandle(1)) 921Dim file2 = reader.GetAssemblyFile(MetadataTokens.AssemblyFileHandle(2)) 948Dim file1 = reader.GetAssemblyFile(MetadataTokens.AssemblyFileHandle(1)) 954Dim file2 = reader.GetAssemblyFile(MetadataTokens.AssemblyFileHandle(2)) 982Dim file1 = reader.GetAssemblyFile(MetadataTokens.AssemblyFileHandle(1)) 989Dim file2 = reader.GetAssemblyFile(MetadataTokens.AssemblyFileHandle(2))
Emit\EditAndContinue\EditAndContinueStateMachineTests.vb (1)
2358diff1.VerifyPdb(Enumerable.Range(1, 20).Select(AddressOf MetadataTokens.MethodDefinitionHandle), "
Emit\EditAndContinue\EditAndContinueTestBase.vb (2)
191Return New EditAndContinueLogEntry(MetadataTokens.Handle(table, rowNumber), operation) 195Return MetadataTokens.Handle(table, rowNumber)
Emit\EditAndContinue\EditAndContinueTests.vb (4)
2918Select Case MetadataTokens.GetRowNumber(m) 4915Yield $"[0x{MetadataTokens.GetToken(typeRef.ResolutionScope):x8}] 0x{MetadataTokens.GetHeapOffset(typeRef.Namespace):x8}.0x{MetadataTokens.GetHeapOffset(typeRef.Name):x8}"
Emit\EmitMetadata.vb (3)
321Dim file1 = reader.GetAssemblyFile(MetadataTokens.AssemblyFileHandle(1)) 322Dim file2 = reader.GetAssemblyFile(MetadataTokens.AssemblyFileHandle(2)) 334Select $"{reader.GetString(et.NamespaceDefinition)}.{reader.GetString(et.Name)} 0x{MetadataTokens.GetToken(et.Implementation):X8} ({et.Implementation.Kind}) 0x{CInt(et.Attributes):X4}"
PDB\PDBTests.vb (1)
155Dim methodDef = mdReader.GetMethodDefinition(CType(MetadataTokens.Handle(peEntryPointToken), MethodDefinitionHandle))
PDB\TypeDefinitionDocumentTests.vb (1)
381Dim doc = pdbReader.GetDocument(MetadataTokens.DocumentHandle(documentRow))
Microsoft.CodeAnalysis.VisualBasic.ExpressionCompiler (5)
CompilationExtensions.vb (1)
25Return [GetType](compilation.GetModule(moduleVersionId), CType(MetadataTokens.Handle(typeToken), TypeDefinitionHandle))
EvaluationContext.vb (3)
79Debug.Assert(MetadataTokens.Handle(typeToken).Kind = HandleKind.TypeDefinition) 154Dim methodHandle = CType(MetadataTokens.Handle(methodToken), MethodDefinitionHandle) 156Dim localSignatureHandle = If(localSignatureToken <> 0, CType(MetadataTokens.Handle(localSignatureToken), StandaloneSignatureHandle), Nothing)
VisualBasicInstructionDecoder.vb (1)
117Dim methodHandle = CType(MetadataTokens.Handle(instructionAddress.MethodId.Token), MethodDefinitionHandle)
Microsoft.CodeAnalysis.VisualBasic.Symbol.UnitTests (6)
SymbolsTests\Source\ComClassTests.vb (6)
8129Assert.True(MetadataTokens.GetRowNumber(ComClass1_Struct1.Handle) < MetadataTokens.GetRowNumber(ComClass1_Struct1_Struct2.Handle)) 8130Assert.True(MetadataTokens.GetRowNumber(ComClass1_Struct1.Handle) < MetadataTokens.GetRowNumber(ComClass1_struct2.Handle)) 8131Assert.True(MetadataTokens.GetRowNumber(ComClass1_struct2.Handle) < MetadataTokens.GetRowNumber(ComClass1_Struct1_Struct2.Handle))
Microsoft.DotNet.Build.Tasks.Packaging (1)
GetAssemblyReferences.cs (1)
71var moduleRef = reader.GetModuleReference(MetadataTokens.ModuleReferenceHandle(i));
Microsoft.DotNet.PackageTesting (2)
VerifyClosure.cs (2)
462var reference = reader.GetAssemblyReference(MetadataTokens.AssemblyReferenceHandle(i + 1)); 476var moduleRef = reader.GetModuleReference(MetadataTokens.ModuleReferenceHandle(i + 1));
Microsoft.DotNet.SharedFramework.Sdk (2)
src\Microsoft.DotNet.PackageTesting\VerifyClosure.cs (2)
462var reference = reader.GetAssemblyReference(MetadataTokens.AssemblyReferenceHandle(i + 1)); 476var moduleRef = reader.GetModuleReference(MetadataTokens.ModuleReferenceHandle(i + 1));
Microsoft.VisualStudio.LanguageServices.CSharp.UnitTests (2)
ProjectSystemShim\VisualStudioCompilationOutputFilesTests.cs (2)
56var localSig = encReader.GetLocalSignature(MetadataTokens.MethodDefinitionHandle(1)); 57Assert.Equal(MetadataTokens.StandaloneSignatureHandle(1), localSig);
Roslyn.Test.PdbUtilities (16)
EditAndContinue\EditAndContinueTestUtilities.cs (8)
41MetadataTokens.TryGetTableIndex(row.Handle.Kind, out tableIndex); 45MetadataTokens.GetRowNumber(row.Handle), 53MetadataTokens.TryGetTableIndex(handle.Kind, out tableIndex); 57MetadataTokens.GetRowNumber(handle), 64MetadataTokens.TryGetTableIndex(row.ParentToken.Kind, out parentTableIndex); 65MetadataTokens.TryGetTableIndex(row.ConstructorToken.Kind, out constructorTableIndex); 69MetadataTokens.GetRowNumber(row.ParentToken), 71MetadataTokens.GetRowNumber(row.ConstructorToken),
Reader\CustomDebugInfoUtilities.cs (1)
21return reader.GetCustomDebugInfo(MetadataTokens.GetToken(handle), methodVersion);
Reader\PdbValidation.cs (2)
93VerifyPdb(diff, methodHandles.Select(h => MetadataTokens.GetToken(h)), expectedPdb); 98VerifyPdb(diff, methodHandles.Select(h => MetadataTokens.GetToken(h)), expectedPdb);
Shared\DummyMetadataImport.cs (5)
63var sig = _metadataReaderOpt.GetStandaloneSignature((StandaloneSignatureHandle)MetadataTokens.Handle(tkSignature)); 89var handle = (TypeDefinitionHandle)MetadataTokens.Handle(typeDefinition); 112baseType = MetadataTokens.GetToken(typeDef.BaseType); 128var handle = (TypeReferenceHandle)MetadataTokens.Handle(typeReference); 151resolutionScope = MetadataTokens.GetToken(typeRef.ResolutionScope);
SemanticSearch.BuildTask (5)
GenerateFilteredReferenceAssembliesTask.cs (5)
334var mvidOffset = metadataOffset + metadataReader.GetHeapMetadataOffset(HeapIndex.Guid) + (MetadataTokens.GetHeapOffset(moduleDef.Mvid) - 1) * sizeof(Guid); 349=> (symbolIndex < symbols.Length && symbols[symbolIndex].MetadataToken == MetadataTokens.GetToken(handle)) ? symbols[symbolIndex++] : null; 379var offset = tableOffset + (MetadataTokens.GetRowNumber(handle) - 1) * tableRowSize + 0; 413var offset = tableOffset + (MetadataTokens.GetRowNumber(handle) - 1) * tableRowSize + sizeof(uint) + sizeof(ushort); 447var offset = tableOffset + (MetadataTokens.GetRowNumber(handle) - 1) * tableRowSize + 0;
System.Diagnostics.StackTrace (1)
System\Diagnostics\StackTraceSymbols.cs (1)
61Handle handle = MetadataTokens.Handle(methodToken);
System.Reflection.Emit (36)
System\Reflection\Emit\FieldBuilderImpl.cs (1)
89public override int MetadataToken => _handle == default ? 0 : MetadataTokens.GetToken(_handle);
System\Reflection\Emit\ILGeneratorImpl.cs (1)
474_il.Token(MetadataTokens.GetToken(handle));
System\Reflection\Emit\MethodBuilderImpl.cs (1)
252public override int MetadataToken => _handle == default ? 0 : MetadataTokens.GetToken(_handle);
System\Reflection\Emit\ModuleBuilderImpl.cs (31)
133fieldList: MetadataTokens.FieldDefinitionHandle(1), 134methodList: MetadataTokens.MethodDefinitionHandle(1)); 306field._handle = MetadataTokens.FieldDefinitionHandle(_nextFieldDefRowId++); 314method._handle = MetadataTokens.MethodDefinitionHandle(_nextMethodDefRowId++); 322property._handle = MetadataTokens.PropertyDefinitionHandle(_nextPropertyRowId++); 330eventBuilder._handle = MetadataTokens.EventDefinitionHandle(_nextEventRowId++); 338typeBuilder._handle = MetadataTokens.TypeDefinitionHandle(++_nextTypeDefRowId); 434spBlobBuilder.WriteCompressedInteger(MetadataTokens.GetRowNumber(localSignatureHandle)); 443AddLocalScope(methodHandle, parentImport: default, MetadataTokens.LocalVariableHandle(_pdbBuilder.GetRowCount(TableIndex.LocalVariable) + 1), scope); 455spBlobBuilder.WriteCompressedInteger(MetadataTokens.GetRowNumber(localSignature)); 456spBlobBuilder.WriteCompressedInteger(MetadataTokens.GetRowNumber(GetDocument(pair.Key))); 465spBlobBuilder.WriteCompressedInteger(MetadataTokens.GetRowNumber(GetDocument(pair.Key))); 518constantList: MetadataTokens.LocalConstantHandle(1), scope._startOffset, scope._endOffset - scope._startOffset); 524AddLocalScope(methodHandle, parentImport, MetadataTokens.LocalVariableHandle(_pdbBuilder.GetRowCount(TableIndex.LocalVariable) + 1), childScope); 564importBlob.WriteCompressedInteger(MetadataTokens.GetHeapOffset(_pdbBuilder.GetOrAddBlobUTF8(importNs))); 615pair.Value.WriteInt32(MetadataTokens.GetToken(GetMemberHandle(member))); 620pair.Value.WriteInt32(MetadataTokens.GetToken(GetMethodReference(pair2.Key, pair2.Value))); 920eventList: MetadataTokens.EventDefinitionHandle(firstEventToken)); 925propertyList: MetadataTokens.PropertyDefinitionHandle(firstPropertyToken)); 939fieldList: MetadataTokens.FieldDefinitionHandle(fieldToken), 940methodList: MetadataTokens.MethodDefinitionHandle(methodToken)); 949parameterList: MetadataTokens.ParameterHandle(parameterToken)); 1089return MetadataTokens.GetToken(handle); 1229public override int GetStringMetadataToken(string stringConstant) => MetadataTokens.GetToken(_metadataBuilder.GetOrAddUserString(stringConstant)); 1268method._handle = MetadataTokens.MethodDefinitionHandle(_nextMethodDefRowId++); 1280field._handle = MetadataTokens.FieldDefinitionHandle(_nextFieldDefRowId++); 1296method._handle = MetadataTokens.MethodDefinitionHandle(_nextMethodDefRowId++); 1316field._handle = MetadataTokens.FieldDefinitionHandle(_nextFieldDefRowId++); 1361MetadataTokens.GetToken(_metadataBuilder.AddStandaloneSignature(_metadataBuilder.GetOrAddBlob(signature.GetSignature()))); 1364MetadataTokens.GetToken(_metadataBuilder.AddStandaloneSignature( 1369MetadataTokens.GetToken(_metadataBuilder.AddStandaloneSignature(_metadataBuilder.GetOrAddBlob(
System\Reflection\Emit\TypeBuilderImpl.cs (2)
50_handle = MetadataTokens.TypeDefinitionHandle(1); 639public override int MetadataToken => MetadataTokens.GetToken(_handle);
System.Reflection.Metadata (45)
System\Reflection\Metadata\Ecma335\Encoding\ControlFlowBuilder.cs (1)
397ExceptionRegionKind.Catch => MetadataTokens.GetToken(handler.CatchType),
System\Reflection\Metadata\Ecma335\Encoding\ExceptionRegionEncoder.cs (1)
241catchTokenOrOffset = MetadataTokens.GetToken(catchType);
System\Reflection\Metadata\Ecma335\Encoding\InstructionEncoder.cs (2)
76Token(MetadataTokens.GetToken(handle)); 94Token(MetadataTokens.GetToken(handle));
System\Reflection\Metadata\Ecma335\Encoding\MethodBodyStreamEncoder.cs (1)
269Builder.WriteInt32(localVariablesSignature.IsNil ? 0 : MetadataTokens.GetToken(localVariablesSignature));
System\Reflection\Metadata\Ecma335\MetadataAggregator.cs (8)
71if (baseTableRowCounts.Count != MetadataTokens.TableCount) 73throw new ArgumentException(SR.Format(SR.ExpectedListOfSize, MetadataTokens.TableCount), nameof(baseTableRowCounts)); 81if (baseHeapSizes.Count != MetadataTokens.HeapCount) 83throw new ArgumentException(SR.Format(SR.ExpectedListOfSize, MetadataTokens.HeapCount), nameof(baseTableRowCounts)); 116int[] rowCounts = new int[MetadataTokens.TableCount]; 117int[] heapSizes = new int[MetadataTokens.HeapCount]; 195var rowCounts = new RowCounts[MetadataTokens.TableCount][]; 261MetadataTokens.TryGetHeapIndex(handle.Kind, out heapIndex);
System\Reflection\Metadata\Ecma335\MetadataBuilder.Tables.cs (8)
292/// An array of size <see cref="MetadataTokens.TableCount"/> with each item filled with the current row count of the corresponding table. 296var rowCounts = ImmutableArray.CreateBuilder<int>(MetadataTokens.TableCount); 297rowCounts.Count = MetadataTokens.TableCount; 453/// If no type defines any fields in the module, <see cref="MetadataTokens.FieldDefinitionHandle(int)"/>(1). 457/// If no type defines any methods in the module, <see cref="MetadataTokens.MethodDefinitionHandle(int)"/>(1). 982/// If no parameters are declared in the module, <see cref="MetadataTokens.ParameterHandle(int)"/>(1). 1262/// If no scope defines any variables, <see cref="MetadataTokens.LocalVariableHandle(int)"/>(1). 1266/// If no scope defines any constants, <see cref="MetadataTokens.LocalConstantHandle(int)"/>(1).
System\Reflection\Metadata\Ecma335\MetadataReaderExtensions.cs (1)
27if ((int)tableIndex >= MetadataTokens.TableCount)
System\Reflection\Metadata\Ecma335\MetadataRootBuilder.cs (1)
20internal static readonly ImmutableArray<int> EmptyRowCounts = ImmutableArray.Create(new int[MetadataTokens.TableCount]);
System\Reflection\Metadata\Ecma335\MetadataSizes.cs (3)
127Debug.Assert(rowCounts.Length == MetadataTokens.TableCount); 128Debug.Assert(externalRowCounts.Length == MetadataTokens.TableCount); 129Debug.Assert(heapSizes.Length == MetadataTokens.HeapCount);
System\Reflection\Metadata\Ecma335\PortablePdbBuilder.cs (4)
35/// The length of the array must be equal to <see cref="MetadataTokens.TableCount"/>. 76if (typeSystemRowCounts.Length != MetadataTokens.TableCount) 78throw new ArgumentException(SR.Format(SR.ExpectedArrayOfSize, MetadataTokens.TableCount), nameof(typeSystemRowCounts)); 110builder.WriteInt32(_entryPoint.IsNil ? 0 : MetadataTokens.GetToken(_entryPoint));
System\Reflection\Metadata\MetadataReader.cs (2)
496var rowCounts = new int[MetadataTokens.TableCount]; 812for (int tableIndex = 0; tableIndex < MetadataTokens.TableCount; tableIndex++)
System\Reflection\Metadata\PortablePdb\ImportDefinitionCollection.cs (12)
69typeOrNamespace: MetadataTokens.BlobHandle(_reader.ReadCompressedInteger())); 76assembly: MetadataTokens.AssemblyReferenceHandle(_reader.ReadCompressedInteger()), 77typeOrNamespace: MetadataTokens.BlobHandle(_reader.ReadCompressedInteger())); 84alias: MetadataTokens.BlobHandle(_reader.ReadCompressedInteger())); 91alias: MetadataTokens.BlobHandle(_reader.ReadCompressedInteger()), 92assembly: MetadataTokens.AssemblyReferenceHandle(_reader.ReadCompressedInteger())); 99alias: MetadataTokens.BlobHandle(_reader.ReadCompressedInteger()), 108alias: MetadataTokens.BlobHandle(_reader.ReadCompressedInteger()), 109typeOrNamespace: MetadataTokens.BlobHandle(_reader.ReadCompressedInteger())); 116alias: MetadataTokens.BlobHandle(_reader.ReadCompressedInteger()), 117assembly: MetadataTokens.AssemblyReferenceHandle(_reader.ReadCompressedInteger()), 118typeOrNamespace: MetadataTokens.BlobHandle(_reader.ReadCompressedInteger()));
System\Reflection\PortableExecutable\ManagedPEBuilder.cs (1)
166_entryPointOpt.IsNil ? 0 : MetadataTokens.GetToken(_entryPointOpt),
System.Reflection.MetadataLoadContext (18)
System\Reflection\TypeLoading\General\Ecma\MetadataExtensions.cs (18)
59public static int GetToken(this Handle handle) => MetadataTokens.GetToken(handle); 60public static int GetToken(this EntityHandle handle) => MetadataTokens.GetToken(handle); 61public static int GetToken(this TypeDefinitionHandle handle) => MetadataTokens.GetToken(handle); 62public static int GetToken(this TypeReferenceHandle handle) => MetadataTokens.GetToken(handle); 63public static int GetToken(this TypeSpecificationHandle handle) => MetadataTokens.GetToken(handle); 64public static int GetToken(this GenericParameterHandle handle) => MetadataTokens.GetToken(handle); 65public static int GetToken(this GenericParameterConstraintHandle handle) => MetadataTokens.GetToken(handle); 66public static int GetToken(this FieldDefinitionHandle handle) => MetadataTokens.GetToken(handle); 67public static int GetToken(this EventDefinitionHandle handle) => MetadataTokens.GetToken(handle); 68public static int GetToken(this MethodDefinitionHandle handle) => MetadataTokens.GetToken(handle); 69public static int GetToken(this PropertyDefinitionHandle handle) => MetadataTokens.GetToken(handle); 70public static int GetToken(this ParameterHandle handle) => MetadataTokens.GetToken(handle); 71public static int GetToken(this StandaloneSignatureHandle handle) => MetadataTokens.GetToken(handle); 72public static int GetToken(this AssemblyFileHandle handle) => MetadataTokens.GetToken(handle); 91public static Handle ToHandle(this int token) => MetadataTokens.Handle(token); 92public static TypeDefinitionHandle ToTypeDefinitionHandle(this int token) => MetadataTokens.TypeDefinitionHandle(token); 93public static TypeReferenceHandle ToTypeReferenceHandle(this int token) => MetadataTokens.TypeReferenceHandle(token); 94public static TypeSpecificationHandle ToTypeSpecificationHandle(this int token) => MetadataTokens.TypeSpecificationHandle(token);