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

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

revision 30 by matty, Fri Sep 14 13:51:38 2001 UTC revision 82 by astrand, Tue Jul 30 07:18:48 2002 UTC
# Line 60  rdp_send(STREAM s, uint8 pdu_type) Line 60  rdp_send(STREAM s, uint8 pdu_type)
60    
61  /* Receive an RDP packet */  /* Receive an RDP packet */
62  static STREAM  static STREAM
63  rdp_recv(uint8 *type)  rdp_recv(uint8 * type)
64  {  {
65          static STREAM rdp_s;          static STREAM rdp_s;
66          uint16 length, pdu_type;          uint16 length, pdu_type;
# Line 155  rdp_send_logon_info(uint32 flags, char * Line 155  rdp_send_logon_info(uint32 flags, char *
155          int len_password = 2 * strlen(password);          int len_password = 2 * strlen(password);
156          int len_program = 2 * strlen(program);          int len_program = 2 * strlen(program);
157          int len_directory = 2 * strlen(directory);          int len_directory = 2 * strlen(directory);
158          uint32 sec_flags = encryption ? (SEC_LOGON_INFO | SEC_ENCRYPT)          uint32 sec_flags = encryption ? (SEC_LOGON_INFO | SEC_ENCRYPT) : SEC_LOGON_INFO;
                                 : SEC_LOGON_INFO;  
159          STREAM s;          STREAM s;
160    
161          s = sec_init(sec_flags, 18 + len_domain + len_user + len_password          s = sec_init(sec_flags, 18 + len_domain + len_user + len_password
# Line 212  rdp_send_synchronise() Line 211  rdp_send_synchronise()
211    
212  /* Send a single input event */  /* Send a single input event */
213  void  void
214  rdp_send_input(uint32 time, uint16 message_type, uint16 device_flags,  rdp_send_input(uint32 time, uint16 message_type, uint16 device_flags, uint16 param1, uint16 param2)
                uint16 param1, uint16 param2)  
215  {  {
216          STREAM s;          STREAM s;
217    
# Line 442  rdp_send_confirm_active() Line 440  rdp_send_confirm_active()
440                  RDP_CAPLEN_GENERAL + RDP_CAPLEN_BITMAP + RDP_CAPLEN_ORDER +                  RDP_CAPLEN_GENERAL + RDP_CAPLEN_BITMAP + RDP_CAPLEN_ORDER +
441                  RDP_CAPLEN_BMPCACHE + RDP_CAPLEN_COLCACHE +                  RDP_CAPLEN_BMPCACHE + RDP_CAPLEN_COLCACHE +
442                  RDP_CAPLEN_ACTIVATE + RDP_CAPLEN_CONTROL +                  RDP_CAPLEN_ACTIVATE + RDP_CAPLEN_CONTROL +
443                  RDP_CAPLEN_POINTER + RDP_CAPLEN_SHARE + RDP_CAPLEN_UNKNOWN                  RDP_CAPLEN_POINTER + RDP_CAPLEN_SHARE + RDP_CAPLEN_UNKNOWN + 4 /* w2k fix, why? */ ;
                         + 4 /* w2k fix, why? */;  
444    
445          s = rdp_init(14 + caplen + sizeof(RDP_SOURCE));          s = rdp_init(14 + caplen + sizeof(RDP_SOURCE));
446    
# Line 526  process_pointer_pdu(STREAM s) Line 523  process_pointer_pdu(STREAM s)
523                          in_uint16_le(s, datalen);                          in_uint16_le(s, datalen);
524                          in_uint8p(s, data, datalen);                          in_uint8p(s, data, datalen);
525                          in_uint8p(s, mask, masklen);                          in_uint8p(s, mask, masklen);
526                          cursor = ui_create_cursor(x, y, width, height, mask,                          cursor = ui_create_cursor(x, y, width, height, mask, data);
                                                   data);  
527                          ui_set_cursor(cursor);                          ui_set_cursor(cursor);
528                          cache_put_cursor(cache_idx, cursor);                          cache_put_cursor(cache_idx, cursor);
529                          break;                          break;
# Line 578  process_bitmap_updates(STREAM s) Line 574  process_bitmap_updates(STREAM s)
574                          bmpdata = xmalloc(width * height);                          bmpdata = xmalloc(width * height);
575                          for (y = 0; y < height; y++)                          for (y = 0; y < height; y++)
576                          {                          {
577                                  in_uint8a(s,                                  in_uint8a(s, &bmpdata[(height - y - 1) * width], width);
                                           &bmpdata[(height - y - 1) * width],  
                                           width);  
578                          }                          }
579                          ui_paint_bitmap(left, top, cx, cy, width, height,                          ui_paint_bitmap(left, top, cx, cy, width, height, bmpdata);
                                         bmpdata);  
580                          xfree(bmpdata);                          xfree(bmpdata);
581                          continue;                          continue;
582                  }                  }
# Line 596  process_bitmap_updates(STREAM s) Line 589  process_bitmap_updates(STREAM s)
589                  bmpdata = xmalloc(width * height);                  bmpdata = xmalloc(width * height);
590                  if (bitmap_decompress(bmpdata, width, height, data, size))                  if (bitmap_decompress(bmpdata, width, height, data, size))
591                  {                  {
592                          ui_paint_bitmap(left, top, cx, cy, width, height,                          ui_paint_bitmap(left, top, cx, cy, width, height, bmpdata);
                                         bmpdata);  
593                  }                  }
594    
595                  xfree(bmpdata);                  xfree(bmpdata);
# Line 616  process_palette(STREAM s) Line 608  process_palette(STREAM s)
608          in_uint16_le(s, map.ncolours);          in_uint16_le(s, map.ncolours);
609          in_uint8s(s, 2);        /* pad */          in_uint8s(s, 2);        /* pad */
610          in_uint8p(s, colours, (map.ncolours * 3));          in_uint8p(s, colours, (map.ncolours * 3));
611          map.colours = (COLOURENTRY *)colours;          map.colours = (COLOURENTRY *) colours;
612    
613          hmap = ui_create_colourmap(&map);          hmap = ui_create_colourmap(&map);
614          ui_set_colourmap(hmap);          ui_set_colourmap(hmap);
# Line 722  rdp_connect(char *server, uint32 flags, Line 714  rdp_connect(char *server, uint32 flags,
714          if (!sec_connect(server))          if (!sec_connect(server))
715                  return False;                  return False;
716    
717          rdp_send_logon_info(flags, domain, username, password,          rdp_send_logon_info(flags, domain, username, password, command, directory);
                             command, directory);  
718          return True;          return True;
719  }  }
720    

Legend:
Removed from v.30  
changed lines
  Added in v.82

  ViewVC Help
Powered by ViewVC 1.1.26