/[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 730 by jsorg71, Tue Jun 29 16:22:41 2004 UTC revision 738 by astrand, Mon Jul 12 21:07:39 2004 UTC
# Line 51  rdp_recv(uint8 * type) Line 51  rdp_recv(uint8 * type)
51  {  {
52          static STREAM rdp_s;          static STREAM rdp_s;
53          uint16 length, pdu_type;          uint16 length, pdu_type;
54            uint8 rdpver;
55    
56          if ((rdp_s == NULL) || (g_next_packet >= rdp_s->end))          if ((rdp_s == NULL) || (g_next_packet >= rdp_s->end))
57          {          {
58                  rdp_s = sec_recv();                  rdp_s = sec_recv(&rdpver);
59                  if (rdp_s == NULL)                  if (rdp_s == NULL)
60                          return NULL;                          return NULL;
61                    if (rdpver != 3)
62                    {
63                            /* rdp5_process should move g_next_packet ok */
64                            rdp5_process(rdp_s);
65                            *type = 0;
66                            return rdp_s;
67                    }
68    
69                  g_next_packet = rdp_s->p;                  g_next_packet = rdp_s->p;
70          }          }
# Line 402  rdp_enum_bmpcache2(void) Line 410  rdp_enum_bmpcache2(void)
410                  out_uint32_le(s, flags);                  out_uint32_le(s, flags);
411    
412                  /* list */                  /* list */
413                  out_uint8a(s, idlist + offset * sizeof(BITMAP_ID),                  out_uint8a(s, idlist + offset * sizeof(BITMAP_ID), count * sizeof(BITMAP_ID));
                                 count * sizeof(BITMAP_ID));  
414    
415                  s_mark_end(s);                  s_mark_end(s);
416                  rdp_send_data(s, 0x2b);                  rdp_send_data(s, 0x2b);
# Line 553  rdp_out_bmpcache2_caps(STREAM s) Line 560  rdp_out_bmpcache2_caps(STREAM s)
560          {          {
561                  out_uint32_le(s, BMPCACHE2_C2_CELLS);                  out_uint32_le(s, BMPCACHE2_C2_CELLS);
562          }          }
563          out_uint8s(s, 20);              /* other bitmap caches not used */          out_uint8s(s, 20);      /* other bitmap caches not used */
564  }  }
565    
566  /* Output control capability set */  /* Output control capability set */
# Line 644  static uint8 caps_0x10[] = { Line 651  static uint8 caps_0x10[] = {
651    
652  /* Output unknown capability sets */  /* Output unknown capability sets */
653  static void  static void
654  rdp_out_unknown_caps(STREAM s, uint16 id, uint16 length, uint8 *caps)  rdp_out_unknown_caps(STREAM s, uint16 id, uint16 length, uint8 * caps)
655  {  {
656          out_uint16_le(s, id);          out_uint16_le(s, id);
657          out_uint16_le(s, length);          out_uint16_le(s, length);
# Line 664  rdp_send_confirm_active(void) Line 671  rdp_send_confirm_active(void)
671                  RDP_CAPLEN_BMPCACHE + RDP_CAPLEN_COLCACHE +                  RDP_CAPLEN_BMPCACHE + RDP_CAPLEN_COLCACHE +
672                  RDP_CAPLEN_ACTIVATE + RDP_CAPLEN_CONTROL +                  RDP_CAPLEN_ACTIVATE + RDP_CAPLEN_CONTROL +
673                  RDP_CAPLEN_POINTER + RDP_CAPLEN_SHARE +                  RDP_CAPLEN_POINTER + RDP_CAPLEN_SHARE +
674                  0x58 + 0x08 + 0x08 + 0x34 /* unknown caps */ +                  0x58 + 0x08 + 0x08 + 0x34 /* unknown caps */  +
675                  4 /* w2k fix, why? */ ;                  4 /* w2k fix, why? */ ;
676    
677          s = sec_init(sec_flags, 6 + 14 + caplen + sizeof(RDP_SOURCE));          s = sec_init(sec_flags, 6 + 14 + caplen + sizeof(RDP_SOURCE));
# Line 692  rdp_send_confirm_active(void) Line 699  rdp_send_confirm_active(void)
699          rdp_out_pointer_caps(s);          rdp_out_pointer_caps(s);
700          rdp_out_share_caps(s);          rdp_out_share_caps(s);
701    
702          rdp_out_unknown_caps(s, 0x0d, 0x58, caps_0x0d); /* international? */          rdp_out_unknown_caps(s, 0x0d, 0x58, caps_0x0d); /* international? */
703          rdp_out_unknown_caps(s, 0x0c, 0x08, caps_0x0c);          rdp_out_unknown_caps(s, 0x0c, 0x08, caps_0x0c);
704          rdp_out_unknown_caps(s, 0x0e, 0x08, caps_0x0e);          rdp_out_unknown_caps(s, 0x0e, 0x08, caps_0x0e);
705          rdp_out_unknown_caps(s, 0x10, 0x34, caps_0x10); /* glyph cache? */          rdp_out_unknown_caps(s, 0x10, 0x34, caps_0x10); /* glyph cache? */
706                                    
707          s_mark_end(s);          s_mark_end(s);
708          sec_send(s, sec_flags);          sec_send(s, sec_flags);
709  }  }
# Line 740  rdp_process_bitmap_caps(STREAM s) Line 747  rdp_process_bitmap_caps(STREAM s)
747          if (g_width != width || g_height != height)          if (g_width != width || g_height != height)
748          {          {
749                  warning("screen size changed from %dx%d to %dx%d\n", g_width, g_height,                  warning("screen size changed from %dx%d to %dx%d\n", g_width, g_height,
750                                  width, height);                          width, height);
751                  g_width = width;                  g_width = width;
752                  g_height = height;                  g_height = height;
753                  ui_resize_window();                  ui_resize_window();
# Line 1135  process_data_pdu(STREAM s, uint32 * ext_ Line 1142  process_data_pdu(STREAM s, uint32 * ext_
1142  }  }
1143    
1144  /* Process incoming packets */  /* Process incoming packets */
1145    /* nevers gets out of here till app is done */
1146  void  void
1147  rdp_main_loop(BOOL * deactivated, uint32 * ext_disc_reason)  rdp_main_loop(BOOL * deactivated, uint32 * ext_disc_reason)
1148  {  {
1149          uint8 type;          while (rdp_loop(deactivated, ext_disc_reason))
1150          BOOL disc = False;      /* True when a disconnect PDU was received */                  ;
         STREAM s;  
   
         while ((s = rdp_recv(&type)) != NULL)  
         {  
                 switch (type)  
                 {  
                         case RDP_PDU_DEMAND_ACTIVE:  
                                 process_demand_active(s);  
                                 *deactivated = False;  
                                 break;  
   
                         case RDP_PDU_DEACTIVATE:  
                                 DEBUG(("RDP_PDU_DEACTIVATE\n"));  
                                 *deactivated = True;  
                                 break;  
   
                         case RDP_PDU_DATA:  
                                 disc = process_data_pdu(s, ext_disc_reason);  
                                 break;  
   
                         case 0:  
                                 break;  
   
                         default:  
                                 unimpl("PDU %d\n", type);  
                 }  
   
                 if (disc)  
                 {  
                         return;  
                 }  
         }  
         return;  
1151  }  }
1152    
1153  /* used in uiports, processes the rdp packets waiting */  /* used in uiports and rdp_main_loop, processes the rdp packets waiting */
1154  BOOL  BOOL
1155  rdp_loop(BOOL * deactivated, uint32 * ext_disc_reason)  rdp_loop(BOOL * deactivated, uint32 * ext_disc_reason)
1156  {  {

Legend:
Removed from v.730  
changed lines
  Added in v.738

  ViewVC Help
Powered by ViewVC 1.1.26