Пример #1
0
/* this registers two channels but only cliprdr is used */
int
VirtualChannelEntry(PCHANNEL_ENTRY_POINTS pEntryPoints)
{
	cliprdrPlugin * plugin;

	LLOGLN(10, ("VirtualChannelEntry:"));

	plugin = (cliprdrPlugin *) malloc(sizeof(cliprdrPlugin));
	memset(plugin, 0, sizeof(cliprdrPlugin));

	chan_plugin_init((rdpChanPlugin *) plugin);

	plugin->data_in_size = 0;
	plugin->data_in = 0;
	plugin->ep = *pEntryPoints;
	memset(&(plugin->channel_def), 0, sizeof(plugin->channel_def));
	plugin->channel_def.options = CHANNEL_OPTION_INITIALIZED |
		CHANNEL_OPTION_ENCRYPT_RDP | CHANNEL_OPTION_COMPRESS_RDP |
		CHANNEL_OPTION_SHOW_PROTOCOL;
	strcpy(plugin->channel_def.name, "cliprdr");
	plugin->in_mutex = (pthread_mutex_t *) malloc(sizeof(pthread_mutex_t));
	pthread_mutex_init(plugin->in_mutex, 0);
	plugin->in_list_head = 0;
	plugin->in_list_tail = 0;
	plugin->term_event = wait_obj_new("freerdpcliprdrterm");
	plugin->data_in_event = wait_obj_new("freerdpcliprdrdatain");
	plugin->ep.pVirtualChannelInit(&plugin->chan_plugin.init_handle, &plugin->channel_def, 1,
		VIRTUAL_CHANNEL_VERSION_WIN2000, InitEvent);
	plugin->device_data = clipboard_new(plugin);
	return 1;
}
Пример #2
0
/*
 * Used for opening channel and sent to core channel pointer to RAIL session.
 *
 * Main difference between core channels and plugin channels is time of
 * calling plugin 'VirtualChannelEntry'.
 * For plugin 'VirtualChannelEntry' is called when rdpInst for channel manager
 * is not yet defined. So we can't link it with rdp session.
 *
 * For core virtual channels 'VirtualChannelEntry' is called when rdpInst
 * linked with channel manager in 'freerdp_chanman_pre_connect' routine by
 * library consumer (in UI).
 *
 * So on this stage all rdpInst structure already builded, so we can call
 * core function for linking with RAIL session structure.
 */
int RailCoreVirtualChannelEntry(PCHANNEL_ENTRY_POINTS pEntryPoints)
{
	railCorePlugin * plugin;

	LLOGLN(10, ("rail_core_plugin:Rail Core plugin VirtualChannelEntry:"));

	plugin = (railCorePlugin *) malloc(sizeof(railCorePlugin));
	memset(plugin, 0, sizeof(railCorePlugin));

	chan_plugin_init((rdpChanPlugin *) plugin);

	plugin->data_in_size = 0;
	plugin->data_in = NULL;
	plugin->ep = *pEntryPoints;

	memset(&(plugin->channel_def), 0, sizeof(plugin->channel_def));
	plugin->channel_def.options = CHANNEL_OPTION_INITIALIZED |
		CHANNEL_OPTION_ENCRYPT_RDP | CHANNEL_OPTION_COMPRESS_RDP |
		CHANNEL_OPTION_SHOW_PROTOCOL;
	strcpy(plugin->channel_def.name, "rail");

	plugin->in_mutex = (pthread_mutex_t *) malloc(sizeof(pthread_mutex_t));
	pthread_mutex_init(plugin->in_mutex, 0);
	plugin->in_list_head = NULL;
	plugin->in_list_tail = NULL;

	plugin->term_event = wait_obj_new("freerdprailterm");
	plugin->data_in_event = wait_obj_new("freerdpraildatain");


	plugin->session = NULL;
	if (pEntryPoints->cbSize >= sizeof(CHANNEL_ENTRY_POINTS_EX))
	{
		RAIL_VCHANNEL_SENDER sender = {0};

		sender.sender_object = plugin;
		sender.send_rail_vchannel_data = rail_core_plugin_send_rail_vchannel_data;

		plugin->session = (((PCHANNEL_ENTRY_POINTS_EX)pEntryPoints)->pExtendedData);

		rail_register_channel_sender(plugin->session, &sender);

		plugin->ep.pVirtualChannelInit(&plugin->chan_plugin.init_handle,
				&plugin->channel_def, 1, VIRTUAL_CHANNEL_VERSION_WIN2000,
				InitEvent);
	}


	return 1;
}
Пример #3
0
int
VirtualChannelEntry(PCHANNEL_ENTRY_POINTS pEntryPoints)
{
	drdynvcPlugin * plugin;
	RD_PLUGIN_DATA * data;

	LLOGLN(10, ("VirtualChannelEntry:"));

	plugin = (drdynvcPlugin *) malloc(sizeof(drdynvcPlugin));
	memset(plugin, 0, sizeof(drdynvcPlugin));

	chan_plugin_init((rdpChanPlugin *) plugin);

	plugin->data_in_size = 0;
	plugin->data_in = 0;
	plugin->ep = *pEntryPoints;
	memset(&(plugin->channel_def), 0, sizeof(plugin->channel_def));
	plugin->channel_def.options = CHANNEL_OPTION_INITIALIZED |
		CHANNEL_OPTION_ENCRYPT_RDP | CHANNEL_OPTION_COMPRESS_RDP;
	strcpy(plugin->channel_def.name, "drdynvc");
	plugin->in_mutex = (pthread_mutex_t *) malloc(sizeof(pthread_mutex_t));
	pthread_mutex_init(plugin->in_mutex, 0);
	plugin->in_list_head = 0;
	plugin->in_list_tail = 0;
	plugin->term_event = wait_obj_new("freerdprdrynvcterm");
	plugin->data_in_event = wait_obj_new("freerdpdrdynvcdatain");
	plugin->thread_status = 0;
	plugin->ep.pVirtualChannelInit(&plugin->chan_plugin.init_handle, &plugin->channel_def, 1,
		VIRTUAL_CHANNEL_VERSION_WIN2000, InitEvent);

	plugin->channel_mgr = dvcman_new(plugin);

	if (pEntryPoints->cbSize >= sizeof(CHANNEL_ENTRY_POINTS_EX))
	{
		data = (RD_PLUGIN_DATA *) (((PCHANNEL_ENTRY_POINTS_EX)pEntryPoints)->pExtendedData);
		while (data && data->size > 0)
		{
			dvcman_load_plugin(plugin->channel_mgr, (char*)data->data[0]);
			data = (RD_PLUGIN_DATA *) (((void *) data) + data->size);
		}
	}

	return 1;
}
Пример #4
0
/* this registers two channels but only rdpsnd is used */
int
VirtualChannelEntry(PCHANNEL_ENTRY_POINTS pEntryPoints)
{
	rdpsndPlugin * plugin;
	RD_PLUGIN_DATA * data;
	RD_PLUGIN_DATA default_data[2] = { { 0 }, { 0 } };

	LLOGLN(10, ("VirtualChannelEntry:"));

	plugin = (rdpsndPlugin *) malloc(sizeof(rdpsndPlugin));
	memset(plugin, 0, sizeof(rdpsndPlugin));

	chan_plugin_init((rdpChanPlugin *) plugin);

	plugin->data_in_size = 0;
	plugin->data_in = 0;
	plugin->ep = *pEntryPoints;
	memset(&(plugin->channel_def), 0, sizeof(plugin->channel_def));
	plugin->channel_def.options = CHANNEL_OPTION_INITIALIZED |
		CHANNEL_OPTION_ENCRYPT_RDP;
	strcpy(plugin->channel_def.name, "rdpsnd");
	plugin->in_mutex = (pthread_mutex_t *) malloc(sizeof(pthread_mutex_t));
	pthread_mutex_init(plugin->in_mutex, 0);
	plugin->in_list_head = 0;
	plugin->in_list_tail = 0;
	plugin->out_list_head = 0;
	plugin->out_list_tail = 0;
	plugin->term_event = wait_obj_new("freerdprdpsndterm");
	plugin->data_in_event = wait_obj_new("freerdprdpsnddatain");
	plugin->expectingWave = 0;
	plugin->current_format = -1;
	plugin->thread_status = 0;
	plugin->ep.pVirtualChannelInit(&plugin->chan_plugin.init_handle, &plugin->channel_def, 1,
		VIRTUAL_CHANNEL_VERSION_WIN2000, InitEvent);

	if (pEntryPoints->cbSize >= sizeof(CHANNEL_ENTRY_POINTS_EX))
	{
		data = (RD_PLUGIN_DATA *) (((PCHANNEL_ENTRY_POINTS_EX)pEntryPoints)->pExtendedData);
	}
	else
	{
		data = NULL;
	}
	while (data && data->size > 0)
	{
		rdpsnd_process_plugin_data(plugin, data);
		data = (RD_PLUGIN_DATA *) (((void *) data) + data->size);
	}
	if (plugin->device_plugin == NULL)
	{
		default_data[0].size = sizeof(RD_PLUGIN_DATA);
		default_data[0].data[0] = "alsa";
		default_data[0].data[1] = "default";
		rdpsnd_load_device_plugin(plugin, "alsa", default_data);
	}
	if (plugin->device_plugin == NULL)
	{
		LLOGLN(0, ("rdpsnd: no sound device."));
	}

	return 1;
}