RtEnumProcessesEx

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

Syntax

BOOL RtEnumProcessesEx(
    PRTPROCESS_INFORMATION pProcesses,
    DWORD cb,
    DWORD *pBytesReturned,
);

Parameters

pProcesses

A pointer to an array that receives the list of process IDs from the PRTPROCESS_INFORMATION structure.

cb

The size of the pProcessIds array, in bytes.

pBytesReturned

The number of bytes returned in the pProcessIds array.

Return Value

Returns TRUE if the function succeeds, FALSE if the function fails.

To get extended error information, call GetLastError.

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 RtEnumProcessesEx.

To determine how many processes were enumerated, divide the pBytesReturned value by sizeof(RTPROCESS_INFORMATION). 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 RTX64 3.0
Header Rtapi.h
Library RtApi.lib (Windows), Rtx_Rtss.lib (RTSS)

See Also:

PRTPROCESS_INFORMATION