Gets the extents of native code associated with the specified FunctionID.
HRESULT GetCodeInfo2( [in] FunctionID functionID, [in] ULONG32 cCodeInfos, [out] ULONG32 *pcCodeInfos, [out, size_is(cCodeInfos), length_is(*pcCodeInfos)] COR_PRF_CODE_INFO codeInfos);
The extents are sorted in order of increasing Microsoft intermediate language (MSIL) offset.
After GetCodeInfo2 returns, you must verify that the codeInfos buffer was large enough to contain all the COR_PRF_CODE_INFO structures. To do this, compare the value of cCodeInfos with the value of the cchName parameter. If cCodeInfos divided by the size of a COR_PRF_CODE_INFO structure is smaller than pcCodeInfos, allocate a larger codeInfos buffer, update cCodeInfos with the new, larger size, and call GetCodeInfo2 again.
Alternatively, you can first call GetCodeInfo2 with a zero-length codeInfos buffer to obtain the correct buffer size. You can then set the codeInfos buffer size to the value returned in pcCodeInfos, multiplied by the size of a COR_PRF_CODE_INFO structure, and call GetCodeInfo2 again.
For more information about these two approaches, see Profiling API Method Conventions.
Platforms: See .NET Framework System Requirements.
Header: CorProf.idl, CorProf.h
.NET Framework Versions: 4.5, 4, 3.5 SP1, 3.5, 3.0 SP1, 3.0, 2.0 SP1, 2.0