[Toc][Index]

DosKillProcess


Bindings:  C, MASM 

This call flags a process to terminate and returns the termination code to 
its parent. 
 DosKillProcess    (ActionCode, ProcessID) 
 
 ActionCode (USHORT) - input 
    The processes to be flagged for termination. 
    Value     Definition 
    0         A process and all its descendant processes. The process must 
              be either the current process or a child process created by 
              the current process. (Detached processes cannot be flagged 
              for termination.) After the indicated process terminates, 
              its descendants are flagged for termination. 
    1         Any process.  Only the indicated process is flagged for 
              termination. 
 ProcessID (PID) - input 
    Process ID of the process, or root process of the process tree to be 
    flagged for termination. 
 rc (USHORT) - return 
    Return code descriptions are: 
    0         NO_ERROR 
    13        ERROR_INVALID_DATA 
    303       ERROR_INVALID_PROCID 
    305       ERROR_NOT_DESCENDANT 
 
 Remarks 
 DosKillProcess allows a process to send the termination signal SIGTERM to 
 another process or group of processes.  The default action of the system 
 is to terminate each of the processes.  A process can intercept this 
 action by installing a signal handler for SIGTERM with DosSetSigHandler. 
  This gives the process the opportunity to clean up its files before it 
 terminates with DosExit. 
 If there is no signal handler, the effect on the process is the same as 
 if one of its threads had issued DosExit for the entire process. All file 
 buffers are flushed and the handles opened by the process are closed. 
 However, any internal buffers managed by programs external to OS/2 are 
 not flushed.  An example of such a buffer could be a C language library's 
 internal character buffer. 
 If a parent process is waiting for a child process to end because of a 
 DosCwait request, and the child is sent the SIGTERM signal but does not 
 have a SIGTERM signal handler installed, the DosCwait request returns the 
 "unintercepted DosKillProcess" termination code. 

Created using Inf-PHP v.2 (c) 2003 Yuri Prokushev
Created using Inf-HTML v.0.9b (c) 1995 Peter Childs