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

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

revision 21 by matty, Mon Oct 16 08:44:48 2000 UTC revision 676 by astrand, Tue Apr 20 07:01:21 2004 UTC
# Line 1  Line 1 
1  /*  /*
2     rdesktop: A Remote Desktop Protocol client.     rdesktop: A Remote Desktop Protocol client.
3     Miscellaneous protocol constants     Miscellaneous protocol constants
4     Copyright (C) Matthew Chapman 1999-2000     Copyright (C) Matthew Chapman 1999-2002
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
8     the Free Software Foundation; either version 2 of the License, or     the Free Software Foundation; either version 2 of the License, or
9     (at your option) any later version.     (at your option) any later version.
10      
11     This program is distributed in the hope that it will be useful,     This program is distributed in the hope that it will be useful,
12     but WITHOUT ANY WARRANTY; without even the implied warranty of     but WITHOUT ANY WARRANTY; without even the implied warranty of
13     MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the     MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
14     GNU General Public License for more details.     GNU General Public License for more details.
15      
16     You should have received a copy of the GNU General Public License     You should have received a copy of the GNU General Public License
17     along with this program; if not, write to the Free Software     along with this program; if not, write to the Free Software
18     Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.     Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
# Line 24  Line 24 
24  /* ISO PDU codes */  /* ISO PDU codes */
25  enum ISO_PDU_CODE  enum ISO_PDU_CODE
26  {  {
27          ISO_PDU_CR = 0xE0, /* Connection Request */          ISO_PDU_CR = 0xE0,      /* Connection Request */
28          ISO_PDU_CC = 0xD0, /* Connection Confirm */          ISO_PDU_CC = 0xD0,      /* Connection Confirm */
29          ISO_PDU_DR = 0x80, /* Disconnect Request */          ISO_PDU_DR = 0x80,      /* Disconnect Request */
30          ISO_PDU_DT = 0xF0, /* Data */          ISO_PDU_DT = 0xF0,      /* Data */
31          ISO_PDU_ER = 0x70  /* Error */          ISO_PDU_ER = 0x70       /* Error */
32  };  };
33    
34  /* MCS PDU codes */  /* MCS PDU codes */
35  enum MCS_PDU_TYPE  enum MCS_PDU_TYPE
36  {  {
37          MCS_EDRQ = 1,   /* Erect Domain Request */          MCS_EDRQ = 1,           /* Erect Domain Request */
38          MCS_DPUM = 8,   /* Disconnect Provider Ultimatum */          MCS_DPUM = 8,           /* Disconnect Provider Ultimatum */
39          MCS_AURQ = 10,  /* Attach User Request */          MCS_AURQ = 10,          /* Attach User Request */
40          MCS_AUCF = 11,  /* Attach User Confirm */          MCS_AUCF = 11,          /* Attach User Confirm */
41          MCS_CJRQ = 14,  /* Channel Join Request */          MCS_CJRQ = 14,          /* Channel Join Request */
42          MCS_CJCF = 15,  /* Channel Join Confirm */          MCS_CJCF = 15,          /* Channel Join Confirm */
43          MCS_SDRQ = 25,  /* Send Data Request */          MCS_SDRQ = 25,          /* Send Data Request */
44          MCS_SDIN = 26   /* Send Data Indication */          MCS_SDIN = 26           /* Send Data Indication */
45  };  };
46    
47  #define MCS_CONNECT_INITIAL     0x7f65  #define MCS_CONNECT_INITIAL     0x7f65
# Line 54  enum MCS_PDU_TYPE Line 54  enum MCS_PDU_TYPE
54  #define MCS_TAG_DOMAIN_PARAMS   0x30  #define MCS_TAG_DOMAIN_PARAMS   0x30
55    
56  #define MCS_GLOBAL_CHANNEL      1003  #define MCS_GLOBAL_CHANNEL      1003
57    #define MCS_USERCHANNEL_BASE    1001
58    
59  /* RDP secure transport constants */  /* RDP secure transport constants */
60  #define SEC_RANDOM_SIZE         32  #define SEC_RANDOM_SIZE         32
# Line 68  enum MCS_PDU_TYPE Line 69  enum MCS_PDU_TYPE
69    
70  #define SEC_TAG_SRV_INFO        0x0c01  #define SEC_TAG_SRV_INFO        0x0c01
71  #define SEC_TAG_SRV_CRYPT       0x0c02  #define SEC_TAG_SRV_CRYPT       0x0c02
72  #define SEC_TAG_SRV_3           0x0c03  #define SEC_TAG_SRV_CHANNELS    0x0c03
73    
74  #define SEC_TAG_CLI_INFO        0xc001  #define SEC_TAG_CLI_INFO        0xc001
75  #define SEC_TAG_CLI_CRYPT       0xc002  #define SEC_TAG_CLI_CRYPT       0xc002
76    #define SEC_TAG_CLI_CHANNELS    0xc003
77    #define SEC_TAG_CLI_4           0xc004
78    
79  #define SEC_TAG_PUBKEY          0x0006  #define SEC_TAG_PUBKEY          0x0006
80  #define SEC_TAG_KEYSIG          0x0008  #define SEC_TAG_KEYSIG          0x0008
81    
82  #define SEC_RSA_MAGIC           0x31415352 /* RSA1 */  #define SEC_RSA_MAGIC           0x31415352      /* RSA1 */
83    
84  /* RDP licensing constants */  /* RDP licensing constants */
85  #define LICENCE_TOKEN_SIZE      10  #define LICENCE_TOKEN_SIZE      10
86  #define LICENCE_HWID_SIZE       20  #define LICENCE_HWID_SIZE       20
87  #define LICENCE_SIGNATURE_SIZE  16  #define LICENCE_SIGNATURE_SIZE  16
88    
89  #define LICENCE_TAG_DEMAND      0x0201  #define LICENCE_TAG_DEMAND      0x01
90  #define LICENCE_TAG_AUTHREQ     0x0202  #define LICENCE_TAG_AUTHREQ     0x02
91  #define LICENCE_TAG_ISSUE       0x0203  #define LICENCE_TAG_ISSUE       0x03
92  #define LICENCE_TAG_REQUEST     0x0213  #define LICENCE_TAG_REISSUE     0x04
93  #define LICENCE_TAG_AUTHRESP    0x0215  #define LICENCE_TAG_PRESENT     0x12
94  #define LICENCE_TAG_RESULT      0x02ff  #define LICENCE_TAG_REQUEST     0x13
95    #define LICENCE_TAG_AUTHRESP    0x15
96    #define LICENCE_TAG_RESULT      0xff
97    
98  #define LICENCE_TAG_USER        0x000f  #define LICENCE_TAG_USER        0x000f
99  #define LICENCE_TAG_HOST        0x0010  #define LICENCE_TAG_HOST        0x0010
# Line 111  enum RDP_DATA_PDU_TYPE Line 116  enum RDP_DATA_PDU_TYPE
116          RDP_DATA_PDU_SYNCHRONISE = 31,          RDP_DATA_PDU_SYNCHRONISE = 31,
117          RDP_DATA_PDU_BELL = 34,          RDP_DATA_PDU_BELL = 34,
118          RDP_DATA_PDU_LOGON = 38,          RDP_DATA_PDU_LOGON = 38,
119          RDP_DATA_PDU_FONT2 = 39          RDP_DATA_PDU_FONT2 = 39,
120            RDP_DATA_PDU_DISCONNECT = 47
121  };  };
122    
123  enum RDP_CONTROL_PDU_TYPE  enum RDP_CONTROL_PDU_TYPE
# Line 132  enum RDP_UPDATE_PDU_TYPE Line 138  enum RDP_UPDATE_PDU_TYPE
138    
139  enum RDP_POINTER_PDU_TYPE  enum RDP_POINTER_PDU_TYPE
140  {  {
141          RDP_POINTER_MOVE = 3          RDP_POINTER_SYSTEM = 1,
142            RDP_POINTER_MOVE = 3,
143            RDP_POINTER_COLOR = 6,
144            RDP_POINTER_CACHED = 7
145    };
146    
147    enum RDP_SYSTEM_POINTER_TYPE
148    {
149            RDP_NULL_POINTER = 0,
150            RDP_DEFAULT_POINTER = 0x7F00
151  };  };
152    
153  enum RDP_INPUT_DEVICE  enum RDP_INPUT_DEVICE
# Line 146  enum RDP_INPUT_DEVICE Line 161  enum RDP_INPUT_DEVICE
161    
162  /* Device flags */  /* Device flags */
163  #define KBD_FLAG_RIGHT          0x0001  #define KBD_FLAG_RIGHT          0x0001
164    #define KBD_FLAG_EXT            0x0100
165  #define KBD_FLAG_QUIET          0x1000  #define KBD_FLAG_QUIET          0x1000
166  #define KBD_FLAG_DOWN           0x4000  #define KBD_FLAG_DOWN           0x4000
167  #define KBD_FLAG_UP             0x8000  #define KBD_FLAG_UP             0x8000
168    
169    /* These are for synchronization; not for keystrokes */
170    #define KBD_FLAG_SCROLL   0x0001
171    #define KBD_FLAG_NUMLOCK  0x0002
172    #define KBD_FLAG_CAPITAL  0x0004
173    
174    /* See T.128 */
175    #define RDP_KEYPRESS 0
176    #define RDP_KEYRELEASE (KBD_FLAG_DOWN | KBD_FLAG_UP)
177    
178  #define MOUSE_FLAG_MOVE         0x0800  #define MOUSE_FLAG_MOVE         0x0800
179  #define MOUSE_FLAG_BUTTON1      0x1000  #define MOUSE_FLAG_BUTTON1      0x1000
180  #define MOUSE_FLAG_BUTTON2      0x2000  #define MOUSE_FLAG_BUTTON2      0x2000
181  #define MOUSE_FLAG_BUTTON3      0x4000  #define MOUSE_FLAG_BUTTON3      0x4000
182    #define MOUSE_FLAG_BUTTON4      0x0280
183    #define MOUSE_FLAG_BUTTON5      0x0380
184  #define MOUSE_FLAG_DOWN         0x8000  #define MOUSE_FLAG_DOWN         0x8000
185    
186  /* Raster operation masks */  /* Raster operation masks */
# Line 169  enum RDP_INPUT_DEVICE Line 196  enum RDP_INPUT_DEVICE
196  #define MIX_TRANSPARENT 0  #define MIX_TRANSPARENT 0
197  #define MIX_OPAQUE      1  #define MIX_OPAQUE      1
198    
199  #define TEXT2_IMPLICIT_X 0x20  #define TEXT2_VERTICAL          0x04
200    #define TEXT2_IMPLICIT_X        0x20
201    
202  /* RDP capabilities */  /* RDP capabilities */
203  #define RDP_CAPSET_GENERAL      1  #define RDP_CAPSET_GENERAL      1       /* Maps to generalCapabilitySet in T.128 page 138 */
204  #define RDP_CAPLEN_GENERAL      0x18  #define RDP_CAPLEN_GENERAL      0x18
205  #define OS_MAJOR_TYPE_UNIX      4  #define OS_MAJOR_TYPE_UNIX      4
206  #define OS_MINOR_TYPE_XSERVER   7  #define OS_MINOR_TYPE_XSERVER   7
# Line 209  enum RDP_INPUT_DEVICE Line 237  enum RDP_INPUT_DEVICE
237  #define RDP_SOURCE              "MSTSC"  #define RDP_SOURCE              "MSTSC"
238    
239  /* Logon flags */  /* Logon flags */
240  #define RDP_LOGON_NORMAL        0x33  #define RDP_LOGON_AUTO          0x0008
241  #define RDP_LOGON_AUTO          0x8  #define RDP_LOGON_NORMAL        0x0033
242    #define RDP_COMPRESSION         0x0080
243    #define RDP_LOGON_BLOB          0x0100
244    #define RDP_LOGON_LEAVE_AUDIO   0x2000
245    
246    #define RDP5_DISABLE_NOTHING    0x00
247    #define RDP5_NO_WALLPAPER       0x01
248    #define RDP5_NO_FULLWINDOWDRAG  0x02
249    #define RDP5_NO_MENUANIMATIONS  0x04
250    #define RDP5_NO_THEMING         0x08
251    #define RDP5_NO_CURSOR_SHADOW   0x20
252    #define RDP5_NO_CURSORSETTINGS  0x40    /* disables cursor blinking */
253    
254    /* Keymap flags */
255    #define MapRightShiftMask   (1<<0)
256    #define MapLeftShiftMask    (1<<1)
257    #define MapShiftMask (MapRightShiftMask | MapLeftShiftMask)
258    
259    #define MapRightAltMask     (1<<2)
260    #define MapLeftAltMask      (1<<3)
261    #define MapAltGrMask MapRightAltMask
262    
263    #define MapRightCtrlMask    (1<<4)
264    #define MapLeftCtrlMask     (1<<5)
265    #define MapCtrlMask (MapRightCtrlMask | MapLeftCtrlMask)
266    
267    #define MapRightWinMask     (1<<6)
268    #define MapLeftWinMask      (1<<7)
269    #define MapWinMask (MapRightWinMask | MapLeftWinMask)
270    
271    #define MapNumLockMask      (1<<8)
272    #define MapCapsLockMask     (1<<9)
273    
274    #define MapLocalStateMask   (1<<10)
275    
276    #define MapInhibitMask      (1<<11)
277    
278    #define MASK_ADD_BITS(var, mask) (var |= mask)
279    #define MASK_REMOVE_BITS(var, mask) (var &= ~mask)
280    #define MASK_HAS_BITS(var, mask) ((var & mask)>0)
281    #define MASK_CHANGE_BIT(var, mask, active) (var = ((var & ~mask) | (active ? mask : 0)))
282    
283    /* Clipboard constants, "borrowed" from GCC system headers in
284       the w32 cross compiler */
285    
286    #define CF_TEXT         1
287    #define CF_BITMAP       2
288    #define CF_METAFILEPICT 3
289    #define CF_SYLK         4
290    #define CF_DIF          5
291    #define CF_TIFF         6
292    #define CF_OEMTEXT      7
293    #define CF_DIB          8
294    #define CF_PALETTE      9
295    #define CF_PENDATA      10
296    #define CF_RIFF         11
297    #define CF_WAVE         12
298    #define CF_UNICODETEXT  13
299    #define CF_ENHMETAFILE  14
300    #define CF_HDROP        15
301    #define CF_LOCALE       16
302    #define CF_MAX          17
303    #define CF_OWNERDISPLAY 128
304    #define CF_DSPTEXT      129
305    #define CF_DSPBITMAP    130
306    #define CF_DSPMETAFILEPICT      131
307    #define CF_DSPENHMETAFILE       142
308    #define CF_PRIVATEFIRST 512
309    #define CF_PRIVATELAST  767
310    #define CF_GDIOBJFIRST  768
311    #define CF_GDIOBJLAST   1023
312    
313    /* Sound format constants */
314    #define WAVE_FORMAT_PCM         1
315    #define WAVE_FORMAT_ADPCM       2
316    #define WAVE_FORMAT_ALAW        6
317    #define WAVE_FORMAT_MULAW       7
318    
319    /* Virtual channel options */
320    #define CHANNEL_OPTION_INITIALIZED      0x80000000
321    #define CHANNEL_OPTION_ENCRYPT_RDP      0x40000000
322    #define CHANNEL_OPTION_COMPRESS_RDP     0x00800000
323    #define CHANNEL_OPTION_SHOW_PROTOCOL    0x00200000
324    
325    /* NT status codes for RDPDR */
326    #define STATUS_SUCCESS                  0x00000000
327    #define STATUS_PENDING                  0x00000103
328    
329    #define STATUS_NO_MORE_FILES            0x80000006
330    #define STATUS_DEVICE_PAPER_EMPTY       0x8000000e
331    #define STATUS_DEVICE_POWERED_OFF       0x8000000f
332    #define STATUS_DEVICE_OFF_LINE          0x80000010
333    #define STATUS_DEVICE_BUSY              0x80000011
334    
335    #define STATUS_INVALID_HANDLE           0xc0000008
336    #define STATUS_INVALID_PARAMETER        0xc000000d
337    #define STATUS_NO_SUCH_FILE             0xc000000f
338    #define STATUS_INVALID_DEVICE_REQUEST   0xc0000010
339    #define STATUS_ACCESS_DENIED            0xc0000022
340    #define STATUS_OBJECT_NAME_COLLISION    0xc0000035
341    #define STATUS_DISK_FULL                0xc000007f
342    #define STATUS_FILE_IS_A_DIRECTORY      0xc00000ba
343    #define STATUS_NOT_SUPPORTED            0xc00000bb
344    #define STATUS_TIMEOUT                  0xc0000102
345    #define STATUS_CANCELLED                0xc0000120
346    
347    
348    /* RDPDR constants */
349    #define RDPDR_MAX_DEVICES               0x10
350    #define DEVICE_TYPE_SERIAL              0x01
351    #define DEVICE_TYPE_PARALLEL            0x02
352    #define DEVICE_TYPE_PRINTER             0x04
353    #define DEVICE_TYPE_DISK                0x08
354    #define DEVICE_TYPE_SCARD               0x20
355    
356    #define FILE_DIRECTORY_FILE             0x00000001
357    #define FILE_NON_DIRECTORY_FILE         0x00000040
358    #define FILE_OPEN_FOR_FREE_SPACE_QUERY  0x00800000
359    
360    /* RDP5 disconnect PDU */
361    #define exDiscReasonNoInfo                              0x0000
362    #define exDiscReasonAPIInitiatedDisconnect              0x0001
363    #define exDiscReasonAPIInitiatedLogoff                  0x0002
364    #define exDiscReasonServerIdleTimeout                   0x0003
365    #define exDiscReasonServerLogonTimeout                  0x0004
366    #define exDiscReasonReplacedByOtherConnection           0x0005
367    #define exDiscReasonOutOfMemory                         0x0006
368    #define exDiscReasonServerDeniedConnection              0x0007
369    #define exDiscReasonServerDeniedConnectionFips          0x0008
370    #define exDiscReasonLicenseInternal                     0x0100
371    #define exDiscReasonLicenseNoLicenseServer              0x0101
372    #define exDiscReasonLicenseNoLicense                    0x0102
373    #define exDiscReasonLicenseErrClientMsg                 0x0103
374    #define exDiscReasonLicenseHwidDoesntMatchLicense       0x0104
375    #define exDiscReasonLicenseErrClientLicense             0x0105
376    #define exDiscReasonLicenseCantFinishProtocol           0x0106
377    #define exDiscReasonLicenseClientEndedProtocol          0x0107
378    #define exDiscReasonLicenseErrClientEncryption          0x0108
379    #define exDiscReasonLicenseCantUpgradeLicense           0x0109
380    #define exDiscReasonLicenseNoRemoteConnections          0x010a

Legend:
Removed from v.21  
changed lines
  Added in v.676

  ViewVC Help
Powered by ViewVC 1.1.26