zqBugZ
June 22nd, 2008, 09:32
I used the debugger sample code from MSDN, and created a very simple console debugger demo from it. However I have a problem to handle Exceptions.
I firstly used CreateProcess with DEBUG_PROCESS to create the process. Then call WaitForDebugEvent with EXCEPTION_DEBUG_EVENT, later I just ignore all kinds of exceptions by using ContinueDebugEvent with DBG_CONTINUE. However, when I used this console to open some windows applications like wmplayer.exe(not all the time). It will trigger some write access violation at the beginning. But wmplayer.exe surely can handle it well. Because I can prove that using well-known debuggers like windbg or ollydbg to see that. But my console just keeps geting this write access vioaltion all the way to then end(WaitForDebugEvent keeps returning the same exception for ever). It seems that it encounters an infinite loop and never ends. The calling of ContinueDebugEvent with DBG_CONTINUE doesn't seem to be able to ignore this exception. Is there anything wrong in the way I am doing it? Should I add more handling steps to make it work?
Thanks a lot for your help!
I firstly used CreateProcess with DEBUG_PROCESS to create the process. Then call WaitForDebugEvent with EXCEPTION_DEBUG_EVENT, later I just ignore all kinds of exceptions by using ContinueDebugEvent with DBG_CONTINUE. However, when I used this console to open some windows applications like wmplayer.exe(not all the time). It will trigger some write access violation at the beginning. But wmplayer.exe surely can handle it well. Because I can prove that using well-known debuggers like windbg or ollydbg to see that. But my console just keeps geting this write access vioaltion all the way to then end(WaitForDebugEvent keeps returning the same exception for ever). It seems that it encounters an infinite loop and never ends. The calling of ContinueDebugEvent with DBG_CONTINUE doesn't seem to be able to ignore this exception. Is there anything wrong in the way I am doing it? Should I add more handling steps to make it work?
Thanks a lot for your help!