|
|
|
@ -179,7 +179,7 @@ xrdp_rdp_recv(struct xrdp_rdp* self, struct stream* s, int* code)
|
|
|
|
|
int pdu_code;
|
|
|
|
|
int chan;
|
|
|
|
|
|
|
|
|
|
DEBUG(("in xrdp_rdp_recv\r\n"));
|
|
|
|
|
DEBUG(("in xrdp_rdp_recv"));
|
|
|
|
|
if (s->next_packet == 0 || s->next_packet >= s->end)
|
|
|
|
|
{
|
|
|
|
|
chan = 0;
|
|
|
|
@ -188,19 +188,19 @@ xrdp_rdp_recv(struct xrdp_rdp* self, struct stream* s, int* code)
|
|
|
|
|
{
|
|
|
|
|
s->next_packet = 0;
|
|
|
|
|
*code = -1;
|
|
|
|
|
DEBUG(("out xrdp_rdp_recv\r\n"));
|
|
|
|
|
DEBUG(("out xrdp_rdp_recv"));
|
|
|
|
|
return 0;
|
|
|
|
|
}
|
|
|
|
|
if (error != 0)
|
|
|
|
|
{
|
|
|
|
|
DEBUG(("out xrdp_rdp_recv error\r\n"));
|
|
|
|
|
DEBUG(("out xrdp_rdp_recv error"));
|
|
|
|
|
return 1;
|
|
|
|
|
}
|
|
|
|
|
if (chan != MCS_GLOBAL_CHANNEL && chan > 0)
|
|
|
|
|
{
|
|
|
|
|
s->next_packet = 0;
|
|
|
|
|
*code = 0;
|
|
|
|
|
DEBUG(("out xrdp_rdp_recv\r\n"));
|
|
|
|
|
DEBUG(("out xrdp_rdp_recv"));
|
|
|
|
|
return 0;
|
|
|
|
|
}
|
|
|
|
|
s->next_packet = s->p;
|
|
|
|
@ -214,14 +214,14 @@ xrdp_rdp_recv(struct xrdp_rdp* self, struct stream* s, int* code)
|
|
|
|
|
{
|
|
|
|
|
s->next_packet += 8;
|
|
|
|
|
*code = 0;
|
|
|
|
|
DEBUG(("out xrdp_rdp_recv\r\n"));
|
|
|
|
|
DEBUG(("out xrdp_rdp_recv"));
|
|
|
|
|
return 0;
|
|
|
|
|
}
|
|
|
|
|
in_uint16_le(s, pdu_code);
|
|
|
|
|
*code = pdu_code & 0xf;
|
|
|
|
|
in_uint8s(s, 2); /* mcs user id */
|
|
|
|
|
s->next_packet += len;
|
|
|
|
|
DEBUG(("out xrdp_rdp_recv\r\n"));
|
|
|
|
|
DEBUG(("out xrdp_rdp_recv"));
|
|
|
|
|
return 0;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
@ -231,7 +231,7 @@ xrdp_rdp_send(struct xrdp_rdp* self, struct stream* s, int pdu_type)
|
|
|
|
|
{
|
|
|
|
|
int len;
|
|
|
|
|
|
|
|
|
|
DEBUG(("in xrdp_rdp_send\r\n"));
|
|
|
|
|
DEBUG(("in xrdp_rdp_send"));
|
|
|
|
|
s_pop_layer(s, rdp_hdr);
|
|
|
|
|
len = s->end - s->p;
|
|
|
|
|
out_uint16_le(s, len);
|
|
|
|
@ -239,10 +239,10 @@ xrdp_rdp_send(struct xrdp_rdp* self, struct stream* s, int pdu_type)
|
|
|
|
|
out_uint16_le(s, self->mcs_channel);
|
|
|
|
|
if (xrdp_sec_send(self->sec_layer, s) != 0)
|
|
|
|
|
{
|
|
|
|
|
DEBUG(("out xrdp_rdp_send error\r\n"));
|
|
|
|
|
DEBUG(("out xrdp_rdp_send error"));
|
|
|
|
|
return 1;
|
|
|
|
|
}
|
|
|
|
|
DEBUG(("out xrdp_rdp_send\r\n"));
|
|
|
|
|
DEBUG(("out xrdp_rdp_send"));
|
|
|
|
|
return 0;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
@ -253,7 +253,7 @@ xrdp_rdp_send_data(struct xrdp_rdp* self, struct stream* s,
|
|
|
|
|
{
|
|
|
|
|
int len;
|
|
|
|
|
|
|
|
|
|
DEBUG(("in xrdp_rdp_send_data\r\n"));
|
|
|
|
|
DEBUG(("in xrdp_rdp_send_data"));
|
|
|
|
|
s_pop_layer(s, rdp_hdr);
|
|
|
|
|
len = s->end - s->p;
|
|
|
|
|
out_uint16_le(s, len);
|
|
|
|
@ -268,10 +268,10 @@ xrdp_rdp_send_data(struct xrdp_rdp* self, struct stream* s,
|
|
|
|
|
out_uint16_le(s, 0);
|
|
|
|
|
if (xrdp_sec_send(self->sec_layer, s) != 0)
|
|
|
|
|
{
|
|
|
|
|
DEBUG(("out xrdp_rdp_send_data error\r\n"));
|
|
|
|
|
DEBUG(("out xrdp_rdp_send_data error"));
|
|
|
|
|
return 1;
|
|
|
|
|
}
|
|
|
|
|
DEBUG(("out xrdp_rdp_send_data\r\n"));
|
|
|
|
|
DEBUG(("out xrdp_rdp_send_data"));
|
|
|
|
|
return 0;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
@ -321,7 +321,7 @@ xrdp_rdp_parse_client_mcs_data(struct xrdp_rdp* self)
|
|
|
|
|
self->client_info.bpp = 16;
|
|
|
|
|
}
|
|
|
|
|
p->p = p->data;
|
|
|
|
|
DEBUG(("client width %d, client height %d bpp %d\r\n",
|
|
|
|
|
DEBUG(("client width %d, client height %d bpp %d",
|
|
|
|
|
self->client_info.width, self->client_info.height,
|
|
|
|
|
self->client_info.bpp));
|
|
|
|
|
return 0;
|
|
|
|
@ -331,7 +331,7 @@ xrdp_rdp_parse_client_mcs_data(struct xrdp_rdp* self)
|
|
|
|
|
int APP_CC
|
|
|
|
|
xrdp_rdp_incoming(struct xrdp_rdp* self)
|
|
|
|
|
{
|
|
|
|
|
DEBUG(("in xrdp_rdp_incoming\r\n"));
|
|
|
|
|
DEBUG(("in xrdp_rdp_incoming"));
|
|
|
|
|
if (xrdp_sec_incoming(self->sec_layer) != 0)
|
|
|
|
|
{
|
|
|
|
|
return 1;
|
|
|
|
@ -339,7 +339,7 @@ xrdp_rdp_incoming(struct xrdp_rdp* self)
|
|
|
|
|
self->mcs_channel = self->sec_layer->mcs_layer->userid +
|
|
|
|
|
MCS_USERCHANNEL_BASE;
|
|
|
|
|
xrdp_rdp_parse_client_mcs_data(self);
|
|
|
|
|
DEBUG(("out xrdp_rdp_incoming mcs channel %d\r\n", self->mcs_channel));
|
|
|
|
|
DEBUG(("out xrdp_rdp_incoming mcs channel %d", self->mcs_channel));
|
|
|
|
|
return 0;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
@ -528,11 +528,11 @@ xrdp_process_capset_bmpcache(struct xrdp_rdp* self, struct stream* s,
|
|
|
|
|
in_uint16_le(s, self->client_info.cache2_size);
|
|
|
|
|
in_uint16_le(s, self->client_info.cache3_entries);
|
|
|
|
|
in_uint16_le(s, self->client_info.cache3_size);
|
|
|
|
|
DEBUG(("cache1 entries %d size %d\r\n", self->client_info.cache1_entries,
|
|
|
|
|
DEBUG(("cache1 entries %d size %d", self->client_info.cache1_entries,
|
|
|
|
|
self->client_info.cache1_size));
|
|
|
|
|
DEBUG(("cache2 entries %d size %d\r\n", self->client_info.cache2_entries,
|
|
|
|
|
DEBUG(("cache2 entries %d size %d", self->client_info.cache2_entries,
|
|
|
|
|
self->client_info.cache2_size));
|
|
|
|
|
DEBUG(("cache3 entries %d size %d\r\n", self->client_info.cache3_entries,
|
|
|
|
|
DEBUG(("cache3 entries %d size %d", self->client_info.cache3_entries,
|
|
|
|
|
self->client_info.cache3_size));
|
|
|
|
|
return 0;
|
|
|
|
|
}
|
|
|
|
@ -564,11 +564,11 @@ xrdp_process_capset_bmpcache2(struct xrdp_rdp* self, struct stream* s,
|
|
|
|
|
i = MIN(i, 2000);
|
|
|
|
|
self->client_info.cache3_entries = i;
|
|
|
|
|
self->client_info.cache3_size = 4096 * Bpp;
|
|
|
|
|
DEBUG(("cache1 entries %d size %d\r\n", self->client_info.cache1_entries,
|
|
|
|
|
DEBUG(("cache1 entries %d size %d", self->client_info.cache1_entries,
|
|
|
|
|
self->client_info.cache1_size));
|
|
|
|
|
DEBUG(("cache2 entries %d size %d\r\n", self->client_info.cache2_entries,
|
|
|
|
|
DEBUG(("cache2 entries %d size %d", self->client_info.cache2_entries,
|
|
|
|
|
self->client_info.cache2_size));
|
|
|
|
|
DEBUG(("cache3 entries %d size %d\r\n", self->client_info.cache3_entries,
|
|
|
|
|
DEBUG(("cache3 entries %d size %d", self->client_info.cache3_entries,
|
|
|
|
|
self->client_info.cache3_size));
|
|
|
|
|
return 0;
|
|
|
|
|
}
|
|
|
|
@ -600,7 +600,7 @@ xrdp_rdp_process_confirm_active(struct xrdp_rdp* self, struct stream* s)
|
|
|
|
|
int len;
|
|
|
|
|
char* p;
|
|
|
|
|
|
|
|
|
|
DEBUG(("in xrdp_rdp_process_confirm_active\r\n"));
|
|
|
|
|
DEBUG(("in xrdp_rdp_process_confirm_active"));
|
|
|
|
|
in_uint8s(s, 4); /* rdp_shareid */
|
|
|
|
|
in_uint8s(s, 2); /* userid */
|
|
|
|
|
in_uint16_le(s, source_len); /* sizeof RDP_SOURCE */
|
|
|
|
@ -616,71 +616,71 @@ xrdp_rdp_process_confirm_active(struct xrdp_rdp* self, struct stream* s)
|
|
|
|
|
switch (type)
|
|
|
|
|
{
|
|
|
|
|
case RDP_CAPSET_GENERAL: /* 1 */
|
|
|
|
|
DEBUG(("RDP_CAPSET_GENERAL\r\n"));
|
|
|
|
|
DEBUG(("RDP_CAPSET_GENERAL"));
|
|
|
|
|
xrdp_process_capset_general(self, s, len);
|
|
|
|
|
break;
|
|
|
|
|
case RDP_CAPSET_BITMAP: /* 2 */
|
|
|
|
|
DEBUG(("RDP_CAPSET_BITMAP\r\n"));
|
|
|
|
|
DEBUG(("RDP_CAPSET_BITMAP"));
|
|
|
|
|
break;
|
|
|
|
|
case RDP_CAPSET_ORDER: /* 3 */
|
|
|
|
|
DEBUG(("RDP_CAPSET_ORDER\r\n"));
|
|
|
|
|
DEBUG(("RDP_CAPSET_ORDER"));
|
|
|
|
|
xrdp_process_capset_order(self, s, len);
|
|
|
|
|
break;
|
|
|
|
|
case RDP_CAPSET_BMPCACHE: /* 4 */
|
|
|
|
|
DEBUG(("RDP_CAPSET_BMPCACHE\r\n"));
|
|
|
|
|
DEBUG(("RDP_CAPSET_BMPCACHE"));
|
|
|
|
|
xrdp_process_capset_bmpcache(self, s, len);
|
|
|
|
|
break;
|
|
|
|
|
case RDP_CAPSET_CONTROL: /* 5 */
|
|
|
|
|
DEBUG(("RDP_CAPSET_CONTROL\r\n"));
|
|
|
|
|
DEBUG(("RDP_CAPSET_CONTROL"));
|
|
|
|
|
break;
|
|
|
|
|
case RDP_CAPSET_ACTIVATE: /* 7 */
|
|
|
|
|
DEBUG(("RDP_CAPSET_ACTIVATE\r\n"));
|
|
|
|
|
DEBUG(("RDP_CAPSET_ACTIVATE"));
|
|
|
|
|
break;
|
|
|
|
|
case RDP_CAPSET_POINTER: /* 8 */
|
|
|
|
|
DEBUG(("RDP_CAPSET_POINTER\r\n"));
|
|
|
|
|
DEBUG(("RDP_CAPSET_POINTER"));
|
|
|
|
|
xrdp_process_capset_pointercache(self, s, len);
|
|
|
|
|
break;
|
|
|
|
|
case RDP_CAPSET_SHARE: /* 9 */
|
|
|
|
|
DEBUG(("RDP_CAPSET_SHARE\r\n"));
|
|
|
|
|
DEBUG(("RDP_CAPSET_SHARE"));
|
|
|
|
|
break;
|
|
|
|
|
case RDP_CAPSET_COLCACHE: /* 10 */
|
|
|
|
|
DEBUG(("RDP_CAPSET_COLCACHE\r\n"));
|
|
|
|
|
DEBUG(("RDP_CAPSET_COLCACHE"));
|
|
|
|
|
break;
|
|
|
|
|
case 12: /* 12 */
|
|
|
|
|
DEBUG(("--12\r\n"));
|
|
|
|
|
DEBUG(("--12"));
|
|
|
|
|
break;
|
|
|
|
|
case 13: /* 13 */
|
|
|
|
|
DEBUG(("--13\r\n"));
|
|
|
|
|
DEBUG(("--13"));
|
|
|
|
|
break;
|
|
|
|
|
case 14: /* 14 */
|
|
|
|
|
DEBUG(("--14\r\n"));
|
|
|
|
|
DEBUG(("--14"));
|
|
|
|
|
break;
|
|
|
|
|
case 15: /* 15 */
|
|
|
|
|
DEBUG(("--15\r\n"));
|
|
|
|
|
DEBUG(("--15"));
|
|
|
|
|
break;
|
|
|
|
|
case 16: /* 16 */
|
|
|
|
|
DEBUG(("--16\r\n"));
|
|
|
|
|
DEBUG(("--16"));
|
|
|
|
|
break;
|
|
|
|
|
case 17: /* 17 */
|
|
|
|
|
DEBUG(("--16\r\n"));
|
|
|
|
|
DEBUG(("--16"));
|
|
|
|
|
break;
|
|
|
|
|
case RDP_CAPSET_BMPCACHE2: /* 19 */
|
|
|
|
|
DEBUG(("RDP_CAPSET_BMPCACHE2\r\n"));
|
|
|
|
|
DEBUG(("RDP_CAPSET_BMPCACHE2"));
|
|
|
|
|
xrdp_process_capset_bmpcache2(self, s, len);
|
|
|
|
|
break;
|
|
|
|
|
case 20: /* 20 */
|
|
|
|
|
DEBUG(("--20\r\n"));
|
|
|
|
|
DEBUG(("--20"));
|
|
|
|
|
break;
|
|
|
|
|
case 21: /* 21 */
|
|
|
|
|
DEBUG(("--21\r\n"));
|
|
|
|
|
DEBUG(("--21"));
|
|
|
|
|
break;
|
|
|
|
|
default:
|
|
|
|
|
g_printf("unknown in xrdp_rdp_process_confirm_active %d\r\n", type);
|
|
|
|
|
g_writeln("unknown in xrdp_rdp_process_confirm_active %d", type);
|
|
|
|
|
break;
|
|
|
|
|
}
|
|
|
|
|
s->p = p + len;
|
|
|
|
|
}
|
|
|
|
|
DEBUG(("out xrdp_rdp_process_confirm_active\r\n"));
|
|
|
|
|
DEBUG(("out xrdp_rdp_process_confirm_active"));
|
|
|
|
|
return 0;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
@ -706,7 +706,7 @@ xrdp_rdp_process_data_input(struct xrdp_rdp* self, struct stream* s)
|
|
|
|
|
|
|
|
|
|
in_uint16_le(s, num_events);
|
|
|
|
|
in_uint8s(s, 2); /* pad */
|
|
|
|
|
DEBUG(("in xrdp_rdp_process_data_input %d events\r\n", num_events));
|
|
|
|
|
DEBUG(("in xrdp_rdp_process_data_input %d events", num_events));
|
|
|
|
|
for (index = 0; index < num_events; index++)
|
|
|
|
|
{
|
|
|
|
|
in_uint32_le(s, time);
|
|
|
|
@ -715,7 +715,7 @@ xrdp_rdp_process_data_input(struct xrdp_rdp* self, struct stream* s)
|
|
|
|
|
in_sint16_le(s, param1);
|
|
|
|
|
in_sint16_le(s, param2);
|
|
|
|
|
DEBUG(("xrdp_rdp_process_data_input event %4.4x flags %4.4x param1 %d \
|
|
|
|
|
param2 %d time %d\r\n", msg_type, device_flags, param1, param2, time));
|
|
|
|
|
param2 %d time %d", msg_type, device_flags, param1, param2, time));
|
|
|
|
|
if (self->session->callback != 0)
|
|
|
|
|
{
|
|
|
|
|
/* msg_type can be
|
|
|
|
@ -727,7 +727,7 @@ param2 %d time %d\r\n", msg_type, device_flags, param1, param2, time));
|
|
|
|
|
device_flags, time);
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
DEBUG(("out xrdp_rdp_process_data_input\r\n"));
|
|
|
|
|
DEBUG(("out xrdp_rdp_process_data_input"));
|
|
|
|
|
return 0;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
@ -942,7 +942,7 @@ xrdp_rdp_process_data(struct xrdp_rdp* self, struct stream* s)
|
|
|
|
|
in_uint8(s, data_type);
|
|
|
|
|
in_uint8(s, ctype);
|
|
|
|
|
in_uint16_le(s, clen);
|
|
|
|
|
DEBUG(("xrdp_rdp_process_data code %d\r\n", data_type));
|
|
|
|
|
DEBUG(("xrdp_rdp_process_data code %d", data_type));
|
|
|
|
|
switch (data_type)
|
|
|
|
|
{
|
|
|
|
|
case RDP_DATA_PDU_POINTER: /* 27 */
|
|
|
|
@ -976,7 +976,7 @@ xrdp_rdp_process_data(struct xrdp_rdp* self, struct stream* s)
|
|
|
|
|
xrdp_rdp_process_data_font(self, s);
|
|
|
|
|
break;
|
|
|
|
|
default:
|
|
|
|
|
g_printf("unknown in xrdp_rdp_process_data %d\r\n", data_type);
|
|
|
|
|
g_writeln("unknown in xrdp_rdp_process_data %d", data_type);
|
|
|
|
|
break;
|
|
|
|
|
}
|
|
|
|
|
return 0;
|
|
|
|
|