184.108.40.206.3 RpcFilterByState (Opnum 2)
The RpcFilterByState method adds a filter to the session enumeration result, running on a terminal server, based on the state of the sessions. This method MUST be called after RpcOpenEnum and before RpcGetEnumResult or RpcGetEnumResultEx. No special permissions are required to call this method.
HRESULT RpcFilterByState( [in] ENUM_HANDLE hEnum, [in] LONG State, [in] BOOL bInvert );
State: The session state, as specified in section 220.127.116.11.8, to be used to filter out the enumeration result. Only the sessions with the specified state will be returned.
bInvert: Set to TRUE to imply that the result of the comparison during enumeration will be inverted, FALSE otherwise.
Return Values: The method MUST return S_OK (0x00000000) on success; otherwise, it MUST return an implementation-specific negative value.