3.7.4.1.7 RpcWinStationSetInformation (Opnum 6)

The RpcWinStationSetInformation method sets various types of configuration information for a session. The caller MUST have the WINSTATION_SET permission. Some operations MUST have more specific permissions as indicated in more detail in the sections that follow. The method checks whether the caller has WINSTATION_SET permission and the specific permission for the configuration information (section 3.1.1) by setting it as the Access Request mask, and fails if the caller does not have the permissions.<171>

 BOOLEAN RpcWinStationSetInformation(
   [in] SERVER_HANDLE hServer,
   [out] DWORD* pResult,
   [in] DWORD LogonId,
   [in] DWORD WinStationInformationClass,
   [in, out, unique, size_is(WinStationInformationLength)] 
     PCHAR pWinStationInformation,
   [in, range(0, 0x8000)] DWORD WinStationInformationLength
 );

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 RpcWinStationSetInformation failed. If the call was successful, this parameter MUST be STATUS_SUCCESS (0x00000000).

Value

Meaning

STATUS_SUCCESS

0x00000000

Successful completion.

STATUS_INVALID_INFO_CLASS

0xC0000003

The class is not recognized.

STATUS_ACCESS_DENIED

0xC0000022

The caller does not have permission for the operation.

LogonId:  The ID of the session for which to set information.

WinStationInformationClass:  The class of data to set. These values come from the enum type WINSTATIONINFOCLASS. See the following sections for the supported classes.

Value

Meaning

WinStationConfiguration

1

Merges configuration data into the terminal server session's data.

The pWinStationInformation argument points to a WINSTACONFIGWIRE structure followed by a USERCONFIG structure. The WinStationInformationLength MUST be sizeof(WINSTACONFIGWIRE) + sizeof(USERCONFIG). The Size field in the USERCONFIG structure inside WINSTACONFIGWIRE MUST be set to sizeof(USERCONFIG) and the Offset set to sizeof(WINSTACONFIGWIRE). The Size field in the NewFields structure inside WINSTACONFIGWIRE MUST be set to 0, and the offset MUST be set to sizeof(WINSTACONFIGWIRE) + sizeof(USERCONFIG).

WinStationPdParams

2

Sets transport protocol driver parameters. The structure coming into the function indicates via SDClass the specific protocol driver for which to set the parameter information.

The pWinStationInformation argument points to a PDPARAMSWIRE structure followed by a PDPARAMS structure. The WinStationInformationLength MUST be sizeof(PDPARAMSWIRE) + sizeof(PDPARAMS). The Size field in SdClassSpecific field inside PDPARAMSWIRE MUST be set to sizeof(PDPARAMS) and the offset MUST be set to sizeof(PDPARAMSWIRE).

WinStationTrace

9

Enables tracing on the lower-level terminal server drivers for this session. This MUST be called by a process running as SYSTEM or as an administrator. The method performs access checks as defined in sections 3.1.2 and 3.1.3. The method fails if both checks fail.

The pWinStationInformation argument points to a TS_TRACE structure, and WinStationInformationLength MUST be sizeof(TS_TRACE).

WinStationBeep

10

Sends a beep to the session.

The pWinStationInformation argument points to a BEEPINPUT structure, and WinStationInformationLength MUST be sizeof(BEEPINPUT).

WinStationEncryptionOff

11

Turns encryption off.<172>

WinStationEncryptionPerm

12

Turns encryption permanently on.<173>

WinStationNtSecurity

13

Sends logon service in the session a CTRL+ALT+DEL message.<174>

The pWinStationInformation argument and WinStationInformationLength are not used for this class. Set them to dummy valid data, however, as there always has to be something in these parameters.

WinStationInitialProgram

17

Not used.

WinStationSystemTrace

19

Enables global tracing on the lower-level terminal server drivers for this session. This MUST be called by a process running as SYSTEM or as an administrator. The method performs access checks as defined in sections 3.1.2 and 3.1.3. The method fails if both checks fail.

The pWinStationInformation argument points to a TS_TRACE structure, and WinStationInformationLength MUST be sizeof(TS_TRACE).

WinStationClientData

21

Sends data to the terminal server client.

WinStationInformationLength represents the complete length of all items to send and MUST be at least sizeof(VARDATA_WIRE) + sizeof(WINSTATIONCLIENTDATA ). Otherwise, STATUS_INFO_LENGTH_MISMATCH (as specified in [MS-ERREF]) is returned in pResult. If the data is larger than this but still less than what is expected, STATUS_INVALID_USER_BUFFER (as specified in [MS-ERREF]) is returned in pResult.

The pWinStationInformation points to a VARDATA_WIRE structure followed by the WINSTATIONCLIENTDATA structure itself. The Size field in the VARDATA_WIRE structure MUST be set to sizeof(WINSTATIONCLIENTDATA) and the Offset set to sizeof(VARDATA_WIRE).

WinStationSecureDesktopEnter

22

Not used.

WinStationSecureDesktopExit

23

Not used.

WinStationShadowInfo

26

Not used.

WinStationLockedState

28

Notifies processes of the new locked state of the session. TRUE or FALSE. The pWinStationInformation argument points to a BOOL variable. WinStationInformationLength MUST be sizeof (BOOL).

WinStationDisallowAutoReconnect

32

Allows or disallows auto-reconnect behavior for this session, TRUE or FALSE. This MUST be called by a process running as SYSTEM.

The pWinStationInformation argument points to a BOOL variable. WinStationInformationLength MUST be sizeof (BOOL).

pWinStationInformation: Pointer to buffer allocated by the caller in which the data for the operation is located. The data type or structure to which pWinStationInformation points is determined by the value of WinStationInformationClass.

WinStationInformationLength: Size of the data pointed to by pWinStationInformation, in bytes.

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.