References:
- http://win32assembly.online.fr/tut28.html
- http://stackoverflow.com/questions/78048/best-way-to-detect-an-application-crash-and-restart-it
一般情况下,如果Windows下面的程序蹦了,那么Windows会跳出一个error对话框来,而不是直接的crash,比如像Linux下面这样。这个时候就需要用到Reference里面提到的技术来进行捕获对应的。其实WaitForDebugEvent这个函数多用在debugger的编写中。