ReactOS 0.4.16-dev-122-g325d74c
cliprdr.c File Reference
#include "rdesktop.h"
Include dependency graph for cliprdr.c:

Go to the source code of this file.

Macros

#define CLIPRDR_CONNECT   1
 
#define CLIPRDR_FORMAT_ANNOUNCE   2
 
#define CLIPRDR_FORMAT_ACK   3
 
#define CLIPRDR_DATA_REQUEST   4
 
#define CLIPRDR_DATA_RESPONSE   5
 
#define CLIPRDR_REQUEST   0
 
#define CLIPRDR_RESPONSE   1
 
#define CLIPRDR_ERROR   2
 

Functions

static void cliprdr_send_packet (RDPCLIENT *This, uint16 type, uint16 status, uint8 *data, uint32 length)
 
void cliprdr_send_simple_native_format_announce (RDPCLIENT *This, uint32 format)
 
void cliprdr_send_native_format_announce (RDPCLIENT *This, uint8 *formats_data, uint32 formats_data_length)
 
void cliprdr_send_data_request (RDPCLIENT *This, uint32 format)
 
void cliprdr_send_data (RDPCLIENT *This, uint8 *data, uint32 length)
 
static void cliprdr_process (RDPCLIENT *This, STREAM s)
 
void cliprdr_set_mode (RDPCLIENT *This, const char *optarg)
 
BOOL cliprdr_init (RDPCLIENT *This)
 

Macro Definition Documentation

◆ CLIPRDR_CONNECT

#define CLIPRDR_CONNECT   1

Definition at line 24 of file cliprdr.c.

◆ CLIPRDR_DATA_REQUEST

#define CLIPRDR_DATA_REQUEST   4

Definition at line 27 of file cliprdr.c.

◆ CLIPRDR_DATA_RESPONSE

#define CLIPRDR_DATA_RESPONSE   5

Definition at line 28 of file cliprdr.c.

◆ CLIPRDR_ERROR

#define CLIPRDR_ERROR   2

Definition at line 32 of file cliprdr.c.

◆ CLIPRDR_FORMAT_ACK

#define CLIPRDR_FORMAT_ACK   3

Definition at line 26 of file cliprdr.c.

◆ CLIPRDR_FORMAT_ANNOUNCE

#define CLIPRDR_FORMAT_ANNOUNCE   2

Definition at line 25 of file cliprdr.c.

◆ CLIPRDR_REQUEST

#define CLIPRDR_REQUEST   0

Definition at line 30 of file cliprdr.c.

◆ CLIPRDR_RESPONSE

#define CLIPRDR_RESPONSE   1

Definition at line 31 of file cliprdr.c.

Function Documentation

◆ cliprdr_init()

BOOL cliprdr_init ( RDPCLIENT This)

Definition at line 174 of file cliprdr.c.

175{
176 This->cliprdr.channel =
177 channel_register(This, "cliprdr",
181 return (This->cliprdr.channel != NULL);
182}
VCHANNEL * channel_register(char *name, uint32 flags, void(*callback)(STREAM))
Definition: channels.c:46
#define CHANNEL_OPTION_ENCRYPT_RDP
Definition: constants.h:432
#define CHANNEL_OPTION_INITIALIZED
Definition: constants.h:431
#define CHANNEL_OPTION_SHOW_PROTOCOL
Definition: constants.h:434
#define CHANNEL_OPTION_COMPRESS_RDP
Definition: constants.h:433
static void cliprdr_process(RDPCLIENT *This, STREAM s)
Definition: cliprdr.c:109
#define NULL
Definition: types.h:112

◆ cliprdr_process()

static void cliprdr_process ( RDPCLIENT This,
STREAM  s 
)
static

Definition at line 109 of file cliprdr.c.

110{
113 uint8 *data;
114
118 data = s->p;
119
120 DEBUG_CLIPBOARD(("CLIPRDR recv: type=%d, status=%d, length=%d\n", type, status, length));
121
122 if (status == CLIPRDR_ERROR)
123 {
124 switch (type)
125 {
127 /* FIXME: We seem to get this when we send an announce while the server is
128 still processing a paste. Try sending another announce. */
129 cliprdr_send_native_format_announce(This, This->cliprdr.last_formats,
130 This->cliprdr.last_formats_length);
131 break;
134 break;
135 default:
136 DEBUG_CLIPBOARD(("CLIPRDR error (type=%d)\n", type));
137 }
138
139 return;
140 }
141
142 switch (type)
143 {
144 case CLIPRDR_CONNECT:
146 break;
150 return;
152 break;
156 break;
159 break;
160 case 7: /* TODO: W2K3 SP1 sends this on connect with a value of 1 */
161 break;
162 default:
163 unimpl("CLIPRDR packet type %d\n", type);
164 }
165}
#define in_uint16_le(s, v)
Definition: parse.h:55
#define in_uint32_le(s, v)
Definition: parse.h:56
void ui_clip_format_announce(uint8 *data, uint32 length)
void ui_clip_sync(void)
void ui_clip_request_failed(void)
void unimpl(char *format,...)
Definition: uimain.c:801
void ui_clip_request_data(uint32 format)
void ui_clip_handle_data(uint8 *data, uint32 length)
#define DEBUG_CLIPBOARD(args)
Definition: rdesktop.h:147
unsigned short uint16
Definition: types.h:30
unsigned int uint32
Definition: types.h:32
unsigned char uint8
Definition: types.h:28
#define CLIPRDR_FORMAT_ANNOUNCE
Definition: cliprdr.c:25
#define CLIPRDR_FORMAT_ACK
Definition: cliprdr.c:26
void cliprdr_send_native_format_announce(RDPCLIENT *This, uint8 *formats_data, uint32 formats_data_length)
Definition: cliprdr.c:73
#define CLIPRDR_CONNECT
Definition: cliprdr.c:24
#define CLIPRDR_DATA_REQUEST
Definition: cliprdr.c:27
static void cliprdr_send_packet(RDPCLIENT *This, uint16 type, uint16 status, uint8 *data, uint32 length)
Definition: cliprdr.c:35
#define CLIPRDR_DATA_RESPONSE
Definition: cliprdr.c:28
#define CLIPRDR_ERROR
Definition: cliprdr.c:32
#define CLIPRDR_RESPONSE
Definition: cliprdr.c:31
GLuint GLuint GLsizei GLenum type
Definition: gl.h:1545
GLdouble s
Definition: gl.h:2039
GLint GLenum GLsizei GLsizei GLsizei GLint GLsizei const GLvoid * data
Definition: gl.h:1950
GLuint GLsizei GLsizei * length
Definition: glext.h:6040
Definition: format.c:58
Definition: ps.c:97

Referenced by cliprdr_init().

◆ cliprdr_send_data()

void cliprdr_send_data ( RDPCLIENT This,
uint8 data,
uint32  length 
)

Definition at line 102 of file cliprdr.c.

103{
104 DEBUG_CLIPBOARD(("cliprdr_send_data\n"));
106}

◆ cliprdr_send_data_request()

void cliprdr_send_data_request ( RDPCLIENT This,
uint32  format 
)

Definition at line 92 of file cliprdr.c.

93{
94 uint8 buffer[4];
95
96 DEBUG_CLIPBOARD(("cliprdr_send_data_request\n"));
99}
void buf_out_uint32(uint8 *buffer, uint32 value)
Definition: secure.c:304
#define CLIPRDR_REQUEST
Definition: cliprdr.c:30
GLuint buffer
Definition: glext.h:5915

◆ cliprdr_send_native_format_announce()

void cliprdr_send_native_format_announce ( RDPCLIENT This,
uint8 formats_data,
uint32  formats_data_length 
)

Definition at line 73 of file cliprdr.c.

74{
75 DEBUG_CLIPBOARD(("cliprdr_send_native_format_announce\n"));
76
78 formats_data_length);
79
80 if (formats_data != This->cliprdr.last_formats)
81 {
82 if (This->cliprdr.last_formats)
83 xfree(This->cliprdr.last_formats);
84
85 This->cliprdr.last_formats = xmalloc(formats_data_length);
86 memcpy(This->cliprdr.last_formats, formats_data, formats_data_length);
87 This->cliprdr.last_formats_length = formats_data_length;
88 }
89}
void xfree(void *mem)
Definition: uimain.c:758
void * xmalloc(int size)
Definition: uimain.c:747
#define memcpy(s1, s2, n)
Definition: mkisofs.h:878

Referenced by cliprdr_process(), and cliprdr_send_simple_native_format_announce().

◆ cliprdr_send_packet()

static void cliprdr_send_packet ( RDPCLIENT This,
uint16  type,
uint16  status,
uint8 data,
uint32  length 
)
static

Definition at line 35 of file cliprdr.c.

36{
37 STREAM s;
38
39 DEBUG_CLIPBOARD(("CLIPRDR send: type=%d, status=%d, length=%d\n", type, status, length));
40
41 s = channel_init(This, This->cliprdr.channel, length + 12);
46 out_uint32(s, 0); /* pad? */
48 channel_send(This, s, This->cliprdr.channel);
49}
STREAM channel_init(VCHANNEL *channel, uint32 length)
Definition: channels.c:69
void channel_send(STREAM s, VCHANNEL *channel)
Definition: channels.c:79
#define s_mark_end(s)
Definition: parse.h:41
#define out_uint32_le(s, v)
Definition: parse.h:59
#define out_uint16_le(s, v)
Definition: parse.h:58
#define out_uint8p(s, v, n)
Definition: parse.h:93
#define out_uint32(s, v)
Definition: parse.h:85
Definition: parse.h:23

Referenced by cliprdr_process(), cliprdr_send_data(), cliprdr_send_data_request(), and cliprdr_send_native_format_announce().

◆ cliprdr_send_simple_native_format_announce()

void cliprdr_send_simple_native_format_announce ( RDPCLIENT This,
uint32  format 
)

Definition at line 57 of file cliprdr.c.

58{
59 uint8 buffer[36];
60
61 DEBUG_CLIPBOARD(("cliprdr_send_simple_native_format_announce\n"));
62
64 memset(buffer + 4, 0, sizeof(buffer) - 4); /* description */
66}
#define memset(x, y, z)
Definition: compat.h:39

◆ cliprdr_set_mode()

void cliprdr_set_mode ( RDPCLIENT This,
const char optarg 
)

Definition at line 168 of file cliprdr.c.

169{
171}
void ui_clip_set_mode(const char *optarg)
const char * optarg
Definition: getopt.c:49