ICorProfilerInfo2::GetFunctionInfo2 Method

Gets the parent class, the metadata token, and the ClassID of each type argument, if present, of a function.

HRESULT GetFunctionInfo2(
    [in] FunctionID funcId,
    [in] COR_PRF_FRAME_INFO frameInfo,
    [out] ClassID *pClassId,
    [out] ModuleID *pModuleId,
    [out] mdToken *pToken,
    [in] ULONG32 cTypeArgs,
    [out] ULONG32 *pcTypeArgs,
    [out] ClassID typeArgs[]);

Parameters

Parameter Description

funcId

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

frameInfo

[in] A COR_PRF_FRAME_INFO value that points to information about a stack frame.

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.

cTypeArgs

[in] The size of the typeArgs array.

pcTypeArgs

[out] A pointer to the number of elements returned in the typeArgs array.

typeArgs

[out] An array of ClassID values, each of which is the ID of a type argument of the function.

Remarks

The profiler code can call ICorProfilerInfo::GetModuleMetaData Method to obtain a Metadata (Unmanaged API Reference) 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 class ID and type arguments that are returned through the pClassId and typeArgs parameters, respectively, depend on the value that is passed in the frameInfo parameter, as shown in the following table.

Value of the frameInfo parameter Result

A COR_PRF_FRAME_INFO value that was obtained from a FunctionEnter2 callback

The ClassID, returned in the location referenced by pClassId, and all type arguments, returned in the typeArgs array, will be exact.

A COR_PRF_FRAME_INFO that was obtained from a source other than a FunctionEnter2 callback

The exact ClassID and type arguments cannot be determined. That is, the ClassID might be NULL and some type arguments might come back as Object.

Zero

The exact ClassID and type arguments cannot be determined. That is, the ClassID might be NULL and some type arguments might come back as Object.

Requirements

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

Header: CorProf.h

Library: CorProf.idl

.NET Framework Version: 2.0

See Also

Reference

ICorProfilerInfo Interface
ICorProfilerInfo2 Interface