diff options
author | jsorg71 <jsorg71> | 2006-03-17 01:10:24 +0000 |
---|---|---|
committer | jsorg71 <jsorg71> | 2006-03-17 01:10:24 +0000 |
commit | b91f25deef43cce2d528e2e121dab32941735dea (patch) | |
tree | 0c178b06bfe37acf36675456971d67625e419781 /libxrdp/xrdp_rdp.c | |
parent | b475ff2c83299fee8baed228f13a337d25a0fa1f (diff) | |
download | xrdp-proprietary-b91f25deef43cce2d528e2e121dab32941735dea.tar.gz xrdp-proprietary-b91f25deef43cce2d528e2e121dab32941735dea.zip |
bitmap cache v2
Diffstat (limited to 'libxrdp/xrdp_rdp.c')
-rw-r--r-- | libxrdp/xrdp_rdp.c | 41 |
1 files changed, 39 insertions, 2 deletions
diff --git a/libxrdp/xrdp_rdp.c b/libxrdp/xrdp_rdp.c index 7d9d376f..ed69c17e 100644 --- a/libxrdp/xrdp_rdp.c +++ b/libxrdp/xrdp_rdp.c @@ -107,7 +107,7 @@ xrdp_rdp_create(struct xrdp_session* session, int sck) self->sec_layer = xrdp_sec_create(self, sck); /* read ini settings */ xrdp_rdp_read_config(&self->client_info); - /* deafult 8 bit color bitmap cache entries and size */ + /* default 8 bit v1 color bitmap cache entries and size */ self->client_info.cache1_entries = 600; self->client_info.cache1_size = 256; self->client_info.cache2_entries = 300; @@ -352,7 +352,7 @@ xrdp_rdp_send_demand_active(struct xrdp_rdp* self) out_uint16_le(s, 0x200); /* Protocol version */ out_uint16_le(s, 0); /* pad */ out_uint16_le(s, 0); /* Compression types */ - out_uint16_le(s, 0); /* pad use 0x40d for rdp packets */ + out_uint16_le(s, 0); /* pad use 0x40d for rdp packets, 0 for not */ out_uint16_le(s, 0); /* Update capability */ out_uint16_le(s, 0); /* Remote unshare capability */ out_uint16_le(s, 0); /* Compression level */ @@ -512,6 +512,42 @@ xrdp_process_capset_bmpcache(struct xrdp_rdp* self, struct stream* s, } /*****************************************************************************/ +/* get the bitmap cache size */ +static int APP_CC +xrdp_process_capset_bmpcache2(struct xrdp_rdp* self, struct stream* s, + int len) +{ + int Bpp; + int i; + + self->client_info.bitmap_cache_version = 2; + Bpp = (self->client_info.bpp + 7) / 8; + in_uint16_le(s, i); + self->client_info.bitmap_cache_persist_enable = i; + in_uint8s(s, 2); /* number of caches in set, 3 */ + in_uint32_le(s, i); + i = MIN(i, 2000); + self->client_info.cache1_entries = i; + self->client_info.cache1_size = 256 * Bpp; + in_uint32_le(s, i); + i = MIN(i, 2000); + self->client_info.cache2_entries = i; + self->client_info.cache2_size = 1024 * Bpp; + in_uint32_le(s, i); + i = i & 0x7fffffff; + 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, + self->client_info.cache1_size)); + DEBUG(("cache2 entries %d size %d\r\n", self->client_info.cache2_entries, + self->client_info.cache2_size)); + DEBUG(("cache3 entries %d size %d\r\n", self->client_info.cache3_entries, + self->client_info.cache3_size)); + return 0; +} + +/*****************************************************************************/ /* get the number of client cursor cache */ static int APP_CC xrdp_process_capset_pointercache(struct xrdp_rdp* self, struct stream* s, @@ -604,6 +640,7 @@ xrdp_rdp_process_confirm_active(struct xrdp_rdp* self, struct stream* s) break; case RDP_CAPSET_BMPCACHE2: /* 19 */ DEBUG(("RDP_CAPSET_BMPCACHE2\r\n")); + xrdp_process_capset_bmpcache2(self, s, len); break; case 20: /* 20 */ DEBUG(("--20\r\n")); |