Signal exceptions are special events sent to a thread when the user presses certain key sequences or when another thread or process explicitly initiates the exception. There are three types of signal exceptions:
XCPT_SIGNAL_BREAK
Signal exceptions are sent only to Thread 1 (the main thread) in the process receiving the exception. If an exception handler is registered on Thread 1, it must be prepared to receive signal exceptions. The thread 1 exception handler can always ignore the signal exception by returning XCPT_CONTINUE_SEARCH.
If the thread 1 exception handler is to receive signal exceptions, it must use DosSetSignalExceptionFocus to notify OS/2 that it wants to receive the XCPT_SIGNAL_INTR (Ctrl+C) and XCPT_SIGNAL_BREAK (Ctrl+Break) signals. Otherwise, these exceptions are not passed to the exception handler and the default action-to terminate the process-is taken by OS/2. The thread will get XCPT_SIGNAL_KILLPROC signals whether it uses DosSetSignalExceptionFocus or not.
All three of these signals are delivered by a single exception-XCPT_SIGNAL-and the exception handler for Thread 1 can choose to handle none, some, or all of the signals. The signal being sent can be determined by examining the exception information in EXCEPTIONREPORTRECORD.
The following table provides information about each type of signal.
Signal Exceptions
┌────────────┬──────────────────────────┬───────────────────────────┐│Signal │Symbolic Constant │Description │ ├────────────┼──────────────────────────┼───────────────────────────┤ │Ctrl+Break │XCPT_SIGNAL_BREAK │This exception is sent to │ │ │ │Thread 1 in the current │ │ │ │keyboard-focus process when│ │ │ │a Ctrl+Break key sequence │ │ │ │is received from the │ │ │ │keyboard. The default │ │ │ │action taken by OS/2 for │ │ │ │this exception is forced │ │ │ │process termination. │ ├────────────┼──────────────────────────┼───────────────────────────┤ │Ctrl+C │XCPT_SIGNAL_INTR │This exception is sent to │ │ │ │Thread 1 in the current │ │ │ │keyboard-focus process when│ │ │ │a Ctrl+C key sequence is │ │ │ │received from the keyboard.│ │ │ │The default action taken by│ │ │ │OS/2 for this exception is │ │ │ │forced process termination.│ ├────────────┼──────────────────────────┼───────────────────────────┤ │Kill Process│XCPT_SIGNAL_KILLPROC │This exception is sent to │ │Signal │ │Thread 1 in the process │ │ │ │specified when an │ │ │ │application uses │ │ │ │DosKillProcess. The │ │ │ │XCPT_SIGNAL_KILLPROC signal│ │ │ │exception results from an │ │ │ │action external to the │ │ │ │process. The default action│ │ │ │taken by OS/2 for this │ │ │ │exception is forced process│ │ │ │termination. │ └────────────┴──────────────────────────┴───────────────────────────┘