3.7.4.1.15 RpcWinStationWaitSystemEvent (Opnum 16)

The RpcWinStationWaitSystemEvent method waits synchronously for a system event from an RPC API request on behalf of the caller. There is no time-out on the wait. Only one event wait at a time can be posted per server handle. If an event wait is already outstanding and the new request is not a cancel, the new request will fail. The caller is not required to have any specific permission to call RpcWinStationWaitSystemEvent. The first time this is called, the server will create an event block for the handle specified by hServer. This event block will be cleared if RpcWinStationWaitSystemEvent is called with EventMask equal to WEVENT_NONE or if RpcWinStationCloseServer or RpcWinStationCloseServerEx are closed for the handle hServer.

 BOOLEAN RpcWinStationWaitSystemEvent(
   [in] SERVER_HANDLE hServer,
   [out] DWORD* pResult,
   [in] DWORD EventMask,
   [out] DWORD* pEventFlags
 );

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

pResult: If the call was successful, this parameter MUST be STATUS_SUCCESS (0x00000000); otherwise, it MUST be an implementation-specific negative value.

EventMask:  The mask of events for which to wait. It MUST be any bitwise OR combination of the following except for WEVENT_NONE.

Value

Meaning

WEVENT_NONE

0x00000000

 The client requests to clear its event wait block. This MUST be called when completing waiting for the event. When RpcWinStationCloseServer is called for hServer, this method and mask value is called on the client's behalf.

WEVENT_CREATE

0x00000001

Wait for a new session to be created.

WEVENT_DELETE

0x00000002

Wait for an existing session to be deleted.

WEVENT_RENAME

0x00000004

Wait for a session to be renamed.

WEVENT_CONNECT

0x00000008

The session connected to a client.

WEVENT_DISCONNECT

0x00000010

A client disconnected from the session.

WEVENT_LOGON

0x00000020

A user logged on to the session.

WEVENT_LOGOFF

0x00000040

A user logged off from the session.

WEVENT_STATECHANGE

0x00000080

The session state changed.

WEVENT_LICENSE

0x00000100

The license state changed.<183>

WEVENT_ALL

0x7fffffff

Wait for all event types.

WEVENT_FLUSH

0x80000000

Release all waiting clients.

pEventFlags:  Pointer to a variable to receive a bitmask that is a subset of EventMask indicating which events actually occurred during this wait operation.

Return Values:  Returns TRUE if the call succeeded, or 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.