From 55b980af095bbdc41d5c4b9f37e52a9d9259bd1f Mon Sep 17 00:00:00 2001 From: jsorg71 Date: Fri, 29 Apr 2005 01:52:56 +0000 Subject: [PATCH] capture more client caps --- xrdp/xrdp_rdp.c | 46 +++++++++++++++++++++++++++++++++++----------- xrdp/xrdp_types.h | 3 ++- 2 files changed, 37 insertions(+), 12 deletions(-) diff --git a/xrdp/xrdp_rdp.c b/xrdp/xrdp_rdp.c index a36aeac6..745f07b7 100644 --- a/xrdp/xrdp_rdp.c +++ b/xrdp/xrdp_rdp.c @@ -432,10 +432,34 @@ int xrdp_rdp_send_demand_active(struct xrdp_rdp* self) } /*****************************************************************************/ +int xrdp_process_capset_general(struct xrdp_rdp* self, struct stream* s, + int len) +{ + int i; + + in_uint8s(s, 10); + in_uint16_le(s, i); + self->client_info.use_compact_packets = (i != 0); + return 0; +} + +/*****************************************************************************/ +int xrdp_process_capset_order(struct xrdp_rdp* self, struct stream* s, + int len) +{ + int i; + + in_uint8s(s, 72); + in_uint32_le(s, i); /* desktop cache size, usually 0x38400 */ + self->client_info.desktop_cache = i; + return 0; +} + +/*****************************************************************************/ +/* get the bitmap cache size */ int xrdp_process_capset_bmpcache(struct xrdp_rdp* self, struct stream* s, int len) { - //g_hexdump(s->p, len); in_uint8s(s, 24); in_uint16_le(s, self->client_info.cache1_entries); in_uint16_le(s, self->client_info.cache1_size); @@ -443,24 +467,20 @@ int 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); - //g_printf("%d %d %d %d %d %d\n", self->cache1_entries, self->cache1_size, - // self->cache2_entries, self->cache2_size, - // self->cache3_entries, self->cache3_size); return 0; } /*****************************************************************************/ +/* get the number of client cursor cache */ int xrdp_process_capset_pointercache(struct xrdp_rdp* self, struct stream* s, int len) { int i; - //g_hexdump(s->p, len); in_uint8s(s, 2); /* color pointer */ in_uint16_le(s, i); i = MIN(i, 32); self->client_info.pointer_cache_entries = i; - //g_printf("%d\n", self->client_info.pointer_cache_entries); return 0; } @@ -487,19 +507,23 @@ int xrdp_rdp_process_confirm_active(struct xrdp_rdp* self, struct stream* s) p = s->p; in_uint16_le(s, type); in_uint16_le(s, len); - //g_printf("%d %d\n", type, len); switch (type) { - case RDP_CAPSET_BMPCACHE: + case RDP_CAPSET_GENERAL: /* 1 */ + xrdp_process_capset_general(self, s, len); + break; + case RDP_CAPSET_ORDER: /* 3 */ + xrdp_process_capset_order(self, s, len); + break; + case RDP_CAPSET_BMPCACHE: /* 4 */ xrdp_process_capset_bmpcache(self, s, len); break; - case RDP_CAPSET_POINTER: + case RDP_CAPSET_POINTER: /* 8 */ xrdp_process_capset_pointercache(self, s, len); break; } s->p = p + len; } - //g_hexdump(s->p, s->end - s->p); return 0; } @@ -765,7 +789,7 @@ int xrdp_rdp_process_data_font(struct xrdp_rdp* self, struct stream* s) int seq; in_uint8s(s, 2); /* num of fonts */ - in_uint8s(s, 2); // unknown + in_uint8s(s, 2); /* unknown */ in_uint16_le(s, seq); /* 419 client sends Seq 1, then 2 */ /* 2600 clients sends only Seq 3 */ diff --git a/xrdp/xrdp_types.h b/xrdp/xrdp_types.h index de687c67..24a60031 100644 --- a/xrdp/xrdp_types.h +++ b/xrdp/xrdp_types.h @@ -184,6 +184,8 @@ struct xrdp_client_info int use_bitmap_comp; int use_bitmap_cache; int op1; /* use smaller bitmap header, todo */ + int desktop_cache; + int use_compact_packets; /* rdp5 smaller packets */ }; /* rdp */ @@ -283,7 +285,6 @@ struct xrdp_orders int text_y; int text_len; char* text_data; - }; struct xrdp_palette_item