title: .NET Profiler - Getting The Type Of A Function Parameter
body: <p>I've implemented the .Net Profiler callback which allows me to get data about all the functions called in a .NET application. The function callback works great. Starting in the callback, I make a call to</p>
  <p><code>GetModuleMetaData(moduleId, ofRead, IID_IMetaDataImport, (IUnknown**)&amp;metaDataImport);</code></p>
  <p>to which I make a subsequent call to</p>
  <p><code>metaDataImport-&gt;EnumParams(&amp;phEnum, (mdMethodDef)metaDataToken, rParams, cMax, &amp;pcTokens);</code></p>
  <p>pcTokens contains an array of parameter reference tokens. I can use those tokens to get the parameter names with the following call.</p>
  <p><code>metaDataImport-&gt;GetParamProps(rParams[i], &amp;(mdMethodDef)metaDataToken, &amp;pulSequence, szName3, cchName3, &amp;pchName3, NULL, NULL, NULL, NULL);</code></p>
  <p>I'm stuck at trying to find the type of each parameter. I can't find any documentation that would give me the parameter type. <a href="https://docs.microsoft.com/en-us/dotnet/framework/unmanaged-api/metadata/imetadataimport-interface" rel="nofollow noreferrer">https://docs.microsoft.com/en-us/dotnet/framework/unmanaged-api/metadata/imetadataimport-interface</a></p>
  <p>Any thoughts?</p>