Leaked source code of windows server 2003
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

747 lines
34 KiB

  1. /****************************************************************************/
  2. // at120ex.h
  3. //
  4. // RDP T.120 protocol extensions
  5. //
  6. // Copyright (C) 1997-2000 Microsoft Corporation
  7. /****************************************************************************/
  8. #ifndef _H_AT120EX
  9. #define _H_AT120EX
  10. /****************************************************************************/
  11. /* TShare security constants. */
  12. /****************************************************************************/
  13. #include <tssec.h>
  14. #if !defined(OS_WINCE) && !defined(OS_WIN16)
  15. #include <winsta.h>
  16. #endif //OS_WIN16
  17. /****************************************************************************/
  18. /* */
  19. /* Definition of GCC User Data used by RDP */
  20. /* */
  21. /****************************************************************************/
  22. /****************************************************************************/
  23. /* H221 keys. */
  24. /****************************************************************************/
  25. #define H221_KEY_LEN 4
  26. #define SERVER_H221_KEY "McDn"
  27. #define CLIENT_H221_KEY "Duca"
  28. /****************************************************************************/
  29. /* User data identifiers */
  30. /****************************************************************************/
  31. /****************************************************************************/
  32. /* Client to Server IDs */
  33. /****************************************************************************/
  34. #define RNS_UD_CS_CORE_ID 0xc001
  35. #define RNS_UD_CS_SEC_ID 0xc002
  36. #define RNS_UD_CS_NET_ID 0xc003
  37. #define TS_UD_CS_CLUSTER_ID 0xC004
  38. /****************************************************************************/
  39. /* Server to Client IDs */
  40. /****************************************************************************/
  41. #define RNS_UD_SC_CORE_ID 0x0c01
  42. #define RNS_UD_SC_SEC_ID 0x0c02
  43. #define RNS_UD_SC_NET_ID 0x0c03
  44. /****************************************************************************/
  45. /* Color depths supported */
  46. /****************************************************************************/
  47. #define RNS_UD_COLOR_4BPP 0xca00
  48. #define RNS_UD_COLOR_8BPP 0xca01
  49. #define RNS_UD_COLOR_16BPP_555 0xca02
  50. #define RNS_UD_COLOR_16BPP_565 0xca03
  51. #define RNS_UD_COLOR_24BPP 0xca04
  52. #ifdef DC_HICOLOR
  53. /****************************************************************************/
  54. /* High color support */
  55. /****************************************************************************/
  56. #define RNS_UD_24BPP_SUPPORT 0x01
  57. #define RNS_UD_16BPP_SUPPORT 0x02
  58. #define RNS_UD_15BPP_SUPPORT 0x04
  59. #endif
  60. /****************************************************************************/
  61. /* SAS Sequence identifiers (incomplete). */
  62. /* Specifies the SAS sequence the client will use to access the login */
  63. /* screen in the Server. */
  64. /****************************************************************************/
  65. #define RNS_UD_SAS_NONE 0xaa01
  66. #define RNS_UD_SAS_CADEL 0xaa02
  67. #define RNS_UD_SAS_DEL 0xaa03
  68. #define RNS_UD_SAS_SYSRQ 0xaa04
  69. #define RNS_UD_SAS_ESC 0xaa05
  70. #define RNS_UD_SAS_F8 0xaa06
  71. /****************************************************************************/
  72. /* Keyboard layout identifiers. */
  73. /****************************************************************************/
  74. #define RNS_UD_KBD_DEFAULT 0
  75. /****************************************************************************/
  76. /* Version number */
  77. /* Major version Minor version */
  78. /* 0xFFFF0000 0x0000FFFF */
  79. /****************************************************************************/
  80. #define RNS_UD_VERSION 0x00080004 // Major 0008 - Minor 0004
  81. #define _RNS_MAJOR_VERSION(x) (x >> 16)
  82. #define _RNS_MINOR_VERSION(x) (x & 0x0000ffff)
  83. #define RNS_UD_MAJOR_VERSION (RNS_UD_VERSION >> 16)
  84. #define RNS_UD_MINOR_VERSION (RNS_UD_VERSION & 0x0000ffff)
  85. #define RNS_TERMSRV_40_UD_VERSION 0x00080001 // UD version used by Terminal
  86. // server 4.0 RTM
  87. #define RNS_DNS_USERNAME_UD_VERSION 0x00080004 // Usernames longer than 20 ok
  88. /****************************************************************************/
  89. // Security header flags
  90. /****************************************************************************/
  91. #define RNS_SEC_EXCHANGE_PKT 0x0001
  92. #define RNS_SEC_ENCRYPT 0x0008
  93. #define RNS_SEC_RESET_SEQNO 0x0010
  94. #define RNS_SEC_IGNORE_SEQNO 0x0020
  95. #define RNS_SEC_INFO_PKT 0x0040
  96. #define RNS_SEC_LICENSE_PKT 0x0080
  97. #define RDP_SEC_REDIRECTION_PKT 0x0100
  98. #define RDP_SEC_REDIRECTION_PKT2 0x0200
  99. #define RDP_SEC_REDIRECTION_PKT3 0x0400
  100. #define RDP_SEC_SECURE_CHECKSUM 0x0800
  101. //
  102. // If this flag is specified by the server
  103. // it means the client should encrypt all licensing
  104. // packets it sends up to the server.
  105. //
  106. // This happens at this early stage because the server
  107. // has to expose this capability before normal capability
  108. // negotiation.
  109. //
  110. // We also have licensing packets encrypted from the
  111. // server to the client, reusing the same flag here.
  112. // For clarify, the flag is defined twice to indicate
  113. // the encryption-direction (CS vs. SC)
  114. //
  115. #define RDP_SEC_LICENSE_ENCRYPT_CS 0x0200
  116. #define RDP_SEC_LICENSE_ENCRYPT_SC 0x0200
  117. /****************************************************************************/
  118. /* Flags which define non-data packets */
  119. /****************************************************************************/
  120. #define RNS_SEC_NONDATA_PKT (RNS_SEC_EXCHANGE_PKT | \
  121. RNS_SEC_INFO_PKT | \
  122. RNS_SEC_LICENSE_PKT | \
  123. RDP_SEC_REDIRECTION_PKT | \
  124. RDP_SEC_REDIRECTION_PKT2 | \
  125. RDP_SEC_REDIRECTION_PKT3)
  126. /****************************************************************************/
  127. /* RNS info packet flags */
  128. /****************************************************************************/
  129. #define RNS_INFO_MOUSE 0x0001
  130. #define RNS_INFO_DISABLECTRLALTDEL 0x0002
  131. #define RNS_INFO_DOUBLECLICKDETECT 0x0004
  132. #define RNS_INFO_AUTOLOGON 0x0008
  133. #define RNS_INFO_UNICODE 0x0010
  134. #define RNS_INFO_MAXIMIZESHELL 0x0020
  135. #define RNS_INFO_LOGONNOTIFY 0x0040
  136. #define RNS_INFO_COMPRESSION 0x0080
  137. #define RNS_INFO_ENABLEWINDOWSKEY 0x0100
  138. #define RNS_INFO_REMOTECONSOLEAUDIO 0x2000
  139. // See compress.h for type values that can appear in these 4 bits.
  140. #define RNS_INFO_COMPR_TYPE_MASK 0x1E00
  141. #define RNS_INFO_COMPR_TYPE_SHIFT 9
  142. // When this flag is set, the client should only send encrypted packet to server
  143. #define RNS_INFO_FORCE_ENCRYPTED_CS_PDU 0x4000
  144. /****************************************************************************/
  145. /* Structure: RNS_SECURITY_HEADER */
  146. /* */
  147. /* Description: Security header sent with all packets if encryption is in */
  148. /* force. */
  149. /* */
  150. /* This header has the following structure: */
  151. /* - flags (one or more of the RNS_SEC_ flags above) */
  152. /****************************************************************************/
  153. typedef struct tagRNS_SECURITY_HEADER
  154. {
  155. TSUINT16 flags;
  156. TSUINT16 flagsHi;
  157. } RNS_SECURITY_HEADER, FAR *PRNS_SECURITY_HEADER;
  158. typedef RNS_SECURITY_HEADER UNALIGNED FAR *PRNS_SECURITY_HEADER_UA;
  159. /****************************************************************************/
  160. /* Structure: RNS_SECURITY_HEADER */
  161. /* */
  162. /* Description: Security header sent with all packets if encryption is in */
  163. /* force. */
  164. /* */
  165. /* This header has the following structure: */
  166. /* - flags (one or more of the RNS_SEC_ flags above) */
  167. /****************************************************************************/
  168. typedef struct tagRNS_SECURITY_HEADER1
  169. {
  170. TSUINT16 flags;
  171. TSUINT16 flagsHi;
  172. TSINT8 dataSignature[DATA_SIGNATURE_SIZE];
  173. } RNS_SECURITY_HEADER1, FAR *PRNS_SECURITY_HEADER1;
  174. typedef RNS_SECURITY_HEADER1 UNALIGNED FAR *PRNS_SECURITY_HEADER1_UA;
  175. /****************************************************************************/
  176. /* Structure: RNS_SECURITY_HEADER */
  177. /* */
  178. /* Description: Security header sent with all packets if encryption is in */
  179. /* force. */
  180. /* */
  181. /* This header has the following structure: */
  182. /* - flags (one or more of the RNS_SEC_ flags above) */
  183. /****************************************************************************/
  184. typedef struct tagRNS_SECURITY_HEADER2
  185. {
  186. TSUINT16 flags;
  187. TSUINT16 flagsHi;
  188. TSUINT16 length; // length of the this header
  189. TSUINT8 version;
  190. #define TSFIPS_VERSION1 1
  191. TSUINT8 padlen; // length of the padding in the encrypted data, has to be next to last
  192. TSINT8 dataSignature[MAX_SIGN_SIZE];
  193. } RNS_SECURITY_HEADER2, FAR *PRNS_SECURITY_HEADER2;
  194. typedef RNS_SECURITY_HEADER2 UNALIGNED FAR *PRNS_SECURITY_HEADER2_UA;
  195. /****************************************************************************/
  196. /* Structure: RNS_SECURITY_PACKET */
  197. /* */
  198. /* Description: Structure of security packet sent during security exchange */
  199. /* */
  200. /* The packet has the following structure */
  201. /* - flags (RNS_SEC_EXCHANGE_PKT) */
  202. /* - length length of data */
  203. /* - variable length data */
  204. /****************************************************************************/
  205. typedef struct tagRNS_SECURITY_PACKET
  206. {
  207. TSUINT32 flags;
  208. TSUINT32 length;
  209. /* data follows */
  210. } RNS_SECURITY_PACKET, FAR *PRNS_SECURITY_PACKET;
  211. typedef RNS_SECURITY_PACKET UNALIGNED FAR *PRNS_SECURITY_PACKET_UA;
  212. /****************************************************************************/
  213. // RDP_SERVER_REDIRECTION_PACKET
  214. //
  215. // Used to communicate a server redirection to the client.
  216. /****************************************************************************/
  217. typedef struct
  218. {
  219. // This corresponds to the security header flags field. We use this to
  220. // contain the "flag" RDP_SEC_REDIRECTION_PKT.
  221. TSUINT16 Flags;
  222. // Overall length of this packet, including the header fields.
  223. TSUINT16 Length;
  224. TSUINT32 SessionID;
  225. // Variable-length, zero-terminated Unicode string. No accompanying size
  226. // field is given since the size can be determined from the length above.
  227. // Up to TS_MAX_SERVERADDRESS_LENGTH Unicode characters in length (incl.
  228. // terminating null).
  229. TSUINT16 ServerAddress[1];
  230. } RDP_SERVER_REDIRECTION_PACKET, FAR *PRDP_SERVER_REDIRECTION_PACKET;
  231. typedef struct
  232. {
  233. // This corresponds to the security header flags field. We use this to
  234. // contain the "flag" RDP_SEC_REDIRECTION_PKT.
  235. TSUINT16 Flags;
  236. // Overall length of this packet, including the header fields.
  237. TSUINT16 Length;
  238. TSUINT32 SessionID;
  239. TSUINT32 RedirFlags;
  240. #define TARGET_NET_ADDRESS 0x1
  241. #define LOAD_BALANCE_INFO 0x2
  242. // Variable-length. For each field, it has the form
  243. // ULONG Length
  244. // BYTE data[]
  245. } RDP_SERVER_REDIRECTION_PACKET_V2, FAR *PRDP_SERVER_REDIRECTION_PACKET_V2;
  246. typedef struct
  247. {
  248. // This corresponds to the security header flags field. We use this to
  249. // contain the "flag" RDP_SEC_REDIRECTION_PKT.
  250. TSUINT16 Flags;
  251. // Overall length of this packet, including the header fields.
  252. TSUINT16 Length;
  253. TSUINT32 SessionID;
  254. TSUINT32 RedirFlags;
  255. #define TARGET_NET_ADDRESS 0x1
  256. #define LOAD_BALANCE_INFO 0x2
  257. #define LB_USERNAME 0x4
  258. #define LB_DOMAIN 0x8
  259. #define LB_PASSWORD 0x10
  260. // In case the policy is set on the server side the client should not store
  261. // the user name it gets from the V3 redirection packet in the default.rdp
  262. // file
  263. #define LB_DONTSTOREUSERNAME 0x20
  264. #define LB_SMARTCARD_LOGON 0x40
  265. // used to inform client the machine IP for later ARC use
  266. #define LB_NOREDIRECT 0x80
  267. // Variable-length. For each field, it has the form
  268. // ULONG Length
  269. // BYTE data[]
  270. } RDP_SERVER_REDIRECTION_PACKET_V3, FAR *PRDP_SERVER_REDIRECTION_PACKET_V3;
  271. //
  272. // Time zone packet
  273. //
  274. #ifndef _RDP_TIME_ZONE_INFORMATION_
  275. #define _RDP_TIME_ZONE_INFORMATION_
  276. typedef struct _RDP_SYSTEMTIME {
  277. TSUINT16 wYear;
  278. TSUINT16 wMonth;
  279. TSUINT16 wDayOfWeek;
  280. TSUINT16 wDay;
  281. TSUINT16 wHour;
  282. TSUINT16 wMinute;
  283. TSUINT16 wSecond;
  284. TSUINT16 wMilliseconds;
  285. } RDP_SYSTEMTIME;
  286. typedef struct _RDP_TIME_ZONE_INFORMATION {
  287. TSINT32 Bias;
  288. TSWCHAR StandardName[ 32 ];
  289. RDP_SYSTEMTIME StandardDate;
  290. TSINT32 StandardBias;
  291. TSWCHAR DaylightName[ 32 ];
  292. RDP_SYSTEMTIME DaylightDate;
  293. TSINT32 DaylightBias;
  294. } RDP_TIME_ZONE_INFORMATION;
  295. #endif //_RDP_TIME_ZONE_INFORMATION_
  296. /****************************************************************************/
  297. /* Structure: RNS_INFO_PACKET */
  298. /* */
  299. /* The packet has the following structure */
  300. /* - fMouse Mouse enabled flag */
  301. /* - fDisableCtrlAltDel CtrlAltDel disable state */
  302. /* - fDoubleClickDetect Double click detect state */
  303. /* - Domain Domain */
  304. /* - UserName UserName */
  305. /* - Password Password */
  306. /****************************************************************************/
  307. // The following fields are added post Win2000 Beta 3
  308. // Future variable length fields can be appended to this struct in similar
  309. // fashion
  310. #define RNS_INFO_INVALID_SESSION_ID LOGONID_NONE
  311. typedef struct tagRNS_EXTENDED_INFO_PACKET
  312. {
  313. TSUINT16 clientAddressFamily;
  314. TSUINT16 cbClientAddress;
  315. TSUINT8 clientAddress[TS_MAX_CLIENTADDRESS_LENGTH];
  316. TSUINT16 cbClientDir;
  317. TSUINT8 clientDir[TS_MAX_CLIENTDIR_LENGTH];
  318. //client time zone information
  319. RDP_TIME_ZONE_INFORMATION clientTimeZone;
  320. TSUINT32 clientSessionId;
  321. //
  322. // List of features to disable
  323. // (flags are defined in the protocol independent header tsperf.h)
  324. //
  325. TSUINT32 performanceFlags;
  326. //
  327. // Flags field
  328. //
  329. TSUINT16 cbAutoReconnectLen;
  330. //
  331. // Variable length portion. Only sent up if autoreconnection info
  332. // is specified
  333. //
  334. TSUINT8 autoReconnectCookie[TS_MAX_AUTORECONNECT_LEN];
  335. } RNS_EXTENDED_INFO_PACKET, FAR *PRNS_EXTENDED_INFO_PACKET;
  336. typedef RNS_EXTENDED_INFO_PACKET UNALIGNED FAR *PRNS_EXTENDED_INFO_PACKET_UA;
  337. typedef struct tagRNS_INFO_PACKET
  338. {
  339. //
  340. // In UNICODE we reuse the CodePage field to hold the active input
  341. // locale identifier (formerly called keyboard layout)
  342. //
  343. TSUINT32 CodePage;
  344. TSUINT32 flags;
  345. TSUINT16 cbDomain;
  346. TSUINT16 cbUserName;
  347. TSUINT16 cbPassword;
  348. TSUINT16 cbAlternateShell;
  349. TSUINT16 cbWorkingDir;
  350. TSUINT8 Domain[TS_MAX_DOMAIN_LENGTH];
  351. TSUINT8 UserName[TS_MAX_USERNAME_LENGTH];
  352. TSUINT8 Password[TS_MAX_PASSWORD_LENGTH];
  353. TSUINT8 AlternateShell[TS_MAX_ALTERNATESHELL_LENGTH];
  354. TSUINT8 WorkingDir[TS_MAX_WORKINGDIR_LENGTH];
  355. RNS_EXTENDED_INFO_PACKET ExtraInfo;
  356. } RNS_INFO_PACKET, FAR *PRNS_INFO_PACKET;
  357. typedef RNS_INFO_PACKET UNALIGNED FAR *PRNS_INFO_PACKET_UA;
  358. /****************************************************************************/
  359. /* User Data Structures */
  360. /****************************************************************************/
  361. /****************************************************************************/
  362. /* Structure: RNS_UD_HEADER */
  363. /* */
  364. /* Header included in all user data structures */
  365. /* - type one of the RNS_UD constants above */
  366. /* - length length of data (including this header) */
  367. /* - data one of the data structures below */
  368. /****************************************************************************/
  369. typedef struct tagRNS_UD_HEADER
  370. {
  371. TSUINT16 type;
  372. TSUINT16 length;
  373. } RNS_UD_HEADER;
  374. typedef RNS_UD_HEADER UNALIGNED FAR *PRNS_UD_HEADER;
  375. /****************************************************************************/
  376. /* Structure: RNS_UD_CS_CORE */
  377. /* */
  378. /* Client to Server core data */
  379. /* - header standard header */
  380. /* - version software version number */
  381. /* - desktopWidth width of desktop in pels */
  382. /* - desktopHeight height of desktop in pels */
  383. /* - colorDepth color depth supported - see note below */
  384. /* - SASSequence SAS sequence to use - one of the SAS constants above */
  385. /* - keyboardLayout Keyboard layout / locale */
  386. /* - clientName Name in Unicode characters */
  387. /* - keyboardType ] */
  388. /* - keyboardSubType ] FE stuff */
  389. /* - keyboardFunctionKey ] */
  390. /* - imeFileName ] */
  391. /* - postBeta2ColorDepth Color depth supported - see note below */
  392. /* - clientProductId */
  393. /* - serialNumber */
  394. #ifdef DC_HICOLOR
  395. /* - highColorDepth preferred color depth (if not 8bpp) */
  396. /* - supportedColorDepths high color depths supported by client */
  397. #endif
  398. /****************************************************************************/
  399. #ifdef DC_HICOLOR
  400. /****************************************************************************/
  401. /* Notes on color depths: */
  402. /* */
  403. /* In the NT4 TSE development, beta 2 servers would only accept connections */
  404. /* from clients requesting 8bpp - 4bpp support was only added later. To */
  405. /* get around this problem while maintaining back compatibility with beta 2 */
  406. /* servers, the postBeta2ColorDepth field was added which is recognised by */
  407. /* servers later than beta 2 */
  408. /* */
  409. /* Later, support for high color depth (15, 16, and 24bpp) connections was */
  410. /* added to the protocol. Again, for compatibility with old servers, new */
  411. /* fields are required. The highColorDepth field contains the color depth */
  412. /* the client would like (one of the RNS_UD_COLOR_XX values) while the */
  413. /* supportedColorDepths field lists the high color depths the client is */
  414. /* capable of supporting (using the RNS_UD_XXBPP_SUPPORT flags ORed */
  415. /* together). */
  416. /* */
  417. /* Thus a new client on a 24bpp system will typically advertise the */
  418. /* following color-related capabilities: */
  419. /* */
  420. /* colorDepth = RNS_UD_COLOR_8BPP - NT4 TSE Beta 2 servers look */
  421. /* at this field */
  422. /* postBeta2ColorDepth = RNS_UD_COLOR_8BPP - NT4 TSE and Win2000 servers */
  423. /* examine this field */
  424. /* highColorDepth = RNS_UD_COLOR_24BPP - post Win2000 (NT5.1?) */
  425. /* supportedColorDepths = RNS_UD_24BPP_SUPPORT servers check these fields */
  426. /* RNS_UD_16BPP_SUPPORT for preferred and supported */
  427. /* RNS_UD_15BPP_SUPPORT color depths */
  428. /* */
  429. /****************************************************************************/
  430. #else
  431. /****************************************************************************/
  432. /* A note on color depths: A beta2 Server rejects connections from a */
  433. /* Client with a color depth of 4bpp. A released Server supports this. */
  434. /* Therefore a new field, postBeta2ColorDepth, is added, which is */
  435. /* recognised by released Servers and can take the value 4bpp. Beta2 */
  436. /* Servers continue to check colorDepth only. */
  437. /****************************************************************************/
  438. #endif
  439. typedef struct tagRNS_UD_CS_CORE
  440. {
  441. RNS_UD_HEADER header;
  442. TSUINT32 version;
  443. TSUINT16 desktopWidth;
  444. TSUINT16 desktopHeight;
  445. TSUINT16 colorDepth;
  446. TSUINT16 SASSequence;
  447. TSUINT32 keyboardLayout;
  448. TSUINT32 clientBuild;
  449. // Max size same as MAX_COMPUTERNAME_LENGTH in windows.h.
  450. #define RNS_UD_CS_CLIENTNAME_LENGTH 15
  451. TSUINT16 clientName[RNS_UD_CS_CLIENTNAME_LENGTH + 1];
  452. TSUINT32 keyboardType;
  453. TSUINT32 keyboardSubType;
  454. TSUINT32 keyboardFunctionKey;
  455. TSUINT16 imeFileName[TS_MAX_IMEFILENAME]; // Unicode string, ASCII code only.
  456. TSUINT16 postBeta2ColorDepth;
  457. TSUINT16 clientProductId;
  458. TSUINT32 serialNumber;
  459. #ifdef DC_HICOLOR
  460. TSUINT16 highColorDepth;
  461. TSUINT16 supportedColorDepths;
  462. #endif
  463. //Used to specify early capability info
  464. //e.g support for error info PDU has to be
  465. //setup before licensing (which unfortunately
  466. //happens after caps negotiation)
  467. #define RNS_UD_CS_SUPPORT_ERRINFO_PDU 0x0001
  468. TSUINT16 earlyCapabilityFlags;
  469. //fix shadow loop detection
  470. //meherm 02/09/2001
  471. #define CLIENT_PRODUCT_ID_LENGTH 32
  472. TSUINT16 clientDigProductId[CLIENT_PRODUCT_ID_LENGTH];
  473. } RNS_UD_CS_CORE;
  474. typedef RNS_UD_CS_CORE UNALIGNED FAR *PRNS_UD_CS_CORE;
  475. typedef PRNS_UD_CS_CORE UNALIGNED FAR *PPRNS_UD_CS_CORE;
  476. // Original size structure used by shadowing code - do not use!
  477. typedef struct tagRNS_UD_CS_CORE_V0
  478. {
  479. RNS_UD_HEADER header;
  480. TSUINT32 version;
  481. TSUINT16 desktopWidth;
  482. TSUINT16 desktopHeight;
  483. TSUINT16 colorDepth;
  484. TSUINT16 SASSequence;
  485. TSUINT32 keyboardLayout;
  486. TSUINT32 clientBuild;
  487. // Max size same as MAX_COMPUTERNAME_LENGTH in windows.h.
  488. #define RNS_UD_CS_CLIENTNAME_LENGTH 15
  489. TSUINT16 clientName[RNS_UD_CS_CLIENTNAME_LENGTH + 1];
  490. TSUINT32 keyboardType;
  491. TSUINT32 keyboardSubType;
  492. TSUINT32 keyboardFunctionKey;
  493. TSUINT16 imeFileName[TS_MAX_IMEFILENAME]; // Unicode string, ASCII code only.
  494. TSUINT16 postBeta2ColorDepth;
  495. TSUINT16 pad;
  496. } RNS_UD_CS_CORE_V0, FAR *PRNS_UD_CS_CORE_V0;
  497. typedef PRNS_UD_CS_CORE_V0 FAR *PPRNS_UD_CS_CORE_V0;
  498. // Intermediate size structure used by shadowing code - do not use!
  499. typedef struct tagRNS_UD_CS_CORE_V1
  500. {
  501. RNS_UD_HEADER header;
  502. TSUINT32 version;
  503. TSUINT16 desktopWidth;
  504. TSUINT16 desktopHeight;
  505. TSUINT16 colorDepth;
  506. TSUINT16 SASSequence;
  507. TSUINT32 keyboardLayout;
  508. TSUINT32 clientBuild;
  509. // Max size same as MAX_COMPUTERNAME_LENGTH in windows.h.
  510. #define RNS_UD_CS_CLIENTNAME_LENGTH 15
  511. TSUINT16 clientName[RNS_UD_CS_CLIENTNAME_LENGTH + 1];
  512. TSUINT32 keyboardType;
  513. TSUINT32 keyboardSubType;
  514. TSUINT32 keyboardFunctionKey;
  515. TSUINT16 imeFileName[TS_MAX_IMEFILENAME]; // Unicode string, ASCII code only.
  516. TSUINT16 postBeta2ColorDepth;
  517. TSUINT16 clientProductId;
  518. TSUINT32 serialNumber;
  519. } RNS_UD_CS_CORE_V1, FAR *PRNS_UD_CS_CORE_V1;
  520. typedef PRNS_UD_CS_CORE_V1 FAR *PPRNS_UD_CS_CORE_V1;
  521. /****************************************************************************/
  522. /* Structure: RNS_UD_CS_SEC */
  523. /* */
  524. /* Client to Server security data */
  525. /* - header standard header */
  526. /* - encryptionMethods encryption method supported by the client */
  527. /* - extEncryptionMethods used by the French Locale system for backward */
  528. /* compatibility. */
  529. /****************************************************************************/
  530. typedef struct tagRNS_UD_CS_SEC
  531. {
  532. RNS_UD_HEADER header;
  533. TSUINT32 encryptionMethods;
  534. TSUINT32 extEncryptionMethods;
  535. } RNS_UD_CS_SEC;
  536. typedef RNS_UD_CS_SEC UNALIGNED FAR *PRNS_UD_CS_SEC;
  537. typedef PRNS_UD_CS_SEC UNALIGNED FAR *PPRNS_UD_CS_SEC;
  538. // Original size structure used by shadowing code - do not use!
  539. typedef struct tagRNS_UD_CS_SEC_V0
  540. {
  541. RNS_UD_HEADER header;
  542. TSUINT32 encryptionMethods;
  543. } RNS_UD_CS_SEC_V0, RNS_UD_CS_SEC_V1, FAR *PRNS_UD_CS_SEC_V0, FAR *PRNS_UD_CS_SEC_V1;
  544. typedef PRNS_UD_CS_SEC_V0 FAR *PPRNS_UD_CS_SEC_V0;
  545. /****************************************************************************/
  546. /* Structure: RNS_UD_CS_NET */
  547. /* */
  548. /* Description: Client to Server network data */
  549. /* - header standard header */
  550. /* - channelCount number of channel names */
  551. /* - channel names */
  552. /****************************************************************************/
  553. typedef struct tagRNS_UD_CS_NET
  554. {
  555. RNS_UD_HEADER header;
  556. TSUINT32 channelCount;
  557. /* array of CHANNEL_DEF structures follows */
  558. } RNS_UD_CS_NET;
  559. typedef RNS_UD_CS_NET UNALIGNED FAR *PRNS_UD_CS_NET;
  560. typedef PRNS_UD_CS_NET UNALIGNED FAR *PPRNS_UD_CS_NET;
  561. /****************************************************************************/
  562. // TS_UD_CS_CLUSTER
  563. //
  564. // Client-to-server information for server clustering-aware clients.
  565. /****************************************************************************/
  566. // Flag values.
  567. // Client supports basic redirection.
  568. #define TS_CLUSTER_REDIRECTION_SUPPORTED 0x01
  569. // Bits 2..5 represent the version for the PDU
  570. #define TS_CLUSTER_REDIRECTION_VERSION 0x3C
  571. #define TS_CLUSTER_REDIRECTION_VERSION1 0x0
  572. #define TS_CLUSTER_REDIRECTION_VERSION2 0x1
  573. #define TS_CLUSTER_REDIRECTION_VERSION3 0x2
  574. #define TS_CLUSTER_REDIRECTION_VERSION4 0x3
  575. // Set if the client has already been redirected and the SessionID field
  576. // in the struct contains a valid value.
  577. #define TS_CLUSTER_REDIRECTED_SESSIONID_FIELD_VALID 0x02
  578. #define TS_CLUSTER_REDIRECTED_SMARTCARD 0x40
  579. typedef struct
  580. {
  581. RNS_UD_HEADER header;
  582. TSUINT32 Flags;
  583. TSUINT32 RedirectedSessionID;
  584. } TS_UD_CS_CLUSTER;
  585. typedef TS_UD_CS_CLUSTER UNALIGNED FAR *PTS_UD_CS_CLUSTER;
  586. /****************************************************************************/
  587. /* Structure: RNS_UD_SC_CORE */
  588. /* */
  589. /* Server to Client core data */
  590. /* - header standard header */
  591. /* - version software version number */
  592. /****************************************************************************/
  593. typedef struct tagRNS_UD_SC_CORE
  594. {
  595. RNS_UD_HEADER header;
  596. TSUINT32 version;
  597. } RNS_UD_SC_CORE, FAR *PRNS_UD_SC_CORE;
  598. /****************************************************************************/
  599. /* Structure: RNS_UD_SC_SEC */
  600. /* */
  601. /* Server to Client security data */
  602. /* - header standard header */
  603. /* - encryptionMethod encryption method selected by the server */
  604. /* - encryptionLevel encryption level supported by the server */
  605. /****************************************************************************/
  606. typedef struct tagRNS_UD_SC_SEC
  607. {
  608. RNS_UD_HEADER header;
  609. TSUINT32 encryptionMethod;
  610. TSUINT32 encryptionLevel;
  611. } RNS_UD_SC_SEC, FAR *PRNS_UD_SC_SEC, FAR * FAR *PPRNS_UD_SC_SEC;
  612. /****************************************************************************/
  613. /* Structure: RNS_UD_SC_SEC1 */
  614. /* */
  615. /* Server to Client security data */
  616. /* - header standard header */
  617. /* - encryptionMethod encryption method selected by the server */
  618. /* - serverRandomLen length of the server random */
  619. /* - serverCertLen server certificate length */
  620. /* - server random data */
  621. /* - server certificate data */
  622. /****************************************************************************/
  623. typedef struct tagRNS_UD_SC_SEC1
  624. {
  625. RNS_UD_HEADER header;
  626. TSUINT32 encryptionMethod;
  627. TSUINT32 encryptionLevel;
  628. TSUINT32 serverRandomLen;
  629. TSUINT32 serverCertLen;
  630. /* server random key data follows */
  631. /* server certificate data follows */
  632. } RNS_UD_SC_SEC1, FAR *PRNS_UD_SC_SEC1;
  633. /****************************************************************************/
  634. /* Structure: RNS_UD_SC_NET */
  635. /* */
  636. /* Server to Client network data */
  637. /* - header standard header */
  638. /* - MCSChannelID T128 MCS channel ID to use */
  639. /* - pad unused */
  640. /* - channelCount number of channels */
  641. /* - channel IDs */
  642. /****************************************************************************/
  643. typedef struct tagRNS_UD_SC_NET
  644. {
  645. RNS_UD_HEADER header;
  646. TSUINT16 MCSChannelID;
  647. TSUINT16 channelCount; /* was pad, but always 0, in release 1 */
  648. /* array of 2-byte integer MCS channel IDs follows (0 = unknown) */
  649. } RNS_UD_SC_NET, FAR *PRNS_UD_SC_NET, FAR * FAR *PPRNS_UD_SC_NET;
  650. /****************************************************************************/
  651. /* Virtual channel protocol flags */
  652. /* Header flags (internal protocol use only) */
  653. /****************************************************************************/
  654. #define CHANNEL_FLAG_SHOW_PROTOCOL 0x10
  655. #define CHANNEL_FLAG_SUSPEND 0x20
  656. #define CHANNEL_FLAG_RESUME 0x40
  657. #define CHANNEL_FLAG_SHADOW_PERSISTENT 0x80
  658. #endif /* _H_AT120EX */