<div class="content" name="RpcWinStationShadow" uuid="8115399d-f159-477f-a871-522fde0cc32a"><p>The RpcWinStationShadow method starts a shadow (remote
control) operation of another <span><a href="c41d3367-04c9-4c93-babf-9b5de834eb29#gt_b416f72e-cf04-4d80-bf93-f5753f3b0998" data-linktype="relative-path">terminal server</a></span>
session. If the method succeeds, the state of the session that started the
shadow operation is State_Shadow and the state of the session being shadowed is
State_Active as defined in the <b>WINSTATIONSTATECLASS</b> enumeration (section
<span><a href="b619d8aa-4e8a-4716-954e-a4d596ed37f8" data-linktype="relative-path">2.2.1.9</a></span>).</p><p>The caller MUST have WINSTATION_SHADOW permission. The other
session can be local or on a terminal server. The method MUST be called from
inside a remote terminal server session. The session to shadow MUST be in the
active state with a user logged on. The method checks whether the caller has
WINSTATION_SHADOW permission (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
permission.<a id="Appendix_A_Target_186"></a><a aria-label="Product behavior note 186" href="7ce7f717-461b-4f18-9829-6690168c7707#Appendix_A_186" data-linktype="relative-path">&lt;186&gt;</a></p><dl>
<dd>
<div><pre> BOOLEAN RpcWinStationShadow(
   [in] SERVER_HANDLE hServer,
   [out] DWORD* pResult,
   [in] DWORD LogonId,
   [in, unique, size_is(NameSize)] 
     PWCHAR pTargetServerName,
   [in, range(0, 1024)] DWORD NameSize,
   [in] DWORD TargetLogonId,
   [in] BYTE HotKeyVk,
   [in] USHORT HotkeyModifiers
 );
</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>
argument value 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>If the call was successful, this
parameter MUST be STATUS_SUCCESS (0x00000000); otherwise, it MUST be an
implementation-specific negative value.</p><p><b>LogonId: </b>The ID of the session to shadow from.</p><p><b>pTargetServerName: </b>The shadow target server
name. Set <i>pTargetServerName</i> to NULL to indicate the current server.</p><p><b>NameSize: </b>The size of the string <i>pTargetServerName</i>,
in bytes. MAY be 0 if <i>pTargetServerName</i> is NULL.</p><p><b>TargetLogonId: </b>The shadow target session ID.</p><p><b>HotKeyVk: </b>The virtual key code of the key to
press to stop shadowing. This key is used in combination with the <i>HotkeyModifiers</i>
parameter.</p><p><b>HotkeyModifiers: </b>The virtual modifier that
signifies the modifier key, such as shift or control, to press to stop
shadowing. The modifier key is used in combination with the key signified by
the <i>HotKeyVk</i> parameter. This parameter MAY be any combination of
KBDSHIFT, KBDCTRL, and KBDALT to indicate the SHIFT key, the CTRL key, and the
ALT key, respectively.</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>