In my previous entry, I described my preliminary experiments to discover the true nature of FunctionID’s, RuntimeMethodHandles and ModuleID / MethodDef pairs. I described how I figured out that FunctionID’s provided by the Profiling API are really just MethodDesc pointers. Here’s the evidence that I omitted from that entry. From \clr\src\vm\proftoeeinterfaceimpl.cpp:
HRESULT ProfToEEInterfaceImpl::GetFunctionInfo(
FunctionID functionId,
ClassID *pClassId,
ModuleID *pModuleId,
mdToken *pToken)
{
MethodDesc *pMDesc = (MethodDesc *) functionId;
The first line of GetFunctionInfo() says it all …