CorElementType Enumeration1

 

Specifies a common language runtime Type, a type modifier, or information about a type in a metadata type signature.

typedef enum CorElementType {  
    ELEMENT_TYPE_END            = 0x0,  
    ELEMENT_TYPE_VOID           = 0x1,  
    ELEMENT_TYPE_BOOLEAN        = 0x2,  
    ELEMENT_TYPE_CHAR           = 0x3,  
    ELEMENT_TYPE_I1             = 0x4,  
    ELEMENT_TYPE_U1             = 0x5,  
    ELEMENT_TYPE_I2             = 0x6,  
    ELEMENT_TYPE_U2             = 0x7,  
    ELEMENT_TYPE_I4             = 0x8,  
    ELEMENT_TYPE_U4             = 0x9,  
    ELEMENT_TYPE_I8             = 0xa,  
    ELEMENT_TYPE_U8             = 0xb,  
    ELEMENT_TYPE_R4             = 0xc,  
    ELEMENT_TYPE_R8             = 0xd,  
    ELEMENT_TYPE_STRING         = 0xe,  
  
    ELEMENT_TYPE_PTR            = 0xf,  
    ELEMENT_TYPE_BYREF          = 0x10,  
  
    ELEMENT_TYPE_VALUETYPE      = 0x11,  
    ELEMENT_TYPE_CLASS          = 0x12,  
    ELEMENT_TYPE_VAR            = 0x13,  
    ELEMENT_TYPE_ARRAY          = 0x14,  
    ELEMENT_TYPE_GENERICINST    = 0x15,  
    ELEMENT_TYPE_TYPEDBYREF     = 0x16,  
  
    ELEMENT_TYPE_I              = 0x18,  
    ELEMENT_TYPE_U              = 0x19,  
    ELEMENT_TYPE_FNPTR          = 0x1B,  
    ELEMENT_TYPE_OBJECT         = 0x1C,  
    ELEMENT_TYPE_SZARRAY        = 0x1D,  
    ELEMENT_TYPE_MVAR           = 0x1e,  
  
    ELEMENT_TYPE_CMOD_REQD      = 0x1F,  
    ELEMENT_TYPE_CMOD_OPT       = 0x20,  
  
    ELEMENT_TYPE_INTERNAL       = 0x21,  
    ELEMENT_TYPE_MAX            = 0x22,  
  
    ELEMENT_TYPE_MODIFIER       = 0x40,  
    ELEMENT_TYPE_SENTINEL       = 0x01 | ELEMENT_TYPE_MODIFIER,  
    ELEMENT_TYPE_PINNED         = 0x05 | ELEMENT_TYPE_MODIFIER  
  
} CorElementType;  

MemberDescription
ELEMENT_TYPE_ENDUsed internally.
ELEMENT_TYPE_VOIDA void type.
ELEMENT_TYPE_BOOLEANA Boolean type
ELEMENT_TYPE_CHARA character type.
ELEMENT_TYPE_I1A signed 1-byte integer.
ELEMENT_TYPE_U1An unsigned 1-byte integer.
ELEMENT_TYPE_I2A signed 2-byte integer.
ELEMENT_TYPE_U2An unsigned 2-byte integer.
ELEMENT_TYPE_I4A signed 4-byte integer.
ELEMENT_TYPE_U4An unsigned 4-byte integer.
ELEMENT_TYPE_I8A signed 8-byte integer.
ELEMENT_TYPE_U8An unsigned 8-byte integer.
ELEMENT_TYPE_R4A 4-byte floating point.
ELEMENT_TYPE_R8An 8-byte floating point.
ELEMENT_TYPE_STRINGA System.String type.
ELEMENT_TYPE_PTRA pointer type modifier.
ELEMENT_TYPE_BYREFA reference type modifier.
ELEMENT_TYPE_VALUETYPEA value type modifier.
ELEMENT_TYPE_CLASSA class type modifier.
ELEMENT_TYPE_VARA class variable type modifier.
ELEMENT_TYPE_ARRAYA multi-dimensional array type modifier.
ELEMENT_TYPE_GENERICINSTA type modifier for generic types.
ELEMENT_TYPE_TYPEDBYREFA typed reference.
ELEMENT_TYPE_ISize of a native integer.
ELEMENT_TYPE_USize of an unsigned native integer.
ELEMENT_TYPE_FNPTRA pointer to a function.
ELEMENT_TYPE_OBJECTA System.Object type.
ELEMENT_TYPE_SZARRAYA single-dimensional, zero lower-bound array type modifier.
ELEMENT_TYPE_MVARA method variable type modifier.
ELEMENT_TYPE_CMOD_REQDA C language required modifier.
ELEMENT_TYPE_CMOD_OPTA C language optional modifier.
ELEMENT_TYPE_INTERNALUsed internally.
ELEMENT_TYPE_MAXAn invalid type.
ELEMENT_TYPE_MODIFIERUsed internally.
ELEMENT_TYPE_SENTINELA type modifier that is a sentinel for a list of a variable number of parameters.
ELEMENT_TYPE_PINNEDUsed internally.

The type modifiers form the basis for representing more complex types. A CorElementType type modifier value is applied to the value that immediately follows it in the type signature. The value that follows the CorElementType type modifier value can be a CorElementType simple type value, a metadata token, or other value, as specified in the following table.

System_CAPS_ICON_note.jpg Note

All numbers (number, argument Count, metadata token, rank, count, and bound) are stored as compressed integers. See Standard ECMA-335 - Common Language Infrastructure (CLI) on the ECMA Web site for details.

Type modifierFormat
ELEMENT_TYPE_PTRELEMENT_TYPE_PTR <a CorElementType value>
ELEMENT_TYPE_BYREFELEMENT_TYPE_BYREF <a CorElementType value>
ELEMENT_TYPE_VALUETYPEELEMENT_TYPE_VALUETYPE <an mdTypeDef metadata token>
ELEMENT_TYPE_CLASSELEMENT_TYPE_CLASS <an mdTypeDef metadata token>
ELEMENT_TYPE_VARELEMENT_TYPE_VAR <number>
ELEMENT_TYPE_ARRAYELEMENT_TYPE_ARRAY <a CorElementType value> <rank> <count1> <bound1> ... <countN> <boundN>
ELEMENT_TYPE_GENERICINSTELEMENT_TYPE_GENERICINST <an mdTypeDef metadata token> <argument Count> <arg1> ... <argN>
ELEMENT_TYPE_FNPTRELEMENT_TYPE_FNPTR <complete signature for the function, including calling convention>
ELEMENT_TYPE_SZARRAYELEMENT_TYPE_SZARRAY <a CorElementType value>
ELEMENT_TYPE_MVARELEMENT_TYPE_MVAR <number>
ELEMENT_TYPE_CMOD_REQDELEMENT_TYPE_<a mdTypeRef or mdTypeDef metadata token>
ELEMENT_TYPE_CMOD_OPTE_T_CMOD_OPT <a mdTypeRef or mdTypeDef metadata token>

Platforms: See System Requirements.

Header: CorHdr.h

.NET Framework Versions: Available since 1.0

Metadata Enumerations

Show: