If the process crashes, Windows first checks to see if the Just-In-Time debugger is configured on your system. If so, you can force this debugger to join the process just before it crashes. Normally you should use this function to dump the memory if the process crashes. No matter which debugger you attach, it will recognize the PID and the name of the failure process. You can either use the features of existing debugging tools, such as ADPlus, or write your own program and tell Windows that it is your Just-In-Time debugger and should start when the process fails. I believe that you can configure the JIT debugger specifically for any process name.
See http://msdn.microsoft.com/en-us/library/5hs4b7a6(v=VS.80).aspx
I think that if you set the registry entry HKLM \ Software \ Microsoft \ Windows NT \ Current Version \ AeDebug \ Debugger to "DirectoryOfYourProgram \ YourProgram.exe" -p% ld ', where YourProgram.exe expects the PID passed in with with the -p flag, your program will be called and will give the correct PID if the process fails.
mrranstrom
source share