<div class="content" name="RpcWinStationRename" uuid="84c75092-c96a-4bee-ac50-8f1632bc2f7b"><p>The RpcWinStationRename method enables the caller to change
the name of the session. The caller MUST have DELETE permission, as specified
in <span><a href="../ms-dtyp/cca27429-5689-4a16-b2b4-9325d93e4ba2" data-linktype="relative-path">[MS-DTYP]</a></span>
section <span><a href="../ms-dtyp/7a53f60e-e730-4dfe-bbe9-b21b62eb790b" data-linktype="relative-path">2.4.3</a></span>,
on the session that is identified by the old name.<a id="Appendix_A_Target_162"></a><a aria-label="Product behavior note 162" href="7ce7f717-461b-4f18-9829-6690168c7707#Appendix_A_162" data-linktype="relative-path">&lt;162&gt;</a></p><dl>
<dd>
<div><pre> BOOLEAN RpcWinStationRename(
   [in] SERVER_HANDLE hServer,
   [out] DWORD* pResult,
   [in, size_is(NameOldSize)] PWCHAR pWinStationNameOld,
   [in, range(0, 256)] DWORD NameOldSize,
   [in, size_is(NameNewSize)] PWCHAR pWinStationNameNew,
   [in, range(0, 256)] DWORD NameNewSize
 );
</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>. The <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> The failure error code if the call
to RpcWinStationRename fails. If the call is successful, this parameter MUST be
STATUS_SUCCESS (0x00000000), as specified in <span><a href="../ms-erref/1bc92ddf-b79e-413c-bbaa-99a5281a6c90" data-linktype="relative-path">[MS-ERREF]</a></span>.</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>The call is successful.</td>
 </tr><tr>
  <td>STATUS_ACCESS_DENIED 0xC0000022</td>
  <td>The caller does not have DELETE permission.</td>
 </tr><tr>
  <td>STATUS_CTX_WINSTATION_NAME_INVALID 0xC00A0001</td>
  <td>The sizes are 0, one or the other of the pointers is NULL, or a pointer is invalid.</td>
 </tr><tr>
  <td>STATUS_CTX_WINSTATION_NOT_FOUND 0xC00A0015</td>
  <td>No session exists with the name given in pWinStationNameOld.</td>
 </tr><tr>
  <td>STATUS_CTX_WINSTATION_NAME_COLLISION 0xC00A0016</td>
  <td>A session already exists with the name given in pWinStationNameNew.</td>
 </tr></tbody></table>
</dd></dl><p><b>pWinStationNameOld: </b> The pointer to a string
that is the old name of the session being renamed.</p><p><b>NameOldSize: </b> The length of the string in
characters pointed to by <i>pWinStationNameOld</i> including the terminating
NULL character.</p><p><b>pWinStationNameNew: </b> The pointer to a string
that is the new name of the session being renamed.</p><p><b>NameNewSize: </b>The length of the string in
characters pointed to by <i>pWinStationNameNew</i> including the terminating
NULL character. Name MUST be shorter than or equal to <span><a href="ce70794f-2138-43e8-bf6c-2c147887d6a2" data-linktype="relative-path">WINSTATIONNAME_LENGTH</a></span>.</p><p><b>Return Values: </b> Returns TRUE if the call
succeeded, or FALSE if the method failed. On failure, pResult 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>