3.7.4.1.16 RpcWinStationShadow (Opnum 17)

The RpcWinStationShadow method starts a shadow (remote control) operation of another terminal server 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 WINSTATIONSTATECLASS enumeration (section 2.2.1.9).

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 3.1.1) by setting it as the Access Request mask, and fails if the caller does not have the permission.<184>

 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
 );

hServer: Handle to the server object. This is of type SERVER_HANDLE. The hServer argument value 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.

LogonId: The ID of the session to shadow from.

pTargetServerName: The shadow target server name. Set pTargetServerName to NULL to indicate the current server.

NameSize: The size of the string pTargetServerName, in bytes. MAY be 0 if pTargetServerName is NULL.

TargetLogonId: The shadow target session ID.

HotKeyVk: The virtual key code of the key to press to stop shadowing. This key is used in combination with the HotkeyModifiers parameter.

HotkeyModifiers: 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 HotKeyVk 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.

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.