summaryrefslogtreecommitdiffstats
path: root/libxrdp/xrdp_rdp.c
diff options
context:
space:
mode:
authorJay Sorg <jay.sorg@gmail.com>2012-06-21 21:36:03 -0700
committerJay Sorg <jay.sorg@gmail.com>2012-06-21 21:36:03 -0700
commit608101fbcad50b9d201577c02f2779947807738e (patch)
tree488e2e1bccc39982b5c8d550261d52a13f1596a1 /libxrdp/xrdp_rdp.c
parent963ceaacabd97ba8a9b9e32da27d20cab6285d2d (diff)
parent02124492c26db64b6a3256c0b14f5533bd37aec7 (diff)
downloadxrdp-proprietary-608101fbcad50b9d201577c02f2779947807738e.tar.gz
xrdp-proprietary-608101fbcad50b9d201577c02f2779947807738e.zip
Merge branch 'master' of github.com:FreeRDP/xrdp
Diffstat (limited to 'libxrdp/xrdp_rdp.c')
-rw-r--r--libxrdp/xrdp_rdp.c112
1 files changed, 100 insertions, 12 deletions
diff --git a/libxrdp/xrdp_rdp.c b/libxrdp/xrdp_rdp.c
index fd163308..ba777092 100644
--- a/libxrdp/xrdp_rdp.c
+++ b/libxrdp/xrdp_rdp.c
@@ -113,13 +113,25 @@ xrdp_rdp_read_config(struct xrdp_client_info* client_info)
{
client_info->crypt_level = 3;
}
+ else
+ {
+ g_writeln("Warning: Your configured crypt level is"
+ "undefined 'high' will be used");
+ client_info->crypt_level = 3;
+ }
}
else if (g_strcasecmp(item, "channel_code") == 0)
{
- if (g_strcasecmp(value, "1") == 0)
+ if ((g_strcasecmp(value, "yes") == 0) ||
+ (g_strcasecmp(value, "1") == 0) ||
+ (g_strcasecmp(value, "true") == 0))
{
client_info->channel_code = 1;
}
+ else
+ {
+ g_writeln("Info: All channels are disabled");
+ }
}
else if (g_strcasecmp(item, "max_bpp") == 0)
{
@@ -223,7 +235,7 @@ xrdp_rdp_recv(struct xrdp_rdp* self, struct stream* s, int* code)
{
s->next_packet = 0;
*code = -1;
- DEBUG(("out xrdp_rdp_recv"));
+ DEBUG(("out (1) xrdp_rdp_recv"));
return 0;
}
if (error != 0)
@@ -235,35 +247,47 @@ xrdp_rdp_recv(struct xrdp_rdp* self, struct stream* s, int* code)
{
if (chan > MCS_GLOBAL_CHANNEL)
{
- xrdp_channel_process(self->sec_layer->chan_layer, s, chan);
+ if(xrdp_channel_process(self->sec_layer->chan_layer, s, chan)!=0)
+ {
+ g_writeln("xrdp_channel_process returned unhandled error") ;
+ }
+ }
+ else
+ {
+ g_writeln("Wrong channel Id to be handled by xrdp_channel_process %d",chan);
}
s->next_packet = 0;
*code = 0;
- DEBUG(("out xrdp_rdp_recv"));
+ DEBUG(("out (2) xrdp_rdp_recv"));
return 0;
}
s->next_packet = s->p;
}
else
{
+ DEBUG(("xrdp_rdp_recv stream not touched"))
s->p = s->next_packet;
}
if (!s_check_rem(s, 6))
{
s->next_packet = 0;
*code = 0;
- DEBUG(("out xrdp_rdp_recv"));
+ DEBUG(("out (3) xrdp_rdp_recv"));
len = (int)(s->end - s->p);
g_writeln("xrdp_rdp_recv: bad RDP packet, length [%d]", len);
return 0;
}
- in_uint16_le(s, len);
- 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"));
- return 0;
+ else
+ {
+ in_uint16_le(s, len);
+ /*g_writeln("New len received : %d next packet: %d s_end: %d",len,s->next_packet,s->end); */
+ in_uint16_le(s, pdu_code);
+ *code = pdu_code & 0xf;
+ in_uint8s(s, 2); /* mcs user id */
+ s->next_packet += len;
+ DEBUG(("out (4) xrdp_rdp_recv"));
+ return 0;
+ }
}
/*****************************************************************************/
@@ -620,6 +644,21 @@ xrdp_rdp_send_demand_active(struct xrdp_rdp* self)
out_uint8(s, 1);
out_uint8s(s, 83);
+ /* Remote Programs Capability Set */
+ caps_count++;
+ out_uint16_le(s, 0x0017); /* CAPSETTYPE_RAIL */
+ out_uint16_le(s, 8);
+ out_uint32_le(s, 3); /* TS_RAIL_LEVEL_SUPPORTED
+ TS_RAIL_LEVEL_DOCKED_LANGBAR_SUPPORTED */
+
+ /* Window List Capability Set */
+ caps_count++;
+ out_uint16_le(s, 0x0018); /* CAPSETTYPE_WINDOW */
+ out_uint16_le(s, 11);
+ out_uint32_le(s, 2); /* TS_WINDOW_LEVEL_SUPPORTED_EX */
+ out_uint8(s, 3); /* NumIconCaches */
+ out_uint16_le(s, 12); /* NumIconCacheEntries */
+
out_uint8s(s, 4); /* pad */
s_mark_end(s);
@@ -826,6 +865,49 @@ xrdp_process_offscreen_bmpcache(struct xrdp_rdp* self, struct stream* s,
}
/*****************************************************************************/
+static int APP_CC
+xrdp_process_capset_rail(struct xrdp_rdp* self, struct stream* s, int len)
+{
+ int i32;
+
+ if (len - 4 < 4)
+ {
+ g_writeln("xrdp_process_capset_rail: bad len");
+ return 1;
+ }
+ in_uint32_le(s, i32);
+ self->client_info.rail_support_level = i32;
+ g_writeln("xrdp_process_capset_rail: rail_support_level %d",
+ self->client_info.rail_support_level);
+ return 0;
+}
+
+/*****************************************************************************/
+static int APP_CC
+xrdp_process_capset_window(struct xrdp_rdp* self, struct stream* s, int len)
+{
+ int i32;
+
+ if (len - 4 < 7)
+ {
+ g_writeln("xrdp_process_capset_window: bad len");
+ return 1;
+ }
+ in_uint32_le(s, i32);
+ self->client_info.wnd_support_level = i32;
+ in_uint8(s, i32);
+ self->client_info.wnd_num_icon_caches = i32;
+ in_uint16_le(s, i32);
+ self->client_info.wnd_num_icon_cache_entries = i32;
+ g_writeln("xrdp_process_capset_window wnd_support_level %d "
+ "wnd_num_icon_caches %d wnd_num_icon_cache_entries %d",
+ self->client_info.wnd_support_level,
+ self->client_info.wnd_num_icon_caches,
+ self->client_info.wnd_num_icon_cache_entries);
+ return 0;
+}
+
+/*****************************************************************************/
int APP_CC
xrdp_rdp_process_confirm_active(struct xrdp_rdp* self, struct stream* s)
{
@@ -915,6 +997,12 @@ xrdp_rdp_process_confirm_active(struct xrdp_rdp* self, struct stream* s)
case 22: /* 22 */
DEBUG(("--22"));
break;
+ case 0x0017: /* 23 CAPSETTYPE_RAIL */
+ xrdp_process_capset_rail(self, s, len);
+ break;
+ case 0x0018: /* 24 CAPSETTYPE_WINDOW */
+ xrdp_process_capset_window(self, s, len);
+ break;
case 26: /* 26 */
DEBUG(("--26"));
break;