]> git.sesse.net Git - rdpsrv/blobdiff - rdp.c
Separated the RDP5 sending into its own protocol layer.
[rdpsrv] / rdp.c
diff --git a/rdp.c b/rdp.c
index e0ce66af31662f88b529c6a514980997082b6ce9..538e053ae821ea14f089036fd2c40c32aaf4dc02 100644 (file)
--- a/rdp.c
+++ b/rdp.c
@@ -152,14 +152,9 @@ void rdp_send_bitmap_update(unsigned x, unsigned y, unsigned width, unsigned hei
 {
        STREAM s;
 
-       int length = 10*2 + width*height*3 + 8;
+       int length = 10*2 + width*height*3 + 5;
 
-       printf("RDP5 chunk length: %u\n", 10*2 + width*height*3 + 2);
-       
-       s = tcp_init(length);
-       out_uint8(s, 0); // version (RDP5)
-       out_uint8(s, 0x80 | (length >> 8));
-       out_uint8(s, length & 0xff);
+       s = rdp5_init(length, 0);
 
        out_uint8(s, 1); // process bitmap update
        out_uint16_le(s, 10*2 + width*height*3 + 2); // RDP5 chunk length
@@ -179,7 +174,7 @@ void rdp_send_bitmap_update(unsigned x, unsigned y, unsigned width, unsigned hei
        out_uint8p(s, data, width*height*3);
        
        s_mark_end(s);
-       tcp_send(s);
+       rdp5_send(s, 0);
 }
 
 #define EXPECT16(value) { in_uint16_le(s, unknown); if (unknown != (value)) printf("Unknown value on code line %u; expected 0x%x, got 0x%x\n", __LINE__, (value), unknown); }