--- sourceforge.net/trunk/rdesktop/rdp.c 2005/03/15 11:25:50 865 +++ sourceforge.net/trunk/rdesktop/rdp.c 2005/05/31 18:49:05 907 @@ -161,7 +161,7 @@ #ifdef HAVE_ICONV size_t ibl = strlen(string), obl = len + 2; static iconv_t iconv_h = (iconv_t) - 1; - char *pin = string, *pout = s->p; + char *pin = string, *pout = (char *) s->p; memset(pout, 0, len + 4); @@ -176,7 +176,8 @@ g_codepage, WINDOWS_CODEPAGE, (int) iconv_h); g_iconv_works = False; - return (rdp_out_unistr(s, string, len)); + rdp_out_unistr(s, string, len); + return; } if (iconv(iconv_h, (ICONV_CONST char **) &pin, &i, &pout, &o) == (size_t) - 1) @@ -186,7 +187,8 @@ warning("rdp_out_unistr: iconv(1) fail, errno %d\n", errno); g_iconv_works = False; - return (rdp_out_unistr(s, string, len)); + rdp_out_unistr(s, string, len); + return; } pin = string; pout = (char *) s->p; @@ -199,7 +201,8 @@ warning("rdp_out_unistr: iconv(2) fail, errno %d\n", errno); g_iconv_works = False; - return (rdp_out_unistr(s, string, len)); + rdp_out_unistr(s, string, len); + return; } s->p += len + 2; @@ -231,7 +234,7 @@ { #ifdef HAVE_ICONV size_t ibl = uni_len, obl = uni_len; - char *pin = s->p, *pout = string; + char *pin = (char *) s->p, *pout = string; static iconv_t iconv_h = (iconv_t) - 1; if (g_iconv_works) @@ -294,12 +297,6 @@ time_t t = time(NULL); time_t tzone; -#if 0 - /* enable rdp compression */ - /* some problems still exist with rdp5 */ - flags |= RDP_COMPRESSION; -#endif - if (!g_use_rdp5 || 1 == g_server_rdp_version) { DEBUG_RDP5(("Sending RDP4-style Logon packet\n")); @@ -484,7 +481,38 @@ rdp_send_data(s, RDP_DATA_PDU_INPUT); } -/* Inform the server on the contents of the persistent bitmap cache */ +/* Send a client window information PDU */ +void +rdp_send_client_window_status(int status) +{ + STREAM s; + static int current_status = 1; + + if (current_status == status) + return; + + s = rdp_init_data(12); + + out_uint32_le(s, status); + + switch (status) + { + case 0: /* shut the server up */ + break; + + case 1: /* receive data again */ + out_uint32_le(s, 0); /* unknown */ + out_uint16_le(s, g_width); + out_uint16_le(s, g_height); + break; + } + + s_mark_end(s); + rdp_send_data(s, RDP_DATA_PDU_CLIENT_WINDOW_STATUS); + current_status = status; +} + +/* Send persistent bitmap cache enumeration PDU's */ static void rdp_enum_bmpcache2(void) { @@ -661,8 +689,9 @@ out_uint16_le(s, g_bitmap_cache_persist_enable ? 2 : 0); /* version */ - out_uint16_le(s, 0x0300); /* flags? number of caches? */ + out_uint16_be(s, 3); /* number of caches in this set */ + /* max cell size for cache 0 is 16x16, 1 = 32x32, 2 = 64x64, etc */ out_uint32_le(s, BMPCACHE2_C0_CELLS); out_uint32_le(s, BMPCACHE2_C1_CELLS); if (pstcache_init(2))