RtEnumProcesses

The RtEnumProcesses function retrieves the process identifier for each RTSS process object.

Syntax

Copy
BOOL RtEnumProcesses(
    [in]    DWORD *pProcessIds,
    [in]    DWORD cb,
    [out]   DWORD *pBytesReturned,
);

Parameters

[in] pProcessIds

A pointer to an array that receives the list of RTSS process identifiers.

[in] cb

The size of the pProcessIds array, in bytes.

[out] pBytesReturned

The number of bytes returned in the pProcessIds array.

Return Value

If the function succeeds, it returns TRUE. If the function fails, it returns FALSE. Call GetLastError to obtain an error code.

Remarks

It is a good idea to use a large array, because it is hard to predict how many processes there will be at the time you call RtEnumProcesses.

To determine how many processes were enumerated, divide the pBytesReturned value by sizeof(DWORD). There is no indication given when the buffer is too small to store all process identifiers. Therefore, if pBytesReturned equals cb, consider retrying the call with a larger array.

To obtain process handles for the processes whose identifiers you have just obtained, call the RtOpenProcess function.

Requirements

Minimum supported version Header Library

wRTOS 1.0 SDK

RtApi.h

RtApi.lib (Windows), Startup.lib (RTSS)