ICorProfilerInfo2::GetClassLayout Method

Gets information about the layout, in memory, of the fields defined by the specified class. That is, this method gets the offsets of the class's fields.

HRESULT GetClassLayout(
    [in]  ClassID classID,
    [in, out] COR_FIELD_OFFSET rFieldOffset[],
    [in] ULONG cFieldOffset,
    [out] ULONG *pcFieldOffset,
    [out] ULONG *pulClassSize);

Parameters

Parameter Description

classID

[in] The ID of the class for which the layout will be retrieved.

rFieldOffset

[in, out] An array of COR_FIELD_OFFSET Structure structures, each of which contains the tokens and offsets of the class's fields.

cFieldOffset

[in] The size of the rFieldOffset array.

pcFieldOffset

[out] A pointer to a location that contains the number of elements returned in the rFieldOffset array. If cFieldOffset is 0, this value is the number of elements needed.

pulClassSize

[out] A pointer to a location that contains the size, in bytes, of the class.

Remarks

The GetClassLayout method returns only the fields defined by the class itself; if its parent class has defined fields as well, the profiler must call GetClassLayout on the parent class to obtain those fields.

If you use GetClassLayout with string classes, the method will not fail, but the data it returns will not be correct. Use ICorProfilerInfo2::GetStringLayout Method to get information about how a string is laid out. GetClassLayout will fail when called with an array class.

Requirements

Platforms: Windows 2000, Windows XP, Windows Server 2003 family

Header: CorProf.idl

Library: CorGuids.lib

.NET Framework Version: 2.0

See Also

Reference

ICorProfilerInfo Interface
ICorProfilerInfo2 Interface