DosSendSignalException

Sends a Ctrl+C or a Ctrl+Break signal exception to another process.

Syntax

 * 1) define INCL_DOSEXCEPTIONS
 * 2) include 

PID      pid; ULONG    exception; APIRET   ulrc;

ulrc = DosSendSignalException(pid, exception); 

Parameters

 * pid (PID) - input: The identification of the process that is to receive the signal exception.
 * exception (ULONG) - input: The number of the signal exception to send.
 * Possible values are shown in the following list:
 * 1 XCPT_SIGNAL_INTR
 * 4 XCPT_SIGNAL_BREAK

DosSendSignalException returns one of the following values: 0             NO_ERROR 1             ERROR_INVALID_FUNCTION 156           ERROR_SIGNAL_REFUSED 205           ERROR_NO_SIGNAL_SENT 209           ERROR_INVALID_SIGNAL_NUMBER 303           ERROR_INVALID_PROCID
 * ulrc (APIRET) - returns: Return Code.

Remarks
Do not make Presentation Manager calls from exception handlers.

DosSendSignalException sends either an XCPT_SIGNAL_INTR (Ctrl+C) or an XCPT_SIGNAL_BREAK (Ctrl+Break) signal exception to another process.

For a detailed list of the system exceptions, select System Exceptions.

Example Code
This example sends a signal exception to another process. 
 * 1) define INCL_DOSPROCESS    /* Process and thread values */
 * 2) define INCL_DOSEXCEPTIONS /* DOS exception values      */
 * 3) define INCL_DOSERRORS     /* DOS error values          */
 * 4) include 
 * 5) include 
 * 6) include 
 * 7) include 

int main(USHORT argc, CHAR *argv[] ) {

APIRET     rc          = NO_ERROR; /* Return code                        */ PID        pidToIntr   = 0;        /* Interrupt this process             */

if ( argc < 2 ) { printf("sendsig error: Need to pass PID of thread to interrupt.\n"); return 1; } else { pidToIntr = (PID) atoi ( argv[1] ); } /* endif */

rc = DosSendSignalException ( pidToIntr,           /* Process to interrupt */                                 XCPT_SIGNAL_INTR );   /* Send this signal     */

if (rc != NO_ERROR) { printf("DosSendSignalException error: return code = %u\n", rc); return 1; } else { printf ("DosSendSignalException complete.\n"); } /* endif */

return NO_ERROR; } 

Related Functions

 * DosAcknowledgeSignalException
 * DosEnterMustComplete
 * DosExitMustComplete
 * DosRaiseException
 * DosSetExceptionHandler
 * DosSetSignalExceptionFocus
 * DosUnsetExceptionHandler
 * DosUnwindException