This documentation is archived and is not being maintained.

ICorProfilerInfo::GetFunctionInfo Method

Gets the parent class and metadata token for the specified function.

HRESULT GetFunctionInfo(
    [in]  FunctionID functionId,
    [out] ClassID    *pClassId,
    [out] ModuleID   *pModuleId,
    [out] mdToken    *pToken);

functionId

[in] The ID of the function for which to get the parent class and metadata token.

pClassId

[out] A pointer to the parent class of the function.

pModuleId

[out] A pointer to the module in which the function's parent class is defined.

pToken

[out] A pointer to the metadata token for the function.

The profiler code can call ICorProfilerInfo::GetModuleMetaData to obtain a metadata interface for a given module. The metadata token that is returned to the location referenced by pToken can then be used to access the metadata for the function.

The ClassID of a function on a generic class might not be obtainable without more contextual information about the use of the function. In this case, pClassId will be 0. Profiler code should use ICorProfilerInfo2::GetFunctionInfo2 with a COR_PRF_FRAME_INFO value to provide more context.

Platforms: See .NET Framework System Requirements.

Header: CorProf.idl, CorProf.h

Library: CorGuids.lib

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

Show: