2 * COPYRIGHT: See COPYING in the top level directory
3 * PROJECT: ReactOS system libraries
4 * FILE: lib/crtdll/process/cwait.c
5 * PURPOSE: Waits for a process to exit
6 * PROGRAMER: Boudewijn Dekker
11 #include <crtdll/process.h>
12 #include <crtdll/errno.h>
13 #include <crtdll/internal/file.h>
15 int _cwait (int* pnStatus, int hProc, int nAction)
20 if ( WaitForSingleObject((void *)hProc,INFINITE) != WAIT_OBJECT_0 ) {
25 if ( !GetExitCodeProcess((void *)hProc,&ExitCode) )
28 *pnStatus = (int)ExitCode;