summaryrefslogtreecommitdiffstats
path: root/libxrdp
diff options
context:
space:
mode:
authorjsorg71 <jsorg71>2008-06-24 05:43:10 +0000
committerjsorg71 <jsorg71>2008-06-24 05:43:10 +0000
commitbfe555e3b6ad96df9ab45365305d1ef463c3f015 (patch)
tree7be1450fb6430acfc82566caedb6f83620c5e0d8 /libxrdp
parent756fcef1c8e4748b4a0c5b616d7afd7347aa6d5d (diff)
downloadxrdp-proprietary-bfe555e3b6ad96df9ab45365305d1ef463c3f015.tar.gz
xrdp-proprietary-bfe555e3b6ad96df9ab45365305d1ef463c3f015.zip
added brush cache bits for clients that support it
Diffstat (limited to 'libxrdp')
-rw-r--r--libxrdp/libxrdp.c11
-rw-r--r--libxrdp/libxrdp.h3
-rw-r--r--libxrdp/libxrdpinc.h6
-rw-r--r--libxrdp/xrdp_orders.c28
-rw-r--r--libxrdp/xrdp_rdp.c17
5 files changed, 63 insertions, 2 deletions
diff --git a/libxrdp/libxrdp.c b/libxrdp/libxrdp.c
index 70e88646..d46b0a08 100644
--- a/libxrdp/libxrdp.c
+++ b/libxrdp/libxrdp.c
@@ -716,3 +716,14 @@ libxrdp_send_to_channel(struct xrdp_session* session, int channel_id,
free_stream(s);
return 0;
}
+
+/*****************************************************************************/
+int EXPORT_CC
+libxrdp_orders_send_brush(struct xrdp_session* session,
+ int width, int height, int bpp, int type,
+ int size, char* data, int cache_id)
+{
+ return xrdp_orders_send_brush((struct xrdp_orders*)session->orders,
+ width, height, bpp, type, size, data,
+ cache_id);
+}
diff --git a/libxrdp/libxrdp.h b/libxrdp/libxrdp.h
index 9fb44391..e996b094 100644
--- a/libxrdp/libxrdp.h
+++ b/libxrdp/libxrdp.h
@@ -379,6 +379,9 @@ int APP_CC
xrdp_orders_send_bitmap2(struct xrdp_orders* self,
int width, int height, int bpp, char* data,
int cache_id, int cache_idx);
+int APP_CC
+xrdp_orders_send_brush(struct xrdp_orders* self, int width, int height,
+ int bpp, int type, int size, char* data, int cache_id);
/* xrdp_bitmap_compress.c */
int APP_CC
diff --git a/libxrdp/libxrdpinc.h b/libxrdp/libxrdpinc.h
index 9797a582..8e12642d 100644
--- a/libxrdp/libxrdpinc.h
+++ b/libxrdp/libxrdpinc.h
@@ -61,6 +61,8 @@ struct xrdp_client_info
int sound_code; /* 1 = leave sound at server */
int is_mce;
int rdp5_performanceflags;
+ int brush_cache_code; /* 0 = no cache 1 = 8x8 standard cache
+ 2 = arbitrary dimensions */
};
struct xrdp_brush
@@ -207,5 +209,9 @@ libxrdp_get_channel_id(struct xrdp_session* session, char* name);
int DEFAULT_CC
libxrdp_send_to_channel(struct xrdp_session* session, int channel_id,
char* data, int data_len);
+int DEFAULT_CC
+libxrdp_orders_send_brush(struct xrdp_session* session,
+ int width, int height, int bpp, int type,
+ int size, char* data, int cache_id);
#endif
diff --git a/libxrdp/xrdp_orders.c b/libxrdp/xrdp_orders.c
index 5695bb80..686d9034 100644
--- a/libxrdp/xrdp_orders.c
+++ b/libxrdp/xrdp_orders.c
@@ -1841,3 +1841,31 @@ height(%d)", lines_sending, height);
free_stream(temp_s);
return 0;
}
+
+/*****************************************************************************/
+/* returns error */
+/* send a brush cache entry */
+int APP_CC
+xrdp_orders_send_brush(struct xrdp_orders* self, int width, int height,
+ int bpp, int type, int size, char* data, int cache_id)
+{
+ int order_flags;
+ int len;
+
+ xrdp_orders_check(self, size + 12);
+ self->order_count++;
+ order_flags = RDP_ORDER_STANDARD | RDP_ORDER_SECONDARY;
+ out_uint8(self->out_s, order_flags);
+ len = (size + 6) - 7; /* length after type minus 7 */
+ out_uint16_le(self->out_s, len);
+ out_uint16_le(self->out_s, 0); /* flags */
+ out_uint8(self->out_s, RDP_ORDER_BRUSHCACHE); /* type */
+ out_uint8(self->out_s, cache_id);
+ out_uint8(self->out_s, bpp);
+ out_uint8(self->out_s, width);
+ out_uint8(self->out_s, height);
+ out_uint8(self->out_s, type);
+ out_uint8(self->out_s, size);
+ out_uint8a(self->out_s, data, size);
+ return 0;
+}
diff --git a/libxrdp/xrdp_rdp.c b/libxrdp/xrdp_rdp.c
index 2b0a30c2..bb9a6fc5 100644
--- a/libxrdp/xrdp_rdp.c
+++ b/libxrdp/xrdp_rdp.c
@@ -696,6 +696,19 @@ xrdp_process_capset_pointercache(struct xrdp_rdp* self, struct stream* s,
}
/*****************************************************************************/
+/* get the type of client brush cache */
+static int APP_CC
+xrdp_process_capset_brushcache(struct xrdp_rdp* self, struct stream* s,
+ int len)
+{
+ int code;
+
+ in_uint32_le(s, code);
+ self->client_info.brush_cache_code = code;
+ return 0;
+}
+
+/*****************************************************************************/
int APP_CC
xrdp_rdp_process_confirm_active(struct xrdp_rdp* self, struct stream* s)
{
@@ -762,8 +775,8 @@ xrdp_rdp_process_confirm_active(struct xrdp_rdp* self, struct stream* s)
case 14: /* 14 */
DEBUG(("--14"));
break;
- case 15: /* 15 */
- DEBUG(("--15"));
+ case RDP_CAPSET_BRUSHCACHE: /* 15 */
+ xrdp_process_capset_brushcache(self, s, len);
break;
case 16: /* 16 */
DEBUG(("--16"));