DosWaitChild

DosWaitChild waits for an asynchronous child process to end and gets its process identifier, termination code and result code. It is also possible to check if the child process has already ended and get information about already ended child processes.

Syntax
DosWaitChild( ulAction, ulWait, pReturnCodes, ppidOut, pidIn )

Parameters

 * ulAction (ULONG): Specifies which process the current thread is waiting for to end. Values are:
 * 0 - DCWA_PROCESS - The process indicated by pidIn
 * 1 - DCWA_PROCESSTREE - The process indicated by pidIn and all of its child processes


 * ulWait (ULONG):Specifies whether to return if no child process ends. Values are:
 * 0 - DCWW_WAIT - Wait if no child process ends or until no child processes are outstanding.
 * 1 - DCWW_NOWAIT Do not wait for child processes to end


 * pReturnCode (PRESULTCODES): Pointer to a RESULTCODES structure holding exit information from the ending process. If no processes furnish a result code, the system provides the value -1.
 * ppidOut (PPID): ointer to the process ID of the ending process.
 * pidIn (PID):Process ID of the child process (and all its descendants) whose termination is being waited for. If 0 then any child process that was executed with a return code, or until there are no more child processes of any type to wait for.

Returns
0 NO_ERROR 13 ERROR_INVALID_DATA 128 ERROR_WAIT_NO_CHILDREN 129 ERROR_CHILD_NOT_COMPLETE 184 ERROR_NO_CHILD_PROCESS 303 ERROR_INVALID_PROCID
 * APIRET rc