INtime SDK Help
ntxWaitForRtProcess, ntxWaitForRtProcessEx
INtime SDK v6 > About INtime > INtime Kernel > Processes > ntxWaitForRtProcess, ntxWaitForRtProcessEx

Waits for a process indicated by the given handle to terminate.

NTXSTATUS ntxWaitForRtProcess(
    NTXHANDLE hProcess,
    DWORD dwMilliseconds,
    LPDWORD pdwExitCode
);

NTXSTATUS ntxWaitForRtProcessEx( NTXHANDLE hWaitOrProcess, DWORD dwMilliseconds, NTXHANDLE *phProcess, LPDWORD pdwExitCode );

Parameters

hProcess
Handle for the process to be waited on for completion.
hWaitOrProcess
Either a wait handle returned from ntxStartRtProcess, or a handle for the process to be waited on for completion.
dwMilliseconds
The number of milliseconds the calling thread waits:
NO_WAIT The thread does not wait.
INFINITE The thread waits for its request to be fully satisfied.
Any positive integer Calling thread goes to sleep for this many milliseconds, after which it awakes.
pdwExitCode
A pointer to the DWORD location where the process exit code is to be received.
phProcess
A pointer to the DWORD location where the process handle which just exited is to be received.

Remarks

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

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

ntxWaitForRtProcessEx waits for msMilliseconds 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

Returns the status value.

Status

E_OK 0x0000
No exceptional conditions occurred.
E_TIME 0x0001
The timeout elapsed before the desired initialization occurred.
E_TYPE 0x8002
Either hProcess or hWaitOrProcess is not a handle for a process or a wait object
E_EXIST 0x0006
Either hProcess or hWaitOrProcess is not a handle for a valid object

Requirements

Versions Defined in Include Link to
INtime 5.0 intime/nt/include/ntx.h ntx.h ntxext.lib
See Also