FreeRDP
shadow_client.c File Reference
#include <freerdp/config.h>
#include <winpr/crt.h>
#include <winpr/assert.h>
#include <winpr/file.h>
#include <winpr/path.h>
#include <winpr/synch.h>
#include <winpr/thread.h>
#include <winpr/sysinfo.h>
#include <winpr/interlocked.h>
#include <freerdp/log.h>
#include <freerdp/channels/drdynvc.h>
#include "shadow.h"

Macros

#define TAG   CLIENT_TAG("shadow")
 

Functions

static INLINE BOOL shadow_client_rdpgfx_new_surface (rdpShadowClient *client)
 
static INLINE BOOL shadow_client_rdpgfx_release_surface (rdpShadowClient *client)
 
static INLINE BOOL shadow_client_rdpgfx_reset_graphic (rdpShadowClient *client)
 
static INLINE void shadow_client_free_queued_message (void *obj)
 
static void shadow_client_context_free (freerdp_peer *peer, rdpContext *context)
 
static BOOL shadow_client_context_new (freerdp_peer *peer, rdpContext *context)
 
static INLINE void shadow_client_mark_invalid (rdpShadowClient *client, UINT32 numRects, const RECTANGLE_16 *rects)
 
static INLINE BOOL shadow_client_recalc_desktop_size (rdpShadowClient *client)
 
static BOOL shadow_client_capabilities (freerdp_peer *peer)
 
static void shadow_reset_desktop_resize (rdpShadowClient *client)
 
static BOOL shadow_send_desktop_resize (rdpShadowClient *client)
 
static BOOL shadow_client_post_connect (freerdp_peer *peer)
 
static INLINE void shadow_client_convert_rects (rdpShadowClient *client, RECTANGLE_16 *dst, const RECTANGLE_16 *src, UINT32 numRects)
 
static BOOL shadow_client_refresh_request (rdpShadowClient *client)
 
static BOOL shadow_client_refresh_rect (rdpContext *context, BYTE count, const RECTANGLE_16 *areas)
 
static BOOL shadow_client_suppress_output (rdpContext *context, BYTE allow, const RECTANGLE_16 *area)
 
static BOOL shadow_client_activate (freerdp_peer *peer)
 
static BOOL shadow_client_logon (freerdp_peer *peer, const SEC_WINNT_AUTH_IDENTITY *identity, BOOL automatic)
 
static INLINE void shadow_client_common_frame_acknowledge (rdpShadowClient *client, UINT32 frameId)
 
static BOOL shadow_client_surface_frame_acknowledge (rdpContext *context, UINT32 frameId)
 
static UINT shadow_client_rdpgfx_frame_acknowledge (RdpgfxServerContext *context, const RDPGFX_FRAME_ACKNOWLEDGE_PDU *frameAcknowledge)
 
static BOOL shadow_are_caps_filtered (const rdpSettings *settings, UINT32 caps)
 
static UINT shadow_client_send_caps_confirm (RdpgfxServerContext *context, rdpShadowClient *client, const RDPGFX_CAPS_CONFIRM_PDU *pdu)
 
static BOOL shadow_client_caps_test_version (RdpgfxServerContext *context, rdpShadowClient *client, BOOL h264, const RDPGFX_CAPSET *capsSets, UINT32 capsSetCount, UINT32 capsVersion, UINT *rc)
 
static UINT shadow_client_rdpgfx_caps_advertise (RdpgfxServerContext *context, const RDPGFX_CAPS_ADVERTISE_PDU *capsAdvertise)
 
static INLINE UINT32 rdpgfx_estimate_h264_avc420 (RDPGFX_AVC420_BITMAP_STREAM *havc420)
 
static BOOL shadow_client_send_surface_gfx (rdpShadowClient *client, const BYTE *pSrcData, UINT32 nSrcStep, UINT32 SrcFormat, UINT16 nXSrc, UINT16 nYSrc, UINT16 nWidth, UINT16 nHeight)
 
static BOOL shadow_client_send_surface_bits (rdpShadowClient *client, BYTE *pSrcData, UINT32 nSrcStep, UINT16 nXSrc, UINT16 nYSrc, UINT16 nWidth, UINT16 nHeight)
 
static BOOL shadow_client_send_bitmap_update (rdpShadowClient *client, BYTE *pSrcData, UINT32 nSrcStep, UINT16 nXSrc, UINT16 nYSrc, UINT16 nWidth, UINT16 nHeight)
 
static BOOL shadow_client_send_surface_update (rdpShadowClient *client, SHADOW_GFX_STATUS *pStatus)
 
static BOOL shadow_client_send_resize (rdpShadowClient *client, SHADOW_GFX_STATUS *pStatus)
 
static BOOL shadow_client_surface_update (rdpShadowClient *client, REGION16 *region)
 
static INLINE BOOL shadow_client_no_surface_update (rdpShadowClient *client, SHADOW_GFX_STATUS *pStatus)
 
static int shadow_client_subsystem_process_message (rdpShadowClient *client, wMessage *message)
 
static DWORD WINAPI shadow_client_thread (LPVOID arg)
 
BOOL shadow_client_accepted (freerdp_listener *listener, freerdp_peer *peer)
 
static void shadow_msg_out_addref (wMessage *message)
 
static void shadow_msg_out_release (wMessage *message)
 
static BOOL shadow_client_dispatch_msg (rdpShadowClient *client, wMessage *message)
 
BOOL shadow_client_post_msg (rdpShadowClient *client, void *context, UINT32 type, SHADOW_MSG_OUT *msg, void *lParam)
 
int shadow_client_boardcast_msg (rdpShadowServer *server, void *context, UINT32 type, SHADOW_MSG_OUT *msg, void *lParam)
 
int shadow_client_boardcast_quit (rdpShadowServer *server, int nExitCode)
 

Macro Definition Documentation

◆ TAG

#define TAG   CLIENT_TAG("shadow")

FreeRDP: A Remote Desktop Protocol Implementation

Copyright 2014 Marc-Andre Moreau marca.nosp@m.ndre.nosp@m..more.nosp@m.au@g.nosp@m.mail..nosp@m.com Copyright 2017 Armin Novak armin.nosp@m..nov.nosp@m.ak@th.nosp@m.inca.nosp@m.st.co.nosp@m.m Copyright 2017 Thincast Technologies GmbH

Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at

http://www.apache.org/licenses/LICENSE-2.0

Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License.

Function Documentation

◆ rdpgfx_estimate_h264_avc420()

static INLINE UINT32 rdpgfx_estimate_h264_avc420 ( RDPGFX_AVC420_BITMAP_STREAM havc420)
static
Here is the caller graph for this function:

◆ shadow_are_caps_filtered()

static BOOL shadow_are_caps_filtered ( const rdpSettings *  settings,
UINT32  caps 
)
static
Here is the call graph for this function:
Here is the caller graph for this function:

◆ shadow_client_accepted()

BOOL shadow_client_accepted ( freerdp_listener *  instance,
freerdp_peer *  client 
)

FreeRDP: A Remote Desktop Protocol Implementation

Copyright 2014 Marc-Andre Moreau marca.nosp@m.ndre.nosp@m..more.nosp@m.au@g.nosp@m.mail..nosp@m.com

Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at

http://www.apache.org/licenses/LICENSE-2.0

Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License.

Here is the call graph for this function:
Here is the caller graph for this function:

◆ shadow_client_activate()

static BOOL shadow_client_activate ( freerdp_peer *  peer)
static
Here is the call graph for this function:
Here is the caller graph for this function:

◆ shadow_client_boardcast_msg()

int shadow_client_boardcast_msg ( rdpShadowServer *  server,
void *  context,
UINT32  type,
SHADOW_MSG_OUT *  msg,
void *  lParam 
)
Here is the call graph for this function:
Here is the caller graph for this function:

◆ shadow_client_boardcast_quit()

int shadow_client_boardcast_quit ( rdpShadowServer *  server,
int  nExitCode 
)
Here is the call graph for this function:
Here is the caller graph for this function:

◆ shadow_client_capabilities()

static BOOL shadow_client_capabilities ( freerdp_peer *  peer)
static
Here is the caller graph for this function:

◆ shadow_client_caps_test_version()

static BOOL shadow_client_caps_test_version ( RdpgfxServerContext *  context,
rdpShadowClient *  client,
BOOL  h264,
const RDPGFX_CAPSET capsSets,
UINT32  capsSetCount,
UINT32  capsVersion,
UINT *  rc 
)
static
Here is the call graph for this function:
Here is the caller graph for this function:

◆ shadow_client_common_frame_acknowledge()

static INLINE void shadow_client_common_frame_acknowledge ( rdpShadowClient *  client,
UINT32  frameId 
)
static
Here is the caller graph for this function:

◆ shadow_client_context_free()

static void shadow_client_context_free ( freerdp_peer *  peer,
rdpContext *  context 
)
static
Here is the call graph for this function:
Here is the caller graph for this function:

◆ shadow_client_context_new()

static BOOL shadow_client_context_new ( freerdp_peer *  peer,
rdpContext *  context 
)
static
Here is the call graph for this function:
Here is the caller graph for this function:

◆ shadow_client_convert_rects()

static INLINE void shadow_client_convert_rects ( rdpShadowClient *  client,
RECTANGLE_16 dst,
const RECTANGLE_16 src,
UINT32  numRects 
)
static
Here is the caller graph for this function:

◆ shadow_client_dispatch_msg()

static BOOL shadow_client_dispatch_msg ( rdpShadowClient *  client,
wMessage *  message 
)
static
Here is the call graph for this function:
Here is the caller graph for this function:

◆ shadow_client_free_queued_message()

static INLINE void shadow_client_free_queued_message ( void *  obj)
static
Here is the caller graph for this function:

◆ shadow_client_logon()

static BOOL shadow_client_logon ( freerdp_peer *  peer,
const SEC_WINNT_AUTH_IDENTITY identity,
BOOL  automatic 
)
static
Here is the call graph for this function:
Here is the caller graph for this function:

◆ shadow_client_mark_invalid()

static INLINE void shadow_client_mark_invalid ( rdpShadowClient *  client,
UINT32  numRects,
const RECTANGLE_16 rects 
)
static
Here is the call graph for this function:
Here is the caller graph for this function:

◆ shadow_client_no_surface_update()

static INLINE BOOL shadow_client_no_surface_update ( rdpShadowClient *  client,
SHADOW_GFX_STATUS *  pStatus 
)
static

Function description Only union invalid region from server surface

Returns
TRUE on success
Here is the call graph for this function:
Here is the caller graph for this function:

◆ shadow_client_post_connect()

static BOOL shadow_client_post_connect ( freerdp_peer *  peer)
static
Here is the call graph for this function:
Here is the caller graph for this function:

◆ shadow_client_post_msg()

BOOL shadow_client_post_msg ( rdpShadowClient *  client,
void *  context,
UINT32  type,
SHADOW_MSG_OUT *  msg,
void *  lParam 
)
Here is the call graph for this function:
Here is the caller graph for this function:

◆ shadow_client_rdpgfx_caps_advertise()

static UINT shadow_client_rdpgfx_caps_advertise ( RdpgfxServerContext *  context,
const RDPGFX_CAPS_ADVERTISE_PDU capsAdvertise 
)
static

Function description

Returns
0 on success, otherwise a Win32 error code
Here is the call graph for this function:
Here is the caller graph for this function:

◆ shadow_client_rdpgfx_frame_acknowledge()

static UINT shadow_client_rdpgfx_frame_acknowledge ( RdpgfxServerContext *  context,
const RDPGFX_FRAME_ACKNOWLEDGE_PDU frameAcknowledge 
)
static
Here is the call graph for this function:
Here is the caller graph for this function:

◆ shadow_client_rdpgfx_new_surface()

static INLINE BOOL shadow_client_rdpgfx_new_surface ( rdpShadowClient *  client)
static
Here is the call graph for this function:
Here is the caller graph for this function:

◆ shadow_client_rdpgfx_release_surface()

static INLINE BOOL shadow_client_rdpgfx_release_surface ( rdpShadowClient *  client)
static
Here is the caller graph for this function:

◆ shadow_client_rdpgfx_reset_graphic()

static INLINE BOOL shadow_client_rdpgfx_reset_graphic ( rdpShadowClient *  client)
static
Here is the call graph for this function:
Here is the caller graph for this function:

◆ shadow_client_recalc_desktop_size()

static INLINE BOOL shadow_client_recalc_desktop_size ( rdpShadowClient *  client)
static

Function description Recalculate client desktop size and update to rdpSettings

Returns
TRUE if width/height changed.
Here is the call graph for this function:
Here is the caller graph for this function:

◆ shadow_client_refresh_rect()

static BOOL shadow_client_refresh_rect ( rdpContext *  context,
BYTE  count,
const RECTANGLE_16 areas 
)
static
Here is the call graph for this function:
Here is the caller graph for this function:

◆ shadow_client_refresh_request()

static BOOL shadow_client_refresh_request ( rdpShadowClient *  client)
static
Here is the call graph for this function:
Here is the caller graph for this function:

◆ shadow_client_send_bitmap_update()

static BOOL shadow_client_send_bitmap_update ( rdpShadowClient *  client,
BYTE pSrcData,
UINT32  nSrcStep,
UINT16  nXSrc,
UINT16  nYSrc,
UINT16  nWidth,
UINT16  nHeight 
)
static

Function description

Returns
TRUE on success
Here is the call graph for this function:
Here is the caller graph for this function:

◆ shadow_client_send_caps_confirm()

static UINT shadow_client_send_caps_confirm ( RdpgfxServerContext *  context,
rdpShadowClient *  client,
const RDPGFX_CAPS_CONFIRM_PDU pdu 
)
static
Here is the caller graph for this function:

◆ shadow_client_send_resize()

static BOOL shadow_client_send_resize ( rdpShadowClient *  client,
SHADOW_GFX_STATUS *  pStatus 
)
static

Function description Notify client for resize. The new desktop width/height should have already been updated in rdpSettings.

Returns
TRUE on success

Unset client activated flag to avoid sending update message during resize. DesktopResize will reactive the client and shadow_client_activate would be invoked later.

Here is the call graph for this function:
Here is the caller graph for this function:

◆ shadow_client_send_surface_bits()

static BOOL shadow_client_send_surface_bits ( rdpShadowClient *  client,
BYTE pSrcData,
UINT32  nSrcStep,
UINT16  nXSrc,
UINT16  nYSrc,
UINT16  nWidth,
UINT16  nHeight 
)
static

Function description

Returns
TRUE on success
Here is the call graph for this function:
Here is the caller graph for this function:

◆ shadow_client_send_surface_gfx()

static BOOL shadow_client_send_surface_gfx ( rdpShadowClient *  client,
const BYTE pSrcData,
UINT32  nSrcStep,
UINT32  SrcFormat,
UINT16  nXSrc,
UINT16  nYSrc,
UINT16  nWidth,
UINT16  nHeight 
)
static

Function description

Returns
TRUE on success
Here is the call graph for this function:
Here is the caller graph for this function:

◆ shadow_client_send_surface_update()

static BOOL shadow_client_send_surface_update ( rdpShadowClient *  client,
SHADOW_GFX_STATUS *  pStatus 
)
static

Function description

Returns
TRUE on success (or nothing need to be updated)
Here is the call graph for this function:
Here is the caller graph for this function:

◆ shadow_client_subsystem_process_message()

static int shadow_client_subsystem_process_message ( rdpShadowClient *  client,
wMessage *  message 
)
static
Here is the call graph for this function:
Here is the caller graph for this function:

◆ shadow_client_suppress_output()

static BOOL shadow_client_suppress_output ( rdpContext *  context,
BYTE  allow,
const RECTANGLE_16 area 
)
static
Here is the call graph for this function:
Here is the caller graph for this function:

◆ shadow_client_surface_frame_acknowledge()

static BOOL shadow_client_surface_frame_acknowledge ( rdpContext *  context,
UINT32  frameId 
)
static
Here is the call graph for this function:
Here is the caller graph for this function:

◆ shadow_client_surface_update()

static BOOL shadow_client_surface_update ( rdpShadowClient *  client,
REGION16 region 
)
static

Function description Mark invalid region for client

Returns
TRUE on success
Here is the call graph for this function:
Here is the caller graph for this function:

◆ shadow_client_thread()

static DWORD WINAPI shadow_client_thread ( LPVOID  arg)
static
Here is the call graph for this function:
Here is the caller graph for this function:

◆ shadow_msg_out_addref()

static void shadow_msg_out_addref ( wMessage *  message)
static
Here is the call graph for this function:
Here is the caller graph for this function:

◆ shadow_msg_out_release()

static void shadow_msg_out_release ( wMessage *  message)
static
Here is the call graph for this function:
Here is the caller graph for this function:

◆ shadow_reset_desktop_resize()

static void shadow_reset_desktop_resize ( rdpShadowClient *  client)
static
Here is the caller graph for this function:

◆ shadow_send_desktop_resize()

static BOOL shadow_send_desktop_resize ( rdpShadowClient *  client)
static
Here is the call graph for this function:
Here is the caller graph for this function: