ICorProfilerInfo::GetFunctionInfo Method

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

Syntax

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

Parameters

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.

Remarks

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.

Requirements

Platforms: See System Requirements.

Header: CorProf.idl, CorProf.h

Library: CorGuids.lib

.NET Framework Versions: Available since 2.0

See also