/[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 1308 by stargo, Wed Nov 1 18:38:40 2006 UTC revision 1372 by jsorg71, Mon Jan 8 04:47:06 2007 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 - RDP layer     Protocol services - RDP layer
4     Copyright (C) Matthew Chapman 1999-2005     Copyright (C) Matthew Chapman 1999-2007
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 19  Line 19 
19  */  */
20    
21  #include <time.h>  #include <time.h>
22    #ifndef _WIN32
23  #include <errno.h>  #include <errno.h>
24  #include <unistd.h>  #include <unistd.h>
25    #endif
26  #include "rdesktop.h"  #include "rdesktop.h"
27    
28  #ifdef HAVE_ICONV  #ifdef HAVE_ICONV
# Line 36  Line 38 
38  extern uint16 g_mcs_userid;  extern uint16 g_mcs_userid;
39  extern char g_username[64];  extern char g_username[64];
40  extern char g_codepage[16];  extern char g_codepage[16];
41  extern BOOL g_bitmap_compression;  extern RD_BOOL g_bitmap_compression;
42  extern BOOL g_orders;  extern RD_BOOL g_orders;
43  extern BOOL g_encryption;  extern RD_BOOL g_encryption;
44  extern BOOL g_desktop_save;  extern RD_BOOL g_desktop_save;
45  extern BOOL g_polygon_ellipse_orders;  extern RD_BOOL g_polygon_ellipse_orders;
46  extern BOOL g_use_rdp5;  extern RD_BOOL g_use_rdp5;
47  extern uint16 g_server_rdp_version;  extern uint16 g_server_rdp_version;
48  extern uint32 g_rdp5_performanceflags;  extern uint32 g_rdp5_performanceflags;
49  extern int g_server_depth;  extern int g_server_depth;
50  extern int g_width;  extern int g_width;
51  extern int g_height;  extern int g_height;
52  extern BOOL g_bitmap_cache;  extern RD_BOOL g_bitmap_cache;
53  extern BOOL g_bitmap_cache_persist_enable;  extern RD_BOOL g_bitmap_cache_persist_enable;
54  extern BOOL g_numlock_sync;  extern RD_BOOL g_numlock_sync;
55    
56  uint8 *g_next_packet;  uint8 *g_next_packet;
57  uint32 g_rdp_shareid;  uint32 g_rdp_shareid;
# Line 57  uint32 g_rdp_shareid; Line 59  uint32 g_rdp_shareid;
59  extern RDPCOMP g_mppc_dict;  extern RDPCOMP g_mppc_dict;
60    
61  /* Session Directory support */  /* Session Directory support */
62  extern BOOL g_redirect;  extern RD_BOOL g_redirect;
63  extern char g_redirect_server[64];  extern char g_redirect_server[64];
64  extern char g_redirect_domain[16];  extern char g_redirect_domain[16];
65  extern char g_redirect_password[64];  extern char g_redirect_password[64];
# Line 71  static uint32 g_packetno; Line 73  static uint32 g_packetno;
73  #endif  #endif
74    
75  #ifdef HAVE_ICONV  #ifdef HAVE_ICONV
76  static BOOL g_iconv_works = True;  static RD_BOOL g_iconv_works = True;
77  #endif  #endif
78    
79  /* Receive an RDP packet */  /* Receive an RDP packet */
# Line 996  process_colour_pointer_pdu(STREAM s) Line 998  process_colour_pointer_pdu(STREAM s)
998  {  {
999          uint16 x, y, width, height, cache_idx, masklen, datalen;          uint16 x, y, width, height, cache_idx, masklen, datalen;
1000          uint8 *mask, *data;          uint8 *mask, *data;
1001          HCURSOR cursor;          RD_HCURSOR cursor;
1002    
1003          in_uint16_le(s, cache_idx);          in_uint16_le(s, cache_idx);
1004          in_uint16_le(s, x);          in_uint16_le(s, x);
# Line 1153  process_palette(STREAM s) Line 1155  process_palette(STREAM s)
1155  {  {
1156          COLOURENTRY *entry;          COLOURENTRY *entry;
1157          COLOURMAP map;          COLOURMAP map;
1158          HCOLOURMAP hmap;          RD_HCOLOURMAP hmap;
1159          int i;          int i;
1160    
1161          in_uint8s(s, 2);        /* pad */          in_uint8s(s, 2);        /* pad */
# Line 1223  process_disconnect_pdu(STREAM s, uint32 Line 1225  process_disconnect_pdu(STREAM s, uint32
1225  }  }
1226    
1227  /* Process data PDU */  /* Process data PDU */
1228  static BOOL  static RD_BOOL
1229  process_data_pdu(STREAM s, uint32 * ext_disc_reason)  process_data_pdu(STREAM s, uint32 * ext_disc_reason)
1230  {  {
1231          uint8 data_pdu_type;          uint8 data_pdu_type;
# Line 1308  process_data_pdu(STREAM s, uint32 * ext_ Line 1310  process_data_pdu(STREAM s, uint32 * ext_
1310  }  }
1311    
1312  /* Process redirect PDU from Session Directory */  /* Process redirect PDU from Session Directory */
1313  static BOOL  static RD_BOOL
1314  process_redirect_pdu(STREAM s /*, uint32 * ext_disc_reason */ )  process_redirect_pdu(STREAM s /*, uint32 * ext_disc_reason */ )
1315  {  {
1316          uint32 len;          uint32 len;
# Line 1358  process_redirect_pdu(STREAM s /*, uint32 Line 1360  process_redirect_pdu(STREAM s /*, uint32
1360  /* Process incoming packets */  /* Process incoming packets */
1361  /* nevers gets out of here till app is done */  /* nevers gets out of here till app is done */
1362  void  void
1363  rdp_main_loop(BOOL * deactivated, uint32 * ext_disc_reason)  rdp_main_loop(RD_BOOL * deactivated, uint32 * ext_disc_reason)
1364  {  {
1365          while (rdp_loop(deactivated, ext_disc_reason))          while (rdp_loop(deactivated, ext_disc_reason))
1366                  ;                  ;
1367  }  }
1368    
1369  /* used in uiports and rdp_main_loop, processes the rdp packets waiting */  /* used in uiports and rdp_main_loop, processes the rdp packets waiting */
1370  BOOL  RD_BOOL
1371  rdp_loop(BOOL * deactivated, uint32 * ext_disc_reason)  rdp_loop(RD_BOOL * deactivated, uint32 * ext_disc_reason)
1372  {  {
1373          uint8 type;          uint8 type;
1374          BOOL disc = False;      /* True when a disconnect PDU was received */          RD_BOOL disc = False;   /* True when a disconnect PDU was received */
1375          BOOL cont = True;          RD_BOOL cont = True;
1376          STREAM s;          STREAM s;
1377    
1378          while (cont)          while (cont)
# Line 1407  rdp_loop(BOOL * deactivated, uint32 * ex Line 1409  rdp_loop(BOOL * deactivated, uint32 * ex
1409  }  }
1410    
1411  /* Establish a connection up to the RDP layer */  /* Establish a connection up to the RDP layer */
1412  BOOL  RD_BOOL
1413  rdp_connect(char *server, uint32 flags, char *domain, char *password,  rdp_connect(char *server, uint32 flags, char *domain, char *password,
1414              char *command, char *directory)              char *command, char *directory)
1415  {  {
# Line 1419  rdp_connect(char *server, uint32 flags, Line 1421  rdp_connect(char *server, uint32 flags,
1421  }  }
1422    
1423  /* Establish a reconnection up to the RDP layer */  /* Establish a reconnection up to the RDP layer */
1424  BOOL  RD_BOOL
1425  rdp_reconnect(char *server, uint32 flags, char *domain, char *password,  rdp_reconnect(char *server, uint32 flags, char *domain, char *password,
1426                char *command, char *directory, char *cookie)                char *command, char *directory, char *cookie)
1427  {  {

Legend:
Removed from v.1308  
changed lines
  Added in v.1372

  ViewVC Help
Powered by ViewVC 1.1.26