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 dfc9827..e0e081d 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 eafd3d0..52ea009 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 e001cd2..f417616 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 3e0b17f..724ff18 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);