INtime SDK Help
WaitForRtProcess, WaitForRtProcessEx
INtime SDK v7.1 > About INtime > INtime Kernel > Processes > WaitForRtProcess, WaitForRtProcessEx

Waits for a previously-loaded process to exit and returns the exit code to the caller.

BOOLEAN WaitForRtProcess(
    RTHANDLE hProcess, 
    DWORD msWait,
    LPDWORD pdwExitCode
);

RTHANDLE WaitForRtProcessEx( RTHANDLE hWaitOrProcess, DWORD msWait, LPDWORD pdwExitCode );

Parameters

hProcess
Handle for the process to be waited for.
hWaitOrProcess
Wait handle returned from a previous call to StartRtProcess, or a handle for the process to be waited for.
msWait
The number of milliseconds the caller waits for the process to exit.
pdwExitCode
A pointer to a DWORD variable where the exit value of the process is returned on successful completion of the call.

Remarks

These calls wait for msWait milliseconds for the process to exit and returns the exit code from the process.

The WaitForRtProcessEx call, if passed a wait handle returned from a previous call to StartRtProcess(), also waits for the process to complete and returns the exit code, and also returns the handle of the process which just completed.

WaitForRtProcessEx waits for msWait milliseconds for the process to exit.

If the process exits before the call times out, then the process exit code is returned via pdwExitCode. The exit code is the value of the parameter passed to exit(). If the process exited using ExitRtProcess instead of using exit() then the exit code returned is 0 (zero).

If the process was not loaded but was built in to the kernel, the call fails with status E_CONTEXT.

If the call times out before the process exist the call fails with status E_TIME.

Return Values

TRUE
Success
FALSE
To determine the status, call GetLastRtError

Status

E_EXIST
The hProcess parameter does not contain a valid handle value.
E_TYPE
The hProcess parameter does not contain a handle for a process.
E_TIME
The target process did not exit within the time specified.

Requirements

Versions Defined in Include Link to
INtime 4.1 intime/rt/include/rtbase.h rt.h rt.lib
See Also