IMetaDataImport class com
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.
To learn more, see learn.microsoft.com/windows/win32/api/rometadataapi/nn-rometadataapi-imetadataimport.
- Inheritance
- Implemented types
- Implementers
Constructors
- IMetaDataImport(VTablePointer ptr)
- Creates a new instance of IMetaDataImport from a VTablePointer.
- IMetaDataImport.from(IUnknown interface)
-
Creates a new instance of IMetaDataImport from an existing
interface.factory
Properties
- hashCode → int
-
The hash code for this object.
no setterinherited
- ptr → VTablePointer
-
finalinherited
- runtimeType → Type
-
A representation of the runtime type of the object.
no setterinherited
Methods
-
addRef(
) → int -
Increments the reference count of this COM object.
inherited
-
closeEnum(
Pointer< NativeType> hEnum) → void - Closes the enumerator that is identified by the specified handle.
-
countEnum(
Pointer< NativeType> hEnum, Pointer<Uint32> pulCount) → void - Gets the number of elements in the enumeration that was retrieved by the specified enumerator.
-
enumCustomAttributes(
Pointer< Pointer< phEnum, int tk, int tkType, Pointer<NativeType> >Uint32> rCustomAttributes, int cMax, Pointer<Uint32> pcCustomAttributes) → void - Enumerates custom attribute-definition tokens associated with the specified type or member.
-
enumEvents(
Pointer< Pointer< phEnum, int td, Pointer<NativeType> >Uint32> rEvents, int cMax, Pointer<Uint32> pcEvents) → void - Enumerates event definition tokens for the specified TypeDef token.
-
enumFields(
Pointer< Pointer< phEnum, int cl, Pointer<NativeType> >Uint32> rFields, int cMax, Pointer<Uint32> pcTokens) → void - Enumerates FieldDef tokens for the type referenced by the specified TypeDef token.
-
enumFieldsWithName(
Pointer< Pointer< phEnum, int cl, PCWSTR szName, Pointer<NativeType> >Uint32> rFields, int cMax, Pointer<Uint32> pcTokens) → void - Enumerates FieldDef tokens of the specified type with the specified name.
-
enumInterfaceImpls(
Pointer< Pointer< phEnum, int td, Pointer<NativeType> >Uint32> rImpls, int cMax, Pointer<Uint32> pcImpls) → void - Enumerates MethodDef tokens representing interface implementations.
-
enumMemberRefs(
Pointer< Pointer< phEnum, int tkParent, Pointer<NativeType> >Uint32> rMemberRefs, int cMax, Pointer<Uint32> pcTokens) → void - Enumerates MemberRef tokens representing members of the specified type.
-
enumMembers(
Pointer< Pointer< phEnum, int cl, Pointer<NativeType> >Uint32> rMembers, int cMax, Pointer<Uint32> pcTokens) → void - Enumerates MemberDef tokens representing members of the specified type.
-
enumMembersWithName(
Pointer< Pointer< phEnum, int cl, PCWSTR szName, Pointer<NativeType> >Uint32> rMembers, int cMax, Pointer<Uint32> pcTokens) → void - Enumerates MemberDef tokens representing members of the specified type with the specified name.
-
enumMethodImpls(
Pointer< Pointer< phEnum, int td, Pointer<NativeType> >Uint32> rMethodBody, Pointer<Uint32> rMethodDecl, int cMax, Pointer<Uint32> pcTokens) → void - Enumerates MethodBody and MethodDeclaration tokens representing methods of the specified type.
-
enumMethods(
Pointer< Pointer< phEnum, int cl, Pointer<NativeType> >Uint32> rMethods, int cMax, Pointer<Uint32> pcTokens) → void - Enumerates MethodDef tokens representing methods of the specified type.
-
enumMethodSemantics(
Pointer< Pointer< phEnum, int mb, Pointer<NativeType> >Uint32> rEventProp, int cMax, Pointer<Uint32> pcEventProp) → void - Enumerates the properties and the property-change events to which the specified method is related.
-
enumMethodsWithName(
Pointer< Pointer< phEnum, int cl, PCWSTR szName, Pointer<NativeType> >Uint32> rMethods, int cMax, Pointer<Uint32> pcTokens) → void - Enumerates methods that have the specified name and that are defined by the type referenced by the specified TypeDef token.
-
enumModuleRefs(
Pointer< Pointer< phEnum, Pointer<NativeType> >Uint32> rModuleRefs, int cmax, Pointer<Uint32> pcModuleRefs) → void - Enumerates ModuleRef tokens that represent imported modules.
-
enumParams(
Pointer< Pointer< phEnum, int mb, Pointer<NativeType> >Uint32> rParams, int cMax, Pointer<Uint32> pcTokens) → void - Enumerates ParamDef tokens representing the parameters of the method referenced by the specified MethodDef token.
-
enumPermissionSets(
Pointer< Pointer< phEnum, int tk, int dwActions, Pointer<NativeType> >Uint32> rPermission, int cMax, Pointer<Uint32> pcTokens) → void - Enumerates permissions for the objects in a specified metadata scope.
-
enumProperties(
Pointer< Pointer< phEnum, int td, Pointer<NativeType> >Uint32> rProperties, int cMax, Pointer<Uint32> pcProperties) → void - Enumerates PropertyDef tokens representing the properties of the type referenced by the specified TypeDef token.
-
enumSignatures(
Pointer< Pointer< phEnum, Pointer<NativeType> >Uint32> rSignatures, int cmax, Pointer<Uint32> pcSignatures) → void - Enumerates Signature tokens representing stand-alone signatures in the current scope.
-
enumTypeDefs(
Pointer< Pointer< phEnum, Pointer<NativeType> >Uint32> rTypeDefs, int cMax, Pointer<Uint32> pcTypeDefs) → void - Enumerates TypeDef tokens representing all types within the current scope.
-
enumTypeRefs(
Pointer< Pointer< phEnum, Pointer<NativeType> >Uint32> rTypeRefs, int cMax, Pointer<Uint32> pcTypeRefs) → void - Enumerates TypeRef tokens defined in the current metadata scope.
-
enumTypeSpecs(
Pointer< Pointer< phEnum, Pointer<NativeType> >Uint32> rTypeSpecs, int cmax, Pointer<Uint32> pcTypeSpecs) → void - Enumerates TypeSpec tokens defined in the current metadata scope.
-
enumUnresolvedMethods(
Pointer< Pointer< phEnum, Pointer<NativeType> >Uint32> rMethods, int cMax, Pointer<Uint32> pcTokens) → void - Enumerates MemberDef tokens representing the unresolved methods in the current metadata scope.
-
enumUserStrings(
Pointer< Pointer< phEnum, Pointer<NativeType> >Uint32> rStrings, int cmax, Pointer<Uint32> pcStrings) → void - Enumerates String tokens representing hard-coded strings in the current metadata scope.
-
findField(
int td, PCWSTR szName, Pointer< Uint8> pvSigBlob, int cbSigBlob, Pointer<Uint32> pmb) → void - Throws a WindowsException on failure.
-
findMember(
int td, PCWSTR szName, Pointer< Uint8> pvSigBlob, int cbSigBlob, Pointer<Uint32> pmb) → void - Throws a WindowsException on failure.
-
findMemberRef(
int td, PCWSTR szName, Pointer< Uint8> pvSigBlob, int cbSigBlob, Pointer<Uint32> pmr) → void - Gets a pointer to the MemberRef token for the member reference that is enclosed by the specified Type and that has the specified name and metadata signature.
-
findMethod(
int td, PCWSTR szName, Pointer< Uint8> pvSigBlob, int cbSigBlob, Pointer<Uint32> pmb) → void - Throws a WindowsException on failure.
-
findTypeDefByName(
PCWSTR szTypeDef, int tkEnclosingClass, Pointer< Uint32> ptd) → void - Gets a pointer to the TypeDef metadata token for the Type with the specified name.
-
findTypeRef(
int tkResolutionScope, PCWSTR szName, Pointer< Uint32> ptr$) → void - Gets a pointer to the TypeRef token for the Type reference that is in the specified scope and that has the specified name.
-
getClassLayout(
int td, Pointer< Uint32> pdwPackSize, Pointer<COR_FIELD_OFFSET> rFieldOffset, int cMax, Pointer<Uint32> pcFieldOffset, Pointer<Uint32> pulClassSize) → void - Throws a WindowsException on failure.
-
getCustomAttributeByName(
int tkObj, PCWSTR szName, Pointer< Pointer< ppData, Pointer<NativeType> >Uint32> pcbData) → void - Gets the custom attribute, given its name and owner.
-
getCustomAttributeProps(
int cv, Pointer< Uint32> ptkObj, Pointer<Uint32> ptkType, Pointer<Pointer< ppBlob, Pointer<NativeType> >Uint32> pcbSize) → void - Gets the value of the custom attribute, given its metadata token.
-
getEventProps(
int ev, Pointer< Uint32> pClass, PCWSTR szEvent, int cchEvent, Pointer<Uint32> pchEvent, Pointer<Uint32> pdwEventFlags, Pointer<Uint32> ptkEventType, Pointer<Uint32> pmdAddOn, Pointer<Uint32> pmdRemoveOn, Pointer<Uint32> pmdFire, Pointer<Uint32> rmdOtherMethod, int cMax, Pointer<Uint32> pcOtherMethod) → void - Throws a WindowsException on failure.
-
getFieldMarshal(
int tk, Pointer< Pointer< ppvNativeType, Pointer<Uint8> >Uint32> pcbNativeType) → void - Gets a pointer to the native, unmanaged type of the field represented by the specified field metadata token.
-
getFieldProps(
int mb, Pointer< Uint32> pClass, PWSTR? szField, int cchField, Pointer<Uint32> pchField, Pointer<Uint32> pdwAttr, Pointer<Pointer< ppvSigBlob, Pointer<Uint8> >Uint32> pcbSigBlob, Pointer<Uint32> pdwCPlusTypeFlag, Pointer<Pointer< ppValue, Pointer<NativeType> >Uint32> pcchValue) → void - Gets metadata associated with the field referenced by the specified FieldDef token.
-
getInterfaceImplProps(
int iiImpl, Pointer< Uint32> pClass, Pointer<Uint32> ptkIface) → void - Gets a pointer to the metadata tokens for the Type that implements the specified method, and for the interface that declares that method.
-
getMemberProps(
int mb, Pointer< Uint32> pClass, PWSTR? szMember, int cchMember, Pointer<Uint32> pchMember, Pointer<Uint32> pdwAttr, Pointer<Pointer< ppvSigBlob, Pointer<Uint8> >Uint32> pcbSigBlob, Pointer<Uint32> pulCodeRVA, Pointer<Uint32> pdwImplFlags, Pointer<Uint32> pdwCPlusTypeFlag, Pointer<Pointer< ppValue, Pointer<NativeType> >Uint32> pcchValue) → void - Gets metadata information, including the name, binary signature, and relative virtual address, of the Type member referenced by the specified metadata token.
-
getMemberRefProps(
int mr, Pointer< Uint32> ptk, PWSTR? szMember, int cchMember, Pointer<Uint32> pchMember, Pointer<Pointer< ppvSigBlob, Pointer<Uint8> >Uint32> pbSig) → void - Gets metadata associated with the member referenced by the specified token.
-
getMethodProps(
int mb, Pointer< Uint32> pClass, PWSTR? szMethod, int cchMethod, Pointer<Uint32> pchMethod, Pointer<Uint32> pdwAttr, Pointer<Pointer< ppvSigBlob, Pointer<Uint8> >Uint32> pcbSigBlob, Pointer<Uint32> pulCodeRVA, Pointer<Uint32> pdwImplFlags) → void - Gets the metadata associated with the method referenced by the specified MethodDef token.
-
getMethodSemantics(
int mb, int tkEventProp, Pointer< Uint32> pdwSemanticsFlags) → void - Gets flags indicating the relationship between the method referenced by the specified MethodDef token and the paired property and event referenced by the specified EventProp token.
-
getModuleFromScope(
Pointer< Uint32> pmd) → void - Gets a metadata token for the module referenced in the current metadata scope.
-
getModuleRefProps(
int mur, PWSTR? szName, int cchName, Pointer< Uint32> pchName) → void - Gets the name of the module referenced by the specified metadata token.
-
getNameFromToken(
int tk, Pointer< Pointer< pszUtf8NamePtr) → voidInt8> > - Gets the UTF-8 name of the object referenced by the specified metadata token.
-
getNativeCallConvFromSig(
Pointer< NativeType> pvSig, int cbSig, Pointer<Uint32> pCallConv) → void - Gets the native calling convention for the method that is represented by the specified signature pointer.
-
getNestedClassProps(
int tdNestedClass, Pointer< Uint32> ptdEnclosingClass) → void - Gets the TypeDef token for the parent Type of the specified nested type.
-
getParamForMethodIndex(
int md, int ulParamSeq, Pointer< Uint32> ppd) → void - Gets the token that represents a specified parameter of the method represented by the specified MethodDef token.
-
getParamProps(
int tk, Pointer< Uint32> pmd, Pointer<Uint32> pulSequence, PWSTR? szName, int cchName, Pointer<Uint32> pchName, Pointer<Uint32> pdwAttr, Pointer<Uint32> pdwCPlusTypeFlag, Pointer<Pointer< ppValue, Pointer<NativeType> >Uint32> pcchValue) → void - Gets metadata values for the parameter referenced by the specified ParamDef token.
-
getPermissionSetProps(
int pm, Pointer< Uint32> pdwAction, Pointer<Pointer< ppvPermission, Pointer<NativeType> >Uint32> pcbPermission) → void - Gets the metadata associated with the System.Security.PermissionSet represented by the specified Permission token.
-
getPinvokeMap(
int tk, Pointer< Uint32> pdwMappingFlags, PWSTR? szImportName, int cchImportName, Pointer<Uint32> pchImportName, Pointer<Uint32> pmrImportDLL) → void - Gets a ModuleRef token to represent the target assembly of a PInvoke call.
-
getPropertyProps(
int prop, Pointer< Uint32> pClass, PCWSTR szProperty, int cchProperty, Pointer<Uint32> pchProperty, Pointer<Uint32> pdwPropFlags, Pointer<Pointer< ppvSig, Pointer<Uint8> >Uint32> pbSig, Pointer<Uint32> pdwCPlusTypeFlag, Pointer<Pointer< ppDefaultValue, Pointer<NativeType> >Uint32> pcchDefaultValue, Pointer<Uint32> pmdSetter, Pointer<Uint32> pmdGetter, Pointer<Uint32> rmdOtherMethod, int cMax, Pointer<Uint32> pcOtherMethod) → void - Throws a WindowsException on failure.
-
getRVA(
int tk, Pointer< Uint32> pulCodeRVA, Pointer<Uint32> pdwImplFlags) → void - Gets the relative virtual address (RVA) and the implementation flags of the method or field represented by the specified token.
-
getScopeProps(
PWSTR? szName, int cchName, Pointer< Uint32> pchName, Pointer<GUID> pmvid) → void - Gets the name and optionally the version identifier of the assembly or module in the current metadata scope.
-
getSigFromToken(
int mdSig, Pointer< Pointer< ppvSig, Pointer<Uint8> >Uint32> pcbSig) → void - Gets the binary metadata signature associated with the specified token.
-
getTypeDefProps(
int td, PWSTR? szTypeDef, int cchTypeDef, Pointer< Uint32> pchTypeDef, Pointer<Uint32> pdwTypeDefFlags, Pointer<Uint32> ptkExtends) → void - Returns metadata information for the Type represented by the specified TypeDef token.
-
getTypeRefProps(
int tr, Pointer< Uint32> ptkResolutionScope, PWSTR? szName, int cchName, Pointer<Uint32> pchName) → void - Gets the metadata associated with the Type referenced by the specified TypeRef token.
-
getTypeSpecFromToken(
int typespec, Pointer< Pointer< ppvSig, Pointer<Uint8> >Uint32> pcbSig) → void - Gets the binary metadata signature of the type specification represented by the specified token.
-
getUserString(
int stk, PWSTR? szString, int cchString, Pointer< Uint32> pchString) → void - Gets the literal string represented by the specified metadata token.
-
isGlobal(
int pd, Pointer< Int32> pbGlobal) → void - Gets a value indicating whether the field, method, or type represented by the specified metadata token has global scope.
-
isValidToken(
int tk) → bool - Gets a value indicating whether the specified token holds a valid reference to a code object.
-
noSuchMethod(
Invocation invocation) → dynamic -
Invoked when a nonexistent method or property is accessed.
inherited
-
queryInterface<
T extends IUnknown> () → T -
Queries this COM object for a specific interface defined by the type
parameter
T.inherited -
release(
) → int -
Decrements the reference count of this COM object.
inherited
-
resetEnum(
Pointer< NativeType> hEnum, int ulPos) → void - Resets the specified enumerator to the specified position.
-
resolveTypeRef(
int tr, Pointer< GUID> riid, Pointer<VTablePointer> ppIScope, Pointer<Uint32> ptd) → void - Resolves a Type reference represented by the specified TypeRef token.
-
toString(
) → String -
A string representation of this object.
override
Operators
-
operator ==(
Object other) → bool -
The equality operator.
inherited