ICorProfilerInfo2::GetRVAStaticAddress Method

Gets the address of the specified relative virtual address (RVA) static field.

HRESULT GetRVAStaticAddress(
    [in] ClassID classId,
    [in] mdFieldDef fieldToken,
    [out] void **ppAddress);

Parameters

  • classId
    [in] The ID of the class containing the requested RVA-static field.

  • fieldToken
    [in] Metadata token for the requested RVA-static field.

  • ppAddress
    [out] A pointer to the address of the RVA-static field.

Remarks

The GetAppDomainStaticAddress method may return the following:

  • A CORPROF_E_DATAINCOMPLETE HRESULT if the given static field has not been assigned an address in the specified context.

  • The addresses of objects that may be in the garbage collection heap. These addresses can become invalid after garbage collection. Therefore, profilers should not assume that they are valid after garbage collection.

Static variables are not visible to profilers until after the class constructor has completed. Static variables are allocated before the constructor is called and can contain object references while the constructor is running. If garbage collection occurs in the middle of constructor code, profilers will not be able to retrieve the addresses of the static variables that contain object references. Those static variables become visible only after the constructor is finished.

Requirements

Platforms: See .NET Framework System Requirements.

Header: CorProf.idl

Library: CorGuids.lib

.NET Framework Versions: 3.5 SP1, 3.5, 3.0 SP1, 3.0, 2.0 SP1, 2.0

See Also

Reference

ICorProfilerInfo Interface

ICorProfilerInfo2 Interface