]> git.sesse.net Git - rdpsrv/commitdiff
Removed some debugging stuff, correct RDP5 bitmap sending.
authorSteinar H. Gunderson <sesse@samfundet.no>
Sun, 6 Feb 2005 02:58:02 +0000 (02:58 +0000)
committerSteinar H. Gunderson <sesse@samfundet.no>
Sun, 6 Feb 2005 02:58:02 +0000 (02:58 +0000)
rdp.c
rdpsrv.c
secure.c

diff --git a/rdp.c b/rdp.c
index e8e69cd0a2f2bbe5472a7a9141374f210b0c900d..e0ce66af31662f88b529c6a514980997082b6ce9 100644 (file)
--- a/rdp.c
+++ b/rdp.c
@@ -152,8 +152,19 @@ void rdp_send_bitmap_update(unsigned x, unsigned y, unsigned width, unsigned hei
 {
        STREAM s;
 
 {
        STREAM s;
 
-       s = rdp_init_data(11*2 + width*height*3);
-       out_uint16_le(s, RDP_UPDATE_BITMAP);
+       int length = 10*2 + width*height*3 + 8;
+
+       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);
+
+       out_uint8(s, 1); // process bitmap update
+       out_uint16_le(s, 10*2 + width*height*3 + 2); // RDP5 chunk length
+       out_uint16_le(s, 10*2 + width*height*3);     // part length
+
        out_uint16_le(s, 1); // one update
        out_uint16_le(s, x); // left, top, right, bottom
        out_uint16_le(s, y);
        out_uint16_le(s, 1); // one update
        out_uint16_le(s, x); // left, top, right, bottom
        out_uint16_le(s, y);
@@ -168,7 +179,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);
        out_uint8p(s, data, width*height*3);
        
        s_mark_end(s);
-       rdp_send_data(s, RDP_DATA_PDU_UPDATE);
+       tcp_send(s);
 }
 
 #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); }
 }
 
 #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); }
index c5cb1876fb397e6f608dc8fb9457ce8b8c3215b2..f5bea8a23d0998b7857205c3d5c44d1bbdbf119a 100644 (file)
--- a/rdpsrv.c
+++ b/rdpsrv.c
@@ -364,8 +364,6 @@ int serve_client()
                        }
                }
 
                        }
                }
 
-               printf("LISTEN_ON_VNC=%u\n", listen_on_vnc);
-               
                // activity on VNC socket?
                if (FD_ISSET(vnc_sock, &readfs) && listen_on_vnc) {
                        unsigned char buf[256];
                // activity on VNC socket?
                if (FD_ISSET(vnc_sock, &readfs) && listen_on_vnc) {
                        unsigned char buf[256];
index 56c8bef117fba0929c4d2c3e129adfaf8be2bc44..4a16ceaec2cbbc0f2605f908d03a45cab060f63c 100644 (file)
--- a/secure.c
+++ b/secure.c
@@ -375,7 +375,7 @@ sec_send_to_channel(STREAM s, uint32 flags, uint16 channel)
                flags &= ~SEC_ENCRYPT;
                datalen = s->end - s->p - 8;
 
                flags &= ~SEC_ENCRYPT;
                datalen = s->end - s->p - 8;
 
-#if WITH_DEBUG
+#if WITH_DEBUG && 0
                DEBUG(("Sending encrypted packet:\n"));
                hexdump(s->p + 8, datalen);
 #endif
                DEBUG(("Sending encrypted packet:\n"));
                hexdump(s->p + 8, datalen);
 #endif