Home | Info | Community | Development | myReactOS | Contact Us
ReactOS Development > Doxygen_cwait.c
Go to the documentation of this file.
00001 /* 00002 * COPYRIGHT: See COPYING in the top level directory 00003 * PROJECT: ReactOS system libraries 00004 * FILE: lib/msvcrt/process/cwait.c 00005 * PURPOSE: Waits for a process to exit 00006 * PROGRAMER: Ariadne 00007 * UPDATE HISTORY: 00008 * 04/03/99: Created 00009 */ 00010 00011 #include <precomp.h> 00012 00013 /* 00014 * @implemented 00015 */ 00016 int _cwait(int* pnStatus, int hProc, int nAction) 00017 { 00018 DWORD ExitCode; 00019 00020 nAction = 0; 00021 if (WaitForSingleObject((void*)ULongToPtr(hProc), INFINITE) != WAIT_OBJECT_0) { 00022 _set_errno(ECHILD); 00023 return -1; 00024 } 00025 00026 if (!GetExitCodeProcess((void*)ULongToPtr(hProc), &ExitCode)) 00027 return -1; 00028 if (pnStatus != NULL) 00029 *pnStatus = (int)ExitCode; 00030 CloseHandle((HANDLE)ULongToPtr(hProc)); 00031 return hProc; 00032 } Generated on Fri May 25 2012 04:34:56 for ReactOS by
1.7.6.1
|