34 |
static VCHANNEL *cliprdr_channel; |
static VCHANNEL *cliprdr_channel; |
35 |
|
|
36 |
static void |
static void |
37 |
cliprdr_send_packet(uint16 type, uint16 status, uint8 *data, uint32 length) |
cliprdr_send_packet(uint16 type, uint16 status, uint8 * data, uint32 length) |
38 |
{ |
{ |
39 |
STREAM s; |
STREAM s; |
40 |
|
|
45 |
out_uint16_le(s, status); |
out_uint16_le(s, status); |
46 |
out_uint32_le(s, length); |
out_uint32_le(s, length); |
47 |
out_uint8p(s, data, length); |
out_uint8p(s, data, length); |
48 |
out_uint32(s, 0); /* pad? */ |
out_uint32(s, 0); /* pad? */ |
49 |
s_mark_end(s); |
s_mark_end(s); |
50 |
channel_send(s, cliprdr_channel); |
channel_send(s, cliprdr_channel); |
51 |
} |
} |
56 |
uint8 buffer[36]; |
uint8 buffer[36]; |
57 |
|
|
58 |
buf_out_uint32(buffer, CF_TEXT); |
buf_out_uint32(buffer, CF_TEXT); |
59 |
memset(buffer+4, 0, sizeof(buffer)-4); /* description */ |
memset(buffer + 4, 0, sizeof(buffer) - 4); /* description */ |
60 |
cliprdr_send_packet(CLIPRDR_FORMAT_ANNOUNCE, CLIPRDR_REQUEST, buffer, sizeof(buffer)); |
cliprdr_send_packet(CLIPRDR_FORMAT_ANNOUNCE, CLIPRDR_REQUEST, buffer, sizeof(buffer)); |
61 |
} |
} |
62 |
|
|
66 |
uint8 buffer[36]; |
uint8 buffer[36]; |
67 |
|
|
68 |
buf_out_uint32(buffer, CF_OEMTEXT); |
buf_out_uint32(buffer, CF_OEMTEXT); |
69 |
memset(buffer+4, 0, sizeof(buffer)-4); /* description */ |
memset(buffer + 4, 0, sizeof(buffer) - 4); /* description */ |
70 |
cliprdr_send_packet(CLIPRDR_FORMAT_ANNOUNCE, CLIPRDR_REQUEST, buffer, sizeof(buffer)); |
cliprdr_send_packet(CLIPRDR_FORMAT_ANNOUNCE, CLIPRDR_REQUEST, buffer, sizeof(buffer)); |
71 |
} |
} |
72 |
|
|
73 |
void |
void |
74 |
cliprdr_send_native_format_announce(uint8 *data, uint32 length) |
cliprdr_send_native_format_announce(uint8 * data, uint32 length) |
75 |
{ |
{ |
76 |
cliprdr_send_packet(CLIPRDR_FORMAT_ANNOUNCE, CLIPRDR_REQUEST, data, length); |
cliprdr_send_packet(CLIPRDR_FORMAT_ANNOUNCE, CLIPRDR_REQUEST, data, length); |
77 |
} |
} |
86 |
} |
} |
87 |
|
|
88 |
void |
void |
89 |
cliprdr_send_data(uint8 *data, uint32 length) |
cliprdr_send_data(uint8 * data, uint32 length) |
90 |
{ |
{ |
91 |
cliprdr_send_packet(CLIPRDR_DATA_RESPONSE, CLIPRDR_RESPONSE, data, length); |
cliprdr_send_packet(CLIPRDR_DATA_RESPONSE, CLIPRDR_RESPONSE, data, length); |
92 |
} |
} |
145 |
BOOL |
BOOL |
146 |
cliprdr_init(void) |
cliprdr_init(void) |
147 |
{ |
{ |
148 |
cliprdr_channel = channel_register("cliprdr", CHANNEL_OPTION_INITIALIZED | CHANNEL_OPTION_ENCRYPT_RDP \ |
cliprdr_channel = |
149 |
| CHANNEL_OPTION_COMPRESS_RDP | CHANNEL_OPTION_SHOW_PROTOCOL, cliprdr_process); |
channel_register("cliprdr", |
150 |
|
CHANNEL_OPTION_INITIALIZED | CHANNEL_OPTION_ENCRYPT_RDP | |
151 |
|
CHANNEL_OPTION_COMPRESS_RDP | CHANNEL_OPTION_SHOW_PROTOCOL, |
152 |
|
cliprdr_process); |
153 |
return (cliprdr_channel != NULL); |
return (cliprdr_channel != NULL); |
154 |
} |
} |