--- sourceforge.net/trunk/rdesktop/rdp5.c 2004/06/16 03:08:55 713 +++ sourceforge.net/trunk/rdesktop/rdp5.c 2005/04/26 22:48:20 895 @@ -1,7 +1,7 @@ /* -*- c-basic-offset: 8 -*- rdesktop: A Remote Desktop Protocol client. - Protocol services - Multipoint Communications Service - Copyright (C) Matthew Chapman 1999-2002 + Protocol services - RDP5 short form PDU processing + Copyright (C) Matthew Chapman 1999-2005 Copyright (C) Erik Forsberg 2003 This program is free software; you can redistribute it and/or modify @@ -26,7 +26,7 @@ extern RDPCOMP g_mppc_dict; void -rdp5_process(STREAM s, BOOL encryption) +rdp5_process(STREAM s) { uint16 length, count, x, y; uint8 type, ctype; @@ -36,12 +36,6 @@ struct stream *ns = &(g_mppc_dict.ns); struct stream *ts; - if (encryption) - { - in_uint8s(s, 8); /* signature */ - sec_decrypt(s->p, s->end - s->p); - } - #if 0 printf("RDP5 data:\n"); hexdump(s->p, s->end - s->p); @@ -51,11 +45,11 @@ while (s->p < s->end) { in_uint8(s, type); - if (type & RDP_COMPRESSION) + if (type & RDP5_COMPRESSED) { in_uint8(s, ctype); in_uint16_le(s, length); - type ^= RDP_COMPRESSION; + type ^= RDP5_COMPRESSED; } else { @@ -66,7 +60,6 @@ if (ctype & RDP_MPPC_COMPRESSED) { - if (mppc_expand(s->p, length, ctype, &roff, &rlen) == -1) error("error while decompressing packet\n"); @@ -87,37 +80,35 @@ switch (type) { - /* Thanks to Jeroen Meijer for finding out the meaning of - most of the opcodes here. Especially opcode - 8! :) */ - case 0: /* orders */ + case 0: /* update orders */ in_uint16_le(ts, count); process_orders(ts, count); break; - case 1: /* bitmap update (???) */ + case 1: /* update bitmap */ in_uint8s(ts, 2); /* part length */ process_bitmap_updates(ts); break; - case 2: /* palette */ + case 2: /* update palette */ in_uint8s(ts, 2); /* uint16 = 2 */ process_palette(ts); break; - case 3: /* probably an palette with offset 3. Weird */ + case 3: /* update synchronize */ break; - case 5: + case 5: /* null pointer */ ui_set_null_cursor(); break; - case 8: + case 6: /* default pointer */ + break; + case 8: /* pointer position */ in_uint16_le(ts, x); in_uint16_le(ts, y); if (s_check(ts)) ui_move_pointer(x, y); break; - case 9: + case 9: /* color pointer */ process_colour_pointer_pdu(ts); break; - case 10: + case 10: /* cached pointer */ process_cached_pointer_pdu(ts); break; default: