summaryrefslogtreecommitdiff
path: root/src/rdp/rdp_channels.c
blob: a4d95eb70238454e549f73bdbd66a5447c652268 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
/* BSD-2-Clause license
 * 
 * Copyright (c) 2018-2023 NST <www.newinfosec.ru>, sss <sss at dark-alexandr dot net>. 
 * 
 */

#include <string.h>
#include "rdp_channels.h"
#include "rdp_clipboard.h"
#include "rdp_rail.h"

void
rdp_on_channel_connected(void *context, const ChannelConnectedEventArgs *e)
{
	if (strcmp(e->name, CLIPRDR_SVC_CHANNEL_NAME) == 0)
	{
		rdp_cliprdr_init(
		    context, (CliprdrClientContext *)e->pInterface);
	}
	else if (strcmp(e->name, RAIL_SVC_CHANNEL_NAME) == 0)
	{
		rdp_rail_init(context, (RailClientContext *)e->pInterface);
	}
}

void
rdp_on_channel_disconnected(
    void *context, const ChannelDisconnectedEventArgs *e)
{
	if (strcmp(e->name, CLIPRDR_SVC_CHANNEL_NAME) == 0)
	{
		rdp_cliprdr_uninit(
		    context, (CliprdrClientContext *)e->pInterface);
	}
	else if (strcmp(e->name, RAIL_SVC_CHANNEL_NAME) == 0)
	{
		rdp_rail_uninit(context, (RailClientContext *)e->pInterface);
	}
}