server/proxy/pf_client.c
static BOOL pf_client_post_connect(freerdp* instance)
{
	rdpContext* context;
	rdpSettings* settings;
	rdpUpdate* update;
	rdpContext* ps;
	pClientContext* pc;
	const proxyConfig* config;

	WINPR_ASSERT(instance);
	context = instance->context;
	WINPR_ASSERT(context);
	settings = instance->settings;
	WINPR_ASSERT(settings);
	update = instance->update;
	WINPR_ASSERT(update);
	pc = (pClientContext*)context;
	WINPR_ASSERT(pc);
	WINPR_ASSERT(pc->pdata);
	ps = (rdpContext*)pc->pdata->ps;
	WINPR_ASSERT(ps);
	config = pc->pdata->config;
	WINPR_ASSERT(config);

	if (!pf_modules_run_hook(pc->pdata->module, HOOK_TYPE_CLIENT_POST_CONNECT, pc->pdata, pc))
		return FALSE;

	if (!gdi_init(instance, PIXEL_FORMAT_BGRA32))
		return FALSE;

	if (!pf_register_pointer(context->graphics))
		return FALSE;

	if (!settings->SoftwareGdi)
	{
		if (!pf_register_graphics(context->graphics))
		{
			PROXY_LOG_ERR(TAG, pc, "failed to register graphics");
			return FALSE;
		}

		pf_gdi_register_update_callbacks(update);
		brush_cache_register_callbacks(update);
		glyph_cache_register_callbacks(update);
		bitmap_cache_register_callbacks(update);
		offscreen_cache_register_callbacks(update);
		palette_cache_register_callbacks(update);
	}

	pf_client_register_update_callbacks(update);

	/* virtual channels receive data hook */
	pc->client_receive_channel_data_original = instance->ReceiveChannelData;
	instance->ReceiveChannelData = pf_client_receive_channel_data_hook;

	instance->heartbeat->ServerHeartbeat = pf_client_on_server_heartbeat;

	pc->connected = TRUE;

	/* Send cached channel data */
	sendQueuedChannelData(pc);

	/*
	 * after the connection fully established and settings were negotiated with target server,
	 * send a reactivation sequence to the client with the negotiated settings. This way,
	 * settings are synchorinized between proxy's peer and and remote target.
	 */
	return proxy_server_reactivate(ps, context);
}
/**
 * Called after a RDP connection was successfully established.
 * Settings might have changed during negotiation of client / server feature
 * support.
 *
 * Set up local framebuffers and painting callbacks.
 * If required, register pointer callbacks to change the local mouse cursor
 * when hovering over the RDP window
 */
Called after a RDP connection was successfully established.
Settings might have changed during negotiation of client / server feature
support.

Set up local framebuffers and painting callbacks.
If required, register pointer callbacks to change the local mouse cursor
when hovering over the RDP window
Called after a RDP connection was successfully established . Settings might have changed during negotiation of client / server feature support . Set up local framebuffers and painting callbacks . If required register pointer callbacks to change the local mouse cursor when hovering over the RDP window
static BOOL pf_client_post_connect(freerdp* instance)
{
	rdpContext* context;
	rdpSettings* settings;
	rdpUpdate* update;
	rdpContext* ps;
	pClientContext* pc;
	const proxyConfig* config;
	WINPR_ASSERT(instance);
	context = instance->context;
	WINPR_ASSERT(context);
	settings = instance->settings;
	WINPR_ASSERT(settings);
	update = instance->update;
	WINPR_ASSERT(update);
	pc = (pClientContext*)context;
	WINPR_ASSERT(pc);
	WINPR_ASSERT(pc->pdata);
	ps = (rdpContext*)pc->pdata->ps;
	WINPR_ASSERT(ps);
	config = pc->pdata->config;
	WINPR_ASSERT(config);
	if (!pf_modules_run_hook(pc->pdata->module, HOOK_TYPE_CLIENT_POST_CONNECT, pc->pdata, pc))
		return FALSE;
	if (!gdi_init(instance, PIXEL_FORMAT_BGRA32))
		return FALSE;
	if (!pf_register_pointer(context->graphics))
		return FALSE;
	if (!settings->SoftwareGdi)
	{
		if (!pf_register_graphics(context->graphics))
		{
			PROXY_LOG_ERR(TAG, pc, "failed to register graphics");
			return FALSE;
		}
		pf_gdi_register_update_callbacks(update);
		brush_cache_register_callbacks(update);
		glyph_cache_register_callbacks(update);
		bitmap_cache_register_callbacks(update);
		offscreen_cache_register_callbacks(update);
		palette_cache_register_callbacks(update);
	}
	pf_client_register_update_callbacks(update);
	pc->client_receive_channel_data_original = instance->ReceiveChannelData;
	instance->ReceiveChannelData = pf_client_receive_channel_data_hook;
	instance->heartbeat->ServerHeartbeat = pf_client_on_server_heartbeat;
	pc->connected = TRUE;
	sendQueuedChannelData(pc);
	return proxy_server_reactivate(ps, context);
}
static BOOL pf_client_post_connect ( freerdp * instance ) { rdpContext * context ; rdpSettings * settings ; rdpUpdate * update ; rdpContext * ps ; pClientContext * pc ; const proxyConfig * config ; WINPR_ASSERT ( instance ) ; context = instance -> context ; WINPR_ASSERT ( context ) ; settings = instance -> settings ; WINPR_ASSERT ( settings ) ; update = instance -> update ; WINPR_ASSERT ( update ) ; pc = ( pClientContext * ) context ; WINPR_ASSERT ( pc ) ; WINPR_ASSERT ( pc -> pdata ) ; ps = ( rdpContext * ) pc -> pdata -> ps ; WINPR_ASSERT ( ps ) ; config = pc -> pdata -> config ; WINPR_ASSERT ( config ) ; if ( ! pf_modules_run_hook ( pc -> pdata -> module , HOOK_TYPE_CLIENT_POST_CONNECT , pc -> pdata , pc ) ) return FALSE ; if ( ! gdi_init ( instance , PIXEL_FORMAT_BGRA32 ) ) return FALSE ; if ( ! pf_register_pointer ( context -> graphics ) ) return FALSE ; if ( ! settings -> SoftwareGdi ) { if ( ! pf_register_graphics ( context -> graphics ) ) { PROXY_LOG_ERR ( TAG , pc , " " ) ; return FALSE ; } pf_gdi_register_update_callbacks ( update ) ; brush_cache_register_callbacks ( update ) ; glyph_cache_register_callbacks ( update ) ; bitmap_cache_register_callbacks ( update ) ; offscreen_cache_register_callbacks ( update ) ; palette_cache_register_callbacks ( update ) ; } pf_client_register_update_callbacks ( update ) ; pc -> client_receive_channel_data_original = instance -> ReceiveChannelData ; instance -> ReceiveChannelData = pf_client_receive_channel_data_hook ; instance -> heartbeat -> ServerHeartbeat = pf_client_on_server_heartbeat ; pc -> connected = TRUE ; sendQueuedChannelData ( pc ) ; return proxy_server_reactivate ( ps , context ) ; }
Called after a RDP connection was successfully established.
Called after a RDP connection was successfully established .
/* virtual channels receive data hook */ /* Send cached channel data */ /*
	 * after the connection fully established and settings were negotiated with target server,
	 * send a reactivation sequence to the client with the negotiated settings. This way,
	 * settings are synchorinized between proxy's peer and and remote target.
	 */