From 2dc5f491323a23c6ce758e9cb82ca4eb5ff21478 Mon Sep 17 00:00:00 2001 From: speidy Date: Sun, 17 Nov 2013 16:23:11 +0200 Subject: [PATCH] libxrdp: add Montior Layout PDU (server to client), temporary hack --- libxrdp/xrdp_rdp.c | 42 ++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 42 insertions(+) diff --git a/libxrdp/xrdp_rdp.c b/libxrdp/xrdp_rdp.c index 5f358fca..f07cf251 100644 --- a/libxrdp/xrdp_rdp.c +++ b/libxrdp/xrdp_rdp.c @@ -52,6 +52,16 @@ static tui8 g_unknown1[172] = 0x2b, 0x00, 0x2a, 0x00 }; +static tui8 g_monitorlayout[44] = +{ + 0x02, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x7F, 0x07, 0x00, 0x00, + 0x37, 0x04, 0x00, 0x00, 0x01, 0x00, 0x00, 0x00, + 0x80, 0x07, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0xFF, 0x0E, 0x00, 0x00, 0x37, 0x04, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00 +}; + /* some compilers need unsigned char to avoid warnings */ /* static tui8 g_unknown2[8] = @@ -1600,7 +1610,33 @@ xrdp_rdp_send_unknown1(struct xrdp_rdp *self) free_stream(s); return 0; } +/*****************************************************************************/ +static int APP_CC +xrdp_rdp_send_monitorlayout(struct xrdp_rdp *self) +{ + struct stream *s; + make_stream(s); + init_stream(s, 8192); + + if (xrdp_rdp_init_data(self, s) != 0) + { + free_stream(s); + return 1; + } + + out_uint8a(s, g_monitorlayout, 44); + s_mark_end(s); + + if (xrdp_rdp_send_data(self, s, 0x37) != 0) + { + free_stream(s); + return 1; + } + + free_stream(s); + return 0; +} /*****************************************************************************/ static int APP_CC xrdp_rdp_process_data_font(struct xrdp_rdp *self, struct stream *s) @@ -1619,6 +1655,12 @@ xrdp_rdp_process_data_font(struct xrdp_rdp *self, struct stream *s) /* running */ DEBUG(("sending unknown1")); xrdp_rdp_send_unknown1(self); + if (self->client_info.monitorCount > 0) { + if (xrdp_rdp_send_monitorlayout(self) != 0) + { + g_writeln("Problem with monitor layout packet!!!"); + } + } self->session->up_and_running = 1; DEBUG(("up_and_running set")); xrdp_rdp_send_data_update_sync(self);