Figure 2 IMetaDataImport Token Types
Token |
Enumeration Method |
Get Properties Method |
mdCustomValue |
EnumCustomAttributes |
GetCustomAttributeProps |
mdEvent |
EnumEvents |
GetEventProps |
mdFieldDef |
EnumFields |
GetFieldProps |
mdInterfaceImpl |
EnumInterfaceImpls |
GetInterfaceImplProps |
mdMemberRef |
EnumMemberRefs |
GetMemberRefProps |
mdToken |
EnumMembers |
GetMemberProps |
mdMethodDef |
EnumMethods |
GetMethodProps |
mdModuleRef |
EnumModuleRefs |
GetModuleRefProps |
mdParamDef |
EnumParams |
GetParamProps |
mdPermission |
EnumPermissionSets |
GetPermissionSetProps |
mdProperty |
EnumProperties |
GetPropertyProps |
mdTypeDef |
EnumTypeDefs |
GetTypeDefProps |
mdTypeRef |
EnumTypeRefs |
GetTypeRefProps |
mdString |
EnumUserStrings |
GetUserString |
Figure 3 Types in Metadata Type Signatures
Type Name |
Value |
Data Type |
ELEMENT_TYPE_VOID |
0x1 |
Void |
ELEMENT_TYPE_BOOLEAN |
0x2 |
Boolean |
ELEMENT_TYPE_CHAR |
0x3 |
Character |
ELEMENT_TYPE_I1 |
0x4 |
Signed 1-byte integer |
ELEMENT_TYPE_U1 |
0x5 |
Unsigned 1-byte integer |
ELEMENT_TYPE_I2 |
0x6 |
Signed 2-byte integer |
ELEMENT_TYPE_U2 |
0x7 |
Unsigned 2-byte integer |
ELEMENT_TYPE_I4 |
0x8 |
Signed 4-byte integer |
ELEMENT_TYPE_U4 |
0x9 |
Unsigned 4-byte integer |
ELEMENT_TYPE_I8 |
0xa |
Signed 8-byte integer |
ELEMENT_TYPE_U8 |
0xb |
Unsigned 8-byte integer |
ELEMENT_TYPE_R4 |
0xc |
4-byte floating point |
ELEMENT_TYPE_R8 |
0xd |
8-byte floating point |
ELEMENT_TYPE_STRING |
0xe |
System.String |
Figure 4 IMetaDataAssemblyImport Token Types
Token |
Enumeration Method |
Get Properties Method |
mdAssemblyRef |
EnumAssemblyRefs |
GetAssemblyRefProps |
mdFile |
EnumFiles |
GetFileProps |
mdComType |
EnumComTypes |
GetComTypeProps |
mdManifestResource |
EnumManifestResources |
GetManifestResourceProps |
mdExecutionLocation |
EnumExecutionLocations |
GetExecutionLocationProps |
Figure 5 CorTokenType Token Types
typedef enum CorTokenType
{
mdtModule = 0x00000000
mdtTypeRef = 0x01000000
mdtTypeDef = 0x02000000
mdtFieldDef = 0x04000000
mdtMethodDef = 0x06000000
mdtParamDef = 0x08000000
mdtInterfaceImpl = 0x09000000
mdtMemberRef = 0x0a000000
mdtCustomAttribute = 0x0c000000
mdtPermission = 0x0e000000
mdtSignature = 0x11000000
mdtEvent = 0x14000000
mdtProperty = 0x17000000
mdtModuleRef = 0x1a000000
mdtTypeSpec = 0x1b000000
mdtAssembly = 0x20000000
mdtAssemblyRef = 0x23000000
mdtFile = 0x26000000
mdtComType = 0x27000000
mdtManifestResource = 0x28000000
mdtExecutionLocation = 0x29000000
mdtSourceFile = 0x2a000000
mdtLocalVarScope = 0x2c000000
mdtLocalVar = 0x2d000000
mdtString = 0x70000000
mdtName = 0x71000000
mdtBaseType = 0x72000000
} CorTokenType;
Figure 6 Unmanaged API Tokens and Equivalent Reflection API Types and Methods
Unmanaged Token |
Reflection Equivalent Type |
Reflection Enumeration Method |
mdModule |
Module * |
Assembly::GetModules |
mdTypeDef |
Type * |
Assembly::GetType |
mdFieldDef |
FieldInfo * |
Type::GetFields |
mdMethodDef |
MethodInfo * |
Type::GetMethods |
mdParamDef |
ParameterInfo * |
MethodInfo::GetParameters |
mdCustomAttribute |
Object * |
XXX::GetCustomAttributes |
mdEvent |
EventInfo * |
Type::GetEvents |
mdProperty |
PropertyInfo * |
Type::GetProperties |
mdAssembly |
Assembly * |
Assembly::Load or AppDomain::GetAssemblies |
mdAssemblyRef |
AssemblyName * |
Assembly::GetReferencedAssemblies |
mdManifestResource |
String * |
Assembly::GetManifestResourceNames |
Figure 7 MethodBase
MethodBase::IsAbstract
MethodBase::IsAssembly
MethodBase::IsConstructor
MethodBase::IsFamily
MethodBase::IsFamilyAndAssembly
MethodBase::IsFamilyOrAssembly
MethodBase::IsFinal
MethodBase::IsHideBySig
MethodBase::IsPrivate
MethodBase::IsPublic
MethodBase::IsSpecialName
MethodBase::IsStatic
MethodBase::IsVirtual