server: proxy: rail: Fix rail handshake flags sync issue at reconnect
authorKobi Mizrachi <kmizrachi18@gmail.com>
Tue, 7 Jul 2020 12:31:31 +0000 (15:31 +0300)
committerakallabeth <akallabeth@posteo.net>
Tue, 7 Jul 2020 13:03:37 +0000 (15:03 +0200)
(cherry picked from commit cc9ef8f74e59f9351aca84a2a95048a4af274af6)

server/proxy/pf_rail.c

index 43cc192..41fe11e 100644 (file)
@@ -38,6 +38,15 @@ BOOL pf_rail_context_init(pServerContext* ps)
                return FALSE;
        }
 
+       /*
+        * when mstsc reconnects, it doesn't wait for a second handshake, so update all handshake flags
+        * to be SET, then set them again when the remote server sends his handshake.
+        */
+       rail_server_set_handshake_ex_flags(rail,
+                                          TS_RAIL_ORDER_HANDSHAKEEX_FLAGS_HIDEF |
+                                              TS_RAIL_ORDER_HANDSHAKE_EX_FLAGS_EXTENDED_SPI_SUPPORTED |
+                                              TS_RAIL_ORDER_HANDSHAKE_EX_FLAGS_SNAP_ARRANGE_SUPPORTED);
+
        rail->rdpcontext = (rdpContext*)ps;
        return TRUE;
 }