The problem is that I get only the correct Stack Trace of the thread running this code; for the rest of the threads in the application, I get an empty string.
The first parameter to GetThreadStackTrace is the thread ID, not the thread handle!
Have you tried running madTraceProcess with admin rights? It's possible that your OS blocks access to IIS because it's running as a system service. Running madTraceProcess may fix that problem, or not. Maybe you'd have to run madTraceProcess inside of a(n interactive) service, too, to get access, I'm not sure.