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.

3100 lines
125 KiB

  1. /****************************************************************************/
  2. // at128.h
  3. //
  4. // RDP/T.128 definitions
  5. //
  6. // Copyright (C) 1997-2000 Microsoft Corporation
  7. /****************************************************************************/
  8. #ifndef _H_AT128
  9. #define _H_AT128
  10. /****************************************************************************/
  11. /* Define basic types used in the rest of this header */
  12. /****************************************************************************/
  13. typedef unsigned long TSUINT32, *PTSUINT32;
  14. typedef unsigned short TSUINT16, *PTSUINT16;
  15. typedef short TSINT16, *PTSINT16;
  16. typedef unsigned char TSUINT8, *PTSUINT8;
  17. typedef char TSINT8, *PTSINT8;
  18. typedef short TSBOOL16, *PTSBOOL16;
  19. typedef long TSINT32, *PTSINT32;
  20. typedef unsigned short TSWCHAR;
  21. typedef TCHAR TSTCHAR;
  22. typedef ULONG TSCOLORREF;
  23. /****************************************************************************/
  24. // Turn off compiler padding of structures. Note this means that *all*
  25. // pointers to structs defined in this file will be automatically UNALIGNED,
  26. // which can cause a lot of problems for RISC platforms where unaligned
  27. // means about eight times as much code.
  28. // Save previous packing style if 32-bit build.
  29. /****************************************************************************/
  30. #ifdef OS_WIN16
  31. #pragma pack (1)
  32. #else
  33. #pragma pack (push, t128pack, 1)
  34. #endif
  35. #define INT16_MIN (-32768)
  36. /****************************************************************************/
  37. /* Basic type definitions */
  38. /****************************************************************************/
  39. typedef TSUINT32 TS_SHAREID;
  40. /****************************************************************************/
  41. /* Constants */
  42. /****************************************************************************/
  43. #define TS_MAX_SOURCEDESCRIPTOR 48
  44. #define TS_MAX_TERMINALDESCRIPTOR 16
  45. #define TS_MAX_FACENAME 32
  46. #define TS_MAX_ORDERS 32
  47. #define TS_MAX_ENC_ORDER_FIELDS 24
  48. #define TS_MAX_DOMAIN_LENGTH 512
  49. #define TS_MAX_DOMAIN_LENGTH_OLD 52
  50. #define TS_MAX_USERNAME_LENGTH_OLD 44
  51. #define TS_MAX_USERNAME_LENGTH 512
  52. #define TS_MAX_PASSWORD_LENGTH 512
  53. #define TS_MAX_PASSWORD_LENGTH_OLD 32
  54. #define TS_MAX_ALTERNATESHELL_LENGTH 512
  55. #define TS_MAX_WORKINGDIR_LENGTH 512
  56. #define TS_MAX_CLIENTADDRESS_LENGTH 64
  57. #define TS_MAX_SERVERADDRESS_LENGTH 64
  58. #define TS_MAX_CLIENTDIR_LENGTH 512
  59. #define TS_MAX_GLYPH_CACHES 10
  60. // Max size might be expand if exist very long IME file name.
  61. #define TS_MAX_IMEFILENAME 32
  62. // Length of the autoreconnect cookie
  63. #define TS_MAX_AUTORECONNECT_LEN 128
  64. //
  65. // Autoreconnect verifier that is sent up to the server
  66. //
  67. #define TS_ARC_VERIFIER_LEN 16
  68. /****************************************************************************/
  69. /* Encoded Order types. */
  70. /* These numbers are the values sent in encoded orders to identify the */
  71. /* order type. Range is 0..31. */
  72. /****************************************************************************/
  73. #define TS_ENC_DSTBLT_ORDER 0x00
  74. #define TS_ENC_PATBLT_ORDER 0x01
  75. #define TS_ENC_SCRBLT_ORDER 0x02
  76. #define TS_ENC_MEMBLT_ORDER 0x03
  77. #define TS_ENC_MEM3BLT_ORDER 0x04
  78. #define TS_ENC_ATEXTOUT_ORDER 0x05
  79. #define TS_ENC_AEXTTEXTOUT_ORDER 0x06
  80. #ifdef DRAW_NINEGRID
  81. #define TS_ENC_DRAWNINEGRID_ORDER 0x07
  82. #define TS_ENC_MULTI_DRAWNINEGRID_ORDER 0x08
  83. #endif
  84. #define TS_ENC_LINETO_ORDER 0x09
  85. #define TS_ENC_OPAQUERECT_ORDER 0x0a
  86. #define TS_ENC_SAVEBITMAP_ORDER 0x0b
  87. // unused 0x0C
  88. #define TS_ENC_MEMBLT_R2_ORDER 0x0d
  89. #define TS_ENC_MEM3BLT_R2_ORDER 0x0e
  90. #define TS_ENC_MULTIDSTBLT_ORDER 0x0f
  91. #define TS_ENC_MULTIPATBLT_ORDER 0x10
  92. #define TS_ENC_MULTISCRBLT_ORDER 0x11
  93. #define TS_ENC_MULTIOPAQUERECT_ORDER 0x12
  94. #define TS_ENC_FAST_INDEX_ORDER 0x13
  95. #define TS_ENC_POLYGON_SC_ORDER 0x14
  96. #define TS_ENC_POLYGON_CB_ORDER 0x15
  97. #define TS_ENC_POLYLINE_ORDER 0x16
  98. // unused 0x17
  99. #define TS_ENC_FAST_GLYPH_ORDER 0x18
  100. #define TS_ENC_ELLIPSE_SC_ORDER 0x19
  101. #define TS_ENC_ELLIPSE_CB_ORDER 0x1a
  102. #define TS_ENC_INDEX_ORDER 0x1b
  103. #define TS_ENC_WTEXTOUT_ORDER 0x1c
  104. #define TS_ENC_WEXTTEXTOUT_ORDER 0x1d
  105. #define TS_ENC_LONG_WTEXTOUT_ORDER 0x1e
  106. #define TS_ENC_LONG_WEXTTEXTOUT_ORDER 0x1f
  107. #define TS_LAST_ORDER 0x1f
  108. /****************************************************************************/
  109. /* Order Negotiation constants. */
  110. /* These numbers are indices to TS_ORDER_CAPABILITYSET.orderSupport, used */
  111. /* to advertise a node's capability to receive each type of encoded order. */
  112. /* Range is 0..TS_MAX_ORDERS-1. */
  113. /****************************************************************************/
  114. #define TS_NEG_DSTBLT_INDEX 0x0000
  115. #define TS_NEG_PATBLT_INDEX 0x0001
  116. #define TS_NEG_SCRBLT_INDEX 0x0002
  117. #define TS_NEG_MEMBLT_INDEX 0x0003
  118. #define TS_NEG_MEM3BLT_INDEX 0x0004
  119. #define TS_NEG_ATEXTOUT_INDEX 0x0005
  120. #define TS_NEG_AEXTTEXTOUT_INDEX 0x0006
  121. #ifdef DRAW_NINEGRID
  122. #define TS_NEG_DRAWNINEGRID_INDEX 0x0007
  123. #endif
  124. #define TS_NEG_LINETO_INDEX 0x0008
  125. #ifdef DRAW_NINEGRID
  126. #define TS_NEG_MULTI_DRAWNINEGRID_INDEX 0x0009
  127. #endif
  128. #define TS_NEG_OPAQUERECT_INDEX 0x000A
  129. #define TS_NEG_SAVEBITMAP_INDEX 0x000B
  130. #define TS_NEG_WTEXTOUT_INDEX 0x000C
  131. #define TS_NEG_MEMBLT_R2_INDEX 0x000D
  132. #define TS_NEG_MEM3BLT_R2_INDEX 0x000E
  133. #define TS_NEG_MULTIDSTBLT_INDEX 0x000F
  134. #define TS_NEG_MULTIPATBLT_INDEX 0x0010
  135. #define TS_NEG_MULTISCRBLT_INDEX 0x0011
  136. #define TS_NEG_MULTIOPAQUERECT_INDEX 0x0012
  137. #define TS_NEG_FAST_INDEX_INDEX 0x0013
  138. #define TS_NEG_POLYGON_SC_INDEX 0x0014
  139. #define TS_NEG_POLYGON_CB_INDEX 0x0015
  140. #define TS_NEG_POLYLINE_INDEX 0x0016
  141. // unused 0x17
  142. #define TS_NEG_FAST_GLYPH_INDEX 0x0018
  143. #define TS_NEG_ELLIPSE_SC_INDEX 0x0019
  144. #define TS_NEG_ELLIPSE_CB_INDEX 0x001A
  145. #define TS_NEG_INDEX_INDEX 0x001B
  146. #define TS_NEG_WEXTTEXTOUT_INDEX 0x001C
  147. #define TS_NEG_WLONGTEXTOUT_INDEX 0x001D
  148. #define TS_NEG_WLONGEXTTEXTOUT_INDEX 0x001E
  149. /****************************************************************************/
  150. // Primary order bounds encoding description flags.
  151. /****************************************************************************/
  152. #define TS_BOUND_LEFT 0x01
  153. #define TS_BOUND_TOP 0x02
  154. #define TS_BOUND_RIGHT 0x04
  155. #define TS_BOUND_BOTTOM 0x08
  156. #define TS_BOUND_DELTA_LEFT 0x10
  157. #define TS_BOUND_DELTA_TOP 0x20
  158. #define TS_BOUND_DELTA_RIGHT 0x40
  159. #define TS_BOUND_DELTA_BOTTOM 0x80
  160. /****************************************************************************/
  161. /* Structure types */
  162. /****************************************************************************/
  163. /****************************************************************************/
  164. // TS_POINT16
  165. /****************************************************************************/
  166. typedef struct tagTS_POINT16
  167. {
  168. TSINT16 x;
  169. TSINT16 y;
  170. } TS_POINT16, FAR *PTS_POINT16;
  171. /****************************************************************************/
  172. // TS_RECTANGLE16
  173. /****************************************************************************/
  174. typedef struct tagTS_RECTANGLE16
  175. {
  176. TSINT16 left;
  177. TSINT16 top;
  178. TSINT16 right;
  179. TSINT16 bottom;
  180. } TS_RECTANGLE16, FAR *PTS_RECTANGLE16;
  181. /****************************************************************************/
  182. // TS_RECTANGLE32
  183. /****************************************************************************/
  184. typedef struct tagTS_RECTANGLE32
  185. {
  186. TSINT32 left;
  187. TSINT32 top;
  188. TSINT32 right;
  189. TSINT32 bottom;
  190. } TS_RECTANGLE32, FAR *PTS_RECTANGLE32;
  191. /****************************************************************************/
  192. /* Structure: TS_SHARECONTROLHEADER */
  193. /* */
  194. /* Description: ShareControlHeader */
  195. /* Note that this structure is not DWORD aligned, it relies on the packing */
  196. /* to ensure that structures following this (within a PDU) are correctly */
  197. /* aligned (i.e. do not have pad bytes inserted). */
  198. /****************************************************************************/
  199. typedef struct tagTS_SHARECONTROLHEADER
  200. {
  201. TSUINT16 totalLength;
  202. TSUINT16 pduType; /* Also encodes the protocol version */
  203. TSUINT16 pduSource;
  204. } TS_SHARECONTROLHEADER, FAR *PTS_SHARECONTROLHEADER;
  205. /****************************************************************************/
  206. // TS_BLENDFUNC
  207. //
  208. // This is the alphablend function information
  209. /****************************************************************************/
  210. typedef struct tagTS_BLENDFUNC
  211. {
  212. BYTE BlendOp;
  213. BYTE BlendFlags;
  214. BYTE SourceConstantAlpha;
  215. BYTE AlphaFormat;
  216. } TS_BLENDFUNC, FAR *PTS_BLENDFUNC;
  217. /****************************************************************************/
  218. /* Macros to access packet length field. */
  219. /****************************************************************************/
  220. #define TS_DATAPKT_LEN(pPkt) \
  221. ((pPkt)->shareDataHeader.shareControlHeader.totalLength)
  222. #define TS_CTRLPKT_LEN(pPkt) \
  223. ((pPkt)->shareControlHeader.totalLength)
  224. #define TS_UNCOMP_LEN(pPkt) ((pPkt)->shareDataHeader.uncompressedLength)
  225. /****************************************************************************/
  226. /* the pduType field contains the Protocol Version and the PDU type. These */
  227. /* masks select the relevant field. */
  228. /****************************************************************************/
  229. #define TS_MASK_PDUTYPE 0x000F
  230. #define TS_MASK_PROTOCOLVERSION 0xFFF0
  231. /****************************************************************************/
  232. /* PDUType values */
  233. /****************************************************************************/
  234. #define TS_PDUTYPE_FIRST 1
  235. #define TS_PDUTYPE_DEMANDACTIVEPDU 1
  236. #define TS_PDUTYPE_REQUESTACTIVEPDU 2
  237. #define TS_PDUTYPE_CONFIRMACTIVEPDU 3
  238. #define TS_PDUTYPE_DEACTIVATEOTHERPDU 4
  239. #define TS_PDUTYPE_DEACTIVATESELFPDU 5
  240. #define TS_PDUTYPE_DEACTIVATEALLPDU 6
  241. #define TS_PDUTYPE_DATAPDU 7
  242. #define TS_PDUTYPE_SERVERCERTIFICATEPDU 8
  243. #define TS_PDUTYPE_CLIENTRANDOMPDU 9
  244. #define TS_PDUTYPE_LAST 9
  245. #define TS_NUM_PDUTYPES 9
  246. /****************************************************************************/
  247. // TS_SHAREDATAHEADER
  248. /****************************************************************************/
  249. typedef struct tagTS_SHAREDATAHEADER
  250. {
  251. TS_SHARECONTROLHEADER shareControlHeader;
  252. TS_SHAREID shareID;
  253. TSUINT8 pad1;
  254. TSUINT8 streamID;
  255. TSUINT16 uncompressedLength;
  256. TSUINT8 pduType2;
  257. TSUINT8 generalCompressedType;
  258. TSUINT16 generalCompressedLength;
  259. } TS_SHAREDATAHEADER, FAR * PTS_SHAREDATAHEADER;
  260. /****************************************************************************/
  261. /* streamID values */
  262. /****************************************************************************/
  263. #define TS_STREAM_LOW 1
  264. #define TS_STREAM_MED 2
  265. #define TS_STREAM_HI 4
  266. /****************************************************************************/
  267. /* PDUType2 values */
  268. /****************************************************************************/
  269. #define TS_PDUTYPE2_APPLICATION 25
  270. #define TS_PDUTYPE2_CONTROL 20
  271. #define TS_PDUTYPE2_FONT 11
  272. #define TS_PDUTYPE2_INPUT 28
  273. #define TS_PDUTYPE2_MEDIATEDCONTROL 29
  274. #define TS_PDUTYPE2_POINTER 27
  275. #define TS_PDUTYPE2_REMOTESHARE 30
  276. #define TS_PDUTYPE2_SYNCHRONIZE 31
  277. #define TS_PDUTYPE2_UPDATE 2
  278. #define TS_PDUTYPE2_UPDATECAPABILITY 32
  279. #define TS_PDUTYPE2_WINDOWACTIVATION 23
  280. #define TS_PDUTYPE2_WINDOWLISTUPDATE 24
  281. #define TS_PDUTYPE2_DESKTOP_SCROLL 26
  282. #define TS_PDUTYPE2_REFRESH_RECT 33
  283. #define TS_PDUTYPE2_PLAY_SOUND 34
  284. #define TS_PDUTYPE2_SUPPRESS_OUTPUT 35
  285. #define TS_PDUTYPE2_SHUTDOWN_REQUEST 36
  286. #define TS_PDUTYPE2_SHUTDOWN_DENIED 37
  287. #define TS_PDUTYPE2_SAVE_SESSION_INFO 38
  288. #define TS_PDUTYPE2_FONTLIST 39
  289. #define TS_PDUTYPE2_FONTMAP 40
  290. #define TS_PDUTYPE2_SET_KEYBOARD_INDICATORS 41
  291. #define TS_PDUTYPE2_BITMAPCACHE_PERSISTENT_LIST 43
  292. #define TS_PDUTYPE2_BITMAPCACHE_ERROR_PDU 44
  293. #define TS_PDUTYPE2_SET_KEYBOARD_IME_STATUS 45
  294. #define TS_PDUTYPE2_OFFSCRCACHE_ERROR_PDU 46
  295. #define TS_PDUTYPE2_SET_ERROR_INFO_PDU 47
  296. #ifdef DRAW_NINEGRID
  297. #define TS_PDUTYPE2_DRAWNINEGRID_ERROR_PDU 48
  298. #endif
  299. #ifdef DRAW_GDIPLUS
  300. #define TS_PDUTYPE2_DRAWGDIPLUS_ERROR_PDU 49
  301. #endif
  302. #define TS_PDUTYPE2_ARC_STATUS_PDU 50
  303. /****************************************************************************/
  304. /* Capabilities Structures: */
  305. /****************************************************************************/
  306. #define TS_CAPSETTYPE_GENERAL 1
  307. #define TS_CAPSETTYPE_BITMAP 2
  308. #define TS_CAPSETTYPE_ORDER 3
  309. #define TS_CAPSETTYPE_BITMAPCACHE 4
  310. #define TS_CAPSETTYPE_CONTROL 5
  311. #define TS_CAPSETTYPE_ACTIVATION 7
  312. #define TS_CAPSETTYPE_POINTER 8
  313. #define TS_CAPSETTYPE_SHARE 9
  314. #define TS_CAPSETTYPE_COLORCACHE 10
  315. #define TS_CAPSETTYPE_WINDOWLIST 11
  316. #define TS_CAPSETTYPE_SOUND 12
  317. #define TS_CAPSETTYPE_INPUT 13
  318. #define TS_CAPSETTYPE_FONT 14
  319. #define TS_CAPSETTYPE_BRUSH 15
  320. #define TS_CAPSETTYPE_GLYPHCACHE 16
  321. #define TS_CAPSETTYPE_OFFSCREENCACHE 17
  322. #define TS_CAPSETTYPE_BITMAPCACHE_HOSTSUPPORT 18
  323. #define TS_CAPSETTYPE_BITMAPCACHE_REV2 19
  324. #define TS_CAPSETTYPE_VIRTUALCHANNEL 20
  325. #ifdef DRAW_NINEGRID
  326. #define TS_CAPSETTYPE_DRAWNINEGRIDCACHE 21
  327. #endif
  328. #ifdef DRAW_GDIPLUS
  329. #define TS_CAPSETTYPE_DRAWGDIPLUS 22
  330. #endif
  331. #define TS_CAPSFLAG_UNSUPPORTED 0
  332. #define TS_CAPSFLAG_SUPPORTED 1
  333. /****************************************************************************/
  334. // TS_GENERAL_CAPABILITYSET
  335. /****************************************************************************/
  336. typedef struct tagTS_GENERAL_CAPABILITYSET
  337. {
  338. TSUINT16 capabilitySetType;
  339. TSUINT16 lengthCapability;
  340. TSUINT16 osMajorType;
  341. #define TS_OSMAJORTYPE_UNSPECIFIED 0
  342. #define TS_OSMAJORTYPE_WINDOWS 1
  343. #define TS_OSMAJORTYPE_OS2 2
  344. #define TS_OSMAJORTYPE_MACINTOSH 3
  345. #define TS_OSMAJORTYPE_UNIX 4
  346. TSUINT16 osMinorType;
  347. #define TS_OSMINORTYPE_UNSPECIFIED 0
  348. #define TS_OSMINORTYPE_WINDOWS_31X 1
  349. #define TS_OSMINORTYPE_WINDOWS_95 2
  350. #define TS_OSMINORTYPE_WINDOWS_NT 3
  351. #define TS_OSMINORTYPE_OS2_V21 4
  352. #define TS_OSMINORTYPE_POWER_PC 5
  353. #define TS_OSMINORTYPE_MACINTOSH 6
  354. #define TS_OSMINORTYPE_NATIVE_XSERVER 7
  355. #define TS_OSMINORTYPE_PSEUDO_XSERVER 8
  356. TSUINT16 protocolVersion;
  357. #define TS_CAPS_PROTOCOLVERSION 0x0200
  358. TSUINT16 pad2octetsA;
  359. TSUINT16 generalCompressionTypes;
  360. // This field used to be pad2octetsB.
  361. // We are reusing the field to hold extra flags
  362. //
  363. // Bit 10: TS_EXTRA_NO_BITMAP_COMPRESSION_HDR capability indicates if the
  364. // server/client supports compressed bitmap without the redundent BC header
  365. // Note this value is defined in REV2 bitmap extraflags value for consistency
  366. TSUINT16 extraFlags;
  367. // Determines that server-to-client fast-path output is supported.
  368. #define TS_FASTPATH_OUTPUT_SUPPORTED 0x0001
  369. // Tells if the compression level is set and can be negociated for the shadow.
  370. #define TS_SHADOW_COMPRESSION_LEVEL 0x0002
  371. // Determine if the Client can support Long UserNames and Passwords
  372. #define TS_LONG_CREDENTIALS_SUPPORTED 0x0004
  373. // Does the client support the reconnect cookie
  374. #define TS_AUTORECONNECT_COOKIE_SUPPORTED 0x0008
  375. //
  376. // Support for safe-encryption checksumming
  377. // Salt the checksum with the packet count
  378. //
  379. #define TS_ENC_SECURE_CHECKSUM 0x0010
  380. TSBOOL16 updateCapabilityFlag;
  381. TSBOOL16 remoteUnshareFlag;
  382. TSUINT16 generalCompressionLevel;
  383. TSUINT8 refreshRectSupport; /* can receive refreshRect */
  384. TSUINT8 suppressOutputSupport; /* and suppressOutputPDU */
  385. } TS_GENERAL_CAPABILITYSET, FAR *PTS_GENERAL_CAPABILITYSET;
  386. /****************************************************************************/
  387. // TS_BITMAP_CAPABILITYSET
  388. /****************************************************************************/
  389. typedef struct tagTS_BITMAP_CAPABILITYSET
  390. {
  391. TSUINT16 capabilitySetType;
  392. TSUINT16 lengthCapability;
  393. TSUINT16 preferredBitsPerPixel;
  394. TSBOOL16 receive1BitPerPixel;
  395. TSBOOL16 receive4BitsPerPixel;
  396. TSBOOL16 receive8BitsPerPixel;
  397. TSUINT16 desktopWidth;
  398. TSUINT16 desktopHeight;
  399. TSUINT16 pad2octets;
  400. TSBOOL16 desktopResizeFlag;
  401. TSUINT16 bitmapCompressionFlag;
  402. /************************************************************************/
  403. /* T.128 extension: fields for supporting > 8bpp color depths */
  404. /* highColorFlags values - undefined bits must be set to zero. */
  405. /************************************************************************/
  406. #define TS_COLOR_FL_RECEIVE_15BPP 1 /* can receive (5,5,5) */
  407. /* rgbs in bitmap data */
  408. #define TS_COLOR_FL_RECEIVE_16BPP 2 /* can receive (5,6,5) */
  409. #define TS_COLOR_FL_RECEIVE_24BPP 4 /* can receive (8,8,8) */
  410. TSUINT8 highColorFlags;
  411. TSUINT8 pad1octet;
  412. /************************************************************************/
  413. /* Extension: indicate multiple rectangle support. */
  414. /************************************************************************/
  415. TSUINT16 multipleRectangleSupport;
  416. TSUINT16 pad2octetsB;
  417. } TS_BITMAP_CAPABILITYSET, FAR *PTS_BITMAP_CAPABILITYSET;
  418. /****************************************************************************/
  419. // TS_ORDER_CAPABILITYSET
  420. /****************************************************************************/
  421. typedef struct tagTS_ORDER_CAPABILITYSET
  422. {
  423. TSUINT16 capabilitySetType;
  424. TSUINT16 lengthCapability;
  425. TSUINT8 terminalDescriptor[TS_MAX_TERMINALDESCRIPTOR];
  426. TSUINT32 pad4octetsA;
  427. TSUINT16 desktopSaveXGranularity;
  428. TSUINT16 desktopSaveYGranularity;
  429. TSUINT16 pad2octetsA;
  430. TSUINT16 maximumOrderLevel;
  431. TSUINT16 numberFonts;
  432. TSUINT16 orderFlags;
  433. #define TS_ORDERFLAGS_NEGOTIATEORDERSUPPORT 0x0002
  434. #define TS_ORDERFLAGS_CANNOTRECEIVEORDERS 0x0004
  435. /************************************************************************/
  436. /* TS_ORDERFLAGS_ZEROBOUNDSDELTASSUPPORT */
  437. /* Indicates support for the order encoding flag for zero bounds delta */
  438. /* coords (TS_ZERO_BOUNDS_DELTAS). */
  439. /* */
  440. /* TS_ORDERFLAGS_COLORINDEXSUPPORT */
  441. /* Indicates support for sending color indices, not RGBs, in orders. */
  442. /* */
  443. /* TS_ORDERFLAGS_SOLIDPATTERNBRUSHONLY */
  444. /* Indicates that this party can receive only solid and pattern brushes.*/
  445. /************************************************************************/
  446. #define TS_ORDERFLAGS_ZEROBOUNDSDELTASSUPPORT 0x0008
  447. #define TS_ORDERFLAGS_COLORINDEXSUPPORT 0x0020
  448. #define TS_ORDERFLAGS_SOLIDPATTERNBRUSHONLY 0x0040
  449. TSUINT8 orderSupport[TS_MAX_ORDERS];
  450. TSUINT16 textFlags;
  451. #define TS_TEXTFLAGS_CHECKFONTASPECT 0x0001
  452. #define TS_TEXTFLAGS_ALLOWDELTAXSIM 0x0020
  453. #define TS_TEXTFLAGS_CHECKFONTSIGNATURES 0x0080
  454. #define TS_TEXTFLAGS_USEBASELINESTART 0x0200
  455. /************************************************************************/
  456. /* T.128 extension: allow support for sending font "Cell Height" in */
  457. /* addition to the standard "Character Height" in text orders. */
  458. /************************************************************************/
  459. #define TS_TEXTFLAGS_ALLOWCELLHEIGHT 0x0400 /* cell height allowed */
  460. #define TS_TEXT_AND_MASK (TS_TEXTFLAGS_CHECKFONTASPECT \
  461. | TS_TEXTFLAGS_CHECKFONTSIGNATURES \
  462. | TS_TEXTFLAGS_USEBASELINESTART \
  463. | TS_TEXTFLAGS_ALLOWCELLHEIGHT)
  464. #define TS_TEXT_OR_MASK (TS_TEXTFLAGS_ALLOWDELTAXSIM)
  465. TSUINT16 pad2octetsB;
  466. TSUINT32 pad4octetsB;
  467. TSUINT32 desktopSaveSize;
  468. TSUINT16 pad2octetsC;
  469. TSUINT16 pad2octetsD;
  470. TSUINT16 textANSICodePage;
  471. #define TS_ANSI_CP_DEFAULT 1252 /* Windows mulitlingual */
  472. TSUINT16 pad2octetsE; /* caps are DWord aligned */
  473. } TS_ORDER_CAPABILITYSET, FAR * PTS_ORDER_CAPABILITYSET;
  474. /****************************************************************************/
  475. // TS_BITMAPCACHE_CAPABILITYSET
  476. /****************************************************************************/
  477. typedef struct tagTS_BITMAPCACHE_CAPABILITYSET
  478. {
  479. TSUINT16 capabilitySetType;
  480. TSUINT16 lengthCapability;
  481. TSUINT32 pad1;
  482. TSUINT32 pad2;
  483. TSUINT32 pad3;
  484. TSUINT32 pad4;
  485. TSUINT32 pad5;
  486. TSUINT32 pad6;
  487. TSUINT16 Cache1Entries;
  488. TSUINT16 Cache1MaximumCellSize;
  489. TSUINT16 Cache2Entries;
  490. TSUINT16 Cache2MaximumCellSize;
  491. TSUINT16 Cache3Entries;
  492. TSUINT16 Cache3MaximumCellSize;
  493. } TS_BITMAPCACHE_CAPABILITYSET, FAR * PTS_BITMAPCACHE_CAPABILITYSET;
  494. /****************************************************************************/
  495. // TS_BITMAPCACHE_CAPABILITYSET_HOSTSUPPORT
  496. //
  497. // Sent from the server when it supports greater than rev1 bitmap caching.
  498. // Allows the client to determine what sort of return capabilitites it should
  499. // return in its ConfirmActivePDU.
  500. /****************************************************************************/
  501. typedef struct
  502. {
  503. TSUINT16 capabilitySetType; // TS_CAPSETTYPE_BITMAPCACHE_HOSTSUPPORT
  504. TSUINT16 lengthCapability;
  505. // Indicates the level of support available on the server. Note
  506. // that using TS_BITMAPCACHE_REV1 is not supported here, since in that
  507. // case the HOSTSUPPORT capability should simply not be included in
  508. // the capabilities sent to the client.
  509. TSUINT8 CacheVersion;
  510. #define TS_BITMAPCACHE_REV1 0
  511. #define TS_BITMAPCACHE_REV2 1
  512. TSUINT8 Pad1;
  513. TSUINT16 Pad2;
  514. } TS_BITMAPCACHE_CAPABILITYSET_HOSTSUPPORT,
  515. FAR *PTS_BITMAPCACHE_CAPABILITYSET_HOSTSUPPORT;
  516. /****************************************************************************/
  517. // TS_BITMAPCACHE_CAPABILITYSET_REV2
  518. //
  519. // Sent from client to server when the server indicates it supports rev2
  520. // caching by sending TS_BITMAPCACHE_CAPABILITYSET_REV2_HOSTSUPPORT.
  521. // Corresponds to the expanded capabilities used with persistent bitmap
  522. // caches.
  523. /****************************************************************************/
  524. #define TS_BITMAPCACHE_0_CELL_SIZE 256
  525. #define TS_BITMAPCACHE_SCREEN_ID 0xFF
  526. typedef struct
  527. {
  528. TSUINT32 NumEntries : 31;
  529. TSUINT32 bSendBitmapKeys : 1;
  530. } TS_BITMAPCACHE_CELL_CACHE_INFO;
  531. #define BITMAPCACHE_WAITING_LIST_INDEX 32767
  532. typedef struct tagTS_BITMAPCACHE_CAPABILITYSET_REV2
  533. {
  534. TSUINT16 capabilitySetType; // TS_CAPSETTYPE_BITMAPCACHE_REV2
  535. TSUINT16 lengthCapability;
  536. // Flags.
  537. TSUINT16 bPersistentKeysExpected : 1; // Persistent keys to be sent.
  538. TSUINT16 bAllowCacheWaitingList : 1;
  539. TSUINT16 Pad1 : 14;
  540. TSUINT8 Pad2;
  541. // Number of cell caches ready to be used.
  542. // The protocol allows maximum 5 caches, the server currently only
  543. // handles 3 caches.
  544. TSUINT8 NumCellCaches;
  545. #define TS_BITMAPCACHE_MAX_CELL_CACHES 5
  546. #define TS_BITMAPCACHE_SERVER_CELL_CACHES 3
  547. // Following space reserved for up to TS_BITMAPCACHE_MAX_CELL_CACHES
  548. // sets of information.
  549. TS_BITMAPCACHE_CELL_CACHE_INFO CellCacheInfo[
  550. TS_BITMAPCACHE_MAX_CELL_CACHES];
  551. } TS_BITMAPCACHE_CAPABILITYSET_REV2, FAR *PTS_BITMAPCACHE_CAPABILITYSET_REV2;
  552. /****************************************************************************/
  553. // TS_BITMAPCACHE_PERSISTENT_LIST_ENTRY
  554. //
  555. // Single bitmap entry for the list of entries that is used to preload the
  556. // bitmap cache at connect time.
  557. /****************************************************************************/
  558. #define TS_BITMAPCACHE_NULL_KEY 0xFFFFFFFF
  559. typedef struct
  560. {
  561. TSUINT32 Key1;
  562. TSUINT32 Key2;
  563. } TS_BITMAPCACHE_PERSISTENT_LIST_ENTRY,
  564. FAR *PTS_BITMAPCACHE_PERSISTENT_LIST_ENTRY;
  565. /****************************************************************************/
  566. // TS_BITMAPCACHE_PERSISTENT_LIST
  567. //
  568. // Specifies one of a set of bitmap cache persistent entry preload lists.
  569. /****************************************************************************/
  570. // Defines the upper limit on the number of keys that can be specified
  571. // in the combined TotalEntries below. More than this constitutes a
  572. // breach of protocol and is cause for session termination.
  573. #define TS_BITMAPCACHE_MAX_TOTAL_PERSISTENT_KEYS (256 * 1024)
  574. typedef struct
  575. {
  576. // Contains TS_PDUTYPE2_BITMAPCACHE_PERSISTENT_LIST as the secondary
  577. // PDU type.
  578. TS_SHAREDATAHEADER shareDataHeader;
  579. TSUINT16 NumEntries[TS_BITMAPCACHE_MAX_CELL_CACHES];
  580. TSUINT16 TotalEntries[TS_BITMAPCACHE_MAX_CELL_CACHES];
  581. TSUINT8 bFirstPDU : 1;
  582. TSUINT8 bLastPDU : 1;
  583. TSUINT8 Pad1 : 6;
  584. TSUINT8 Pad2;
  585. TSUINT16 Pad3;
  586. TS_BITMAPCACHE_PERSISTENT_LIST_ENTRY Entries[1];
  587. } TS_BITMAPCACHE_PERSISTENT_LIST, FAR *PTS_BITMAPCACHE_PERSISTENT_LIST;
  588. /****************************************************************************/
  589. // TS_BITMAPCACHE_ERROR_PDU
  590. //
  591. // Sent when the client encounters a catastrophic error in its caching.
  592. // This PDU is sent to inform the server of the problem and what actions to
  593. // take with each of the cell caches.
  594. /****************************************************************************/
  595. // maximum number of error pdus a client is allowed to send for a session
  596. // this is also the maximum number of error pdus a server will handle
  597. #define MAX_NUM_ERROR_PDU_SEND 5
  598. typedef struct
  599. {
  600. // Specifies the cache ID in this info block.
  601. TSUINT8 CacheID;
  602. // Specifies that the cache should have its contents emptied.
  603. // If FALSE and a NewNumEntries specifies a new nonzero size, the previous
  604. // cache contents in the initial (NewNumEntries) cells will be preserved.
  605. TSUINT8 bFlushCache : 1;
  606. // Specifies that the NewNumEntries field is valid.
  607. TSUINT8 bNewNumEntriesValid : 1;
  608. TSUINT8 Pad1 : 6;
  609. TSUINT16 Pad2;
  610. // New number of entries in the cache. Must be less than or equal to the
  611. // number of entries previously sent in the capabilities.
  612. TSUINT32 NewNumEntries;
  613. } TS_BITMAPCACHE_ERROR_INFO, FAR *PTS_BITMAPCACHE_ERROR_INFO;
  614. typedef struct
  615. {
  616. // Contains TS_PDUTYPE2_BITMAPCACHE_ERROR_PDU as the secondary
  617. // PDU type.
  618. TS_SHAREDATAHEADER shareDataHeader;
  619. TSUINT8 NumInfoBlocks;
  620. TSUINT8 Pad1;
  621. TSUINT16 Pad2;
  622. TS_BITMAPCACHE_ERROR_INFO Info[1];
  623. } TS_BITMAPCACHE_ERROR_PDU, FAR *PTS_BITMAPCACHE_ERROR_PDU;
  624. /****************************************************************************/
  625. // TS_OFFSCRCACHE_ERROR_PDU
  626. /****************************************************************************/
  627. typedef struct
  628. {
  629. // Contains TS_PDUTYPE2_OFFSCRCACHE_ERROR_PDU as the secondary
  630. // PDU type
  631. TS_SHAREDATAHEADER shareDataHeader;
  632. TSUINT32 flags;
  633. #define TS_FLUSH_AND_DISABLE_OFFSCREEN 0x1
  634. } TS_OFFSCRCACHE_ERROR_PDU, FAR *PTS_OFFSCRCACHE_ERROR_PDU;
  635. #ifdef DRAW_NINEGRID
  636. /****************************************************************************/
  637. // TS_DRAWNINEGRID_ERROR_PDU
  638. /****************************************************************************/
  639. typedef struct
  640. {
  641. // Contains TS_PDUTYPE2_DRAWNINEGRID_ERROR_PDU as the secondary
  642. // PDU type
  643. TS_SHAREDATAHEADER shareDataHeader;
  644. TSUINT32 flags;
  645. #define TS_FLUSH_AND_DISABLE_DRAWNINEGRID 0x1
  646. } TS_DRAWNINEGRID_ERROR_PDU, FAR *PTS_DRAWNINEGRID_ERROR_PDU;
  647. #endif
  648. #ifdef DRAW_GDIPLUS
  649. typedef struct
  650. {
  651. // Contains TS_PDUTYPE2_DRAWGDIPLUS_ERROR_PDU as the secondary
  652. // PDU type
  653. TS_SHAREDATAHEADER shareDataHeader;
  654. TSUINT32 flags;
  655. #define TS_FLUSH_AND_DISABLE_DRAWGDIPLUS 0x1
  656. } TS_DRAWGDIPLUS_ERROR_PDU, FAR *PTS_DRAWGDIPLUS_ERROR_PDU;
  657. #endif
  658. /****************************************************************************/
  659. // TS_COLORTABLECACHE_CAPABILITYSET
  660. /****************************************************************************/
  661. typedef struct tagTS_COLORTABLECACHE_CAPABILITYSET
  662. {
  663. TSUINT16 capabilitySetType;
  664. TSUINT16 lengthCapability;
  665. TSUINT16 colorTableCacheSize;
  666. TSUINT16 pad2octets; /* caps are DWORD aligned */
  667. } TS_COLORTABLECACHE_CAPABILITYSET, FAR * PTS_COLORTABLECACHE_CAPABILITYSET;
  668. /****************************************************************************/
  669. // TS_WINDOWACTIVATION_CAPABILITYSET
  670. /****************************************************************************/
  671. typedef struct tagTS_WINDOWACTIVATION_CAPABILITYSET
  672. {
  673. TSUINT16 capabilitySetType;
  674. TSUINT16 lengthCapability;
  675. TSBOOL16 helpKeyFlag;
  676. TSBOOL16 helpKeyIndexFlag;
  677. TSBOOL16 helpExtendedKeyFlag;
  678. TSBOOL16 windowManagerKeyFlag;
  679. } TS_WINDOWACTIVATION_CAPABILITYSET, FAR * PTS_WINDOWACTIVATION_CAPABILITYSET;
  680. /****************************************************************************/
  681. // TS_CONTROL_CAPABILITYSET
  682. /****************************************************************************/
  683. typedef struct tagTS_CONTROL_CAPABILITYSET
  684. {
  685. TSUINT16 capabilitySetType;
  686. TSUINT16 lengthCapability;
  687. TSUINT16 controlFlags;
  688. #define TS_CAPS_CONTROL_ALLOWMEDIATEDCONTROL 1
  689. TSBOOL16 remoteDetachFlag;
  690. TSUINT16 controlInterest;
  691. #define TS_CONTROLPRIORITY_ALWAYS 1
  692. #define TS_CONTROLPRIORITY_NEVER 2
  693. #define TS_CONTROLPRIORITY_CONFIRM 3
  694. TSUINT16 detachInterest;
  695. } TS_CONTROL_CAPABILITYSET, FAR * PTS_CONTROL_CAPABILITYSET;
  696. /****************************************************************************/
  697. // TS_POINTER_CAPABILITYSET
  698. /****************************************************************************/
  699. typedef struct tagTS_POINTER_CAPABILITYSET
  700. {
  701. TSUINT16 capabilitySetType;
  702. TSUINT16 lengthCapability;
  703. TSBOOL16 colorPointerFlag;
  704. TSUINT16 colorPointerCacheSize;
  705. TSUINT16 pointerCacheSize;
  706. } TS_POINTER_CAPABILITYSET, FAR * PTS_POINTER_CAPABILITYSET;
  707. /****************************************************************************/
  708. // TS_SHARE_CAPABILITYSET
  709. /****************************************************************************/
  710. typedef struct tagTS_SHARE_CAPABILITYSET
  711. {
  712. TSUINT16 capabilitySetType;
  713. TSUINT16 lengthCapability;
  714. TSUINT16 nodeID;
  715. TSUINT16 pad2octets; /* caps are DWORD aligned */
  716. } TS_SHARE_CAPABILITYSET, FAR * PTS_SHARE_CAPABILITYSET;
  717. /****************************************************************************/
  718. /* Structure: TS_SOUND_CAPABILITYSET */
  719. /* */
  720. /* Description: Extension to T.128 for sound support */
  721. /* */
  722. /* Set TS_SOUND_FLAG_BEEPS if capable of replaying beeps */
  723. /* all undefined bits in soundFlags must be zero */
  724. /****************************************************************************/
  725. typedef struct tagTS_SOUND_CAPABILITYSET
  726. {
  727. TSUINT16 capabilitySetType;
  728. TSUINT16 lengthCapability;
  729. TSUINT16 soundFlags;
  730. #define TS_SOUND_FLAG_BEEPS 0x0001
  731. TSUINT16 pad2octetsA;
  732. } TS_SOUND_CAPABILITYSET, FAR * PTS_SOUND_CAPABILITYSET;
  733. /****************************************************************************/
  734. /* Structure: TS_INPUT_CAPABILITYSET */
  735. /* */
  736. /* Description: Extension to T.128 for input support */
  737. /****************************************************************************/
  738. typedef struct tagTS_INPUT_CAPABILITYSET
  739. {
  740. TSUINT16 capabilitySetType;
  741. TSUINT16 lengthCapability;
  742. TSUINT16 inputFlags;
  743. /************************************************************************/
  744. /* If TS_INPUT_FLAG_SCANCODES is set, it should be interpreted as 'this */
  745. /* party understands TS_INPUT_EVENT_SCANCODE'. When all parties in a */
  746. /* call support scancodes, scancodes should be sent in preference to */
  747. /* codepoints, virtual keys or hotkeys. */
  748. /************************************************************************/
  749. #define TS_INPUT_FLAG_SCANCODES 0x0001
  750. /************************************************************************/
  751. /* If TS_INPUT_FLAG_CPVK is set, it should be interpreted as 'this */
  752. /* party understands TS_INPUT_EVENT_CODEPOINT and */
  753. /* TS_INPUT_EVENT_VIRTUALKEY' */
  754. /************************************************************************/
  755. #define TS_INPUT_FLAG_CPVK 0x0002
  756. /************************************************************************/
  757. /* If TS_INPUT_FLAG_MOUSEX is set, it should be interpreted as 'this */
  758. /* party can send or receive TS_INPUT_EVENT_MOUSEX' */
  759. /************************************************************************/
  760. #define TS_INPUT_FLAG_MOUSEX 0x0004
  761. //
  762. // Specifies server support for fast-path input packets.
  763. // Deprecated because of an encryption security bug which affects input
  764. // packets
  765. //
  766. #define TS_INPUT_FLAG_FASTPATH_INPUT 0x0008
  767. // Server support for receiving injected Unicode input from the client
  768. #define TS_INPUT_FLAG_VKPACKET 0x0010
  769. //
  770. // New style fast path input identifier added to allow new clients that
  771. // have safe (fixed) encryption checksumming to use fastpath, all old clients
  772. // have to use slow path as that is unaffected by the security bug
  773. //
  774. #define TS_INPUT_FLAG_FASTPATH_INPUT2 0x0020
  775. TSUINT16 pad2octetsA;
  776. TSUINT32 keyboardLayout;
  777. TSUINT32 keyboardType;
  778. TSUINT32 keyboardSubType;
  779. TSUINT32 keyboardFunctionKey;
  780. TSUINT16 imeFileName[TS_MAX_IMEFILENAME]; /* Unicode string, ASCII only */
  781. } TS_INPUT_CAPABILITYSET, FAR * PTS_INPUT_CAPABILITYSET;
  782. /****************************************************************************/
  783. /* Structure: TS_FONT_CAPABILITYSET */
  784. /* */
  785. /* Description: Fontlist/map support */
  786. /****************************************************************************/
  787. typedef struct tagTS_FONT_CAPABILITYSET
  788. {
  789. TSUINT16 capabilitySetType;
  790. TSUINT16 lengthCapability;
  791. #define TS_FONTSUPPORT_FONTLIST 0x0001
  792. TSUINT16 fontSupportFlags;
  793. TSUINT16 pad2octets;
  794. } TS_FONT_CAPABILITYSET, FAR * PTS_FONT_CAPABILITYSET;
  795. /****************************************************************************/
  796. /* Structure: TS_CACHE_DEFINITION */
  797. /* */
  798. /* Description: Extension to T.128 for glyph cache support */
  799. /****************************************************************************/
  800. typedef struct tagTS_CACHE_DEFINITION
  801. {
  802. TSUINT16 CacheEntries;
  803. TSUINT16 CacheMaximumCellSize;
  804. } TS_CACHE_DEFINITION, FAR * PTS_CACHE_DEFINITION;
  805. /****************************************************************************/
  806. // TS_GLYPHCACHE_CAPABILITYSET
  807. /****************************************************************************/
  808. typedef struct tagTS_GLYPHCACHE_CAPABILITYSET
  809. {
  810. TSUINT16 capabilitySetType;
  811. TSUINT16 lengthCapability;
  812. TS_CACHE_DEFINITION GlyphCache[TS_MAX_GLYPH_CACHES];
  813. TS_CACHE_DEFINITION FragCache;
  814. TSUINT16 GlyphSupportLevel;
  815. TSUINT16 pad2octets;
  816. } TS_GLYPHCACHE_CAPABILITYSET, FAR * PTS_GLYPHCACHE_CAPABILITYSET;
  817. /****************************************************************************/
  818. // TS_BRUSH_CAPABILITYSET
  819. /****************************************************************************/
  820. typedef struct tagTS_BRUSH_CAPABILITYSET
  821. {
  822. TSUINT16 capabilitySetType;
  823. TSUINT16 lengthCapability;
  824. #define TS_BRUSH_DEFAULT 0x0000
  825. #define TS_BRUSH_COLOR8x8 0x0001
  826. #define TS_BRUSH_COLOR_FULL 0x0002
  827. TSUINT32 brushSupportLevel;
  828. } TS_BRUSH_CAPABILITYSET, FAR * PTS_BRUSH_CAPABILITYSET;
  829. /****************************************************************************/
  830. // Structure: TS_OFFSCREEN_CAPABILITYSET
  831. //
  832. // This is the capability set for the offscreen bitmap support
  833. /****************************************************************************/
  834. typedef struct tagTS_OFFSCREEN_CAPABILITYSET
  835. {
  836. TSUINT16 capabilitySetType;
  837. TSUINT16 lengthCapability;
  838. TSUINT32 offscreenSupportLevel;
  839. #define TS_OFFSCREEN_DEFAULT 0x0000
  840. #define TS_OFFSCREEN_SUPPORTED 0x0001
  841. // Unlike memory bitmap cache which has fixed bitmap cache entry size,
  842. // offscreen bitmap size varies depending on the apps. So, we want to
  843. // allow both entries and cache size be to adjustable
  844. TSUINT16 offscreenCacheSize;
  845. // in KB, 2.5 MB cache memory for 8bpp, 5 MB for 16bpp, 7.5 MB for 24bpp
  846. #define TS_OFFSCREEN_CACHE_SIZE_CLIENT_DEFAULT (2560)
  847. #define TS_OFFSCREEN_CACHE_SIZE_SERVER_DEFAULT (2560 * 3)
  848. TSUINT16 offscreenCacheEntries;
  849. #define TS_OFFSCREEN_CACHE_ENTRIES_DEFAULT 100 // 100 cache entries
  850. } TS_OFFSCREEN_CAPABILITYSET, FAR * PTS_OFFSCREEN_CAPABILITYSET;
  851. #ifdef DRAW_GDIPLUS
  852. typedef struct tagTS_GDIPLUS_CACHE_ENTRIES
  853. {
  854. TSUINT16 GdipGraphicsCacheEntries;
  855. #define TS_GDIP_GRAPHICS_CACHE_ENTRIES_DEFAULT 10
  856. TSUINT16 GdipObjectBrushCacheEntries;
  857. #define TS_GDIP_BRUSH_CACHE_ENTRIES_DEFAULT 5
  858. TSUINT16 GdipObjectPenCacheEntries;
  859. #define TS_GDIP_PEN_CACHE_ENTRIES_DEFAULT 5
  860. TSUINT16 GdipObjectImageCacheEntries;
  861. #define TS_GDIP_IMAGE_CACHE_ENTRIES_DEFAULT 10
  862. TSUINT16 GdipObjectImageAttributesCacheEntries;
  863. #define TS_GDIP_IMAGEATTRIBUTES_CACHE_ENTRIES_DEFAULT 2
  864. } TS_GDIPLUS_CACHE_ENTRIES, FAR *PTS_GDIPLUS_CACHE_ENTRIES;
  865. typedef struct tagTS_GDIPLUS_CACHE_CHUNK_SIZE
  866. {
  867. TSUINT16 GdipGraphicsCacheChunkSize;
  868. #define TS_GDIP_GRAPHICS_CACHE_CHUNK_SIZE_DEFAULT 512
  869. TSUINT16 GdipObjectBrushCacheChunkSize;
  870. #define TS_GDIP_BRUSH_CACHE_CHUNK_SIZE_DEFAULT 2*1024
  871. TSUINT16 GdipObjectPenCacheChunkSize;
  872. #define TS_GDIP_PEN_CACHE_CHUNK_SIZE_DEFAULT 1024
  873. TSUINT16 GdipObjectImageAttributesCacheChunkSize;
  874. #define TS_GDIP_IMAGEATTRIBUTES_CACHE_CHUNK_SIZE_DEFAULT 64
  875. } TS_GDIPLUS_CACHE_CHUNK_SIZE, FAR * PTS_GDIPLUS_CACHE_CHUNK_SIZE;
  876. typedef struct tag_TS_GDIPLUS_IMAGE_CACHE_PROPERTIES
  877. {
  878. TSUINT16 GdipObjectImageCacheChunkSize;
  879. #define TS_GDIP_IMAGE_CACHE_CHUNK_SIZE_DEFAULT 4*1024
  880. TSUINT16 GdipObjectImageCacheTotalSize;
  881. #define TS_GDIP_IMAGE_CACHE_TOTAL_SIZE_DEFAULT 256 // In number of chunks
  882. TSUINT16 GdipObjectImageCacheMaxSize;
  883. #define TS_GDIP_IMAGE_CACHE_MAX_SIZE_DEFAULT 128 // In number of chunks
  884. } TS_GDIPLUS_IMAGE_CACHE_PROPERTIES, FAR * PTS_GDIPLUS_IMAGE_CACHE_PROPERTIES;
  885. typedef struct tagTS_DRAW_GDIPLUS_CAPABILITYSET
  886. {
  887. TSUINT16 capabilitySetType;
  888. TSUINT16 lengthCapability;
  889. TSUINT32 drawGdiplusSupportLevel;
  890. #define TS_DRAW_GDIPLUS_DEFAULT 0x0000
  891. #define TS_DRAW_GDIPLUS_SUPPORTED 0x0001
  892. TSUINT32 GdipVersion;
  893. #define TS_GDIPVERSION_DEFAULT 0x0
  894. TSUINT32 drawGdiplusCacheLevel;
  895. #define TS_DRAW_GDIPLUS_CACHE_LEVEL_DEFAULT 0x0
  896. #define TS_DRAW_GDIPLUS_CACHE_LEVEL_ONE 0x1
  897. TS_GDIPLUS_CACHE_ENTRIES GdipCacheEntries;
  898. TS_GDIPLUS_CACHE_CHUNK_SIZE GdipCacheChunkSize;
  899. TS_GDIPLUS_IMAGE_CACHE_PROPERTIES GdipImageCacheProperties;
  900. } TS_DRAW_GDIPLUS_CAPABILITYSET, FAR * PTS_DRAW_GDIPLUS_CAPABILITYSET;
  901. #define ActualSizeToChunkSize(Size, ChunkSize) (((Size) + (ChunkSize - 1)) / ChunkSize)
  902. #endif // DRAW_GDIPLUS
  903. #ifdef DRAW_NINEGRID
  904. /****************************************************************************/
  905. // Structure: TS_DRAW_NINEGRID_CAPABILITYSET
  906. //
  907. // This is the capability set for the draw ninegrid support
  908. /****************************************************************************/
  909. typedef struct tagTS_DRAW_NINEGRID_CAPABILITYSET
  910. {
  911. TSUINT16 capabilitySetType;
  912. TSUINT16 lengthCapability;
  913. TSUINT32 drawNineGridSupportLevel;
  914. #define TS_DRAW_NINEGRID_DEFAULT 0x0000
  915. #define TS_DRAW_NINEGRID_SUPPORTED 0x0001
  916. #define TS_DRAW_NINEGRID_SUPPORTED_REV2 0x0002
  917. // Unlike memory bitmap cache which has fixed bitmap cache entry size,
  918. // drawninegrid bitmap size varies. So, we want to allow both entries
  919. // and cache size be to adjustable
  920. TSUINT16 drawNineGridCacheSize;
  921. #define TS_DRAW_NINEGRID_CACHE_SIZE_DEFAULT 2560 // in KB, 2.5 MB cache memory
  922. TSUINT16 drawNineGridCacheEntries;
  923. #define TS_DRAW_NINEGRID_CACHE_ENTRIES_DEFAULT 256 // 256 cache entries
  924. } TS_DRAW_NINEGRID_CAPABILITYSET, FAR * PTS_DRAW_NINEGRID_CAPABILITYSET;
  925. #endif
  926. /****************************************************************************/
  927. // Structure: TS_VIRTUALCHANNEL_CAPABILITYSET
  928. //
  929. // This is the capability set for virtual channels
  930. /****************************************************************************/
  931. typedef struct tagTS_VIRTUALCHANNEL_CAPABILITYSET
  932. {
  933. TSUINT16 capabilitySetType;
  934. TSUINT16 lengthCapability;
  935. //
  936. // Server and client may adverise different capabilities
  937. // e.g today for scalability reasons C->S is limited to 8K
  938. // but S->C is 64K
  939. //
  940. //
  941. #define TS_VCCAPS_DEFAULT 0x0000
  942. #define TS_VCCAPS_COMPRESSION_64K 0x0001
  943. #define TS_VCCAPS_COMPRESSION_8K 0x0002
  944. TSUINT32 vccaps1;
  945. } TS_VIRTUALCHANNEL_CAPABILITYSET, FAR * PTS_VIRTUALCHANNEL_CAPABILITYSET;
  946. /****************************************************************************/
  947. // TS_COMBINED_CAPABILITIES
  948. /****************************************************************************/
  949. typedef struct tagTS_COMBINED_CAPABILITIES
  950. {
  951. TSUINT16 numberCapabilities;
  952. TSUINT16 pad2octets;
  953. TSUINT8 data[1];
  954. } TS_COMBINED_CAPABILITIES, FAR * PTS_COMBINED_CAPABILITIES;
  955. /****************************************************************************/
  956. // TS_CAPABILITYHEADER
  957. /****************************************************************************/
  958. typedef struct tagTS_CAPABILITYHEADER
  959. {
  960. TSUINT16 capabilitySetType;
  961. TSUINT16 lengthCapability;
  962. } TS_CAPABILITYHEADER, FAR * PTS_CAPABILITYHEADER;
  963. /****************************************************************************/
  964. // TS_FONT_ATTRIBUTE
  965. /****************************************************************************/
  966. typedef struct tagTS_FONT_ATTRIBUTE
  967. {
  968. TSUINT8 faceName[TS_MAX_FACENAME];
  969. TSUINT16 fontAttributeFlags;
  970. #define TS_FONTFLAGS_FIXED_PITCH 0x0001
  971. #define TS_FONTFLAGS_FIXED_SIZE 0x0002
  972. #define TS_FONTFLAGS_ITALIC 0x0004
  973. #define TS_FONTFLAGS_UNDERLINE 0x0008
  974. #define TS_FONTFLAGS_STRIKEOUT 0x0010
  975. #define TS_FONTFLAGS_TRUETYPE 0x0080
  976. #define TS_FONTFLAGS_BASELINE 0x0100
  977. #define TS_FONTFLAGS_UNICODE_COMPLIANT 0x0200
  978. // Cell Height (rather than default Character Height) support.
  979. #define TS_FONTFLAGS_CELLHEIGHT 0x0400
  980. TSUINT16 averageWidth;
  981. TSUINT16 height;
  982. TSUINT16 aspectX;
  983. TSUINT16 aspectY;
  984. TSUINT8 signature1;
  985. #define TS_SIZECALCULATION_HEIGHT 100
  986. #define TS_SIZECALCULATION_WIDTH 100
  987. #define TS_SIG1_RANGE1_FIRST 0x30
  988. #define TS_SIG1_RANGE1_LAST 0x5A
  989. #define TS_SIG1_RANGE2_FIRST 0x24
  990. #define TS_SIG1_RANGE2_LAST 0x26
  991. TSUINT8 signature2;
  992. #define TS_SIG2_RANGE_FIRST 0x20
  993. #define TS_SIG2_RANGE_LAST 0x7E
  994. TSUINT16 signature3;
  995. #define TS_SIG3_RANGE1_FIRST 0x00
  996. #define TS_SIG3_RANGE1_LAST 0x1E
  997. #define TS_SIG3_RANGE2_FIRST 0x80
  998. #define TS_SIG3_RANGE2_LAST 0xFE
  999. TSUINT16 codePage;
  1000. #define TS_CODEPAGE_ALLCODEPOINTS 0
  1001. #define TS_CODEPAGE_CORECODEPOINTS 255
  1002. TSUINT16 ascent;
  1003. } TS_FONT_ATTRIBUTE, FAR *PTS_FONT_ATTRIBUTE;
  1004. /****************************************************************************/
  1005. // TS_KEYBOARD_EVENT
  1006. //
  1007. // See also the fast-path keyboard format specified below.
  1008. /****************************************************************************/
  1009. typedef struct tagTS_KEYBOARD_EVENT
  1010. {
  1011. TSUINT16 keyboardFlags;
  1012. #define TS_KBDFLAGS_RIGHT 0x0001
  1013. #define TS_KBDFLAGS_QUIET 0x1000
  1014. #define TS_KBDFLAGS_DOWN 0x4000
  1015. #define TS_KBDFLAGS_RELEASE 0x8000
  1016. #define TS_KBDFLAGS_SECONDARY 0x0080
  1017. #define TS_KBDFLAGS_EXTENDED 0x0100
  1018. #define TS_KBDFLAGS_EXTENDED1 0x0200
  1019. #define TS_KBDFLAGS_ALT_DOWN 0x2000
  1020. TSUINT16 keyCode;
  1021. TSUINT16 pad2octets;
  1022. } TS_KEYBOARD_EVENT, FAR *PTS_KEYBOARD_EVENT;
  1023. /****************************************************************************/
  1024. // TS_SYNC_EVENT
  1025. //
  1026. // Sets toggle keys on server.
  1027. // See also the fast-path sync format specified below.
  1028. /****************************************************************************/
  1029. typedef struct tagTS_SYNC_EVENT
  1030. {
  1031. TSUINT16 pad2octets;
  1032. TSUINT32 toggleFlags;
  1033. #define TS_SYNC_KANA_LOCK 8
  1034. #define TS_SYNC_CAPS_LOCK 4
  1035. #define TS_SYNC_NUM_LOCK 2
  1036. #define TS_SYNC_SCROLL_LOCK 1
  1037. } TS_SYNC_EVENT, FAR *PTS_SYNC_EVENT;
  1038. /****************************************************************************/
  1039. // TS_POINTER_EVENT
  1040. //
  1041. // See also the fast-path mouse format specified below.
  1042. /****************************************************************************/
  1043. typedef struct tagTS_POINTER_EVENT
  1044. {
  1045. TSUINT16 pointerFlags;
  1046. // Extensions for wheel-mouse support.
  1047. #define TS_FLAG_MOUSE_WHEEL ((TSUINT16)0x0200)
  1048. #define TS_FLAG_MOUSE_DIRECTION ((TSUINT16)0x0100)
  1049. #define TS_FLAG_MOUSE_ROTATION_MASK ((TSUINT16)0x01FF)
  1050. #define TS_FLAG_MOUSE_DOUBLE ((TSUINT16)0x0400)
  1051. #define TS_FLAG_MOUSE_MOVE ((TSUINT16)0x0800)
  1052. #define TS_FLAG_MOUSE_BUTTON1 ((TSUINT16)0x1000)
  1053. #define TS_FLAG_MOUSE_BUTTON2 ((TSUINT16)0x2000)
  1054. #define TS_FLAG_MOUSE_BUTTON3 ((TSUINT16)0x4000)
  1055. #define TS_FLAG_MOUSE_DOWN ((TSUINT16)0x8000)
  1056. #define TS_FLAG_MOUSEX_BUTTON1 ((TSUINT16)0x0001)
  1057. #define TS_FLAG_MOUSEX_BUTTON2 ((TSUINT16)0x0002)
  1058. #define TS_FLAG_MOUSEX_DOWN ((TSUINT16)0x8000)
  1059. TSINT16 x;
  1060. TSINT16 y;
  1061. } TS_POINTER_EVENT, FAR *PTS_POINTER_EVENT;
  1062. /****************************************************************************/
  1063. // TS_INPUT_EVENT
  1064. //
  1065. // See also the fast-path input event formats specified below.
  1066. /****************************************************************************/
  1067. typedef struct tagTS_INPUT_EVENT
  1068. {
  1069. TSUINT32 eventTime;
  1070. TSUINT16 messageType;
  1071. #define TS_INPUT_EVENT_SYNC 0
  1072. #define TS_INPUT_EVENT_CODEPOINT 1
  1073. #define TS_INPUT_EVENT_VIRTUALKEY 2
  1074. #define TS_INPUT_EVENT_HOTKEY 3
  1075. // Indicates client sends all keyboard input as raw scan codes.
  1076. #define TS_INPUT_EVENT_SCANCODE 4
  1077. // Indivates support for VKPACKET input. This is the same format
  1078. // as TS_INPUT_EVENT_SCANCODE but the meaning is interpreted
  1079. // differently - scancode is a unicode character
  1080. //
  1081. #define TS_INPUT_EVENT_VKPACKET 5
  1082. #define TS_INPUT_EVENT_MOUSE 0x8001
  1083. // MOUSEX allows us to support extended mouse buttons
  1084. // It still implies TS_POINTER_EVENT, but with different flag meanings
  1085. #define TS_INPUT_EVENT_MOUSEX 0x8002
  1086. union
  1087. {
  1088. TS_KEYBOARD_EVENT key;
  1089. TS_POINTER_EVENT mouse;
  1090. TS_SYNC_EVENT sync;
  1091. } u;
  1092. } TS_INPUT_EVENT, FAR * PTS_INPUT_EVENT;
  1093. /****************************************************************************/
  1094. // TS_INPUT_PDU
  1095. //
  1096. // Variable length list of TS_INPUT_EVENTs.
  1097. // See also the fast-path input format specified below.
  1098. /****************************************************************************/
  1099. typedef struct tagTS_INPUT_PDU
  1100. {
  1101. TS_SHAREDATAHEADER shareDataHeader;
  1102. TSUINT16 numberEvents;
  1103. TSUINT16 pad2octets;
  1104. TS_INPUT_EVENT eventList[1];
  1105. } TS_INPUT_PDU, FAR * PTS_INPUT_PDU;
  1106. // Sizes are for an InputPDU with 0 events attached.
  1107. #define TS_INPUTPDU_SIZE (sizeof(TS_INPUT_PDU) - sizeof(TS_INPUT_EVENT))
  1108. #define TS_INPUTPDU_UNCOMP_LEN 8
  1109. /****************************************************************************/
  1110. // Fast-path input codes. Fast-path input is designed to reduce the wire
  1111. // overhead of all the regular input PDU headers, by collapsing all the
  1112. // headers -- including X.224, MCS, encryption, share data, and input --
  1113. // into a bit-packed, optimized bytestream. Total win for a single keydown or
  1114. // keyup: before = 60 bytes, after = 12 bytes, an 80% decrease.
  1115. //
  1116. // Fast-path bytestream format:
  1117. //
  1118. // +--------+------+---------------+-----------+--------+
  1119. // | Header | Size | MAC signature | NumEvents | Events |
  1120. // +--------+------+---------------+-----------+--------+
  1121. //
  1122. // Header: Byte 0. This byte coincides with X.224 RFC1006 header byte 0,
  1123. // which is always 0x03. In fastpath, we collapse three pieces of
  1124. // information into this byte, 2 bits for security, 2 bits for
  1125. // the action (to tell the difference between X.224 and other
  1126. // actions), and 4 bits for a NumEvents field, which holds the
  1127. // number of input events in the packet if in the range 1..15,
  1128. // or 0 if we have a NumEvents field later on.
  1129. //
  1130. // Size: Overall packet length, first byte. The high bit determines
  1131. // what the size of the size field is -- high bit 0 means the size
  1132. // field is the low 7 bits, giving a range 0..127. High bit 1 means
  1133. // the size field is the low 7 bits of this byte, plus the 8 bits of
  1134. // the next byte, in big-endian order (the second byte contains the
  1135. // low-order bits). This encoding scheme is based on ASN.1 PER
  1136. // encoding used in MCS.
  1137. //
  1138. // Encryption signature: 8 bytes for encryption MAC signature of the
  1139. // encrypted payload.
  1140. //
  1141. // NumEvents: If the header byte NumEvents is 0, there is a 1-byte field
  1142. // here containing up to 256 for NumEvents.
  1143. //
  1144. // Bytestream input events: These correspond to the same event types already
  1145. // defined for TS_INPUT_EVENT above, optimized for small size.
  1146. // In each of the events following, there is at least one byte, where
  1147. // the high 3 bits are the event type, and the bottom 5 bits are flags.
  1148. // Additionally, each order type can use a defined number of extra bytes.
  1149. // Descriptions of the event formats follow.
  1150. //
  1151. // Keyboard: 2 bytes. Byte 0 contains the event type, plus special
  1152. // extended and release flags. Byte 1 is the scan code.
  1153. // Mouse: 7 bytes. Byte 0 contains only the event type. Bytes 1-6 contain
  1154. // the same contents as a normal TS_POINTER_EVENT.
  1155. // Sync: 1 byte. Byte 0 is the event type plus the regular sync flags.
  1156. /****************************************************************************/
  1157. // Masks for first-byte bits.
  1158. #define TS_INPUT_FASTPATH_ACTION_MASK 0x03
  1159. #define TS_INPUT_FASTPATH_NUMEVENTS_MASK 0x3C
  1160. #define TS_INPUT_FASTPATH_ENCRYPTION_MASK 0xC0
  1161. // Encryption settings
  1162. #define TS_INPUT_FASTPATH_ENCRYPTED 0x80
  1163. //
  1164. // Encrypted checksum packet
  1165. //
  1166. #define TS_INPUT_FASTPATH_SECURE_CHECKSUM 0x40
  1167. // 2 values here for future expansion.
  1168. #define TS_INPUT_FASTPATH_ACTION_FASTPATH 0x0
  1169. #define TS_INPUT_FASTPATH_ACTION_X224 0x3
  1170. // Event mask and type for each event in input.
  1171. // Event is encoded into high 3 bits of first byte.
  1172. // 4 values here for future expansion.
  1173. #define TS_INPUT_FASTPATH_EVENT_MASK 0xE0
  1174. #define TS_INPUT_FASTPATH_FLAGS_MASK 0x1F
  1175. #define TS_INPUT_FASTPATH_EVENT_KEYBOARD 0x00
  1176. #define TS_INPUT_FASTPATH_EVENT_MOUSE 0x20
  1177. #define TS_INPUT_FASTPATH_EVENT_MOUSEX 0x40
  1178. #define TS_INPUT_FASTPATH_EVENT_SYNC 0x60
  1179. #define TS_INPUT_FASTPATH_EVENT_VKPACKET 0x80
  1180. // Fastpath keyboard flags. These are set to be the same values as the server
  1181. // driver KEY_BREAK, KEY_E0, and KEY_E1 to simplify translation to kernel
  1182. // input event.
  1183. #define TS_INPUT_FASTPATH_KBD_RELEASE 0x01
  1184. #define TS_INPUT_FASTPATH_KBD_EXTENDED 0x02
  1185. #define TS_INPUT_FASTPATH_KBD_EXTENDED1 0x04
  1186. /****************************************************************************/
  1187. /* Structure: TS_CONFIRM_ACTIVE_PDU */
  1188. /****************************************************************************/
  1189. typedef struct tagTS_CONFIRM_ACTIVE_PDU
  1190. {
  1191. TS_SHARECONTROLHEADER shareControlHeader;
  1192. TS_SHAREID shareID;
  1193. TSUINT16 originatorID;
  1194. TSUINT16 lengthSourceDescriptor;
  1195. TSUINT16 lengthCombinedCapabilities;
  1196. // Source descriptor and Caps start here.
  1197. TSUINT8 data[1];
  1198. } TS_CONFIRM_ACTIVE_PDU, FAR * PTS_CONFIRM_ACTIVE_PDU;
  1199. /****************************************************************************/
  1200. /* Size of Confirm Active without the data. 6 is the 3 UINT16's. */
  1201. /****************************************************************************/
  1202. #define TS_CA_NON_DATA_SIZE (sizeof(TS_SHARECONTROLHEADER) + \
  1203. sizeof(TS_SHAREID) + 6)
  1204. /****************************************************************************/
  1205. /* Structure: TS_DEMAND_ACTIVE_PDU */
  1206. /****************************************************************************/
  1207. typedef struct tagTS_DEMAND_ACTIVE_PDU
  1208. {
  1209. TS_SHARECONTROLHEADER shareControlHeader;
  1210. TS_SHAREID shareID;
  1211. TSUINT16 lengthSourceDescriptor;
  1212. TSUINT16 lengthCombinedCapabilities;
  1213. // Source descriptor and Caps start here.
  1214. TSUINT8 data[1];
  1215. } TS_DEMAND_ACTIVE_PDU, FAR * PTS_DEMAND_ACTIVE_PDU;
  1216. /****************************************************************************/
  1217. /* Structure: TS_SERVER_CERTIFICATE_PDU */
  1218. /* */
  1219. /* Description: Used during shadowing to send the target server's cert + */
  1220. /* random to the client server. */
  1221. /****************************************************************************/
  1222. typedef struct tagTS_SERVER_CERTIFICATE_PDU
  1223. {
  1224. TS_SHARECONTROLHEADER shareControlHeader;
  1225. TSUINT16 pad1;
  1226. TSUINT32 encryptionMethod;
  1227. TSUINT32 encryptionLevel;
  1228. TSUINT32 shadowRandomLen;
  1229. TSUINT32 shadowCertLen;
  1230. // server random followed by server cert start here
  1231. TSUINT8 data[1];
  1232. } TS_SERVER_CERTIFICATE_PDU, FAR * PTS_SERVER_CERTIFICATE_PDU;
  1233. /****************************************************************************/
  1234. /* Structure: TS_CLIENT_RANDOM_PDU */
  1235. /* */
  1236. /* Description: Used during shadowing to send the client's encrypted random */
  1237. /* back to the shadow target server. */
  1238. /****************************************************************************/
  1239. typedef struct tagTS_CLIENT_RANDOM_PDU
  1240. {
  1241. TS_SHARECONTROLHEADER shareControlHeader;
  1242. TSUINT16 pad1;
  1243. TSUINT32 clientRandomLen;
  1244. // client random starts here
  1245. TSUINT8 data[1];
  1246. } TS_CLIENT_RANDOM_PDU, FAR * PTS_CLIENT_RANDOM_PDU;
  1247. /****************************************************************************/
  1248. /* Structure: TS_REQUEST_ACTIVE_PDU */
  1249. /****************************************************************************/
  1250. typedef struct tagTS_REQUEST_ACTIVE_PDU
  1251. {
  1252. TS_SHARECONTROLHEADER shareControlHeader;
  1253. TSUINT16 lengthSourceDescriptor;
  1254. TSUINT16 lengthCombinedCapabilities;
  1255. // Source descriptor and Caps start here.
  1256. TSUINT8 data[1];
  1257. } TS_REQUEST_ACTIVE_PDU, FAR * PTS_REQUEST_ACTIVE_PDU;
  1258. /****************************************************************************/
  1259. /* Structure: TS_DEACTIVATE_ALL_PDU */
  1260. /****************************************************************************/
  1261. typedef struct tagTS_DEACTIVATE_ALL_PDU
  1262. {
  1263. TS_SHARECONTROLHEADER shareControlHeader;
  1264. TS_SHAREID shareID;
  1265. TSUINT16 lengthSourceDescriptor;
  1266. TSUINT8 sourceDescriptor[1];
  1267. } TS_DEACTIVATE_ALL_PDU, FAR * PTS_DEACTIVATE_ALL_PDU;
  1268. /****************************************************************************/
  1269. /* Structure: TS_DEACTIVATE_OTHER_PDU */
  1270. /****************************************************************************/
  1271. typedef struct tagTS_DEACTIVATE_OTHER_PDU
  1272. {
  1273. TS_SHARECONTROLHEADER shareControlHeader;
  1274. TS_SHAREID shareID;
  1275. TSUINT16 deactivateID;
  1276. TSUINT16 lengthSourceDescriptor;
  1277. TSUINT8 sourceDescriptor[1];
  1278. } TS_DEACTIVATE_OTHER_PDU, FAR * PTS_DEACTIVATE_OTHER_PDU;
  1279. /****************************************************************************/
  1280. /* Structure: TS_DEACTIVATE_SELF_PDU */
  1281. /****************************************************************************/
  1282. typedef struct tagTS_DEACTIVATE_SELF_PDU
  1283. {
  1284. TS_SHARECONTROLHEADER shareControlHeader;
  1285. TS_SHAREID shareID;
  1286. } TS_DEACTIVATE_SELF_PDU, FAR * PTS_DEACTIVATE_SELF_PDU;
  1287. /****************************************************************************/
  1288. /* Structure: TS_SYNCHRONIZE_PDU */
  1289. /****************************************************************************/
  1290. typedef struct tagTS_SYNCHRONIZE_PDU
  1291. {
  1292. TS_SHAREDATAHEADER shareDataHeader;
  1293. TSUINT16 messageType;
  1294. #define TS_SYNCMSGTYPE_SYNC 1
  1295. TSUINT16 targetUser;
  1296. } TS_SYNCHRONIZE_PDU, FAR * PTS_SYNCHRONIZE_PDU;
  1297. #define TS_SYNC_PDU_SIZE sizeof(TS_SYNCHRONIZE_PDU)
  1298. #define TS_SYNC_UNCOMP_LEN 8
  1299. /****************************************************************************/
  1300. /* Structure: TS_CONTROL_PDU */
  1301. /****************************************************************************/
  1302. typedef struct tagTS_CONTROL_PDU
  1303. {
  1304. TS_SHAREDATAHEADER shareDataHeader;
  1305. TSUINT16 action;
  1306. #define TS_CTRLACTION_FIRST 1
  1307. #define TS_CTRLACTION_REQUEST_CONTROL 1
  1308. #define TS_CTRLACTION_GRANTED_CONTROL 2
  1309. #define TS_CTRLACTION_DETACH 3
  1310. #define TS_CTRLACTION_COOPERATE 4
  1311. #define TS_CTRLACTION_LAST 4
  1312. TSUINT16 grantId;
  1313. TSUINT32 controlId;
  1314. } TS_CONTROL_PDU, FAR * PTS_CONTROL_PDU;
  1315. #define TS_CONTROL_PDU_SIZE sizeof(TS_CONTROL_PDU)
  1316. #define TS_CONTROL_UNCOMP_LEN 12
  1317. /****************************************************************************/
  1318. /* Structure: TS_FLOW_PDU */
  1319. /****************************************************************************/
  1320. typedef struct tagTS_FLOW_PDU
  1321. {
  1322. TSUINT16 flowMarker;
  1323. #define TS_FLOW_MARKER 0x8000
  1324. TSUINT16 pduType; /* also includes protocol version */
  1325. #define TS_PDUTYPE_FLOWTESTPDU 65
  1326. #define TS_PDUTYPE_FLOWRESPONSEPDU 66
  1327. #define TS_PDUTYPE_FLOWSTOPPDU 67
  1328. TSUINT8 flowIdentifier;
  1329. #define TS_MAX_FLOWIDENTIFIER 127
  1330. TSUINT8 flowNumber;
  1331. TSUINT16 pduSource;
  1332. } TS_FLOW_PDU, FAR * PTS_FLOW_PDU;
  1333. #define TS_FLOW_PDU_SIZE sizeof(TS_FLOW_PDU)
  1334. /****************************************************************************/
  1335. /* Structure: TS_FONT_PDU */
  1336. /****************************************************************************/
  1337. typedef struct tagTS_FONT_PDU
  1338. {
  1339. TS_SHAREDATAHEADER shareDataHeader;
  1340. TSUINT16 numberFonts;
  1341. TSUINT16 entrySize;
  1342. TS_FONT_ATTRIBUTE fontList[1];
  1343. } TS_FONT_PDU, FAR * PTS_FONT_PDU;
  1344. /****************************************************************************/
  1345. /* Structure: TS_FONT_LIST_PDU */
  1346. /****************************************************************************/
  1347. typedef struct tagTS_FONT_LIST_PDU
  1348. {
  1349. TS_SHAREDATAHEADER shareDataHeader;
  1350. TSUINT16 numberFonts;
  1351. TSUINT16 totalNumFonts;
  1352. #define TS_FONTLIST_FIRST 0x0001
  1353. #define TS_FONTLIST_LAST 0x0002
  1354. TSUINT16 listFlags;
  1355. TSUINT16 entrySize;
  1356. TS_FONT_ATTRIBUTE fontList[1];
  1357. } TS_FONT_LIST_PDU, FAR * PTS_FONT_LIST_PDU;
  1358. /****************************************************************************/
  1359. /* Structure: TS_FONTTABLE_ENTRY */
  1360. /****************************************************************************/
  1361. typedef struct tagTS_FONTTABLE_ENTRY
  1362. {
  1363. TSUINT16 serverFontID;
  1364. TSUINT16 clientFontID;
  1365. } TS_FONTTABLE_ENTRY, FAR * PTS_FONTTABLE_ENTRY;
  1366. /****************************************************************************/
  1367. /* Structure: TS_FONT_MAP_PDU */
  1368. /* */
  1369. /* Description: Font mapping table (sent from server to client) */
  1370. /****************************************************************************/
  1371. typedef struct tagTS_FONT_MAP_PDU_DATA
  1372. {
  1373. TSUINT16 numberEntries;
  1374. TSUINT16 totalNumEntries;
  1375. #define TS_FONTMAP_FIRST 0x0001
  1376. #define TS_FONTMAP_LAST 0x0002
  1377. TSUINT16 mapFlags;
  1378. TSUINT16 entrySize;
  1379. TS_FONTTABLE_ENTRY fontTable[1];
  1380. } TS_FONT_MAP_PDU_DATA, FAR * PTS_FONT_MAP_PDU_DATA;
  1381. typedef struct tagTS_FONT_MAP_PDU
  1382. {
  1383. TS_SHAREDATAHEADER shareDataHeader;
  1384. TS_FONT_MAP_PDU_DATA data;
  1385. } TS_FONT_MAP_PDU, FAR * PTS_FONT_MAP_PDU;
  1386. /****************************************************************************/
  1387. // Fast-path output codes. Fast-path output is designed to reduce the wire
  1388. // overhead of all the server-to-client output "packages." These packages
  1389. // can contain one or more of the following PDU types, each of which is
  1390. // individually compressed (if compression is enabled):
  1391. //
  1392. // Mouse pointers (TS_POINTER_PDU_DATA)
  1393. // Output sync (No PDU body in fastpath version)
  1394. // Orders (TS_UPDATE_ORDERS_PDU_DATA - fastpath version)
  1395. // Screen data (TS_UPDATE_BITMAP_PDU_DATA)
  1396. // Palettes (TS_UPDATE_PALETTE_PDU_DATA)
  1397. //
  1398. // The contents of the package can also be encrypted if high encryption
  1399. // is enabled.
  1400. //
  1401. // Fast-path output collapses a whole series of headers -- including X.224,
  1402. // MCS, encryption, and TS_SHAREDATAHEADERs included on each individual
  1403. // update PDU subpacket included in the package. It also defines a
  1404. // slightly different version of the original TS_UPDATE_XXX_PDU_DATA structs
  1405. // which optimize the TS_UPDATE_HDR space and combine the information
  1406. // into other headers in a bit-packed form.
  1407. //
  1408. // Fast-path bytestream format:
  1409. //
  1410. // +--------+------+---------------+-------------------------+
  1411. // | Header | Size | MAC signature | One or more update PDUs |
  1412. // +--------+------+---------------+-------------------------+
  1413. //
  1414. // Header: Byte 0. This byte coincides with X.224 RFC1006 header byte 0,
  1415. // which is always 0x03. In fastpath, we collapse two pieces of
  1416. // information into this byte, 2 bits for security, 2 bits for
  1417. // the action (to tell the difference between X.224 and other
  1418. // actions), and 4 bits currently unused but set to zero for possible
  1419. // future use.
  1420. //
  1421. // Size: Overall packet length, first byte. The high bit determines
  1422. // what the size of the size field is -- high bit 0 means the size
  1423. // field is the low 7 bits, giving a range 0..127. High bit 1 means
  1424. // the size field is the low 7 bits of this byte, plus the 8 bits of
  1425. // the next byte, in big-endian order (the second byte contains the
  1426. // low-order bits). This encoding scheme is based on ASN.1 PER
  1427. // encoding used in MCS.
  1428. //
  1429. // Encryption signature: 8 bytes for encryption MAC signature of the
  1430. // encrypted payload, if encryption enabled.
  1431. //
  1432. // Update PDU format:
  1433. //
  1434. // +--------+-------------------+------+-------------+
  1435. // | Header | Compression flags | Size | Update data |
  1436. // +--------+-------------------+------+-------------+
  1437. //
  1438. // Header: 1 byte. Contains two pieces of information, the update type
  1439. // (TS_UPDATETYPE_XXX values) and a compression-used flag. If
  1440. // compression-used is set, the next byte is a set of compression flags.
  1441. //
  1442. // Compression flags: Identical to the usage defined compress.h. Optional
  1443. // byte -- if compression is not enabled on the session, it is not
  1444. // included.
  1445. //
  1446. // Size: 2-byte size in little-endian (Intel) byte ordering. Fixed size
  1447. // to allow update PDU header length to be determined before encoding
  1448. // starting in the next byte after this field. Note that this is the
  1449. // size of the data following this field -- if compression
  1450. // is used the size is the compressed size.
  1451. //
  1452. // Update data: Formats as defined for individual PDUs. Some
  1453. // formats match the non-fast-path formats for low-frequency packets,
  1454. // others are special newer formats that collapse even more headers.
  1455. /****************************************************************************/
  1456. // Masks for first-byte bits.
  1457. #define TS_OUTPUT_FASTPATH_ACTION_MASK 0x03
  1458. #define TS_OUTPUT_FASTPATH_UNUSED_MASK 0x3C
  1459. #define TS_OUTPUT_FASTPATH_ENCRYPTION_MASK 0xC0
  1460. // Encryption flags
  1461. #define TS_OUTPUT_FASTPATH_ENCRYPTED 0x80
  1462. #define TS_OUTPUT_FASTPATH_SECURE_CHECKSUM 0x40
  1463. // 2 values here for future expansion.
  1464. #define TS_OUTPUT_FASTPATH_ACTION_FASTPATH 0x0
  1465. #define TS_OUTPUT_FASTPATH_ACTION_X224 0x3
  1466. // Masks and values for update PDU header byte.
  1467. // 11 values empty in update type field for future expansion of PDUs in
  1468. // packages. 1 extra bit available in compression flags for future
  1469. // expansion. 2 extra bits unused but available for future use.
  1470. #define TS_OUTPUT_FASTPATH_UPDATETYPE_MASK 0x0F
  1471. #define TS_OUTPUT_FASTPATH_UPDATE_COMPRESSION_MASK 0xC0
  1472. #define TS_OUTPUT_FASTPATH_COMPRESSION_USED 0x80
  1473. /****************************************************************************/
  1474. // TS_MONOPOINTERATTRIBUTE
  1475. /****************************************************************************/
  1476. typedef struct tagTS_MONOPOINTERATTRIBUTE
  1477. {
  1478. TS_POINT16 hotSpot;
  1479. TSUINT16 width;
  1480. TSUINT16 height;
  1481. TSUINT16 lengthPointerData;
  1482. TSUINT8 monoPointerData[1];
  1483. } TS_MONOPOINTERATTRIBUTE, FAR * PTS_MONOPOINTERATTRIBUTE;
  1484. /****************************************************************************/
  1485. // TS_COLORPOINTERATTRIBUTE
  1486. //
  1487. // 24bpp color pointer.
  1488. /****************************************************************************/
  1489. typedef struct tagTS_COLORPOINTERATTRIBUTE
  1490. {
  1491. TSUINT16 cacheIndex;
  1492. TS_POINT16 hotSpot;
  1493. TSUINT16 width;
  1494. TSUINT16 height;
  1495. TSUINT16 lengthANDMask;
  1496. TSUINT16 lengthXORMask;
  1497. TSUINT8 colorPointerData[1];
  1498. } TS_COLORPOINTERATTRIBUTE, FAR * PTS_COLORPOINTERATTRIBUTE;
  1499. /****************************************************************************/
  1500. // TS_POINTERATTRIBUTE
  1501. //
  1502. // Variable color depth pointer.
  1503. /****************************************************************************/
  1504. typedef struct tagTS_POINTERATTRIBUTE
  1505. {
  1506. TSUINT16 XORBpp;
  1507. TS_COLORPOINTERATTRIBUTE colorPtrAttr;
  1508. } TS_POINTERATTRIBUTE, FAR * PTS_POINTERATTRIBUTE;
  1509. /****************************************************************************/
  1510. // TS_POINTER_PDU
  1511. //
  1512. // Container definition for various mouse pointer types.
  1513. // See also the fast-path output pointer definitions and types defined below.
  1514. /****************************************************************************/
  1515. typedef struct tagTS_POINTER_PDU_DATA
  1516. {
  1517. TSUINT16 messageType;
  1518. #define TS_PTRMSGTYPE_SYSTEM 1
  1519. #define TS_PTRMSGTYPE_MONO 2
  1520. #define TS_PTRMSGTYPE_POSITION 3
  1521. #define TS_PTRMSGTYPE_COLOR 6
  1522. #define TS_PTRMSGTYPE_CACHED 7
  1523. #define TS_PTRMSGTYPE_POINTER 8
  1524. TSUINT16 pad2octets;
  1525. union
  1526. {
  1527. TSUINT32 systemPointerType;
  1528. #define TS_SYSPTR_NULL 0
  1529. #define TS_SYSPTR_DEFAULT 0x7f00
  1530. TS_MONOPOINTERATTRIBUTE monoPointerAttribute;
  1531. TS_COLORPOINTERATTRIBUTE colorPointerAttribute;
  1532. TS_POINTERATTRIBUTE pointerAttribute;
  1533. TSUINT16 cachedPointerIndex;
  1534. TS_POINT16 pointerPosition;
  1535. } pointerData;
  1536. } TS_POINTER_PDU_DATA, FAR * PTS_POINTER_PDU_DATA;
  1537. typedef struct tagTS_POINTER_PDU
  1538. {
  1539. TS_SHAREDATAHEADER shareDataHeader;
  1540. TS_POINTER_PDU_DATA data;
  1541. } TS_POINTER_PDU, FAR * PTS_POINTER_PDU;
  1542. #define TS_POINTER_PDU_SIZE sizeof(TS_POINTER_PDU)
  1543. /****************************************************************************/
  1544. // Fast-path output for mouse pointers - overview.
  1545. //
  1546. // We use the fast-path header packet type to contain the mouse pointer
  1547. // update type explicitly. This allows us to collapse headers inside the
  1548. // TS_POINTER_PDU definition. Following are format descriptions for each
  1549. // pointer update type:
  1550. //
  1551. // TS_UPDATETYPE_MOUSEPTR_SYSTEM_NULL: Replaces systemPointerType ==
  1552. // TS_SYSPTR_NULL. Payload is zero bytes.
  1553. //
  1554. // TS_UPDATETYPE_MOUSEPTR_SYSTEM_DEFAULT: Replaces systemPointerType ==
  1555. // TS_SYSPTR_DEFAULT. Zero-byte payload.
  1556. //
  1557. // TS_UPDATETYPE_MOUSEPTR_MONO: Payload is TS_MONOPOINTERATTRIBUTE.
  1558. //
  1559. // TS_UPDATETYPE_MOUSEPTR_POSITION: Payload is a TS_POINT16.
  1560. //
  1561. // TS_UPDATETYPE_MOUSEPTR_COLOR: Payload is TS_COLORPOINTERATTRIBUTE.
  1562. //
  1563. // TS_UPDATETYPE_MOUSEPTR_CACHED: Payload is TSUINT16 cachedPointerIndex.
  1564. //
  1565. // TS_UPDATETYPE_MOUSEPTR_POINTER: Payload is TS_POINTERATTRIBUTE.
  1566. /****************************************************************************/
  1567. /****************************************************************************/
  1568. // Update types, used by TS_UPDATE_HDR and fast-path output.
  1569. /****************************************************************************/
  1570. #define TS_UPDATETYPE_ORDERS 0
  1571. #define TS_UPDATETYPE_BITMAP 1
  1572. #define TS_UPDATETYPE_PALETTE 2
  1573. #define TS_UPDATETYPE_SYNCHRONIZE 3
  1574. // Fast-path-only mouse pointer types, see fast-path output pointer
  1575. // description above.
  1576. #define TS_UPDATETYPE_MOUSEPTR_SYSTEM_NULL 5
  1577. #define TS_UPDATETYPE_MOUSEPTR_SYSTEM_DEFAULT 6
  1578. #define TS_UPDATETYPE_MOUSEPTR_MONO 7
  1579. #define TS_UPDATETYPE_MOUSEPTR_POSITION 8
  1580. #define TS_UPDATETYPE_MOUSEPTR_COLOR 9
  1581. #define TS_UPDATETYPE_MOUSEPTR_CACHED 10
  1582. #define TS_UPDATETYPE_MOUSEPTR_POINTER 11
  1583. /****************************************************************************/
  1584. /* Structure: TS_UPDATE_HDR */
  1585. /****************************************************************************/
  1586. typedef struct tagTS_UPDATE_HDR_DATA
  1587. {
  1588. TSUINT16 updateType;
  1589. TSUINT16 pad2octets;
  1590. } TS_UPDATE_HDR_DATA, FAR * PTS_UPDATE_HDR_DATA;
  1591. typedef struct tagTS_UPDATE_HDR
  1592. {
  1593. TS_SHAREDATAHEADER shareDataHeader;
  1594. TS_UPDATE_HDR_DATA data;
  1595. } TS_UPDATE_HDR, FAR * PTS_UPDATE_HDR;
  1596. /****************************************************************************/
  1597. /* Structure: TS_BITMAP_DATA */
  1598. /* */
  1599. /* Description: Data for a single rectangle in a BitmapUpdatePDU */
  1600. /* Note: bitsPerPixel is included for backwards compatibility, although it */
  1601. /* is the same for every rectangle sent. */
  1602. /****************************************************************************/
  1603. typedef struct tagTS_BITMAP_DATA
  1604. {
  1605. TSINT16 destLeft;
  1606. TSINT16 destTop;
  1607. TSINT16 destRight;
  1608. TSINT16 destBottom;
  1609. TSUINT16 width;
  1610. TSUINT16 height;
  1611. TSUINT16 bitsPerPixel;
  1612. TSBOOL16 compressedFlag;
  1613. // Bit 1: TS_BITMAP_COMPRESSION Bitmap data is compressed or not
  1614. // Bit 10: TS_EXTRA_NO_BITMAP_COMPRESSION_HDR indicates if the compressed
  1615. // bitmap data contains the redundant BC header or not. Note this
  1616. // value is defined in REV2 bitmap extraflags value for consistency.
  1617. #define TS_BITMAP_COMPRESSION 0x0001
  1618. TSUINT16 bitmapLength;
  1619. TSUINT8 bitmapData[1]; /* variable length field */
  1620. } TS_BITMAP_DATA, FAR * PTS_BITMAP_DATA;
  1621. /****************************************************************************/
  1622. /* Structure: TS_UPDATE_BITMAP_PDU */
  1623. /****************************************************************************/
  1624. typedef struct tagTS_UPDATE_BITMAP_PDU_DATA
  1625. {
  1626. TSUINT16 updateType; /* See TS_UPDATE_HDR */
  1627. TSUINT16 numberRectangles;
  1628. TS_BITMAP_DATA rectangle[1];
  1629. } TS_UPDATE_BITMAP_PDU_DATA, FAR * PTS_UPDATE_BITMAP_PDU_DATA;
  1630. typedef struct tagTS_UPDATE_BITMAP_PDU
  1631. {
  1632. TS_SHAREDATAHEADER shareDataHeader;
  1633. TS_UPDATE_BITMAP_PDU_DATA data;
  1634. } TS_UPDATE_BITMAP_PDU, FAR * PTS_UPDATE_BITMAP_PDU;
  1635. /****************************************************************************/
  1636. /* Structure: TS_UPDATE_CAPABILITYSET */
  1637. /****************************************************************************/
  1638. typedef struct tagTS_UPDATE_CAPABILITYSET
  1639. {
  1640. TS_BITMAP_CAPABILITYSET bitmapCapabilitySet;
  1641. } TS_UPDATE_CAPABILITYSET, FAR * PTS_UPDATE_CAPABILITYSET;
  1642. /****************************************************************************/
  1643. /* Structure: TS_UPDATE_CAPABILITY_PDU */
  1644. /****************************************************************************/
  1645. typedef struct tagTS_UPDATE_CAPABILITY_PDU
  1646. {
  1647. TS_SHAREDATAHEADER shareDataHeader;
  1648. TS_UPDATE_CAPABILITYSET updateCapabilitySet;
  1649. } TS_UPDATE_CAPABILITY_PDU, FAR * PTS_UPDATE_CAPABILITY_PDU;
  1650. /****************************************************************************/
  1651. // TS_UPDATE_ORDERS_PDU
  1652. //
  1653. // Variable size UpdateOrdersPDU.
  1654. // See also the fastpath version described below.
  1655. /****************************************************************************/
  1656. typedef struct tagTS_UPDATE_ORDERS_PDU_DATA
  1657. {
  1658. TSUINT16 updateType; /* See TS_UPDATE_HDR */
  1659. TSUINT16 pad2octetsA;
  1660. TSUINT16 numberOrders;
  1661. TSUINT16 pad2octetsB;
  1662. TSUINT8 orderList[1];
  1663. } TS_UPDATE_ORDERS_PDU_DATA, FAR * PTS_UPDATE_ORDERS_PDU_DATA;
  1664. typedef struct tagTS_UPDATE_ORDERS_PDU
  1665. {
  1666. TS_SHAREDATAHEADER shareDataHeader;
  1667. TS_UPDATE_ORDERS_PDU_DATA data;
  1668. } TS_UPDATE_ORDERS_PDU, FAR * PTS_UPDATE_ORDERS_PDU;
  1669. /****************************************************************************/
  1670. // TS_UPDATE_ORDERS_PDU_DATA - fast-path bytestream version
  1671. //
  1672. // Rather than waste 6 of the 8 header bytes in the TS_UPDATE_ORDERS_PDU_DATA
  1673. // (updateType is already known in the fastpath header), we simply define
  1674. // a new optimized version: numberOrders is a 2-byte little-endian (Intel)
  1675. // format field preceding the bytestream of encoded orders.
  1676. /****************************************************************************/
  1677. /****************************************************************************/
  1678. /* Structure: TS_COLOR */
  1679. /****************************************************************************/
  1680. typedef struct tagTS_COLOR
  1681. {
  1682. TSUINT8 red;
  1683. TSUINT8 green;
  1684. TSUINT8 blue;
  1685. } TS_COLOR, FAR * PTS_COLOR;
  1686. /****************************************************************************/
  1687. /* Structure: TS_COLOR_QUAD */
  1688. /****************************************************************************/
  1689. typedef struct tagTS_COLOR_QUAD
  1690. {
  1691. TSUINT8 red;
  1692. TSUINT8 green;
  1693. TSUINT8 blue;
  1694. TSUINT8 pad1octet;
  1695. } TS_COLOR_QUAD, FAR * PTS_COLOR_QUAD;
  1696. /****************************************************************************/
  1697. // TS_ORDER_HEADER
  1698. //
  1699. // There are several types of orders available using this control flag byte.
  1700. // They include:
  1701. //
  1702. // Primary orders: Denoted by the lower two control bits 01 meaning
  1703. // TS_STANDARD but not TS_SECONDARY. Primary orders are field encoded
  1704. // using the OE2 encoding logic on the server and the OD logic on the
  1705. // client. See oe2.h in the server code for field encoding rules.
  1706. // The upper six bits of the control byte are used for further information
  1707. // about the field encoding.
  1708. //
  1709. // Secondary orders: Denoted by low 2 control bits 11 meaning TS_STANDARD |
  1710. // TS_SECONDARY. The upper 6 bits are not used. Followed by the next 5
  1711. // bytes of the TS_SECONDARY_ORDER_HEADER definition, then followed by
  1712. // order-specific data.
  1713. //
  1714. // Alternate secondary orders: Introduced in RDP 5.1, these orders are
  1715. // denoted by low 2 control bits 10, meaning TS_SECONDARY but not
  1716. // TS_STANDARD. The upper 6 bits are used to encode the order type; the
  1717. // order format following the control byte is order-specific but not field
  1718. // encoded. This order type was introduced to overcome the wastefulness
  1719. // inherent in the secondary order header, allowing nonstandard secondary
  1720. // orders to follow whatever form best suits the data being carried.
  1721. //
  1722. // Control flag low 2 bit value 00 is not used in RDP 4.0, 5.0, or 5.1,
  1723. // but is reserved for future use.
  1724. /****************************************************************************/
  1725. #define TS_STANDARD 1
  1726. #define TS_SECONDARY 2
  1727. #define TS_BOUNDS 4
  1728. #define TS_TYPE_CHANGE 8
  1729. #define TS_DELTA_COORDINATES 16
  1730. // Indicates that there are zero modified bounds coordinates.
  1731. // Used in conjunction with the TS_BOUNDS flags, the presence of this flag
  1732. // means that there is no subsequent byte for the bounds fields (it would be
  1733. // zero).
  1734. #define TS_ZERO_BOUNDS_DELTAS 32
  1735. // T.128 extension: two bits that contain the number of consecutive
  1736. // field encoding bytes that are zero. When these bits indicate that
  1737. // there are zero-value field bytes, the corresponding bytes are not
  1738. // sent. The count is for consecutive zeros from the last byte
  1739. // scanning backwards (the non-zero bytes normally appear at the
  1740. // beginning).
  1741. //
  1742. // Example: order that has three field encoding bytes
  1743. //
  1744. // field encoding bytes: 0x20 0x00 0x00
  1745. //
  1746. // There are two zeros (counting from the end backwards), so the
  1747. // control flags contain 0x80 (0x02 << 6), and the order is sent with
  1748. // just 0x20. We therefore save sending the two bytes.
  1749. #define TS_ZERO_FIELD_BYTE_BIT0 64
  1750. #define TS_ZERO_FIELD_BYTE_BIT1 128
  1751. #define TS_ZERO_FIELD_COUNT_SHIFT 6
  1752. #define TS_ZERO_FIELD_COUNT_MASK 0xC0
  1753. // Alternate secondary order mask and shift values for the order type.
  1754. #define TS_ALTSEC_ORDER_TYPE_MASK 0xFC
  1755. #define TS_ALTSEC_ORDER_TYPE_SHIFT 2
  1756. typedef struct tagTS_ORDER_HEADER
  1757. {
  1758. TSUINT8 controlFlags;
  1759. } TS_ORDER_HEADER, FAR *PTS_ORDER_HEADER;
  1760. /****************************************************************************/
  1761. // TS_SECONDARY_ORDER_HEADER
  1762. /****************************************************************************/
  1763. #define TS_CACHE_BITMAP_UNCOMPRESSED 0
  1764. #define TS_CACHE_COLOR_TABLE 1
  1765. #define TS_CACHE_BITMAP_COMPRESSED 2
  1766. #define TS_CACHE_GLYPH 3
  1767. #define TS_CACHE_BITMAP_UNCOMPRESSED_REV2 4
  1768. #define TS_CACHE_BITMAP_COMPRESSED_REV2 5
  1769. #define TS_STREAM_BITMAP 6
  1770. #define TS_CACHE_BRUSH 7
  1771. #define TS_NUM_SECONDARY_ORDERS 8
  1772. typedef struct tagTS_SECONDARY_ORDER_HEADER
  1773. {
  1774. TS_ORDER_HEADER orderHdr;
  1775. TSUINT16 orderLength;
  1776. // This field was used in RDP 4.0 to hold TS_EXTRA_SECONDARY, but was
  1777. // re-tasked to allow secondary orders to use these two bytes as encoding
  1778. // bytes and flags.
  1779. TSUINT16 extraFlags;
  1780. TSUINT8 orderType;
  1781. } TS_SECONDARY_ORDER_HEADER, FAR *PTS_SECONDARY_ORDER_HEADER;
  1782. /****************************************************************************/
  1783. /* The calculation of the value to store in the orderLength field of */
  1784. /* TS_SECONDARY_ORDER_HEADER is non-trivial. Hence we provide some macros */
  1785. /* to make life easier. */
  1786. /****************************************************************************/
  1787. #define TS_SECONDARY_ORDER_LENGTH_FUDGE_FACTOR 8
  1788. #define TS_SECONDARY_ORDER_LENGTH_ADJUSTMENT \
  1789. (sizeof(TS_SECONDARY_ORDER_HEADER) - \
  1790. FIELDSIZE(TS_SECONDARY_ORDER_HEADER, orderType) + \
  1791. TS_SECONDARY_ORDER_LENGTH_FUDGE_FACTOR)
  1792. #define TS_CALCULATE_SECONDARY_ORDER_ORDERLENGTH(actualOrderLength) \
  1793. ((actualOrderLength) - TS_SECONDARY_ORDER_LENGTH_ADJUSTMENT)
  1794. #define TS_DECODE_SECONDARY_ORDER_ORDERLENGTH(secondaryOrderLength) \
  1795. ((secondaryOrderLength) + TS_SECONDARY_ORDER_LENGTH_ADJUSTMENT)
  1796. /****************************************************************************/
  1797. // Alternate secondary order type values.
  1798. /****************************************************************************/
  1799. #define TS_ALTSEC_SWITCH_SURFACE 0
  1800. #define TS_ALTSEC_CREATE_OFFSCR_BITMAP 1
  1801. #ifdef DRAW_NINEGRID
  1802. #define TS_ALTSEC_STREAM_BITMAP_FIRST 2
  1803. #define TS_ALTSEC_STREAM_BITMAP_NEXT 3
  1804. #define TS_ALTSEC_CREATE_NINEGRID_BITMAP 4
  1805. #endif
  1806. #ifdef DRAW_GDIPLUS
  1807. #define TS_ALTSEC_GDIP_FIRST 5
  1808. #define TS_ALTSEC_GDIP_NEXT 6
  1809. #define TS_ALTSEC_GDIP_END 7
  1810. #define TS_ALTSEC_GDIP_CACHE_FIRST 8
  1811. #define TS_ALTSEC_GDIP_CACHE_NEXT 9
  1812. #define TS_ALTSEC_GDIP_CACHE_END 10
  1813. #endif // DRAW_GDIPLUS
  1814. #ifdef DRAW_GDIPLUS
  1815. #define TS_NUM_ALTSEC_ORDERS 11
  1816. #else // DRAW_GDIPLUS
  1817. #ifdef DRAW_NINEGRID
  1818. #define TS_NUM_ALTSEC_ORDERS 5
  1819. #else
  1820. #define TS_NUM_ALTSEC_ORDERS 2
  1821. #endif // DRAW_NINEGRID
  1822. #endif // DRAW_GDIPLUS
  1823. /****************************************************************************/
  1824. /* Convert BPP to number of colors. */
  1825. /****************************************************************************/
  1826. #ifdef DC_HICOLOR
  1827. /****************************************************************************/
  1828. /* This macro as it was doesn't cater for 15bpp. Consider a 64 pel wide */
  1829. /* bitmap at 15 and 16bpp. It really has the same numner of bytes per scan */
  1830. /* line but this macro gives 128 for 16bpp and only 120 for 15bpp... */
  1831. /****************************************************************************/
  1832. // WRONG: #define TS_BYTES_IN_SCANLINE(width, bpp) (((((width)*(bpp))+31)/32) * 4)
  1833. #define TS_BYTES_IN_SCANLINE(width, bpp) ((((width)*((((bpp)+3)/4)*4)+31)/32) * 4)
  1834. #else
  1835. #define TS_BYTES_IN_SCANLINE(width, bpp) (((((width)*(bpp))+31)/32) * 4)
  1836. #endif
  1837. #define TS_BYTES_IN_BITMAP(width, height, bpp) \
  1838. (TS_BYTES_IN_SCANLINE((width), (bpp)) * (height))
  1839. /****************************************************************************/
  1840. /* The Compressed Data header structure. */
  1841. /* */
  1842. /* Rather than add a field to indicate V1 vs V2 compression we use the */
  1843. /* fact that V2 compression treats all the bitmap as main body and sets */
  1844. /* the first row size to zero to distinguish them. I hesitate to do this */
  1845. /* but any bandwidth saving is important. */
  1846. /****************************************************************************/
  1847. typedef struct tagTS_CD_HEADER
  1848. {
  1849. TSUINT16 cbCompFirstRowSize;
  1850. TSUINT16 cbCompMainBodySize;
  1851. TSUINT16 cbScanWidth;
  1852. TSUINT16 cbUncompressedSize;
  1853. } TS_CD_HEADER, FAR *PTS_CD_HEADER;
  1854. typedef TS_CD_HEADER UNALIGNED FAR *PTS_CD_HEADER_UA;
  1855. /****************************************************************************/
  1856. // Structure: TS_CACHE_BITMAP_ORDER
  1857. //
  1858. // Description: First cache-bitmap order revision used in RDP 4.0.
  1859. /****************************************************************************/
  1860. typedef struct tagTS_CACHE_BITMAP_ORDER
  1861. {
  1862. TS_SECONDARY_ORDER_HEADER header;
  1863. // header.extraflags
  1864. // Bit 10: TS_EXTRA_NO_BITMAP_COMPRESSION_HDR indicates if the compressed
  1865. // bitmap data contains the redundant BC header or not. Note this value
  1866. // is defined in REV2 bitmap extraflags value for consistency
  1867. TSUINT8 cacheId;
  1868. TSUINT8 pad1octet;
  1869. TSUINT8 bitmapWidth;
  1870. TSUINT8 bitmapHeight;
  1871. TSUINT8 bitmapBitsPerPel;
  1872. TSUINT16 bitmapLength;
  1873. TSUINT16 cacheIndex;
  1874. TSUINT8 bitmapData[1];
  1875. } TS_CACHE_BITMAP_ORDER, FAR *PTS_CACHE_BITMAP_ORDER;
  1876. /****************************************************************************/
  1877. // TS_CACHE_BITMAP_ORDER_REV2_HEADER
  1878. //
  1879. // Second version of cache-bitmap order that includes the hash key and
  1880. // changes the field definitions to minimize wire bytes.
  1881. /****************************************************************************/
  1882. // Maximum worst-case order size, rounded up to the nearest DWORD boundary.
  1883. #define TS_CACHE_BITMAP_ORDER_REV2_MAX_SIZE \
  1884. (((sizeof(TS_CACHE_BITMAP_ORDER_REV2_HEADER) + 18) + 3) & ~0x03)
  1885. typedef struct
  1886. {
  1887. // Two bytes in header.extraFlags are encoded as follows:
  1888. // Bits 0..2 (mask 0x0007): CacheID.
  1889. // Bits 3..6 (mask 0x0078): BitsPerPixelID, see below for values.
  1890. // Bit 7 (mask 0x0080): bHeightSameAsWidth, set to 1 when the bitmap
  1891. // height is the same as the encoded width.
  1892. // Bit 8 (mask 0x0100): bKeyPresent, set to 1 when the persistent key
  1893. // is encoded in the stream.
  1894. // Bit 9 (mask 0x0200): bStreamBitmap, set to 1 if this cache-bitmap
  1895. // order is a bitmap-streaming header.
  1896. // Bit 10 (mask 0x0400): noBitmapCompressionHdr, set to 1 if the
  1897. // compressed bitmap doesn't contain redundent header (8 bytes)
  1898. // This mask is used by REV1 bitmap header, SDA bitmap data
  1899. // and TS_GENERAL_CAPS as well
  1900. // Bit 11 (mask 0x0800): not cache flag, set to 1 if the bitmap
  1901. // is not to be cached in the bitmap cache
  1902. TS_SECONDARY_ORDER_HEADER header;
  1903. #define TS_CacheBitmapRev2_CacheID_Mask 0x0007
  1904. #define TS_CacheBitmapRev2_BitsPerPixelID_Mask 0x0078
  1905. #define TS_CacheBitmapRev2_bHeightSameAsWidth_Mask 0x0080
  1906. #define TS_CacheBitmapRev2_bKeyPresent_Mask 0x0100
  1907. #define TS_CacheBitmapRev2_bStreamBitmap_Mask 0x0200
  1908. #define TS_EXTRA_NO_BITMAP_COMPRESSION_HDR 0x0400
  1909. #define TS_CacheBitmapRev2_bNotCacheFlag 0x0800
  1910. // These are defined to be in the same position they would be in the
  1911. // extraFlags field.
  1912. #define TS_CacheBitmapRev2_1BitPerPel (0 << 3)
  1913. #define TS_CacheBitmapRev2_2BitsPerPel (1 << 3)
  1914. #define TS_CacheBitmapRev2_4BitsPerPel (2 << 3)
  1915. #define TS_CacheBitmapRev2_8BitsPerPel (3 << 3)
  1916. #define TS_CacheBitmapRev2_16BitsPerPel (4 << 3)
  1917. #define TS_CacheBitmapRev2_24BitsPerPel (5 << 3)
  1918. #define TS_CacheBitmapRev2_32BitsPerPel (6 << 3)
  1919. // 64-bit key. These are absent from the wire encoding if the cache
  1920. // properties in the bitmap cache capabilities indicate the cache
  1921. // is not persistent and bKeyPresent is false above.
  1922. TSUINT32 Key1;
  1923. TSUINT32 Key2;
  1924. // Following fields are variable-sized and so only have a description.
  1925. // Encoding rules:
  1926. // 2-byte encoding: Uses high bit of first byte as a field length
  1927. // indicator, where 0 means the field is one byte (the 7 low
  1928. // bits of the first byte), 1 means it is 2 bytes (low 7 bits
  1929. // of the first byte are the high bits, 8 bits of next byte
  1930. // are the low bits, total 15 bits available).
  1931. // 4-byte encoding: Uses high 2 bits of first byte as a field length
  1932. // indicator: 00 means a one-byte field (low 6 bits of that byte
  1933. // are the value), 01=2-byte field (low 6 bits + next byte, with
  1934. // 1st 6 bits being most significant, 14 bits total for value),
  1935. // 10=3-byte field (22 bits total for value), 11=4-byte field (30
  1936. // bits for value).
  1937. // Bitmap width: 2-byte encoding.
  1938. // Bitmap height: If same as width, the bHeightSameAsWidth bit is
  1939. // set above, otherwise appears here as a 2-byte encoding.
  1940. // Bitmap length: 4-byte encoding.
  1941. // Streaming extended info: This field is present only if the bStreamBitmap
  1942. // flag was set in the header field. This field is a 2-byte encoding
  1943. // specifying the length of the portion of the bitmap in this PDU.
  1944. // The rest of the bitmap data will be sent later with a series of
  1945. // TS_STREAM_BITMAP secondary orders.
  1946. // Cache index: 2-byte encoding.
  1947. } TS_CACHE_BITMAP_ORDER_REV2_HEADER, FAR *PTS_CACHE_BITMAP_ORDER_REV2_HEADER;
  1948. /****************************************************************************/
  1949. // TS_STREAM_BITMAP_ORDER_HEADER
  1950. //
  1951. // Follow-up PDU to TS_CACHE_BITMAP_ORDER_REV2 that provides further blocks
  1952. // of data for the streamed bitmap. Note there are no first/last streaming
  1953. // bits provided, the block sizes sent are sufficient information to
  1954. // determine when the bitmap stream is complete.
  1955. /****************************************************************************/
  1956. // Maximum worst-case order size, rounded up to the nearest DWORD boundary.
  1957. #define TS_STREAM_BITMAP_ORDER_MAX_SIZE \
  1958. (((sizeof(TS_STREAM_BITMAP_ORDER_HEADER) + 2) + 3) & ~0x03)
  1959. typedef struct
  1960. {
  1961. TS_SECONDARY_ORDER_HEADER header;
  1962. // Following fields are variable-sized according to encoding descriptions
  1963. // given for TS_CACHE_BITMAP_ORDER_HEADER_REV2.
  1964. // Data length: 2-byte encoding.
  1965. } TS_STREAM_BITMAP_ORDER_HEADER, FAR *PTS_STREAM_BITMAP_ORDER_HEADER;
  1966. /****************************************************************************/
  1967. /* Structure: TS_CACHE_COLOR_TABLE_ORDER */
  1968. /****************************************************************************/
  1969. typedef struct tagTS_CACHE_COLOR_TABLE_ORDER
  1970. {
  1971. TS_SECONDARY_ORDER_HEADER header;
  1972. TSUINT8 cacheIndex;
  1973. TSUINT16 numberColors;
  1974. TS_COLOR_QUAD colorTable[1];
  1975. } TS_CACHE_COLOR_TABLE_ORDER, FAR * PTS_CACHE_COLOR_TABLE_ORDER;
  1976. /****************************************************************************/
  1977. /* Structure: TS_CACHE_GLYPH_DATA */
  1978. /****************************************************************************/
  1979. typedef struct tagTS_CACHE_GLYPH_DATA
  1980. {
  1981. TSUINT16 cacheIndex;
  1982. TSINT16 x;
  1983. TSINT16 y;
  1984. TSUINT16 cx;
  1985. TSUINT16 cy;
  1986. TSUINT8 aj[1];
  1987. } TS_CACHE_GLYPH_DATA, FAR * PTS_CACHE_GLYPH_DATA;
  1988. /****************************************************************************/
  1989. /* Structure: TS_CACHE_GLYPH_ORDER */
  1990. /****************************************************************************/
  1991. #define TS_EXTRA_GLYPH_UNICODE 16
  1992. typedef struct tagTS_CACHE_GLYPH_ORDER
  1993. {
  1994. TS_SECONDARY_ORDER_HEADER header;
  1995. TSUINT8 cacheId;
  1996. TSUINT8 cGlyphs;
  1997. TS_CACHE_GLYPH_DATA glyphData[1];
  1998. } TS_CACHE_GLYPH_ORDER, FAR * PTS_CACHE_GLYPH_ORDER;
  1999. /****************************************************************************/
  2000. /* Structure: TS_CACHE_GLYPH_ORDER_REV2 */
  2001. /****************************************************************************/
  2002. #define TS_GLYPH_DATA_REV2_HDR_MAX_SIZE 9
  2003. typedef struct tagTS_CACHE_GLYPH_ORDER_REV2
  2004. {
  2005. // Two bytes in header.extraFlags are encoded as follows:
  2006. // Bits 0..3 (mask 0x000f): CacheID.
  2007. // Bit 4 (mask 0x0010): glyph unicode
  2008. // Bit 5 (mask 0x0020): Glyph REV2 order
  2009. // Bits 6..7: free
  2010. // Bits 8..15 (mask 0xff00): cGlyphs
  2011. TS_SECONDARY_ORDER_HEADER header;
  2012. #define TS_CacheGlyphRev2_CacheID_Mask 0x000f
  2013. #define TS_CacheGlyphRev2_Mask 0x0020
  2014. #define TS_CacheGlyphRev2_cGlyphs_Mask 0xff00
  2015. // array of glyph data
  2016. BYTE glyphData[1];
  2017. // Following fields are variable-sized and so only have a description.
  2018. // Encoding rules:
  2019. // 2-byte encoding: Uses high bit of first byte as a field length
  2020. // indicator, where 0 means the field is one byte (the 7 low
  2021. // bits of the first byte), 1 means it is 2 bytes (low 7 bits
  2022. // of the first byte are the high bits, 8 bits of next byte
  2023. // are the low bits, total 15 bits available).
  2024. //
  2025. // 2-byte signed encoding: Uses high bit of first byte as a field length
  2026. // indicator, where 0 means the field is one byte (the 6 low
  2027. // bits of the first byte), 1 means it is 2 bytes (low 6 bits
  2028. // of the first byte are the high bits, 8 bits of next byte
  2029. // are the low bits, total 14 bits available).
  2030. // The second high bit used as a sign indicator. 0 means the
  2031. // field is unsigned, 1 means the field is signed
  2032. //
  2033. // cacheIndex: 1-byte field
  2034. // Glyph x: 2-byte signed encoding
  2035. // Glyph y: 2-byte signed encoding
  2036. // Glyph cx: 2-byte unsigned encoding
  2037. // Glyph cy: 2-byte unsigned encoding
  2038. // Glyph bitmap data: in bytes
  2039. } TS_CACHE_GLYPH_ORDER_REV2, FAR * PTS_CACHE_GLYPH_ORDER_REV2;
  2040. /****************************************************************************/
  2041. /* Structure: TS_CACHE_BRUSH_ORDER */
  2042. /****************************************************************************/
  2043. #define TS_CACHED_BRUSH 0x80
  2044. #define MAX_BRUSH_ENCODE_COLORS 4
  2045. typedef struct tagTS_CACHE_BRUSH_ORDER
  2046. {
  2047. TS_SECONDARY_ORDER_HEADER header;
  2048. TSUINT8 cacheEntry;
  2049. TSUINT8 iBitmapFormat;
  2050. TSUINT8 cx;
  2051. TSUINT8 cy;
  2052. TSUINT8 style;
  2053. TSUINT8 iBytes;
  2054. TSUINT8 brushData[1];
  2055. #ifdef DC_HICOLOR
  2056. // The layout of the brush data is dependent on the format of the
  2057. // bitmap, and if it has been compressed in any way. In particular,
  2058. // many brushes actually only use two different colors, and the
  2059. // majority use four or less.
  2060. //
  2061. // Two-color brushes are treated as mono bitmaps, so the brushData
  2062. // array contains the bits encoded in 8 bytes.
  2063. //
  2064. // Four color brushes are represented as 2-bit indices into a color
  2065. // table. The brushData array thus contains
  2066. //
  2067. // - 16 bytes of bitmap data (8x8 pels x 2bpp)
  2068. // - either
  2069. // - 4 1-byte indices into the current color table (for 8bpp
  2070. // sessions)
  2071. // - 4 4-byte color values, either color indices for 15/16bpp or full
  2072. // RGB values for 24bpp sessions
  2073. //
  2074. // The bits of brushes using more than 4 colors are simply copied into
  2075. // the brushData at the appropriate color depth.
  2076. #endif
  2077. } TS_CACHE_BRUSH_ORDER, FAR * PTS_CACHE_BRUSH_ORDER;
  2078. /****************************************************************************/
  2079. // TS_CREATE_OFFSCR_BITMAP_ORDER
  2080. //
  2081. // This alternate secondary order creates an offscreen bitmap of size
  2082. // cx by cy. The bitmap ID is stored at the ExtraFlags field in the header
  2083. /****************************************************************************/
  2084. typedef struct tagTS_CREATE_OFFSCR_BITMAP_ORDER
  2085. {
  2086. BYTE ControlFlags;
  2087. // Bit 0..14: Offscreen bitmap ID
  2088. // Bit 15: Flag to indicate if offscreen bitmap delete list is appended.
  2089. TSUINT16 Flags;
  2090. TSUINT16 cx;
  2091. TSUINT16 cy;
  2092. // Number offscreen bitmaps to delete: 2 bytes
  2093. // Offscreen bitmap ID delete list: 2-bytes list
  2094. TSUINT16 variableBytes[1];
  2095. } TS_CREATE_OFFSCR_BITMAP_ORDER, FAR * PTS_CREATE_OFFSCR_BITMAP_ORDER;
  2096. /****************************************************************************/
  2097. // TS_SWITCH_SURFACE_ORDER_HEADER
  2098. //
  2099. // This alternate secondary order switches the target drawing surface at the
  2100. // client, identified by the bitmap ID. The primary drawing surface (screen)
  2101. // has the bitmap ID of 0xFFFF.
  2102. /****************************************************************************/
  2103. #define SCREEN_BITMAP_SURFACE 0xFFFF
  2104. typedef struct tagTS_SWITCH_SURFACE_ORDER
  2105. {
  2106. BYTE ControlFlags;
  2107. TSUINT16 BitmapID;
  2108. } TS_SWITCH_SURFACE_ORDER, FAR * PTS_SWITCH_SURFACE_ORDER;
  2109. #ifdef DRAW_GDIPLUS
  2110. /****************************************************************************/
  2111. // Structure: TS_DRAW_GDIPLUS_ORDER
  2112. //
  2113. // Description: DrawGdiplus order
  2114. /****************************************************************************/
  2115. typedef struct tagTS_DRAW_GDIPLUS_ORDER_FRIST
  2116. {
  2117. BYTE ControlFlags;
  2118. BYTE Flags; // curently not used
  2119. TSUINT16 cbSize;
  2120. TSUINT32 cbTotalSize;
  2121. TSUINT32 cbTotalEmfSize;
  2122. } TS_DRAW_GDIPLUS_ORDER_FIRST, FAR * PTS_DRAW_GDIPLUS_ORDER_FIRST;
  2123. typedef struct tagTS_DRAW_GDIPLUS_ORDER_NEXT
  2124. {
  2125. BYTE ControlFlags;
  2126. BYTE Flags; // curently not used
  2127. TSUINT16 cbSize;
  2128. } TS_DRAW_GDIPLUS_ORDER_NEXT, FAR * PTS_DRAW_GDIPLUS_ORDER_NEXT;
  2129. typedef struct tagTS_DRAW_GDIPLUS_ORDER_END
  2130. {
  2131. BYTE ControlFlags;
  2132. BYTE Flags; // curently not used
  2133. TSUINT16 cbSize;
  2134. TSUINT32 cbTotalSize;
  2135. TSUINT32 cbTotalEmfSize;
  2136. } TS_DRAW_GDIPLUS_ORDER_END, FAR * PTS_DRAW_GDIPLUS_ORDER_END;
  2137. #define TS_GDIPLUS_ORDER_SIZELIMIT 4096
  2138. /****************************************************************************/
  2139. // Structure: TS_CACHE_DRAW_GDIPLUS_CACHE_ORDER
  2140. //
  2141. // Description: DrawGdiplus cache order
  2142. /****************************************************************************/
  2143. typedef struct tagTS_DRAW_GDIPLUS_CACHE_ORDER_FIRST
  2144. {
  2145. BYTE ControlFlags;
  2146. BYTE Flags;
  2147. #define TS_GDIPLUS_CACHE_ORDER_REMOVE_CACHEENTRY 0x1
  2148. TSUINT16 CacheType; // See following define for CacheType
  2149. TSUINT16 CacheID;
  2150. TSUINT16 cbSize;
  2151. TSUINT32 cbTotalSize;
  2152. } TS_DRAW_GDIPLUS_CACHE_ORDER_FIRST, FAR * PTS_DRAW_GDIPLUS_CACHE_ORDER_FIRST;
  2153. typedef struct tagTS_DRAW_GDIPLUS_CACHE_ORDER_NEXT
  2154. {
  2155. BYTE ControlFlags;
  2156. BYTE Flags;
  2157. TSUINT16 CacheType; // See following define for CacheType
  2158. TSUINT16 CacheID;
  2159. TSUINT16 cbSize;
  2160. } TS_DRAW_GDIPLUS_CACHE_ORDER_NEXT, FAR * PTS_DRAW_GDIPLUS_CACHE_ORDER_NEXT;
  2161. typedef struct tagTS_DRAW_GDIPLUS_CACHE_ORDER_END
  2162. {
  2163. BYTE ControlFlags;
  2164. BYTE Flags;
  2165. TSUINT16 CacheType; // See following define for CacheType
  2166. TSUINT16 CacheID;
  2167. TSUINT16 cbSize;
  2168. TSUINT32 cbTotalSize;
  2169. } TS_DRAW_GDIPLUS_CACHE_ORDER_END, FAR * PTS_DRAW_GDIPLUS_CACHE_ORDER_END;
  2170. #define GDIP_CACHE_GRAPHICS_DATA 0x1
  2171. #define GDIP_CACHE_OBJECT_BRUSH 0x2
  2172. #define GDIP_CACHE_OBJECT_PEN 0x3
  2173. #define GDIP_CACHE_OBJECT_IMAGE 0x4
  2174. #define GDIP_CACHE_OBJECT_IMAGEATTRIBUTES 0x5
  2175. typedef struct tagTSEmfPlusRecord
  2176. {
  2177. TSINT16 Type;
  2178. TSUINT16 Flags; // Higher 8 bits is Gdi+ object type
  2179. TSUINT32 Size; // If MSB is set, the following data will be cacheID
  2180. } TSEmfPlusRecord, FAR * PTSEmfPlusRecord;
  2181. #endif // DRAW_GDIPLUS
  2182. #ifdef DRAW_NINEGRID
  2183. /****************************************************************************/
  2184. // Structure: TS_CREATE_DRAW_NINEGRID_ORDER
  2185. //
  2186. // Description: Luna DrawNineGrid bitmap order
  2187. /****************************************************************************/
  2188. typedef struct tagTS_NINEGRID_BITMAP_INFO
  2189. {
  2190. ULONG flFlags;
  2191. TSUINT16 ulLeftWidth;
  2192. TSUINT16 ulRightWidth;
  2193. TSUINT16 ulTopHeight;
  2194. TSUINT16 ulBottomHeight;
  2195. TSCOLORREF crTransparent;
  2196. } TS_NINEGRID_BITMAP_INFO, FAR * PTS_NINEGRID_BITMAP_INFO;
  2197. typedef struct tagTS_CREATE_NINEGRID_BITMAP_ORDER
  2198. {
  2199. BYTE ControlFlags;
  2200. BYTE BitmapBpp;
  2201. TSUINT16 BitmapID;
  2202. TSUINT16 cx;
  2203. TSUINT16 cy;
  2204. TS_NINEGRID_BITMAP_INFO nineGridInfo;
  2205. } TS_CREATE_NINEGRID_BITMAP_ORDER, FAR * PTS_CREATE_NINEGRID_BITMAP_ORDER;
  2206. /****************************************************************************/
  2207. // Streaming bitmap orders
  2208. /****************************************************************************/
  2209. #define TS_STREAM_BITMAP_BLOCK 4 * 1024 // stream bitmap block is 4k chunk
  2210. #define TS_STREAM_BITMAP_END 0x1
  2211. #define TS_STREAM_BITMAP_COMPRESSED 0x2
  2212. #define TS_STREAM_BITMAP_REV2 0x4
  2213. typedef struct tagTS_STREAM_BITMAP_FIRST_PDU
  2214. {
  2215. BYTE ControlFlags;
  2216. BYTE BitmapFlags;
  2217. BYTE BitmapBpp;
  2218. TSUINT16 BitmapId;
  2219. #define TS_DRAW_NINEGRID_BITMAP_CACHE 0x1
  2220. TSUINT16 BitmapWidth;
  2221. TSUINT16 BitmapHeight;
  2222. TSUINT16 BitmapLength;
  2223. TSUINT16 BitmapBlockLength;
  2224. } TS_STREAM_BITMAP_FIRST_PDU, FAR * PTS_STREAM_BITMAP_FIRST_PDU;
  2225. typedef struct tagTS_STREAM_BITMAP_NEXT_PDU
  2226. {
  2227. BYTE ControlFlags;
  2228. BYTE BitmapFlags;
  2229. TSUINT16 BitmapId;
  2230. TSUINT16 BitmapBlockLength;
  2231. } TS_STREAM_BITMAP_NEXT_PDU, FAR * PTS_STREAM_BITMAP_NEXT_PDU;
  2232. // For DRAW_STREM_REV2, the only change is the BitmapLength in tagTS_STREAM_BITMAP_FIRST_PDU
  2233. // from TSUINT16 to TSUINT32
  2234. typedef struct tagTS_STREAM_BITMAP_FIRST_PDU_REV2
  2235. {
  2236. BYTE ControlFlags;
  2237. BYTE BitmapFlags;
  2238. BYTE BitmapBpp;
  2239. TSUINT16 BitmapId;
  2240. #define TS_DRAW_NINEGRID_BITMAP_CACHE 0x1
  2241. TSUINT16 BitmapWidth;
  2242. TSUINT16 BitmapHeight;
  2243. TSUINT32 BitmapLength;
  2244. TSUINT16 BitmapBlockLength;
  2245. } TS_STREAM_BITMAP_FIRST_PDU_REV2, FAR * PTS_STREAM_BITMAP_FIRST_PDU_REV2;
  2246. #if 0
  2247. /****************************************************************************/
  2248. // Structure: TS_CREATE_DRAW_STREAM_ORDER
  2249. //
  2250. // Description: Luna DrawStream order
  2251. /****************************************************************************/
  2252. typedef struct tagTS_CREATE_DRAW_STREAM_ORDER
  2253. {
  2254. BYTE ControlFlags;
  2255. TSUINT16 BitmapID;
  2256. TSUINT16 cx;
  2257. TSUINT16 cy;
  2258. TSUINT8 bitmapBpp;
  2259. } TS_CREATE_DRAW_STREAM_ORDER, FAR * PTS_CREATE_DRAW_STREAM_ORDER;
  2260. /****************************************************************************/
  2261. // Structure: TS_DRAW_STREAM_ORDER
  2262. //
  2263. // Description: Luna DrawStream order
  2264. /****************************************************************************/
  2265. typedef struct tagTS_DRAW_STREAM_ORDER
  2266. {
  2267. BYTE ControlFlags;
  2268. TS_RECTANGLE16 Bounds;
  2269. TSUINT16 BitmapID;
  2270. TSUINT8 nClipRects;
  2271. TSUINT16 StreamLen;
  2272. } TS_DRAW_STREAM_ORDER, FAR * PTS_DRAW_STREAM_ORDER;
  2273. typedef struct tagTS_DRAW_NINEGRID_ORDER
  2274. {
  2275. BYTE ControlFlags;
  2276. TSUINT16 BitmapID;
  2277. TS_RECTANGLE16 dstBounds;
  2278. TS_RECTANGLE16 srcBounds;
  2279. TSUINT8 nClipRects;
  2280. } TS_DRAW_NINEGRID_ORDER, FAR * PTS_DRAW_NINEGRID_ORDER;
  2281. typedef struct _RDP_DS_COPYTILE
  2282. {
  2283. BYTE ulCmdID;
  2284. TS_RECTANGLE16 rclDst;
  2285. TS_RECTANGLE16 rclSrc;
  2286. TS_POINT16 ptlOrigin;
  2287. } RDP_DS_COPYTILE;
  2288. typedef struct _RDP_DS_SOLIDFILL
  2289. {
  2290. BYTE ulCmdID;
  2291. TS_RECTANGLE16 rclDst;
  2292. TSCOLORREF crSolidColor;
  2293. } RDP_DS_SOLIDFILL;
  2294. typedef struct _RDP_DS_TRANSPARENTTILE
  2295. {
  2296. BYTE ulCmdID;
  2297. TS_RECTANGLE16 rclDst;
  2298. TS_RECTANGLE16 rclSrc;
  2299. TS_POINT16 ptlOrigin;
  2300. TSCOLORREF crTransparentColor;
  2301. } RDP_DS_TRANSPARENTTILE;
  2302. typedef struct _RDP_DS_ALPHATILE
  2303. {
  2304. BYTE ulCmdID;
  2305. TS_RECTANGLE16 rclDst;
  2306. TS_RECTANGLE16 rclSrc;
  2307. TS_POINT16 ptlOrigin;
  2308. TS_BLENDFUNC blendFunction;
  2309. } RDP_DS_ALPHATILE;
  2310. typedef struct _RDP_DS_STRETCH
  2311. {
  2312. BYTE ulCmdID;
  2313. TS_RECTANGLE16 rclDst;
  2314. TS_RECTANGLE16 rclSrc;
  2315. } RDP_DS_STRETCH;
  2316. typedef struct _RDP_DS_TRANSPARENTSTRETCH
  2317. {
  2318. BYTE ulCmdID;
  2319. TS_RECTANGLE16 rclDst;
  2320. TS_RECTANGLE16 rclSrc;
  2321. TSCOLORREF crTransparentColor;
  2322. } RDP_DS_TRANSPARENTSTRETCH;
  2323. typedef struct _RDP_DS_ALPHASTRETCH
  2324. {
  2325. BYTE ulCmdID;
  2326. TS_RECTANGLE16 rclDst;
  2327. TS_RECTANGLE16 rclSrc;
  2328. TS_BLENDFUNC blendFunction;
  2329. } RDP_DS_ALPHASTRETCH;
  2330. #endif
  2331. #endif //DRAW_NINEGRID
  2332. /****************************************************************************/
  2333. /* Structure: TS_SECONDARY_ORDER */
  2334. /****************************************************************************/
  2335. typedef struct tagTS_SECONDARY_ORDER
  2336. {
  2337. union
  2338. {
  2339. TS_CACHE_BITMAP_ORDER cacheBitmap;
  2340. TS_CACHE_COLOR_TABLE_ORDER cacheColorTable;
  2341. TS_CACHE_GLYPH_ORDER cacheGlyph;
  2342. TS_CACHE_BRUSH_ORDER cacheBrush;
  2343. } u;
  2344. } TS_SECONDARY_ORDER, FAR * PTS_SECONDARY_ORDER;
  2345. /****************************************************************************/
  2346. /* Structure: TS_UPDATE_PALETTE_PDU */
  2347. /****************************************************************************/
  2348. typedef struct tagTS_UPDATE_PALETTE_PDU_DATA
  2349. {
  2350. TSUINT16 updateType; /* See TS_UPDATE_HDR */
  2351. TSUINT16 pad2octets;
  2352. TSUINT32 numberColors;
  2353. TS_COLOR palette[1]; /* 16 or 256 entries */
  2354. } TS_UPDATE_PALETTE_PDU_DATA, FAR * PTS_UPDATE_PALETTE_PDU_DATA;
  2355. typedef struct tagTS_UPDATE_PALETTE_PDU
  2356. {
  2357. TS_SHAREDATAHEADER shareDataHeader;
  2358. TS_UPDATE_PALETTE_PDU_DATA data;
  2359. } TS_UPDATE_PALETTE_PDU, FAR * PTS_UPDATE_PALETTE_PDU;
  2360. /****************************************************************************/
  2361. /* Structure: TS_UPDATE_SYNCHRONIZE_PDU */
  2362. /****************************************************************************/
  2363. typedef struct tagTS_UPDATE_SYNCHRONIZE_PDU
  2364. {
  2365. TS_SHAREDATAHEADER shareDataHeader;
  2366. TSUINT16 updateType; /* See TS_UPDATE_HDR */
  2367. TSUINT16 pad2octets;
  2368. } TS_UPDATE_SYNCHRONIZE_PDU, FAR * PTS_UPDATE_SYNCHRONIZE_PDU;
  2369. /****************************************************************************/
  2370. /* CONSTANTS */
  2371. /****************************************************************************/
  2372. #define TS_PROTOCOL_VERSION 0x0010
  2373. /****************************************************************************/
  2374. /* MCS priorities */
  2375. /****************************************************************************/
  2376. #define TS_LOWPRIORITY 3
  2377. #define TS_MEDPRIORITY 2
  2378. #define TS_HIGHPRIORITY 1
  2379. #ifdef DC_HICOLOR
  2380. /****************************************************************************/
  2381. /* Mask definitions for high color support */
  2382. /****************************************************************************/
  2383. #define TS_RED_MASK_24BPP 0xff0000;
  2384. #define TS_GREEN_MASK_24BPP 0x00ff00;
  2385. #define TS_BLUE_MASK_24BPP 0x0000ff;
  2386. #define TS_RED_MASK_16BPP 0xf800
  2387. #define TS_GREEN_MASK_16BPP 0x07e0
  2388. #define TS_BLUE_MASK_16BPP 0x001f
  2389. #define TS_RED_MASK_15BPP 0x7c00
  2390. #define TS_GREEN_MASK_15BPP 0x03e0
  2391. #define TS_BLUE_MASK_15BPP 0x001f
  2392. #endif
  2393. /****************************************************************************/
  2394. /* Structure: TS_REFRESH_RECT_PDU */
  2395. /* */
  2396. /* Name of PDU: RefreshRectanglePDU (a T.128 extension) */
  2397. /* */
  2398. /* Description of Function: */
  2399. /* Flows from Client -> Server (and optionally: Server -> Client) */
  2400. /* Requests that the Server should send data to the client to allow */
  2401. /* the client to redraw the areas defined by the rectangles defined in */
  2402. /* the PDU. The server responds by sending updatePDUs (orders, bitmap */
  2403. /* data etc.) containing all the drawing information necessary to */
  2404. /* "fill in" the rectangle. The server will probably implement this */
  2405. /* by invalidating the rectangle - which results in a bunch of drawing */
  2406. /* orders from the affected apps, which are then remoted to the Client */
  2407. /* */
  2408. /* Field Descriptions: */
  2409. /* numberOfAreas: count of rectangles included */
  2410. /* areaToRefresh: area the client needs repainted */
  2411. /****************************************************************************/
  2412. typedef struct tagTS_REFRESH_RECT_PDU
  2413. {
  2414. TS_SHAREDATAHEADER shareDataHeader;
  2415. TSUINT8 numberOfAreas;
  2416. TSUINT8 pad3octets[3];
  2417. TS_RECTANGLE16 areaToRefresh[1]; /* inclusive */
  2418. } TS_REFRESH_RECT_PDU, FAR * PTS_REFRESH_RECT_PDU;
  2419. #define TS_REFRESH_RECT_PDU_SIZE sizeof(TS_REFRESH_RECT_PDU)
  2420. #define TS_REFRESH_RECT_UNCOMP_LEN 12
  2421. /****************************************************************************/
  2422. /* Structure: TS_SUPPRESS_OUTPUT_PDU */
  2423. /* */
  2424. /* Name of PDU: SuppressOutputPDU (a T.128 extension) */
  2425. /* */
  2426. /* Description of Function: */
  2427. /* Flows from Client -> Server */
  2428. /* Notifies the Server that there are changes in the areas of the */
  2429. /* shared desktop that are visible at the client. */
  2430. /* */
  2431. /* By default, at the start of a new session, the server assumes that */
  2432. /* the entire desktop is visible at the client and will send all */
  2433. /* remoted output to it. During a session, the client can use this */
  2434. /* PDU to notify the server that only certain areas of the shared */
  2435. /* desktop are visible. The server may then choose NOT to send output */
  2436. /* for the other areas (note: the server does not guarantee to not */
  2437. /* send the output; the client must be capable of handling such output */
  2438. /* by ignoring it). */
  2439. /* */
  2440. /* Once the client has sent one of these PDUs it is then responsible */
  2441. /* for keeping the server up to date i.e. it must send further */
  2442. /* PDUs whenever the areas that can be excluded changes. Note that */
  2443. /* processing the PDU at the server can be quite an expensive */
  2444. /* operation (because areas that were excluded but are now not- */
  2445. /* excluded need to be redrawn to ensure that the client has an */
  2446. /* up to date view of them). */
  2447. /* */
  2448. /* The intent behind this PDU is not that the Client should notify the */
  2449. /* server every time the client area is resized (by the user dragging */
  2450. /* the frame border for example) but to allow line-utilization */
  2451. /* optimization whenever there is any "significant" reason for */
  2452. /* output to be excluded. The definition of "significant" is */
  2453. /* entirely a client decision but reasons might include */
  2454. /* - the client is minimized (which suggests that the user is */
  2455. /* likely to not want to see the Client output for a lengthy */
  2456. /* period of time) */
  2457. /* - another application is maximized and has the focus (which */
  2458. /* again suggests that the client user may not be interested in */
  2459. /* output for a lengthy period of time) */
  2460. /* - with multiple-monitor configuration at the client there may */
  2461. /* be some areas of the server desktop that are simply NEVER */
  2462. /* visible at the client; selectively suppressing output for */
  2463. /* those areas is a good idea. */
  2464. /* */
  2465. /* Note that in TSE4.0 and Win2000, the Client only ever excludes */
  2466. /* output for the entire desktop, or for none of it. Similarly, the */
  2467. /* server only actually suppresses all output or none (it cannot */
  2468. /* suppress output for selected areas). */
  2469. /* */
  2470. /* Field Descriptions: */
  2471. /* numberOfRectangles: TS_QUIET_FULL_SUPPRESSION (zero): indicates */
  2472. /* that the Server may choose to stop sending */
  2473. /* all output (including sound). */
  2474. /* 1..TS_MAX_INCLUDED_RECTS: number of rectangles */
  2475. /* following. */
  2476. /* any other value: ASSERTABLE ERROR. */
  2477. /* includedRectangle[] Each rectangle defines an area of the desktop */
  2478. /* for which the client requires output. */
  2479. /****************************************************************************/
  2480. typedef struct tagTS_SUPPRESS_OUTPUT_PDU
  2481. {
  2482. TS_SHAREDATAHEADER shareDataHeader;
  2483. TSUINT8 numberOfRectangles;
  2484. #define TS_QUIET_FULL_SUPPRESSION 0
  2485. #define TS_MAX_INCLUDED_RECTS 128
  2486. TSUINT8 pad3octets[3];
  2487. TS_RECTANGLE16 includedRectangle[1]; /* optional. */
  2488. } TS_SUPPRESS_OUTPUT_PDU, FAR * PTS_SUPPRESS_OUTPUT_PDU;
  2489. #define TS_SUPPRESS_OUTPUT_PDU_SIZE(n) \
  2490. ((sizeof(TS_SUPPRESS_OUTPUT_PDU)-sizeof(TS_RECTANGLE16)) + \
  2491. (n * sizeof(TS_RECTANGLE16)))
  2492. #define TS_SUPPRESS_OUTPUT_UNCOMP_LEN(n) \
  2493. (8 + n * sizeof(TS_RECTANGLE16))
  2494. /****************************************************************************/
  2495. /* Structure: TS_PLAY_SOUND_PDU */
  2496. /* */
  2497. /* Name of PDU: PlaySoundPDU (a T.128 extension) */
  2498. /* */
  2499. /* Description of Function: */
  2500. /* Flows from Server -> Client */
  2501. /* On receipt, the Client should (if possible) generate some local */
  2502. /* audio output as indicated by the information in the packet. */
  2503. /* */
  2504. /* Field Descriptions: */
  2505. /* duration: duration in ms */
  2506. /* frequency: frequency in Hz */
  2507. /****************************************************************************/
  2508. typedef struct tagTS_PLAY_SOUND_PDU_DATA
  2509. {
  2510. TSUINT32 duration;
  2511. TSUINT32 frequency;
  2512. } TS_PLAY_SOUND_PDU_DATA, FAR * PTS_PLAY_SOUND_PDU_DATA;
  2513. typedef struct tagTS_PLAY_SOUND_PDU
  2514. {
  2515. TS_SHAREDATAHEADER shareDataHeader;
  2516. TS_PLAY_SOUND_PDU_DATA data;
  2517. } TS_PLAY_SOUND_PDU, FAR * PTS_PLAY_SOUND_PDU;
  2518. /****************************************************************************/
  2519. /* Structure: TS_SHUTDOWN_REQUEST_PDU */
  2520. /* */
  2521. /* Name of PDU: ShutdownRequestPDU (a T.128 extension) */
  2522. /* */
  2523. /* Description of Function: */
  2524. /* Flows from Client -> Server */
  2525. /* Notifies the Server that the Client wishes to terminate. If the */
  2526. /* server objects for some reason (in RNS/Ducati this reason is */
  2527. /* "the user is still logged on to the underlying session") then */
  2528. /* the server responds with a shutdownDeniedPDU. Otherwise, this */
  2529. /* PDU has no response, and the Server disconnects the Client (which */
  2530. /* then terminates). */
  2531. /****************************************************************************/
  2532. typedef struct tagTS_SHUTDOWN_REQ_PDU
  2533. {
  2534. TS_SHAREDATAHEADER shareDataHeader;
  2535. } TS_SHUTDOWN_REQ_PDU, FAR * PTS_SHUTDOWN_REQ_PDU;
  2536. #define TS_SHUTDOWN_REQ_PDU_SIZE sizeof(TS_SHUTDOWN_REQ_PDU)
  2537. #define TS_SHUTDOWN_REQ_UNCOMP_LEN 4
  2538. /****************************************************************************/
  2539. /* Structure: TS_SHUTDOWN_DENIED_PDU */
  2540. /* */
  2541. /* Name of PDU: ShutdownDeniedPDU (a T.128 extension) */
  2542. /* */
  2543. /* Description of Function: */
  2544. /* Flows from Server -> Client */
  2545. /* Notifies the Client that the remote user is still logged on to */
  2546. /* the NT session, and for this reason RNS is not going to end the */
  2547. /* conference (even though the client has signalled that this should */
  2548. /* happen by sending a ShutdownRequestPDU). */
  2549. /****************************************************************************/
  2550. typedef struct tagTS_SHUTDOWN_DENIED_PDU
  2551. {
  2552. TS_SHAREDATAHEADER shareDataHeader;
  2553. } TS_SHUTDOWN_DENIED_PDU, FAR * PTS_SHUTDOWN_DENIED_PDU;
  2554. /****************************************************************************/
  2555. /* Structure: TS_LOGON_INFO */
  2556. /****************************************************************************/
  2557. typedef struct tagTS_LOGON_INFO
  2558. {
  2559. TSUINT32 cbDomain;
  2560. TSUINT8 Domain[TS_MAX_DOMAIN_LENGTH_OLD];
  2561. TSUINT32 cbUserName;
  2562. TSUINT8 UserName[TS_MAX_USERNAME_LENGTH];
  2563. TSUINT32 SessionId;
  2564. } TS_LOGON_INFO, FAR * PTS_LOGON_INFO;
  2565. /****************************************************************************/
  2566. /* Structure: TS_LOGON_INFO_VERSION_2 ; For Supporting Long Credentials */
  2567. /****************************************************************************/
  2568. typedef struct tagTS_LOGON_INFO_VERSION_2
  2569. {
  2570. TSUINT16 Version;
  2571. #define SAVE_SESSION_PDU_VERSION_ONE 1
  2572. TSUINT32 Size;
  2573. TSUINT32 SessionId;
  2574. TSUINT32 cbDomain;
  2575. TSUINT32 cbUserName;
  2576. // NOTE -- Actual Domain and UserName follows this structure
  2577. // The actual Domain name follows this structure immediately
  2578. // The actual UserName follows the Domain Name
  2579. // Both the Domain and UserName are NULL terminated
  2580. } TS_LOGON_INFO_VERSION_2, FAR * PTS_LOGON_INFO_VERSION_2;
  2581. /****************************************************************************/
  2582. /* Structure: TS_LOGON_INFO_EXTENDED ; Supports extended logon info */
  2583. /****************************************************************************/
  2584. typedef struct tagTS_LOGON_INFO_EXTENDED
  2585. {
  2586. // Overall length of this packet, including the header fields.
  2587. TSUINT16 Length;
  2588. // Flags specify which pieces of data are present (ordered)
  2589. TSUINT32 Flags;
  2590. #define LOGON_EX_AUTORECONNECTCOOKIE 0x1
  2591. // Variable-length. For each field, it has the form
  2592. // ULONG Length
  2593. // BYTE data[]
  2594. } TS_LOGON_INFO_EXTENDED, FAR * PTS_LOGON_INFO_EXTENDED;
  2595. /****************************************************************************/
  2596. /* Structure: TS_SAVE_SESSION_INFO_PDU */
  2597. /****************************************************************************/
  2598. typedef struct tagTS_SAVE_SESSION_INFO_PDU_DATA
  2599. {
  2600. TSUINT32 InfoType;
  2601. #define TS_INFOTYPE_LOGON 0
  2602. #define TS_INFOTYPE_LOGON_LONG 1
  2603. // Plain notify just notifies of the fact that we've logged on.
  2604. #define TS_INFOTYPE_LOGON_PLAINNOTIFY 2
  2605. // Extended logon info packet (e.g contains autoreconnect cookie)
  2606. #define TS_INFOTYPE_LOGON_EXTENDED_INFO 3
  2607. union
  2608. {
  2609. TS_LOGON_INFO LogonInfo;
  2610. TS_LOGON_INFO_VERSION_2 LogonInfoVersionTwo;
  2611. TS_LOGON_INFO_EXTENDED LogonInfoEx;
  2612. } Info;
  2613. } TS_SAVE_SESSION_INFO_PDU_DATA, FAR * PTS_SAVE_SESSION_INFO_PDU_DATA;
  2614. typedef struct tagTS_SAVE_SESSION_INFO_PDU
  2615. {
  2616. TS_SHAREDATAHEADER shareDataHeader;
  2617. TS_SAVE_SESSION_INFO_PDU_DATA data;
  2618. } TS_SAVE_SESSION_INFO_PDU, FAR * PTS_SAVE_SESSION_INFO_PDU;
  2619. #define TS_SAVE_SESSION_INFO_PDU_SIZE sizeof(TS_SAVE_SESSION_INFO_PDU)
  2620. /****************************************************************************/
  2621. /* Structure: TS_SET_ERROR_INFO_PDU */
  2622. /****************************************************************************/
  2623. typedef struct tagTS_SET_ERROR_INFO_PDU
  2624. {
  2625. TS_SHAREDATAHEADER shareDataHeader;
  2626. TSUINT32 errorInfo;
  2627. } TS_SET_ERROR_INFO_PDU, FAR * PTS_SET_ERROR_INFO_PDU;
  2628. #define TS_SET_ERROR_INFO_PDU_SIZE sizeof(TS_SET_ERROR_INFO_PDU)
  2629. /****************************************************************************/
  2630. /* Structure: TS_SET_KEYBOARD_INDICATORS_PDU */
  2631. /****************************************************************************/
  2632. typedef struct tagTS_SET_KEYBOARD_INDICATORS_PDU
  2633. {
  2634. TS_SHAREDATAHEADER shareDataHeader;
  2635. TSUINT16 UnitId;
  2636. TSUINT16 LedFlags;
  2637. } TS_SET_KEYBOARD_INDICATORS_PDU, FAR * PTS_SET_KEYBOARD_INDICATORS_PDU;
  2638. #define TS_SET_KEYBOARD_INDICATORS_PDU_SIZE sizeof(TS_SET_KEYBOARD_INDICATORS_PDU)
  2639. /****************************************************************************/
  2640. /* Structure: TS_SET_KEYBOARD_IME_STATUS_PDU */
  2641. /****************************************************************************/
  2642. typedef struct tagTS_SET_KEYBOARD_IME_STATUS_PDU
  2643. {
  2644. TS_SHAREDATAHEADER shareDataHeader;
  2645. TSUINT16 UnitId;
  2646. TSUINT32 ImeOpen;
  2647. TSUINT32 ImeConvMode;
  2648. } TS_SET_KEYBOARD_IME_STATUS_PDU, FAR * PTS_SET_KEYBOARD_IME_STATUS_PDU;
  2649. #define TS_SET_KEYBOARD_IME_STATUS_PDU_SIZE sizeof(TS_SET_KEYBOARD_IME_STATUS_PDU)
  2650. /****************************************************************************/
  2651. /* Structure: TS_AUTORECONNECT_STATUS_PDU */
  2652. /****************************************************************************/
  2653. typedef struct tagTS_AUTORECONNECT_STATUS_PDU
  2654. {
  2655. TS_SHAREDATAHEADER shareDataHeader;
  2656. TSUINT32 arcStatus;
  2657. } TS_AUTORECONNECT_STATUS_PDU, FAR * PTS_AUTORECONNECT_STATUS_PDU;
  2658. #define TS_AUTORECONNECT_STATUS_PDU_SIZE sizeof(TS_AUTORECONNECT_STATUS_PDU)
  2659. /****************************************************************************/
  2660. /* Restore packing style (previous for 32-bit, default for 16-bit). */
  2661. /****************************************************************************/
  2662. #ifdef OS_WIN16
  2663. #pragma pack ()
  2664. #else
  2665. #pragma pack (pop, t128pack)
  2666. #endif
  2667. #endif /* _H_AT128 */