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-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 |
8 |
the Free Software Foundation; either version 2 of the License, or |
the Free Software Foundation; either version 2 of the License, or |
21 |
/* TCP port for Remote Desktop Protocol */ |
/* TCP port for Remote Desktop Protocol */ |
22 |
#define TCP_PORT_RDP 3389 |
#define TCP_PORT_RDP 3389 |
23 |
|
|
24 |
|
#define DEFAULT_CODEPAGE "UTF-8" |
25 |
|
#define WINDOWS_CODEPAGE "UTF-16LE" |
26 |
|
|
27 |
/* ISO PDU codes */ |
/* ISO PDU codes */ |
28 |
enum ISO_PDU_CODE |
enum ISO_PDU_CODE |
29 |
{ |
{ |
62 |
/* RDP secure transport constants */ |
/* RDP secure transport constants */ |
63 |
#define SEC_RANDOM_SIZE 32 |
#define SEC_RANDOM_SIZE 32 |
64 |
#define SEC_MODULUS_SIZE 64 |
#define SEC_MODULUS_SIZE 64 |
65 |
|
#define SEC_MAX_MODULUS_SIZE 256 |
66 |
#define SEC_PADDING_SIZE 8 |
#define SEC_PADDING_SIZE 8 |
67 |
#define SEC_EXPONENT_SIZE 4 |
#define SEC_EXPONENT_SIZE 4 |
68 |
|
|
70 |
#define SEC_ENCRYPT 0x0008 |
#define SEC_ENCRYPT 0x0008 |
71 |
#define SEC_LOGON_INFO 0x0040 |
#define SEC_LOGON_INFO 0x0040 |
72 |
#define SEC_LICENCE_NEG 0x0080 |
#define SEC_LICENCE_NEG 0x0080 |
73 |
|
#define SEC_REDIRECT_ENCRYPT 0x0C00 |
74 |
|
|
75 |
#define SEC_TAG_SRV_INFO 0x0c01 |
#define SEC_TAG_SRV_INFO 0x0c01 |
76 |
#define SEC_TAG_SRV_CRYPT 0x0c02 |
#define SEC_TAG_SRV_CRYPT 0x0c02 |
108 |
{ |
{ |
109 |
RDP_PDU_DEMAND_ACTIVE = 1, |
RDP_PDU_DEMAND_ACTIVE = 1, |
110 |
RDP_PDU_CONFIRM_ACTIVE = 3, |
RDP_PDU_CONFIRM_ACTIVE = 3, |
111 |
|
RDP_PDU_REDIRECT = 4, /* MS Server 2003 Session Redirect */ |
112 |
RDP_PDU_DEACTIVATE = 6, |
RDP_PDU_DEACTIVATE = 6, |
113 |
RDP_PDU_DATA = 7 |
RDP_PDU_DATA = 7 |
114 |
}; |
}; |
121 |
RDP_DATA_PDU_INPUT = 28, |
RDP_DATA_PDU_INPUT = 28, |
122 |
RDP_DATA_PDU_SYNCHRONISE = 31, |
RDP_DATA_PDU_SYNCHRONISE = 31, |
123 |
RDP_DATA_PDU_BELL = 34, |
RDP_DATA_PDU_BELL = 34, |
124 |
|
RDP_DATA_PDU_CLIENT_WINDOW_STATUS = 35, |
125 |
RDP_DATA_PDU_LOGON = 38, |
RDP_DATA_PDU_LOGON = 38, |
126 |
RDP_DATA_PDU_FONT2 = 39, |
RDP_DATA_PDU_FONT2 = 39, |
127 |
RDP_DATA_PDU_KEYBOARD_INDICATORS = 41, |
RDP_DATA_PDU_KEYBOARD_INDICATORS = 41, |
207 |
#define TEXT2_VERTICAL 0x04 |
#define TEXT2_VERTICAL 0x04 |
208 |
#define TEXT2_IMPLICIT_X 0x20 |
#define TEXT2_IMPLICIT_X 0x20 |
209 |
|
|
210 |
|
#define ALTERNATE 1 |
211 |
|
#define WINDING 2 |
212 |
|
|
213 |
/* RDP bitmap cache (version 2) constants */ |
/* RDP bitmap cache (version 2) constants */ |
214 |
#define BMPCACHE2_C0_CELLS 0x78 |
#define BMPCACHE2_C0_CELLS 0x78 |
215 |
#define BMPCACHE2_C1_CELLS 0x78 |
#define BMPCACHE2_C1_CELLS 0x78 |
260 |
/* Logon flags */ |
/* Logon flags */ |
261 |
#define RDP_LOGON_AUTO 0x0008 |
#define RDP_LOGON_AUTO 0x0008 |
262 |
#define RDP_LOGON_NORMAL 0x0033 |
#define RDP_LOGON_NORMAL 0x0033 |
263 |
#define RDP_COMPRESSION 0x0080 |
#define RDP_LOGON_COMPRESSION 0x0080 /* mppc compression with 8kB histroy buffer */ |
264 |
#define RDP_LOGON_BLOB 0x0100 |
#define RDP_LOGON_BLOB 0x0100 |
265 |
|
#define RDP_LOGON_COMPRESSION2 0x0200 /* rdp5 mppc compression with 64kB history buffer */ |
266 |
#define RDP_LOGON_LEAVE_AUDIO 0x2000 |
#define RDP_LOGON_LEAVE_AUDIO 0x2000 |
267 |
|
|
268 |
#define RDP5_DISABLE_NOTHING 0x00 |
#define RDP5_DISABLE_NOTHING 0x00 |
274 |
#define RDP5_NO_CURSORSETTINGS 0x40 /* disables cursor blinking */ |
#define RDP5_NO_CURSORSETTINGS 0x40 /* disables cursor blinking */ |
275 |
|
|
276 |
/* compression types */ |
/* compression types */ |
277 |
|
#define RDP_MPPC_BIG 0x01 |
278 |
#define RDP_MPPC_COMPRESSED 0x20 |
#define RDP_MPPC_COMPRESSED 0x20 |
279 |
#define RDP_MPPC_RESET 0x40 |
#define RDP_MPPC_RESET 0x40 |
280 |
#define RDP_MPPC_FLUSH 0x80 |
#define RDP_MPPC_FLUSH 0x80 |
281 |
#define RDP_MPPC_DICT_SIZE 8192 |
#define RDP_MPPC_DICT_SIZE 65536 |
282 |
|
|
283 |
|
#define RDP5_COMPRESSED 0x80 |
284 |
|
|
285 |
/* Keymap flags */ |
/* Keymap flags */ |
286 |
#define MapRightShiftMask (1<<0) |
#define MapRightShiftMask (1<<0) |
312 |
#define MASK_CHANGE_BIT(var, mask, active) (var = ((var & ~mask) | (active ? mask : 0))) |
#define MASK_CHANGE_BIT(var, mask, active) (var = ((var & ~mask) | (active ? mask : 0))) |
313 |
|
|
314 |
/* Clipboard constants, "borrowed" from GCC system headers in |
/* Clipboard constants, "borrowed" from GCC system headers in |
315 |
the w32 cross compiler */ |
the w32 cross compiler |
316 |
|
this is the CF_ set when WINVER is 0x0400 */ |
317 |
|
|
318 |
|
#ifndef CF_TEXT |
319 |
#define CF_TEXT 1 |
#define CF_TEXT 1 |
320 |
#define CF_BITMAP 2 |
#define CF_BITMAP 2 |
321 |
#define CF_METAFILEPICT 3 |
#define CF_METAFILEPICT 3 |
342 |
#define CF_PRIVATELAST 767 |
#define CF_PRIVATELAST 767 |
343 |
#define CF_GDIOBJFIRST 768 |
#define CF_GDIOBJFIRST 768 |
344 |
#define CF_GDIOBJLAST 1023 |
#define CF_GDIOBJLAST 1023 |
345 |
|
#endif |
346 |
|
|
347 |
/* Sound format constants */ |
/* Sound format constants */ |
348 |
#define WAVE_FORMAT_PCM 1 |
#define WAVE_FORMAT_PCM 1 |
357 |
#define CHANNEL_OPTION_SHOW_PROTOCOL 0x00200000 |
#define CHANNEL_OPTION_SHOW_PROTOCOL 0x00200000 |
358 |
|
|
359 |
/* NT status codes for RDPDR */ |
/* NT status codes for RDPDR */ |
360 |
#define STATUS_SUCCESS 0x00000000 |
#define RD_STATUS_SUCCESS 0x00000000 |
361 |
#define STATUS_NOT_IMPLEMENTED 0x00000001 |
#define RD_STATUS_NOT_IMPLEMENTED 0x00000001 |
362 |
#define STATUS_PENDING 0x00000103 |
#define RD_STATUS_PENDING 0x00000103 |
363 |
|
|
364 |
#define STATUS_NO_MORE_FILES 0x80000006 |
#define RD_STATUS_NO_MORE_FILES 0x80000006 |
365 |
#define STATUS_DEVICE_PAPER_EMPTY 0x8000000e |
#define RD_STATUS_DEVICE_PAPER_EMPTY 0x8000000e |
366 |
#define STATUS_DEVICE_POWERED_OFF 0x8000000f |
#define RD_STATUS_DEVICE_POWERED_OFF 0x8000000f |
367 |
#define STATUS_DEVICE_OFF_LINE 0x80000010 |
#define RD_STATUS_DEVICE_OFF_LINE 0x80000010 |
368 |
#define STATUS_DEVICE_BUSY 0x80000011 |
#define RD_STATUS_DEVICE_BUSY 0x80000011 |
369 |
|
|
370 |
#define STATUS_INVALID_HANDLE 0xc0000008 |
#define RD_STATUS_INVALID_HANDLE 0xc0000008 |
371 |
#define STATUS_INVALID_PARAMETER 0xc000000d |
#define RD_STATUS_INVALID_PARAMETER 0xc000000d |
372 |
#define STATUS_NO_SUCH_FILE 0xc000000f |
#define RD_STATUS_NO_SUCH_FILE 0xc000000f |
373 |
#define STATUS_INVALID_DEVICE_REQUEST 0xc0000010 |
#define RD_STATUS_INVALID_DEVICE_REQUEST 0xc0000010 |
374 |
#define STATUS_ACCESS_DENIED 0xc0000022 |
#define RD_STATUS_ACCESS_DENIED 0xc0000022 |
375 |
#define STATUS_OBJECT_NAME_COLLISION 0xc0000035 |
#define RD_STATUS_OBJECT_NAME_COLLISION 0xc0000035 |
376 |
#define STATUS_DISK_FULL 0xc000007f |
#define RD_STATUS_DISK_FULL 0xc000007f |
377 |
#define STATUS_FILE_IS_A_DIRECTORY 0xc00000ba |
#define RD_STATUS_FILE_IS_A_DIRECTORY 0xc00000ba |
378 |
#define STATUS_NOT_SUPPORTED 0xc00000bb |
#define RD_STATUS_NOT_SUPPORTED 0xc00000bb |
379 |
#define STATUS_TIMEOUT 0xc0000102 |
#define RD_STATUS_TIMEOUT 0xc0000102 |
380 |
#define STATUS_NOTIFY_ENUM_DIR 0xc000010c |
#define RD_STATUS_NOTIFY_ENUM_DIR 0xc000010c |
381 |
#define STATUS_CANCELLED 0xc0000120 |
#define RD_STATUS_CANCELLED 0xc0000120 |
382 |
|
|
383 |
|
|
384 |
/* RDPDR constants */ |
/* RDPDR constants */ |
416 |
#define exDiscReasonLicenseErrClientEncryption 0x0108 |
#define exDiscReasonLicenseErrClientEncryption 0x0108 |
417 |
#define exDiscReasonLicenseCantUpgradeLicense 0x0109 |
#define exDiscReasonLicenseCantUpgradeLicense 0x0109 |
418 |
#define exDiscReasonLicenseNoRemoteConnections 0x010a |
#define exDiscReasonLicenseNoRemoteConnections 0x010a |
419 |
|
|
420 |
|
/* SeamlessRDP constants */ |
421 |
|
#define SEAMLESSRDP_NOTYETMAPPED -1 |
422 |
|
#define SEAMLESSRDP_NORMAL 0 |
423 |
|
#define SEAMLESSRDP_MINIMIZED 1 |
424 |
|
#define SEAMLESSRDP_MAXIMIZED 2 |
425 |
|
#define SEAMLESSRDP_POSITION_TIMER 200000 |
426 |
|
|
427 |
|
#define SEAMLESSRDP_CREATE_MODAL 0x0001 |
428 |
|
|
429 |
|
#define SEAMLESSRDP_HELLO_RECONNECT 0x0001 |
430 |
|
#define SEAMLESSRDP_HELLO_HIDDEN 0x0002 |
431 |
|
|
432 |
|
/* Smartcard constants */ |
433 |
|
#define SCARD_LOCK_TCP 0 |
434 |
|
#define SCARD_LOCK_SEC 1 |
435 |
|
#define SCARD_LOCK_CHANNEL 2 |
436 |
|
#define SCARD_LOCK_RDPDR 3 |
437 |
|
#define SCARD_LOCK_LAST 4 |