summaryrefslogtreecommitdiff
path: root/src/rdp/rdp_clipboard.h
blob: 1536a2ccf70ead28dd8c49e1850341e212fbfecf (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
40
41
42
43
44
45
46
47
48
49
50
51
52
/* BSD-2-Clause license
 * 
 * Copyright (c) 2018-2023 NST <www.newinfosec.ru>, sss <sss at dark-alexandr dot net>. 
 * 
 */

#pragma once

#include <stdbool.h>
#include <stddef.h>
#include <stdint.h>

#include "webrdp_core_api.h"
#include "webrdp_module_api.h"
#include "rdp_backend_api.h"
#include "rdp_impl.h"

typedef struct
{
	CLIPRDR_FORMAT rdp_fmt;
	wrdp_enum_clip_format my_fmt;
} my_clip_format;

typedef struct
{
	uint32_t file_id;
	uint64_t file_size;
} file_list_cache_entry;

struct my_rdp_clipboard_s
{
	wClipboard *clipboard;
	CliprdrClientContext *clip_context;
	my_rdp_context *my_rdp_context;
	wClipboardDelegate *delegate;
	bool streams_supported;
	uint8_t *data_raw;
	/* we need to cache server side format list to know dynamic format id */
	my_clip_format *srv_fmts, cli_req_fmt_id, srv_req_fmt_id;
	uint8_t srv_fmts_count;
	file_list_cache_entry *client_filelist_cache;

	rdp_internals *my_internals;
};

my_rdp_clipboard *rdp_clipboard_new(my_rdp_context *context);

void rdp_cliprdr_init(my_rdp_context *ctx, CliprdrClientContext *cliprdr);

void rdp_cliprdr_uninit(my_rdp_context *ctx, CliprdrClientContext *cliprdr);

void register_clipboard(wrdp_backend_module *backend);