IMetaDataImport Interface

Provides methods for importing and manipulating existing metadata from a portable executable (PE) file or other source, such as a type library or a stand-alone, run-time metadata binary.

Methods

Method

Description

IMetaDataImport::CloseEnum Method

Closes the enumerator with the specified handle.

IMetaDataImport::CountEnum Method

Gets the number of elements in the enumerator with the specified handle.

IMetaDataImport::EnumCustomAttributes Method

Enumerates a list of custom attribute-definition tokens associated with the specified type or member.

IMetaDataImport::EnumEvents Method

Enumerates event definition tokens for the specified TypeDef token.

IMetaDataImport::EnumFields Method

Enumerates FieldDef tokens for the type referenced by the specified TypeDef token.

IMetaDataImport::EnumFieldsWithName Method

Enumerates FieldDef tokens of the specified type with the specified name.

IMetaDataImport::EnumInterfaceImpls Method

Enumerates MethodDef tokens representing interface implementations.

IMetaDataImport::EnumMemberRefs Method

Enumerates MemberRef tokens representing members of the specified type.

IMetaDataImport::EnumMembers Method

Enumerates MemberDef tokens representing members of the specified type.

IMetaDataImport::EnumMembersWithName Method

Enumerates MemberDef tokens representing members of the specified type with the specified name.

IMetaDataImport::EnumMethodImpls Method

Enumerates MethodBody and MethodDeclaration tokens representing methods of the specified type.

IMetaDataImport::EnumMethods Method

Enumerates MethodDef tokens representing methods of the specified type.

IMetaDataImport::EnumMethodSemantics Method

Enumerates the properties and the property-change events to which the specified method is related.

IMetaDataImport::EnumMethodsWithName Method

Enumerates methods that have the specified name and that are defined by the type referenced by the specified TypeDef token.

IMetaDataImport::EnumModuleRefs Method

Enumerates ModuleRef tokens that represent imported modules.

IMetaDataImport::EnumParams Method

Enumerates ParamDef tokens representing the parameters of the method referenced by the specified MethodDef token.

IMetaDataImport::EnumPermissionSets Method

Enumerates permissions for the objects in a specified metadata scope.

IMetaDataImport::EnumProperties Method

Enumerates PropertyDef tokens representing the properties of the type referenced by the specified TypeDef token.

IMetaDataImport::EnumSignatures Method

Enumerates Signature tokens representing stand-alone signatures in the current scope.

IMetaDataImport::EnumTypeDefs Method

Enumerates TypeDef tokens representing all types within the current scope.

IMetaDataImport::EnumTypeRefs Method

Enumerates TypeRef tokens defined in the current metadata scope.

IMetaDataImport::EnumTypeSpecs Method

Enumerates TypeSpec tokens defined in the current metadata scope.

IMetaDataImport::EnumUnresolvedMethods Method

Enumerates MemberDef tokens representing the unresolved methods in the current metadata scope.

IMetaDataImport::EnumUserStrings Method

Enumerates String tokens representing hard-coded strings in the current metadata scope.

IMetaDataImport::FindField Method

Gets the FieldDef token for the field that is a member of the specified type, and has the specified name and metadata signature.

IMetaDataImport::FindMember Method

Gets a pointer to the MemberDef token for the member defined by the specified type with the specified name and metadata signature.

IMetaDataImport::FindMemberRef Method

Gets a pointer to the MemberRef token for the member defined by the specified type with the specified name and metadata signature.

IMetaDataImport::FindMethod Method

Gets a pointer to the MethodDef token for the method defined by the specified type with the specified name and metadata signature.

IMetaDataImport::FindTypeDefByName Method

Gets a pointer to the TypeDef metadata token for the type with the specified name.

IMetaDataImport::FindTypeRef Method

Gets a pointer to the TypeRef metadata token that references the type in the specified search scope with the specified name.

IMetaDataImport::GetClassLayout Method

Gets layout information for the class referenced by the specified TypeDef token.

IMetaDataImport::GetCustomAttributeByName Method

Gets the value of the custom attribute, given its name.

IMetaDataImport::GetCustomAttributeProps Method

Gets the value of the custom attribute, given its metadata token.

IMetaDataImport::GetEventProps Method

Gets metadata information (including the declaring type, the add and remove methods for delegates, and any flags and other associated data) for the event represented by the specified event token.

IMetaDataImport::GetFieldMarshal Method

Gets a pointer to the native, unmanaged type of the field represented by the specified Field metadata token.

IMetaDataImport::GetFieldProps Method

Gets metadata associated with the field referenced by the specified FieldDef token.

IMetaDataImport::GetInterfaceImplProps Method

Gets a pointer to the metadata tokens for the type that implements the specified method and for the interface that declares that method.

IMetaDataImport::GetMemberProps Method

Gets metadata information (including the name, binary signature, and relative virtual address) of the type member referenced by the specified metadata token.

IMetaDataImport::GetMemberRefProps Method

Gets metadata associated with the member referenced by the specified token.

IMetaDataImport::GetMethodProps Method

Gets the metadata associated with the method referenced by the specified MethodDef token.

IMetaDataImport::GetMethodSemantics Method

Gets a pointer to the relationship between the method referenced by the specified MethodDef token and the paired property and event referenced by the specified EventProp token.

IMetaDataImport::GetModuleFromScope Method

Gets a pointer to the metadata token for the module referenced in the current metadata scope.

IMetaDataImport::GetModuleRefProps Method

Gets the name of the module referenced by the specified metadata token.

IMetaDataImport::GetNameFromToken Method

Gets the UTF-8 name of the object referenced by the specified metadata token.

IMetaDataImport::GetNativeCallConvFromSig Method

Gets the native calling convention for the method that is represented by the specified signature pointer.

IMetaDataImport::GetNestedClassProps Method

Gets the TypeDef token for the enclosing parent type of the specified nested type.

IMetaDataImport::GetParamForMethodIndex Method

Gets a pointer to the token that represents the parameter at the specified ordinal position in the sequence of method parameters for the method represented by the specified MethodDef token.

IMetaDataImport::GetParamProps Method

Gets metadata values for the parameter referenced by the specified ParamDef token.

IMetaDataImport::GetPermissionSetProps Method

Gets the metadata associated with the System.Security.PermissionSet represented by the specified Permission token.

IMetaDataImport::GetPinvokeMap Method

Gets a ModuleRef token to represent the target assembly of a PInvoke call.

IMetaDataImport::GetPropertyProps Method

Gets the metadata associated with the property represented by the specified token.

IMetaDataImport::GetRVA Method

Gets the offset of the relative virtual address of the code object represented by the specified token.

IMetaDataImport::GetScopeProps Method

Gets the name and optionally the version identifier of the assembly or module in the current metadata scope.

IMetaDataImport::GetSigFromToken Method

Gets the binary metadata signature associated with the specified token.

IMetaDataImport::GetTypeDefProps Method

Returns metadata information for the type represented by the specified TypeDef token.

IMetaDataImport::GetTypeRefProps Method

Gets the metadata associated with the type referenced by the specified TypeRef token.

IMetaDataImport::GetTypeSpecFromToken Method

Gets the binary metadata signature of the type specification represented by the specified token.

IMetaDataImport::GetUserString Method

Gets the literal string represented by the specified metadata token.

IMetaDataImport::IsGlobal Method

Gets a value indicating whether the field, method, or type represented by the specified metadata token has global scope.

IMetaDataImport::IsValidToken Method

Gets a value indicating whether the specified token holds a valid reference to a code object.

IMetaDataImport::ResetEnum Method

Resets the specified enumerator to the specified position.

IMetaDataImport::ResolveTypeRef Method

Gets type information for the type referenced by the specified TypeRef token.

Remarks

The design of the IMetaDataImport interface is intended primarily to be used by tools and services that will be importing type information (for example, development tools) or managing deployed components (for example, resolution/activation services). The methods in IMetaDataImport fall into the following task categories:

  • Enumerating collections of items in the metadata scope.

  • Finding an item that has a specific set of characteristics.

  • Getting properties of a specified item.

  • The Get methods are specifically designed to return single-valued properties of a metadata item. When the property is a reference to another item, a token for that item is returned. Any pointer input type can be NULL to indicate that the particular value is not being requested. To obtain properties that are essentially collection objects (for example, the collection of interfaces that a class implements), use the enumeration methods.

Requirements

Platforms: See .NET Framework System Requirements.

Header: Cor.h

Library: Used as a resource in MsCorEE.dll

.NET Framework Versions: 4, 3.5 SP1, 3.5, 3.0 SP1, 3.0, 2.0 SP1, 2.0, 1.1, 1.0

See Also

Reference

IMetaDataImport2 Interface

Other Resources

Metadata Interfaces

Overview of Metadata