MiniDumpWriteDump for an external process

I have written an app to generate a minidump on an external process. This will be ultimately be called by our test harness on process’s that take too long to execute its unit tests. Or for our a process that hung while executing unit tests. (i.e. timed out) So I would like to create a minidump before terminating the process.

The minidump will be used to inspect the callstacks of the hung process. By looking at the callstacks you can get an idea of what went wrong: Or in our case, where did the hang occur.

So I wrote a handy little command line tool to do that. It takes as it’s (only) parameter the full path name of the executable you want a dump for. The cool part of this tool is you can also execute it while an application is running. And if you have symbols for your app, you will get nice callstacks in your minidump report.

getminidump (Source code here)

6 thoughts on “MiniDumpWriteDump for an external process

  1. MuiBienCarlota

    I’m searching to find an exemple of mini dumping an external process but just a question:
    why a managed C++ utility?
    I don’t have .Net 2.0 installed on my client machines.


  2. Viðarr

    To my knowledge there is a rather nasty side-effect of using this API. If you are working with guard pages in your program, those will be unprotected after the dump. So your code relies on the guard page mechanism it will fail after this … 😐


  3. Robin

    I get this error when trying to dump calc.exe process
    “hresult 0x8007012b Only part of a ReadProcessMemory or WriteProcessMemory request was completed”
    I am admin on Win 7 x64. Any help please ?


Leave a Reply

Fill in your details below or click an icon to log in: Logo

You are commenting using your account. Log Out /  Change )

Twitter picture

You are commenting using your Twitter account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )

Connecting to %s