mirror of
https://github.com/reactos/reactos.git
synced 2025-07-24 17:43:57 +00:00
Create a branch for header work.
svn path=/branches/header-work/; revision=45691
This commit is contained in:
parent
14fe274b1c
commit
9ea495ba33
19538 changed files with 0 additions and 1063950 deletions
32
lib/sdk/crt/process/_cwait.c
Normal file
32
lib/sdk/crt/process/_cwait.c
Normal file
|
@ -0,0 +1,32 @@
|
|||
/*
|
||||
* COPYRIGHT: See COPYING in the top level directory
|
||||
* PROJECT: ReactOS system libraries
|
||||
* FILE: lib/msvcrt/process/cwait.c
|
||||
* PURPOSE: Waits for a process to exit
|
||||
* PROGRAMER: Ariadne
|
||||
* UPDATE HISTORY:
|
||||
* 04/03/99: Created
|
||||
*/
|
||||
|
||||
#include <precomp.h>
|
||||
|
||||
/*
|
||||
* @implemented
|
||||
*/
|
||||
int _cwait(int* pnStatus, int hProc, int nAction)
|
||||
{
|
||||
DWORD ExitCode;
|
||||
|
||||
nAction = 0;
|
||||
if (WaitForSingleObject((void*)ULongToPtr(hProc), INFINITE) != WAIT_OBJECT_0) {
|
||||
__set_errno(ECHILD);
|
||||
return -1;
|
||||
}
|
||||
|
||||
if (!GetExitCodeProcess((void*)ULongToPtr(hProc), &ExitCode))
|
||||
return -1;
|
||||
if (pnStatus != NULL)
|
||||
*pnStatus = (int)ExitCode;
|
||||
CloseHandle((HANDLE)ULongToPtr(hProc));
|
||||
return hProc;
|
||||
}
|
Loading…
Add table
Add a link
Reference in a new issue