3.7.4.1.21 RpcWinStationTerminateProcess (Opnum 37)

The RpcWinStationTerminateProcess method terminates the specified process. An attempt is made to enable the SE_DEBUG_PRIVILEGE privilege to kill processes not owned by the current user, including processes running in other terminal server sessions. Caller MUST have terminate permission to terminate the process.

 BOOLEAN RpcWinStationTerminateProcess(
   [in] SERVER_HANDLE hServer,
   [out] DWORD* pResult,
   [in] DWORD ProcessId,
   [in] DWORD ExitCode
 );

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

pResult:  Failure error code if the call to RpcWinStationTerminateProcess failed. If the call was successful, this parameter MUST be STATUS_SUCCESS (0x00000000), as specified in [MS-ERREF].

Value

Meaning

STATUS_SUCCESS

0x00000000

The call succeeded.

STATUS_ACCESS_DENIED

0xC0000022

The caller does not have permission to terminate the process.

ProcessId: The ID of the process to terminate.

ExitCode: The exit code to be used by the process and threads that are terminated as a result of this call.

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

Return value/code

Description

0x01

TRUE

Successful completion.

0x00

FALSE

Method call failed.