/[rdesktop]/sourceforge.net/trunk/rdesktop/rdp5.c
This is repository of my old source code which isn't updated any more. Go to git.rot13.org for current projects!
ViewVC logotype

Diff of /sourceforge.net/trunk/rdesktop/rdp5.c

Parent Directory Parent Directory | Revision Log Revision Log | View Patch Patch

revision 782 by astrand, Thu Oct 7 13:00:29 2004 UTC revision 895 by jdmeijer, Tue Apr 26 22:48:20 2005 UTC
# Line 1  Line 1 
1  /* -*- c-basic-offset: 8 -*-  /* -*- c-basic-offset: 8 -*-
2     rdesktop: A Remote Desktop Protocol client.     rdesktop: A Remote Desktop Protocol client.
3     Protocol services - Multipoint Communications Service     Protocol services - RDP5 short form PDU processing
4     Copyright (C) Matthew Chapman 1999-2002     Copyright (C) Matthew Chapman 1999-2005
5     Copyright (C) Erik Forsberg 2003     Copyright (C) Erik Forsberg 2003
6    
7     This program is free software; you can redistribute it and/or modify     This program is free software; you can redistribute it and/or modify
# Line 45  rdp5_process(STREAM s) Line 45  rdp5_process(STREAM s)
45          while (s->p < s->end)          while (s->p < s->end)
46          {          {
47                  in_uint8(s, type);                  in_uint8(s, type);
48                  if (type & RDP_COMPRESSION)                  if (type & RDP5_COMPRESSED)
49                  {                  {
50                          in_uint8(s, ctype);                          in_uint8(s, ctype);
51                          in_uint16_le(s, length);                          in_uint16_le(s, length);
52                          type ^= RDP_COMPRESSION;                          type ^= RDP5_COMPRESSED;
53                  }                  }
54                  else                  else
55                  {                  {
# Line 60  rdp5_process(STREAM s) Line 60  rdp5_process(STREAM s)
60    
61                  if (ctype & RDP_MPPC_COMPRESSED)                  if (ctype & RDP_MPPC_COMPRESSED)
62                  {                  {
                         if (length > RDP_MPPC_DICT_SIZE)  
                                 error("error decompressed packet size exceeds max\n");  
63                          if (mppc_expand(s->p, length, ctype, &roff, &rlen) == -1)                          if (mppc_expand(s->p, length, ctype, &roff, &rlen) == -1)
64                                  error("error while decompressing packet\n");                                  error("error while decompressing packet\n");
65    
# Line 82  rdp5_process(STREAM s) Line 80  rdp5_process(STREAM s)
80    
81                  switch (type)                  switch (type)
82                  {                  {
83                                  /* Thanks to Jeroen Meijer <jdmeijer at yahoo                          case 0: /* update orders */
                                    dot com> for finding out the meaning of  
                                    most of the opcodes here. Especially opcode  
                                    8! :) */  
                         case 0: /* orders */  
84                                  in_uint16_le(ts, count);                                  in_uint16_le(ts, count);
85                                  process_orders(ts, count);                                  process_orders(ts, count);
86                                  break;                                  break;
87                          case 1: /* bitmap update (???) */                          case 1: /* update bitmap */
88                                  in_uint8s(ts, 2);       /* part length */                                  in_uint8s(ts, 2);       /* part length */
89                                  process_bitmap_updates(ts);                                  process_bitmap_updates(ts);
90                                  break;                                  break;
91                          case 2: /* palette */                          case 2: /* update palette */
92                                  in_uint8s(ts, 2);       /* uint16 = 2 */                                  in_uint8s(ts, 2);       /* uint16 = 2 */
93                                  process_palette(ts);                                  process_palette(ts);
94                                  break;                                  break;
95                          case 3: /* probably an palette with offset 3. Weird */                          case 3: /* update synchronize */
96                                  break;                                  break;
97                          case 5:                          case 5: /* null pointer */
98                                  ui_set_null_cursor();                                  ui_set_null_cursor();
99                                  break;                                  break;
100                          case 8:                          case 6: /* default pointer */
101                                    break;
102                            case 8: /* pointer position */
103                                  in_uint16_le(ts, x);                                  in_uint16_le(ts, x);
104                                  in_uint16_le(ts, y);                                  in_uint16_le(ts, y);
105                                  if (s_check(ts))                                  if (s_check(ts))
106                                          ui_move_pointer(x, y);                                          ui_move_pointer(x, y);
107                                  break;                                  break;
108                          case 9:                          case 9: /* color pointer */
109                                  process_colour_pointer_pdu(ts);                                  process_colour_pointer_pdu(ts);
110                                  break;                                  break;
111                          case 10:                          case 10: /* cached pointer */
112                                  process_cached_pointer_pdu(ts);                                  process_cached_pointer_pdu(ts);
113                                  break;                                  break;
114                          default:                          default:

Legend:
Removed from v.782  
changed lines
  Added in v.895

  ViewVC Help
Powered by ViewVC 1.1.26