/[rdesktop]/sourceforge.net/trunk/rdesktop/orders.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/orders.c

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

revision 725 by jsorg71, Sun Jun 27 17:51:54 2004 UTC revision 830 by jdmeijer, Tue Mar 8 00:23:02 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     RDP order processing     RDP order processing
4     Copyright (C) Matthew Chapman 1999-2002     Copyright (C) Matthew Chapman 1999-2005
5    
6     This program is free software; you can redistribute it and/or modify     This program is free software; you can redistribute it and/or modify
7     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
# Line 269  process_line(STREAM s, LINE_ORDER * os, Line 269  process_line(STREAM s, LINE_ORDER * os,
269    
270          rdp_parse_pen(s, &os->pen, present >> 7);          rdp_parse_pen(s, &os->pen, present >> 7);
271    
272          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",
273                 os->opcode, os->startx, os->starty, os->endx, os->endy, os->pen.colour));                 os->opcode, os->startx, os->starty, os->endx, os->endy, os->pen.colour));
274    
275          if (os->opcode < 0x01 || os->opcode > 0x10)          if (os->opcode < 0x01 || os->opcode > 0x10)
# Line 606  process_text2(STREAM s, TEXT2_ORDER * os Line 606  process_text2(STREAM s, TEXT2_ORDER * os
606          if (present & 0x002000)          if (present & 0x002000)
607                  in_uint16_le(s, os->boxbottom);                  in_uint16_le(s, os->boxbottom);
608    
609          if (present & 0x004000) /* fix for connecting to a server that */          /*
610                  in_uint8s(s, 10);       /* was disconnected with mstsc.exe */           * Unknown members, seen when connecting to a session that was disconnected with
611          /* 0x008000, 0x020000, and 0x040000 are present too ??? */           * mstsc and with wintach's spreadsheet test.
612             */
613            if (present & 0x004000)
614                    in_uint8s(s, 1);
615    
616            if (present & 0x008000)
617                    in_uint8s(s, 1);
618    
619            if (present & 0x010000)
620            {
621                    in_uint8s(s, 1);        /* guessing the length here */
622                    warning("Unknown order state member (0x010000) in text2 order.\n");
623            }
624    
625            if (present & 0x020000)
626                    in_uint8s(s, 4);
627    
628            if (present & 0x040000)
629                    in_uint8s(s, 4);
630    
631          if (present & 0x080000)          if (present & 0x080000)
632                  in_uint16_le(s, os->x);                  in_uint16_le(s, os->x);
# Line 670  process_raw_bmpcache(STREAM s) Line 688  process_raw_bmpcache(STREAM s)
688    
689          bitmap = ui_create_bitmap(width, height, inverted);          bitmap = ui_create_bitmap(width, height, inverted);
690          xfree(inverted);          xfree(inverted);
691          cache_put_bitmap(cache_id, cache_idx, bitmap, 0);          cache_put_bitmap(cache_id, cache_idx, bitmap);
692  }  }
693    
694  /* Process a bitmap cache order */  /* Process a bitmap cache order */
# Line 719  process_bmpcache(STREAM s) Line 737  process_bmpcache(STREAM s)
737          if (bitmap_decompress(bmpdata, width, height, data, size, Bpp))          if (bitmap_decompress(bmpdata, width, height, data, size, Bpp))
738          {          {
739                  bitmap = ui_create_bitmap(width, height, bmpdata);                  bitmap = ui_create_bitmap(width, height, bmpdata);
740                  cache_put_bitmap(cache_id, cache_idx, bitmap, 0);                  cache_put_bitmap(cache_id, cache_idx, bitmap);
741          }          }
742          else          else
743          {          {
# Line 772  process_bmpcache2(STREAM s, uint16 flags Line 790  process_bmpcache2(STREAM s, uint16 flags
790          in_uint8p(s, data, bufsize);          in_uint8p(s, data, bufsize);
791    
792          DEBUG(("BMPCACHE2(compr=%d,flags=%x,cx=%d,cy=%d,id=%d,idx=%d,Bpp=%d,bs=%d)\n",          DEBUG(("BMPCACHE2(compr=%d,flags=%x,cx=%d,cy=%d,id=%d,idx=%d,Bpp=%d,bs=%d)\n",
793                          compressed, flags, width, height, cache_id, cache_idx, Bpp, bufsize));                 compressed, flags, width, height, cache_id, cache_idx, Bpp, bufsize));
794    
795          bmpdata = (uint8 *) xmalloc(width * height * Bpp);          bmpdata = (uint8 *) xmalloc(width * height * Bpp);
796    
# Line 789  process_bmpcache2(STREAM s, uint16 flags Line 807  process_bmpcache2(STREAM s, uint16 flags
807          {          {
808                  for (y = 0; y < height; y++)                  for (y = 0; y < height; y++)
809                          memcpy(&bmpdata[(height - y - 1) * (width * Bpp)],                          memcpy(&bmpdata[(height - y - 1) * (width * Bpp)],
810                                          &data[y * (width * Bpp)], width * Bpp);                                 &data[y * (width * Bpp)], width * Bpp);
811          }          }
812    
813          bitmap = ui_create_bitmap(width, height, bmpdata);          bitmap = ui_create_bitmap(width, height, bmpdata);
814    
815          if (bitmap)          if (bitmap)
816          {          {
817                  cache_put_bitmap(cache_id, cache_idx, bitmap, 0);                  cache_put_bitmap(cache_id, cache_idx, bitmap);
818                  if (flags & PERSIST)                  if (flags & PERSIST)
819                          pstcache_put_bitmap(cache_id, cache_idx, bitmap_id, width, height,                          pstcache_save_bitmap(cache_id, cache_idx, bitmap_id, width, height,
820                                          width * height * Bpp, bmpdata);                                               width * height * Bpp, bmpdata);
821          }          }
822          else          else
823          {          {
# Line 879  process_secondary_order(STREAM s) Line 897  process_secondary_order(STREAM s)
897          /* The length isn't calculated correctly by the server.          /* The length isn't calculated correctly by the server.
898           * For very compact orders the length becomes negative           * For very compact orders the length becomes negative
899           * so a signed integer must be used. */           * so a signed integer must be used. */
900          sint16 length;          uint16 length;
901          uint16 flags;          uint16 flags;
902          uint8 type;          uint8 type;
903          uint8 *next_order;          uint8 *next_order;
904    
905          in_uint16_le(s, (uint16) length);          in_uint16_le(s, length);
906          in_uint16_le(s, flags);         /* used by bmpcache2 */          in_uint16_le(s, flags); /* used by bmpcache2 */
907          in_uint8(s, type);          in_uint8(s, type);
908    
909          next_order = s->p + length + 7;          next_order = s->p + (sint16) length + 7;
910    
911          switch (type)          switch (type)
912          {          {

Legend:
Removed from v.725  
changed lines
  Added in v.830

  ViewVC Help
Powered by ViewVC 1.1.26