]> git.sesse.net Git - rdpsrv/commitdiff
Add function for sending bitmap updates (not working yet :-/)
authorSteinar H. Gunderson <sgunderson@bigfoot.com>
Fri, 4 Feb 2005 01:44:38 +0000 (01:44 +0000)
committerSteinar H. Gunderson <sgunderson@bigfoot.com>
Fri, 4 Feb 2005 01:44:38 +0000 (01:44 +0000)
proto.h
rdp.c
rdpsrv.c
secure.c

diff --git a/proto.h b/proto.h
index dfc9827acb4ff5ffda75988312fa7dff2b572a3b..e0e081d01c847655af1fd474c8ac5572ad93f200 100644 (file)
--- a/proto.h
+++ b/proto.h
@@ -63,6 +63,7 @@ void save_licence(unsigned char *data, int length);
 /* rdp5.c */
 void rdp5_process(STREAM s, BOOL encryption);
 /* rdp.c */
+STREAM rdp_recv(uint8 * type);
 void rdp_out_unistr(STREAM s, char *string, int len);
 void rdp_send_input(uint32 time, uint16 message_type, uint16 device_flags, uint16 param1,
                    uint16 param2);
@@ -75,6 +76,7 @@ BOOL rdp_main_loop(void);
 BOOL rdp_connect(char *server, uint32 flags, char *domain, char *password, char *command,
                 char *directory);
 void rdp_disconnect(void);
+void rdp_send_bitmap_update(void);
 /* rdpdr.c */
 void rdpdr_send_connect(void);
 void rdpdr_send_name(void);
diff --git a/rdp.c b/rdp.c
index eafd3d0da7fae6e2506951723366e64fcd9c8355..52ea0093ea48b073d63590c9206fd51ef6c877d6 100644 (file)
--- a/rdp.c
+++ b/rdp.c
@@ -80,7 +80,7 @@ rdp_recv(uint8 * type)
 }
 
 /* Initialise an RDP data packet */
-static STREAM
+STREAM
 rdp_init_data(int maxlen)
 {
        STREAM s;
@@ -92,7 +92,7 @@ rdp_init_data(int maxlen)
 }
 
 /* Send an RDP data packet */
-static void
+void
 rdp_send_data(STREAM s, uint8 data_pdu_type)
 {
        uint16 length;
@@ -148,6 +148,44 @@ rdp_in_unistr(STREAM s, char *string, int len)
        s->p += len;
 }
 
+void rdp_send_bitmap_update(void)
+{
+       STREAM s;
+
+       s = rdp_init_data(11*2 + 2*2*3);
+       out_uint16_le(s, RDP_UPDATE_BITMAP);
+       out_uint16_le(s, 1); // one update
+       out_uint16_le(s, 1); // left, top, right, bottom
+       out_uint16_le(s, 2);
+       out_uint16_le(s, 3);
+       out_uint16_le(s, 4);
+       out_uint16_le(s, 2); // width, height
+       out_uint16_le(s, 2);
+       out_uint16_le(s, 24); // bpp
+       out_uint16_le(s, 0); // no compression
+       out_uint16_le(s, 2*2*3); // bufsize
+
+       out_uint8(s, 255);
+       out_uint8(s, 0);
+       out_uint8(s, 0);
+
+       out_uint8(s, 0);
+       out_uint8(s, 255);
+       out_uint8(s, 0);
+
+       out_uint8(s, 0);
+       out_uint8(s, 0);
+       out_uint8(s, 255);
+
+       out_uint8(s, 255);
+       out_uint8(s, 255);
+       out_uint8(s, 255);
+
+       s_mark_end(s);
+       rdp_send_data(s, RDP_DATA_PDU_UPDATE);
+}
+
+
 void
 rdp_get_logon_info(STREAM s)
 {
index e001cd24cd6e99672738ee2248a3ccf3ab544e2e..f417616724d502081eda6352e82c2721159dc318 100644 (file)
--- a/rdpsrv.c
+++ b/rdpsrv.c
@@ -86,6 +86,8 @@ int serve_client()
                        default:
                                printf("Unknown data PDU type %u\n", data_pdu_type);
                        };
+
+//                     rdp_send_bitmap_update();
                }
        }
 }
index 3e0b17f90a0698f0f35bc53ed61adb0eb9e708c4..724ff189bdc6e46518b07cfdd8b154ee827d3cc5 100644 (file)
--- a/secure.c
+++ b/secure.c
@@ -343,6 +343,8 @@ sec_send_to_channel(STREAM s, uint32 flags, uint16 channel)
 {
        int datalen;
 
+       DEBUG(("sending packet to channel %u", channel));
+       
        s_pop_layer(s, sec_hdr);
 //     if (!g_licence_issued || (flags & SEC_ENCRYPT))
                out_uint32_le(s, flags);