--- sourceforge.net/trunk/rdesktop/rdp.c 2003/10/31 20:34:26 540 +++ sourceforge.net/trunk/rdesktop/rdp.c 2004/02/14 19:30:01 604 @@ -18,6 +18,7 @@ Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. */ +#include #include "rdesktop.h" extern uint16 g_mcs_userid; @@ -131,6 +132,25 @@ s->p += len; } +/* Input a string in Unicode + * + * Returns str_len of string + */ +int +rdp_in_unistr(STREAM s, char *string, int uni_len) +{ + int i = 0; + + while (i < uni_len / 2) + { + in_uint8a(s, &string[i++], 1); + in_uint8s(s, 1); + } + + return i - 1; +} + + /* Parse a logon info packet */ static void rdp_send_logon_info(uint32 flags, char *domain, char *user, @@ -146,6 +166,8 @@ int packetlen = 0; uint32 sec_flags = g_encryption ? (SEC_LOGON_INFO | SEC_ENCRYPT) : SEC_LOGON_INFO; STREAM s; + time_t t = time(NULL); + time_t tzone; if (!g_use_rdp5 || 1 == g_server_rdp_version) { @@ -247,8 +269,10 @@ rdp_out_unistr(s, "127.0.0.1", len_ip); out_uint16_le(s, len_dll + 2); rdp_out_unistr(s, "C:\\WINNT\\System32\\mstscax.dll", len_dll); - out_uint16_le(s, 0xffc4); - out_uint16_le(s, 0xffff); + + tzone = (mktime(gmtime(&t)) - mktime(localtime(&t))) / 60; + out_uint32_le(s, tzone); + rdp_out_unistr(s, "GTB, normaltid", 2 * strlen("GTB, normaltid")); out_uint8s(s, 62 - 2 * strlen("GTB, normaltid")); @@ -600,7 +624,7 @@ rdp_recv(&type); /* RDP_PDU_SYNCHRONIZE */ rdp_recv(&type); /* RDP_CTL_COOPERATE */ rdp_recv(&type); /* RDP_CTL_GRANT_CONTROL */ - rdp_send_input(0, RDP_INPUT_SYNCHRONIZE, 0, 0, 0); + rdp_send_input(0, RDP_INPUT_SYNCHRONIZE, 0, ui_get_numlock_state(read_keyboard_state()), 0); rdp_send_fonts(1); rdp_send_fonts(2); rdp_recv(&type); /* RDP_PDU_UNKNOWN 0x28 */