Exemplo n.º 1
0
/* Called when we have a new peer connecting */
void mf_peer_context_new(freerdp_peer* client, mfPeerContext* context)
{
	context->info = mf_info_get_instance();
	context->rfx_context = rfx_context_new();
	context->rfx_context->mode = RLGR3;
	context->rfx_context->width = client->settings->DesktopWidth;
	context->rfx_context->height = client->settings->DesktopHeight;
	rfx_context_set_pixel_format(context->rfx_context, RDP_PIXEL_FORMAT_B8G8R8A8);
	
	//context->nsc_context = nsc_context_new();
	//nsc_context_set_pixel_format(context->nsc_context, RDP_PIXEL_FORMAT_B8G8R8A8);
	
	context->s = stream_new(0xFFFF);
	
	//#ifdef WITH_SERVER_CHANNELS
	context->vcm = WTSCreateVirtualChannelManager(client);
	//#endif
	
	mf_info_peer_register(context->info, context);
}
Exemplo n.º 2
0
/* Called when we have a new peer connecting */
BOOL mf_peer_context_new(freerdp_peer* client, mfPeerContext* context)
{
	if (!(context->info = mf_info_get_instance()))
		return FALSE;

	if (!(context->rfx_context = rfx_context_new(TRUE)))
		goto fail_rfx_context;

	context->rfx_context->mode = RLGR3;
	context->rfx_context->width = client->settings->DesktopWidth;
	context->rfx_context->height = client->settings->DesktopHeight;
	rfx_context_set_pixel_format(context->rfx_context, RDP_PIXEL_FORMAT_B8G8R8A8);
	
	//if (!(context->nsc_context = nsc_context_new()))
	//	goto fail_nsc_context;
	//nsc_context_set_pixel_format(context->nsc_context, RDP_PIXEL_FORMAT_B8G8R8A8);
	
	if (!(context->s = Stream_New(NULL, 0xFFFF)))
		goto fail_stream_new;
	
	context->vcm = WTSOpenServerA((LPSTR) client->context);

	if (!context->vcm || context->vcm == INVALID_HANDLE_VALUE)
		goto fail_open_server;
	
	mf_info_peer_register(context->info, context);

	return TRUE;

fail_open_server:
	Stream_Free(context->s, TRUE);
	context->s = NULL;
fail_stream_new:
	rfx_context_free(context->rfx_context);
	context->rfx_context = NULL;
fail_rfx_context:

	return FALSE;
}