<div class="content" name="RpcWinStationSetInformation" uuid="2a5ee131-a1dd-44c7-9880-98df708061ea"><p>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 <span><a href="4507e852-be3d-45b6-bc47-8ca0b552c94d" data-linktype="relative-path">3.1.1</a></span>) by setting
it as the Access Request mask, and fails if the caller does not have the
permissions.<a id="Appendix_A_Target_173"></a><a aria-label="Product behavior note 173" href="7ce7f717-461b-4f18-9829-6690168c7707#Appendix_A_173" data-linktype="relative-path">&lt;173&gt;</a></p><dl>
<dd>
<div><pre> 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
 );
</pre></div>
</dd></dl><p><b>hServer: </b>Handle to the server object. This is
of type <span><a href="49484cdf-2feb-4de9-a588-5d01cf8995dc" data-linktype="relative-path">SERVER_HANDLE</a></span>. <i>hServer</i>
MUST be obtained from a previous call to <span><a href="fd6f339d-f5dd-452c-a9a9-ec753c22a36a" data-linktype="relative-path">RpcWinStationOpenServer</a></span>.</p><p><b>pResult: </b>Failure error code if the call to
RpcWinStationSetInformation failed. If the call was successful, this parameter
MUST be STATUS_SUCCESS (0x00000000).</p><dl>
<dd>
<table><thead>
  <tr>
   <th>
   <p>Value</p>
   </th>
   <th>
   <p>Meaning</p>
   </th>
  </tr>
 </thead><tbody><tr>
  <td>STATUS_SUCCESS 0x00000000</td>
  <td>Successful completion.</td>
 </tr><tr>
  <td>STATUS_INVALID_INFO_CLASS 0xC0000003</td>
  <td>The class is not recognized.</td>
 </tr><tr>
  <td>STATUS_ACCESS_DENIED 0xC0000022</td>
  <td>The caller does not have permission for the operation.</td>
 </tr></tbody></table>
</dd></dl><p><b>LogonId: </b> The ID of the session for which to
set information. </p><p><b>WinStationInformationClass: </b> The class of data
to set. These values come from the enum type <span><a href="f333c223-de8a-46e1-a83e-79cbdab92371" data-linktype="relative-path">WINSTATIONINFOCLASS</a></span>.
See the following sections for the supported classes. </p><dl>
<dd>
<table><thead>
  <tr>
   <th>
   <p>Value</p>
   </th>
   <th>
   <p>Meaning</p>
   </th>
  </tr>
 </thead><tbody><tr>
  <td>WinStationConfiguration 1</td>
  <td>Merges configuration data into the terminal server session&#39;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).</td>
 </tr><tr>
  <td>WinStationPdParams 2</td>
  <td>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).</td>
 </tr><tr>
  <td>WinStationTrace 9</td>
  <td>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).</td>
 </tr><tr>
  <td>WinStationBeep 10</td>
  <td>Sends a beep to the session. The pWinStationInformation argument points to a BEEPINPUT structure, and WinStationInformationLength MUST be sizeof(BEEPINPUT).</td>
 </tr><tr>
  <td>WinStationEncryptionOff 11</td>
  <td>Turns encryption off.&lt;174&gt;</td>
 </tr><tr>
  <td>WinStationEncryptionPerm 12</td>
  <td>Turns encryption permanently on.&lt;175&gt;</td>
 </tr><tr>
  <td>WinStationNtSecurity 13</td>
  <td>Sends logon service in the session a CTRL+ALT+DEL message.&lt;176&gt; 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.</td>
 </tr><tr>
  <td>WinStationInitialProgram 17</td>
  <td>Not used.</td>
 </tr><tr>
  <td>WinStationSystemTrace 19</td>
  <td>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).</td>
 </tr><tr>
  <td>WinStationClientData 21</td>
  <td>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).</td>
 </tr><tr>
  <td>WinStationSecureDesktopEnter 22</td>
  <td>Not used.</td>
 </tr><tr>
  <td>WinStationSecureDesktopExit 23</td>
  <td>Not used.</td>
 </tr><tr>
  <td>WinStationShadowInfo 26</td>
  <td>Not used.</td>
 </tr><tr>
  <td>WinStationLockedState 28</td>
  <td>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).</td>
 </tr><tr>
  <td>WinStationDisallowAutoReconnect 32</td>
  <td>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).</td>
 </tr></tbody></table>
</dd></dl><p><b>pWinStationInformation: </b>Pointer to buffer
allocated by the caller in which the data for the operation is located. The
data type or structure to which <i>pWinStationInformation</i> points is
determined by the value of <i>WinStationInformationClass</i>.</p><p><b>WinStationInformationLength: </b>Size of the data
pointed to by <i>pWinStationInformation</i>, in bytes.</p><p><b>Return Values: </b> Returns TRUE if the call
succeeded, or FALSE if the method failed. On failure, <i>pResult</i> indicates
the failure status code.</p><dl>
<dd>
<table><thead>
  <tr>
   <th>
   <p>Return value/code</p>
   </th>
   <th>
   <p>Description</p>
   </th>
  </tr>
 </thead><tbody><tr>
  <td>0x01 TRUE</td>
  <td>Successful completion.</td>
 </tr><tr>
  <td>0x00 FALSE</td>
  <td>Method call failed.</td>
 </tr></tbody></table>
</dd></dl><p> </p></div>