3.7.4.1.22 RpcWinStationGetAllProcesses (Opnum 43)

The RpcWinStationGetAllProcesses method retrieves the list of processes running on the server machine. Only the processes from the sessions on which the user has WINSTATION_QUERY permission will be retrieved. The method checks whether the caller has WINSTATION_QUERY permission (section 3.1.1) by setting it as the Access Request mask, and fails if the caller does not have the permission.

 BOOLEAN RpcWinStationGetAllProcesses(
   [in] SERVER_HANDLE hServer,
   [out] DWORD* pResult,
   [in] ULONG Level,
   [in, out] BOUNDED_ULONG* pNumberOfProcesses,
   [out, size_is(,*pNumberOfProcesses)] 
     PTS_ALL_PROCESSES_INFO* ppTsAllProcessesInfo
 );

hServer: Handle to the server object. This is of type SERVER_HANDLE. The hServer argument MUST be obtained from a previous call to RpcWinStationOpenServer.

pResult:  Failure error code if the call to RpcWinStationGetAllProcesses failed. If the call was successful, this parameter MUST be STATUS_SUCCESS (0x00000000).

Value

Meaning

STATUS_SUCCESS

0x00000000

The call was successful.

STATUS_ACCESS_DENIED

0xC0000022

The caller does not have permission.

Level:  MUST be 0. Any other value will lead to FALSE being returned by the method.

pNumberOfProcesses:  The number of processes requested by the caller. On return, this indicates the number of processes actually stored in the ppTsAllProcessesInfo parameter.

ppTsAllProcessesInfo:  Pointer to an array of processes allocated and returned by the method. *ppTsAllProcessesInfo is allocated by the method to be an array of TS_ALL_PROCESSES_INFO structures. The array returned by the method MUST be freed by the caller.

Return Values:  Returns TRUE if the call succeeded, and FALSE if the lookup failed. On failure, pResult indicates the failure status code.

Return value/code

Description

0x01

TRUE

Successful completion.

0x00

FALSE

Method call failed.