3.3.4.1.8 RpcGetState (Opnum 7)

The RpcGetState method gets the state of the specified session on the terminal server. This method MUST be called after RpcOpenSession. The caller MUST have WINSTATION_QUERY permission for the session. 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.

 HRESULT RpcGetState(
   [in] SESSION_HANDLE hSession,
   [out] LONG* plState
 );

hSession: The handle to the session returned by RpcOpenSession. This is of type SESSION_HANDLE.

plState:  The current state of the session as defined in WINSTATIONSTATECLASS (section 2.2.1.9).

Return Values: The method MUST return S_OK (0x00000000) on success; otherwise, it MUST return an implementation-specific negative value.

Return value/code

Description

0x00000000

S_OK

Successful completion.