Esempio n. 1
0
RDP_EVENT* freerdp_event_new(uint16 event_class, uint16 event_type,
	RDP_EVENT_CALLBACK on_event_free_callback, void* user_data)
{
	RDP_EVENT* event = NULL;

	switch (event_class)
	{
		case RDP_EVENT_CLASS_DEBUG:
			event = xnew(RDP_EVENT);
			break;
		case RDP_EVENT_CLASS_CLIPRDR:
			event = freerdp_cliprdr_event_new(event_type);
			break;
		case RDP_EVENT_CLASS_TSMF:
			event = freerdp_tsmf_event_new(event_type);
			break;
		case RDP_EVENT_CLASS_RAIL:
			event = freerdp_rail_event_new(event_type);
			break;
	}

	if (event != NULL)
	{
		event->event_class = event_class;
		event->event_type = event_type;
		event->on_event_free_callback = on_event_free_callback;
		event->user_data = user_data;
	}

	return event;
}
Esempio n. 2
0
wMessage* freerdp_event_new(UINT16 event_class, UINT16 event_type,
	MESSAGE_FREE_FN on_event_free_callback, void* user_data)
{
	wMessage* event = NULL;

	switch (event_class)
	{
		case DebugChannel_Class:
			event = (wMessage*) malloc(sizeof(wMessage));
			ZeroMemory(event, sizeof(wMessage));
			break;

		case CliprdrChannel_Class:
			event = freerdp_cliprdr_event_new(event_type);
			break;

		case TsmfChannel_Class:
			event = freerdp_tsmf_event_new(event_type);
			break;

		case RailChannel_Class:
			event = freerdp_rail_event_new(event_type);
			break;
	}

	if (event)
	{
		event->wParam = user_data;
		event->Free = (void*) on_event_free_callback;
		event->id = GetMessageId(event_class, event_type);
	}

	return event;
}