3.10.4.1.1 RpcShadow2 (Opnum 0)

The RpcShadow2 method will create a shadow session using the Windows Desktop Sharing API in the target session and return an invitation to that session.

The caller MUST have WINSTATION_SHADOW permission. The other session can be local or on a terminal server. The session to be shadowed 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) and fails if the caller does not have the permission.

 HRESULT RpcShadow2(
   [in] handle_t hBinding,
   [in] ULONG TargetSessionId,
   [in] SHADOW_CONTROL_REQUEST eRequestControl,
   [in] SHADOW_PERMISSION_REQUEST eRequestPermission,
   [out] SHADOW_REQUEST_RESPONSE* pePermission,
   [out, string, size_is(cchInvitation)] 
     LPWSTR pszInvitation,
   [in, range(1,8192)] ULONG cchInvitation
 );

hBinding: The RPC binding handle. For more information, see [MSDN-RPCBIND].

TargetSessionId: The ID of the session to be shadowed.

eRequestControl: Specifies a request for either a UI interaction or a view-only session.

eRequestPermission: Specifies whether to request permission before the shadow session is started. The call is synchronous, so if permission is requested, the call will wait until the user responds to the request.

pePermission: User response to permission request. If the response is anything other than SHADOW_REQUEST_RESPONSE_ALLOW, the shadow session has been denied.

pszInvitation: The output data containing the invitation string for the shadow session. The data returned is a Unicode string in the XML format specified in [MS-RAI] section 2.2.2 that can be used to connect to a session running in the target session (specified by TargetSessionId). The caller must allocate a buffer to hold this data and specify the size of the buffer in cchInvitation.

cchInvitation: The size, in WCHARs (16-bit Unicode), of pszInvitation.

Return Values: The method MUST return S_OK (0x00000000) on success; otherwise, it MUST return an implementation-specific negative value.

Return value/code

Description

0x00000000

S_OK

Successful completion.