/[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 711 by jsorg71, Tue Jun 15 22:45:12 2004 UTC revision 889 by jdmeijer, Sun Apr 17 23:14: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 - Multipoint Communications Service
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
8     it under the terms of the GNU General Public License as published by     it under the terms of the GNU General Public License as published by
9     the Free Software Foundation; either version 2 of the License, or     the Free Software Foundation; either version 2 of the License, or
10     (at your option) any later version.     (at your option) any later version.
11      
12     This program is distributed in the hope that it will be useful,     This program is distributed in the hope that it will be useful,
13     but WITHOUT ANY WARRANTY; without even the implied warranty of     but WITHOUT ANY WARRANTY; without even the implied warranty of
14     MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the     MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
15     GNU General Public License for more details.     GNU General Public License for more details.
16      
17     You should have received a copy of the GNU General Public License     You should have received a copy of the GNU General Public License
18     along with this program; if not, write to the Free Software     along with this program; if not, write to the Free Software
19     Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.     Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
# Line 26  extern uint8 *g_next_packet; Line 26  extern uint8 *g_next_packet;
26  extern RDPCOMP g_mppc_dict;  extern RDPCOMP g_mppc_dict;
27    
28  void  void
29  rdp5_process(STREAM s, BOOL encryption)  rdp5_process(STREAM s)
30  {  {
31          uint16 length, count, x, y;          uint16 length, count, x, y;
32          uint8 type, ctype;          uint8 type, ctype;
# Line 36  rdp5_process(STREAM s, BOOL encryption) Line 36  rdp5_process(STREAM s, BOOL encryption)
36          struct stream *ns = &(g_mppc_dict.ns);          struct stream *ns = &(g_mppc_dict.ns);
37          struct stream *ts;          struct stream *ts;
38    
         if (encryption)  
         {  
                 in_uint8s(s, 8);        /* signature */  
                 sec_decrypt(s->p, s->end - s->p);  
         }  
   
39  #if 0  #if 0
40          printf("RDP5 data:\n");          printf("RDP5 data:\n");
41          hexdump(s->p, s->end - s->p);          hexdump(s->p, s->end - s->p);
42  #endif  #endif
43    
44            ui_begin_update();
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 65  rdp5_process(STREAM s, BOOL encryption) Line 60  rdp5_process(STREAM s, BOOL encryption)
60    
61                  if (ctype & RDP_MPPC_COMPRESSED)                  if (ctype & RDP_MPPC_COMPRESSED)
62                  {                  {
   
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 107  rdp5_process(STREAM s, BOOL encryption) Line 101  rdp5_process(STREAM s, BOOL encryption)
101                          case 5:                          case 5:
102                                  ui_set_null_cursor();                                  ui_set_null_cursor();
103                                  break;                                  break;
104                            case 6: /* TODO: W2K3 SP1 sends this on connect */
105                                    break;
106                          case 8:                          case 8:
107                                  in_uint16_le(ts, x);                                  in_uint16_le(ts, x);
108                                  in_uint16_le(ts, y);                                  in_uint16_le(ts, y);
# Line 125  rdp5_process(STREAM s, BOOL encryption) Line 121  rdp5_process(STREAM s, BOOL encryption)
121    
122                  s->p = next;                  s->p = next;
123          }          }
124            ui_end_update();
125  }  }

Legend:
Removed from v.711  
changed lines
  Added in v.889

  ViewVC Help
Powered by ViewVC 1.1.26