From 3877f62cb1eaadc9389341106befc04eded5ae18 Mon Sep 17 00:00:00 2001 From: "Steinar H. Gunderson" Date: Fri, 4 Feb 2005 02:20:01 +0000 Subject: [PATCH] Various changes to try to work better with MS RDC (no big luck) --- mcs.c | 13 +++++++++---- proto.h | 3 +-- rdp.c | 24 +++++++----------------- 3 files changed, 17 insertions(+), 23 deletions(-) diff --git a/mcs.c b/mcs.c index d1cbf8c..4a8fc3f 100644 --- a/mcs.c +++ b/mcs.c @@ -155,8 +155,9 @@ void mcs_send_connect_response() { STREAM s; + int i; - s = iso_init(80); // FIXME + s = iso_init(92); ber_out_header(s, MCS_CONNECT_RESPONSE, 80); ber_out_header(s, BER_TAG_RESULT, 1); @@ -167,17 +168,21 @@ mcs_send_connect_response() mcs_out_domain_params(s, 34, 2, 0, 0xffff); // dumdidum? - ber_out_header(s, BER_TAG_OCTET_STRING, 28); + ber_out_header(s, BER_TAG_OCTET_STRING, 40); out_uint8s(s, 21); // ick out_uint8(s, 0); - // server info -- we claim to support RDP4 + // server info -- we claim to support RDP1 out_uint16_le(s, SEC_TAG_SRV_INFO); out_uint16_le(s, 6); // length out_uint16_le(s, 1); - // aiee, no crypto info yet! :-) + // crypto info + out_uint16_le(s, SEC_TAG_SRV_CRYPT); + out_uint16_le(s, 12); // length + out_uint32_le(s, 1); // 40-bit + out_uint32_le(s, 0); // no encryption s_mark_end(s); printf("LEN: %u\n", s->p - s->iso_hdr); diff --git a/proto.h b/proto.h index e0e081d..d2cf92a 100644 --- a/proto.h +++ b/proto.h @@ -65,8 +65,7 @@ void rdp5_process(STREAM s, BOOL encryption); /* rdp.c */ STREAM rdp_recv(uint8 * type); void rdp_out_unistr(STREAM s, char *string, int len); -void rdp_send_input(uint32 time, uint16 message_type, uint16 device_flags, uint16 param1, - uint16 param2); +void rdp_recv_input(STREAM s, uint32 *time, uint16 *message_type, uint16 *device_flags, uint16 *param1, uint16 *param2); void process_colour_pointer_pdu(STREAM s); void process_cached_pointer_pdu(STREAM s); void process_system_pointer_pdu(STREAM s); diff --git a/rdp.c b/rdp.c index f7fac2d..ff302fb 100644 --- a/rdp.c +++ b/rdp.c @@ -260,25 +260,15 @@ rdp_send_synchronise(void) rdp_send_data(s, RDP_DATA_PDU_SYNCHRONISE); } -/* Send a single input event */ +/* Receive a single input event */ void -rdp_send_input(uint32 time, uint16 message_type, uint16 device_flags, uint16 param1, uint16 param2) +rdp_recv_input(STREAM s, uint32 *time, uint16 *message_type, uint16 *device_flags, uint16 *param1, uint16 *param2) { - STREAM s; - - s = rdp_init_data(16); - - out_uint16_le(s, 1); /* number of events */ - out_uint16(s, 0); /* pad */ - - out_uint32_le(s, time); - out_uint16_le(s, message_type); - out_uint16_le(s, device_flags); - out_uint16_le(s, param1); - out_uint16_le(s, param2); - - s_mark_end(s); - rdp_send_data(s, RDP_DATA_PDU_INPUT); + in_uint32_le(s, time); + in_uint16_le(s, message_type); + in_uint16_le(s, device_flags); + in_uint16_le(s, param1); + in_uint16_le(s, param2); } /* Disconnect from the RDP layer */ -- 2.39.2