The information in this article applies to:
SUMMARYAn exception is raised for CTRL+C only if the process is being debugged. The purpose is to make it convenient for the debugger to catch CTRL+C in console applications. For the purposes of this article, the debugger is assumed to be WinDbg. MORE INFORMATION
When the console server detects a CTRL+C, it uses CreateRemoteThread() to
create a thread in the client process to handle the event. This new thread
then raises an exception IF AND ONLY IF the process is being debugged. At
this point, the debugger either handles the exception or it continues the
exception unhandled.
It is not possible to get the debugger to stop the wait from terminating.The "gn" command marks an exception as unhandled and continues the execution. The handler list for the application is searched, as documented for SetConsoleCtrlHandler(). The handler is executed in the thread created by the console server. After the exception is handled, the thread created to handle the event terminates. The debugger will not continue to execute the application if Go On Thread Termination is not enabled (from the Options menu, choose Debug, and select the Go On Thread Termination check box). The thread and process status indicate that the application is stopped at a debug event. As soon as the debugger is given a go command, the dead thread disappears and the application continues execution. There are three cases where CTRL+C doesn't cause the program to stop executing (instead it causes a "page down"):
Additional query words: 3.10 3.50 4.00 95
Keywords : kbAPI kbKernBase TlsWindbg kbGrpKernBase |
Last Reviewed: December 9, 1999 © 2000 Microsoft Corporation. All rights reserved. Terms of Use. |