Send the same value back in synchronise.
authorSteinar H. Gunderson <sesse@samfundet.no>
Sun, 6 Feb 2005 14:17:12 +0000 (14:17 +0000)
committerSteinar H. Gunderson <sesse@samfundet.no>
Sun, 6 Feb 2005 14:17:12 +0000 (14:17 +0000)
proto.h
rdp.c
rdpsrv.c

diff --git a/proto.h b/proto.h
index 20710c0..932901e 100644 (file)
--- a/proto.h
+++ b/proto.h
@@ -79,6 +79,8 @@ BOOL rdp_connect(char *server, uint32 flags, char *domain, char *password, char
                 char *directory);
 void rdp_disconnect(void);
 void rdp_send_bitmap_update(unsigned x, unsigned y, unsigned width, unsigned height, unsigned char *data);
+void rdp_send_control(uint16 action);
+void rdp_send_synchronise(uint16 id);
 /* rdpdr.c */
 void rdpdr_send_connect(void);
 void rdpdr_send_name(void);
diff --git a/rdp.c b/rdp.c
index 49ff6a9..111f37b 100644 (file)
--- a/rdp.c
+++ b/rdp.c
@@ -304,14 +304,14 @@ rdp_send_control(uint16 action)
 
 /* Send a synchronisation PDU */
 void
-rdp_send_synchronise(void)
+rdp_send_synchronise(uint16 id)
 {
        STREAM s;
 
        s = rdp_init_data(4);
 
        out_uint16_le(s, 1);    /* type */
-       out_uint16_le(s, 1002);
+       out_uint16_le(s, id);
 
        s_mark_end(s);
        rdp_send_data(s, RDP_DATA_PDU_SYNCHRONISE);
index 18c5b7a..9623971 100644 (file)
--- a/rdpsrv.c
+++ b/rdpsrv.c
@@ -357,6 +357,7 @@ int serve_client()
 
        for ( ;; ) {
                uint8 type, data_pdu_type;
+               uint16 id;
                STREAM s;
 
                fd_set readfs;
@@ -384,7 +385,15 @@ int serve_client()
                                                handle_control_pdu(s);
                                                break;
                                        case RDP_DATA_PDU_SYNCHRONISE:
-                                               rdp_send_synchronise(s);
+                                               in_uint16_le(s, id);
+                                               printf("Synchronise, id=%u\n", id);
+                                               rdp_send_synchronise(id);
+                                               break;
+                                       case RDP_DATA_PDU_FONT2:
+                                               // respond with the
+                                               // unknown 0x28 PDU
+                                               // here?
+                                               printf("FONT2, ignored\n");
                                                break;
                                        default:
                                                printf("Unknown data PDU type %u\n", data_pdu_type);