--- sourceforge.net/trunk/rdesktop/orders.c 2004/06/27 18:53:08 726 +++ sourceforge.net/trunk/rdesktop/orders.c 2005/03/08 00:23:02 830 @@ -1,7 +1,7 @@ /* -*- c-basic-offset: 8 -*- rdesktop: A Remote Desktop Protocol client. RDP order processing - Copyright (C) Matthew Chapman 1999-2002 + Copyright (C) Matthew Chapman 1999-2005 This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by @@ -269,7 +269,7 @@ rdp_parse_pen(s, &os->pen, present >> 7); - DEBUG(("LINE(op=0x%x,sx=%d,sy=%d,dx=%d,dx=%d,fg=0x%x)\n", + DEBUG(("LINE(op=0x%x,sx=%d,sy=%d,dx=%d,dy=%d,fg=0x%x)\n", os->opcode, os->startx, os->starty, os->endx, os->endy, os->pen.colour)); if (os->opcode < 0x01 || os->opcode > 0x10) @@ -606,9 +606,27 @@ if (present & 0x002000) in_uint16_le(s, os->boxbottom); - if (present & 0x004000) /* fix for connecting to a server that */ - in_uint8s(s, 10); /* was disconnected with mstsc.exe */ - /* 0x008000, 0x020000, and 0x040000 are present too ??? */ + /* + * Unknown members, seen when connecting to a session that was disconnected with + * mstsc and with wintach's spreadsheet test. + */ + if (present & 0x004000) + in_uint8s(s, 1); + + if (present & 0x008000) + in_uint8s(s, 1); + + if (present & 0x010000) + { + in_uint8s(s, 1); /* guessing the length here */ + warning("Unknown order state member (0x010000) in text2 order.\n"); + } + + if (present & 0x020000) + in_uint8s(s, 4); + + if (present & 0x040000) + in_uint8s(s, 4); if (present & 0x080000) in_uint16_le(s, os->x); @@ -670,7 +688,7 @@ bitmap = ui_create_bitmap(width, height, inverted); xfree(inverted); - cache_put_bitmap(cache_id, cache_idx, bitmap, 0); + cache_put_bitmap(cache_id, cache_idx, bitmap); } /* Process a bitmap cache order */ @@ -719,7 +737,7 @@ if (bitmap_decompress(bmpdata, width, height, data, size, Bpp)) { bitmap = ui_create_bitmap(width, height, bmpdata); - cache_put_bitmap(cache_id, cache_idx, bitmap, 0); + cache_put_bitmap(cache_id, cache_idx, bitmap); } else { @@ -772,7 +790,7 @@ in_uint8p(s, data, bufsize); DEBUG(("BMPCACHE2(compr=%d,flags=%x,cx=%d,cy=%d,id=%d,idx=%d,Bpp=%d,bs=%d)\n", - compressed, flags, width, height, cache_id, cache_idx, Bpp, bufsize)); + compressed, flags, width, height, cache_id, cache_idx, Bpp, bufsize)); bmpdata = (uint8 *) xmalloc(width * height * Bpp); @@ -789,17 +807,17 @@ { for (y = 0; y < height; y++) memcpy(&bmpdata[(height - y - 1) * (width * Bpp)], - &data[y * (width * Bpp)], width * Bpp); + &data[y * (width * Bpp)], width * Bpp); } bitmap = ui_create_bitmap(width, height, bmpdata); if (bitmap) { - cache_put_bitmap(cache_id, cache_idx, bitmap, 0); + cache_put_bitmap(cache_id, cache_idx, bitmap); if (flags & PERSIST) - pstcache_put_bitmap(cache_id, cache_idx, bitmap_id, width, height, - width * height * Bpp, bmpdata); + pstcache_save_bitmap(cache_id, cache_idx, bitmap_id, width, height, + width * height * Bpp, bmpdata); } else { @@ -885,10 +903,10 @@ uint8 *next_order; in_uint16_le(s, length); - in_uint16_le(s, flags); /* used by bmpcache2 */ + in_uint16_le(s, flags); /* used by bmpcache2 */ in_uint8(s, type); - next_order = s->p + (sint16)length + 7; + next_order = s->p + (sint16) length + 7; switch (type) {