COR_TYPE_LAYOUT 結構COR_TYPE_LAYOUT Structure

提供記憶體中物件配置的相關資訊。Provides information about the layout of an object in memory.

語法Syntax

typedef struct COR_TYPE_LAYOUT {  
    COR_TYPEID parentID;  
    ULONG32 objectSize;  
    ULONG32 numFields;  
    ULONG32 boxOffset;  
    CorElementType type;  
} COR_TYPE_LAYOUT;  

成員Members

memberMember 描述Description
parentID 這個類型的父類型識別碼。The identifier of the parent type to this type. 如果類型識別碼對應至,則這會是 Null 類型識別碼 (token1 = 0、token2 = 0) System.ObjectThis will be the NULL type id (token1= 0, token2 = 0) if the type id corresponds to System.Object.
objectSize 此類型之物件的基底大小。The base size of an object of this type. 這是非變數大小物件的總大小。This is the total size for non-variable sized objects.
numFields 此類型的物件中包含的欄位數目。The number of fields included in objects of this type.
boxOffset 如果此類型是已封裝的,則為物件欄位的開始位移。If this type is boxed, the beginning offset of an object's fields. 此欄位僅適用于實數值型別,例如基本和結構。This field is valid only for value types such as primitives and structures.
type 此類型所屬的 CorElementType。The CorElementType to which this type belongs.

備註Remarks

如果 numFields 大於零,您可以呼叫 ICorDebugProcess5:: GetTypeFields 方法,以取得有關此類型中之欄位的資訊。If numFields is greater than zero, you can call the ICorDebugProcess5::GetTypeFields method to obtain information about the fields in this type. 如果 typeELEMENT_TYPE_STRINGELEMENT_TYPE_ARRAYELEMENT_TYPE_SZARRAY ,則此類型的物件大小為變數,您可以將 COR_TYPEID 結構傳遞給 ICorDebugProcess5:: GetArrayLayout 方法。If type is ELEMENT_TYPE_STRING, ELEMENT_TYPE_ARRAY, or ELEMENT_TYPE_SZARRAY, the size of objects of this type is variable, and you can pass the COR_TYPEID structure to the ICorDebugProcess5::GetArrayLayout method.

規格需求Requirements

平台: 請參閱 系統需求Platforms: See System Requirements.

標頭: CorDebug.idl、CorDebug.hHeader: CorDebug.idl, CorDebug.h

程式庫: CorGuids.libLibrary: CorGuids.lib

.NET Framework 版本:自 4.5 起可用Available since 4.5.NET Framework Versions: 自 4.5 起可用Available since 4.5

另請參閱See also