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 e8e69cd..e0ce66a 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;
 
-       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);
@@ -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);
-       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); }
index c5cb187..f5bea8a 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];
index 56c8bef..4a16cea 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;
 
-#if WITH_DEBUG
+#if WITH_DEBUG && 0
                DEBUG(("Sending encrypted packet:\n"));
                hexdump(s->p + 8, datalen);
 #endif