How can I watch a process and produce a minidump when it crashes (like PROCDUMP)?

StackOverflow https://stackoverflow.com/questions/7424528

  •  30-10-2019
  •  | 
  •  

Question

I've found a number of posts on how to create a crash dump manually when required, but what I would like to do is ensure that a crash dump is produced when a monitored application crashes.

The TechNet PROCDUMP tool can do this perfectly. What I would like to know is how I can write some code to do the same thing in a management program of my own so that I only create a dump file when an exception occurs.

My program is a service app that knows the process IDs of the programs I wish to monitor.

Just to clarify, I want to mimic what this call to PROCDUMP would do:

procdump -e someprocess.exe -w

Theoretically Windows should be able to do this job for me with DrWatson. The problem I have is that I have about 200 customer systems running that are claiming our application crashes randomly. Dr Watson doesn't seem to be confirming the fact that our applications are crashing so I've decided that I'd rather have the crash dump generation controlled by our own software.

I have managed to get my own applications to create their own dumps using __try/except and MiniDumpWriteDump() with the MiniDumpWithFullMemory type.. but I can't look at local variables etc with WinDbg, so I'm guessing this is because it has been triggered from within the application itself.. so.. another reason I would like a monitor/management type of application to do the job.

At the very least.. how can one application react to another application crashing? Do you have to install some sort of debug hook or pretend that the management program is actually a custom debugger?

Cheers

No correct solution

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top