I work on Reflector but whenever I go through the code I always some other useful feature that I’ve not used before. On Thursday I was playing around with the Analyze functionality, available on the right context menu in the assembly tree. I’d never noticed before that when you were on a module, the Analyze offered the ability to find all P/Invoked methods on the module, and then the ability to search for where these methods were used. Using this on mscorlib is interesting, and there appear to be a lot of interesting differences between the .NET 2 and .NET 4 versions.
Whereas in .NET 2, there was a dependency on mscorwks and mscoree, in .NET 4 these have been replaced with references to clr.dll and a new QCall.dll. Following back from some of these methods, it appears that a lot more of the COM marshalling code is now exposed via managed interfaces inside System.StubHelpers. The Microsoft.Win32.Win32Native class also exposes a lot of useful functionality.