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 |
---|---|
Closes the enumerator with the specified handle. |
|
Gets the number of elements in the enumerator with the specified handle. |
|
Enumerates a list of custom attribute-definition tokens associated with the specified type or member. |
|
Enumerates event definition tokens for the specified TypeDef token. |
|
Enumerates FieldDef tokens for the type referenced by the specified TypeDef token. |
|
Enumerates FieldDef tokens of the specified type with the specified name. |
|
Enumerates MethodDef tokens representing interface implementations. |
|
Enumerates MemberRef tokens representing members of the specified type. |
|
Enumerates MemberDef tokens representing members of the specified type. |
|
Enumerates MemberDef tokens representing members of the specified type with the specified name. |
|
Enumerates MethodBody and MethodDeclaration tokens representing methods of the specified type. |
|
Enumerates MethodDef tokens representing methods of the specified type. |
|
Enumerates the properties and the property-change events to which the specified method is related. |
|
Enumerates methods that have the specified name and that are defined by the type referenced by the specified TypeDef token. |
|
Enumerates ModuleRef tokens that represent imported modules. |
|
Enumerates ParamDef tokens representing the parameters of the method referenced by the specified MethodDef token. |
|
Enumerates permissions for the objects in a specified metadata scope. |
|
Enumerates PropertyDef tokens representing the properties of the type referenced by the specified TypeDef token. |
|
Enumerates Signature tokens representing stand-alone signatures in the current scope. |
|
Enumerates TypeDef tokens representing all types within the current scope. |
|
Enumerates TypeRef tokens defined in the current metadata scope. |
|
Enumerates TypeSpec tokens defined in the current metadata scope. |
|
Enumerates MemberDef tokens representing the unresolved methods in the current metadata scope. |
|
Enumerates String tokens representing hard-coded strings in the current metadata scope. |
|
Gets the FieldDef token for the field that is a member of the specified type, and has the specified name and metadata signature. |
|
Gets a pointer to the MemberDef token for the member defined by the specified type with the specified name and metadata signature. |
|
Gets a pointer to the MemberRef token for the member defined by the specified type with the specified name and metadata signature. |
|
Gets a pointer to the MethodDef token for the method defined by the specified type with the specified name and metadata signature. |
|
Gets a pointer to the TypeDef metadata token for the type with the specified name. |
|
Gets a pointer to the TypeRef metadata token that references the type in the specified search scope with the specified name. |
|
Gets layout information for the class referenced by the specified TypeDef token. |
|
Gets the value of the custom attribute, given its name. |
|
Gets the value of the custom attribute, given its metadata token. |
|
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. |
|
Gets a pointer to the native, unmanaged type of the field represented by the specified Field metadata token. |
|
Gets metadata associated with the field referenced by the specified FieldDef token. |
|
Gets a pointer to the metadata tokens for the type that implements the specified method and for the interface that declares that method. |
|
Gets metadata information (including the name, binary signature, and relative virtual address) of the type member referenced by the specified metadata token. |
|
Gets metadata associated with the member referenced by the specified token. |
|
Gets the metadata associated with the method referenced by the specified MethodDef token. |
|
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. |
|
Gets a pointer to the metadata token for the module referenced in the current metadata scope. |
|
Gets the name of the module referenced by the specified metadata token. |
|
Gets the UTF-8 name of the object referenced by the specified metadata token. |
|
Gets the native calling convention for the method that is represented by the specified signature pointer. |
|
Gets the TypeDef token for the enclosing parent type of the specified nested type. |
|
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. |
|
Gets metadata values for the parameter referenced by the specified ParamDef token. |
|
Gets the metadata associated with the System.Security.PermissionSet represented by the specified Permission token. |
|
Gets a ModuleRef token to represent the target assembly of a PInvoke call. |
|
Gets the metadata associated with the property represented by the specified token. |
|
Gets the offset of the relative virtual address of the code object represented by the specified token. |
|
Gets the name and optionally the version identifier of the assembly or module in the current metadata scope. |
|
Gets the binary metadata signature associated with the specified token. |
|
Returns metadata information for the type represented by the specified TypeDef token. |
|
Gets the metadata associated with the type referenced by the specified TypeRef token. |
|
Gets the binary metadata signature of the type specification represented by the specified token. |
|
Gets the literal string represented by the specified metadata token. |
|
Gets a value indicating whether the field, method, or type represented by the specified metadata token has global scope. |
|
Gets a value indicating whether the specified token holds a valid reference to a code object. |
|
Resets the specified enumerator to the specified position. |
|
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