ICorProfilerInfo2::GetStaticFieldInfo Method


Gets a value that indicates the kind of static that applies to the specified field.

HRESULT GetStaticFieldInfo (
    [in] ClassID               classId,
    [in] mdFieldDef            fieldToken,
    [out] COR_PRF_STATIC_TYPE  *pFieldInfo);


[in] The ID of the class in which the static field is defined.


[in] The metadata token for the static field.


[out] A pointer to a value of the COR_PRF_STATIC_TYPE enumeration that indicates whether the specified field is static, and if so, the kind of static that applies to the field.

This information can be used to determine which function to call to get the address of the static field.

The profiler code should still check the metadata for a static field to ensure that it actually has an address. Static literals (that is, constants) exist only in the metadata and do not have an address.


Platforms: See .NET Framework System Requirements.

Header: CorProf.idl, CorProf.h

Library: CorGuids.lib

.NET Framework Versions: Available since 2.0