Source code of Windows XP (NT5)
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.

3097 lines
122 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. #define TS_OFFSCREEN_CACHE_SIZE_DEFAULT 2560 // in KB, 2.5 MB cache memory
  846. TSUINT16 offscreenCacheEntries;
  847. #define TS_OFFSCREEN_CACHE_ENTRIES_DEFAULT 100 // 100 cache entries
  848. } TS_OFFSCREEN_CAPABILITYSET, FAR * PTS_OFFSCREEN_CAPABILITYSET;
  849. #ifdef DRAW_GDIPLUS
  850. typedef struct tagTS_GDIPLUS_CACHE_ENTRIES
  851. {
  852. TSUINT16 GdipGraphicsCacheEntries;
  853. #define TS_GDIP_GRAPHICS_CACHE_ENTRIES_DEFAULT 10
  854. TSUINT16 GdipObjectBrushCacheEntries;
  855. #define TS_GDIP_BRUSH_CACHE_ENTRIES_DEFAULT 5
  856. TSUINT16 GdipObjectPenCacheEntries;
  857. #define TS_GDIP_PEN_CACHE_ENTRIES_DEFAULT 5
  858. TSUINT16 GdipObjectImageCacheEntries;
  859. #define TS_GDIP_IMAGE_CACHE_ENTRIES_DEFAULT 10
  860. TSUINT16 GdipObjectImageAttributesCacheEntries;
  861. #define TS_GDIP_IMAGEATTRIBUTES_CACHE_ENTRIES_DEFAULT 2
  862. } TS_GDIPLUS_CACHE_ENTRIES, FAR *PTS_GDIPLUS_CACHE_ENTRIES;
  863. typedef struct tagTS_GDIPLUS_CACHE_CHUNK_SIZE
  864. {
  865. TSUINT16 GdipGraphicsCacheChunkSize;
  866. #define TS_GDIP_GRAPHICS_CACHE_CHUNK_SIZE_DEFAULT 512
  867. TSUINT16 GdipObjectBrushCacheChunkSize;
  868. #define TS_GDIP_BRUSH_CACHE_CHUNK_SIZE_DEFAULT 2*1024
  869. TSUINT16 GdipObjectPenCacheChunkSize;
  870. #define TS_GDIP_PEN_CACHE_CHUNK_SIZE_DEFAULT 1024
  871. TSUINT16 GdipObjectImageAttributesCacheChunkSize;
  872. #define TS_GDIP_IMAGEATTRIBUTES_CACHE_CHUNK_SIZE_DEFAULT 64
  873. } TS_GDIPLUS_CACHE_CHUNK_SIZE, FAR * PTS_GDIPLUS_CACHE_CHUNK_SIZE;
  874. typedef struct tag_TS_GDIPLUS_IMAGE_CACHE_PROPERTIES
  875. {
  876. TSUINT16 GdipObjectImageCacheChunkSize;
  877. #define TS_GDIP_IMAGE_CACHE_CHUNK_SIZE_DEFAULT 4*1024
  878. TSUINT16 GdipObjectImageCacheTotalSize;
  879. #define TS_GDIP_IMAGE_CACHE_TOTAL_SIZE_DEFAULT 256 // In number of chunks
  880. TSUINT16 GdipObjectImageCacheMaxSize;
  881. #define TS_GDIP_IMAGE_CACHE_MAX_SIZE_DEFAULT 128 // In number of chunks
  882. } TS_GDIPLUS_IMAGE_CACHE_PROPERTIES, FAR * PTS_GDIPLUS_IMAGE_CACHE_PROPERTIES;
  883. typedef struct tagTS_DRAW_GDIPLUS_CAPABILITYSET
  884. {
  885. TSUINT16 capabilitySetType;
  886. TSUINT16 lengthCapability;
  887. TSUINT32 drawGdiplusSupportLevel;
  888. #define TS_DRAW_GDIPLUS_DEFAULT 0x0000
  889. #define TS_DRAW_GDIPLUS_SUPPORTED 0x0001
  890. TSUINT32 GdipVersion;
  891. #define TS_GDIPVERSION_DEFAULT 0x0
  892. TSUINT32 drawGdiplusCacheLevel;
  893. #define TS_DRAW_GDIPLUS_CACHE_LEVEL_DEFAULT 0x0
  894. #define TS_DRAW_GDIPLUS_CACHE_LEVEL_ONE 0x1
  895. TS_GDIPLUS_CACHE_ENTRIES GdipCacheEntries;
  896. TS_GDIPLUS_CACHE_CHUNK_SIZE GdipCacheChunkSize;
  897. TS_GDIPLUS_IMAGE_CACHE_PROPERTIES GdipImageCacheProperties;
  898. } TS_DRAW_GDIPLUS_CAPABILITYSET, FAR * PTS_DRAW_GDIPLUS_CAPABILITYSET;
  899. #define ActualSizeToChunkSize(Size, ChunkSize) (((Size) + (ChunkSize - 1)) / ChunkSize)
  900. #endif // DRAW_GDIPLUS
  901. #ifdef DRAW_NINEGRID
  902. /****************************************************************************/
  903. // Structure: TS_DRAW_NINEGRID_CAPABILITYSET
  904. //
  905. // This is the capability set for the draw ninegrid support
  906. /****************************************************************************/
  907. typedef struct tagTS_DRAW_NINEGRID_CAPABILITYSET
  908. {
  909. TSUINT16 capabilitySetType;
  910. TSUINT16 lengthCapability;
  911. TSUINT32 drawNineGridSupportLevel;
  912. #define TS_DRAW_NINEGRID_DEFAULT 0x0000
  913. #define TS_DRAW_NINEGRID_SUPPORTED 0x0001
  914. #define TS_DRAW_NINEGRID_SUPPORTED_REV2 0x0002
  915. // Unlike memory bitmap cache which has fixed bitmap cache entry size,
  916. // drawninegrid bitmap size varies. So, we want to allow both entries
  917. // and cache size be to adjustable
  918. TSUINT16 drawNineGridCacheSize;
  919. #define TS_DRAW_NINEGRID_CACHE_SIZE_DEFAULT 2560 // in KB, 2.5 MB cache memory
  920. TSUINT16 drawNineGridCacheEntries;
  921. #define TS_DRAW_NINEGRID_CACHE_ENTRIES_DEFAULT 256 // 256 cache entries
  922. } TS_DRAW_NINEGRID_CAPABILITYSET, FAR * PTS_DRAW_NINEGRID_CAPABILITYSET;
  923. #endif
  924. /****************************************************************************/
  925. // Structure: TS_VIRTUALCHANNEL_CAPABILITYSET
  926. //
  927. // This is the capability set for virtual channels
  928. /****************************************************************************/
  929. typedef struct tagTS_VIRTUALCHANNEL_CAPABILITYSET
  930. {
  931. TSUINT16 capabilitySetType;
  932. TSUINT16 lengthCapability;
  933. //
  934. // Server and client may adverise different capabilities
  935. // e.g today for scalability reasons C->S is limited to 8K
  936. // but S->C is 64K
  937. //
  938. //
  939. #define TS_VCCAPS_DEFAULT 0x0000
  940. #define TS_VCCAPS_COMPRESSION_64K 0x0001
  941. #define TS_VCCAPS_COMPRESSION_8K 0x0002
  942. TSUINT32 vccaps1;
  943. } TS_VIRTUALCHANNEL_CAPABILITYSET, FAR * PTS_VIRTUALCHANNEL_CAPABILITYSET;
  944. /****************************************************************************/
  945. // TS_COMBINED_CAPABILITIES
  946. /****************************************************************************/
  947. typedef struct tagTS_COMBINED_CAPABILITIES
  948. {
  949. TSUINT16 numberCapabilities;
  950. TSUINT16 pad2octets;
  951. TSUINT8 data[1];
  952. } TS_COMBINED_CAPABILITIES, FAR * PTS_COMBINED_CAPABILITIES;
  953. /****************************************************************************/
  954. // TS_CAPABILITYHEADER
  955. /****************************************************************************/
  956. typedef struct tagTS_CAPABILITYHEADER
  957. {
  958. TSUINT16 capabilitySetType;
  959. TSUINT16 lengthCapability;
  960. } TS_CAPABILITYHEADER, FAR * PTS_CAPABILITYHEADER;
  961. /****************************************************************************/
  962. // TS_FONT_ATTRIBUTE
  963. /****************************************************************************/
  964. typedef struct tagTS_FONT_ATTRIBUTE
  965. {
  966. TSUINT8 faceName[TS_MAX_FACENAME];
  967. TSUINT16 fontAttributeFlags;
  968. #define TS_FONTFLAGS_FIXED_PITCH 0x0001
  969. #define TS_FONTFLAGS_FIXED_SIZE 0x0002
  970. #define TS_FONTFLAGS_ITALIC 0x0004
  971. #define TS_FONTFLAGS_UNDERLINE 0x0008
  972. #define TS_FONTFLAGS_STRIKEOUT 0x0010
  973. #define TS_FONTFLAGS_TRUETYPE 0x0080
  974. #define TS_FONTFLAGS_BASELINE 0x0100
  975. #define TS_FONTFLAGS_UNICODE_COMPLIANT 0x0200
  976. // Cell Height (rather than default Character Height) support.
  977. #define TS_FONTFLAGS_CELLHEIGHT 0x0400
  978. TSUINT16 averageWidth;
  979. TSUINT16 height;
  980. TSUINT16 aspectX;
  981. TSUINT16 aspectY;
  982. TSUINT8 signature1;
  983. #define TS_SIZECALCULATION_HEIGHT 100
  984. #define TS_SIZECALCULATION_WIDTH 100
  985. #define TS_SIG1_RANGE1_FIRST 0x30
  986. #define TS_SIG1_RANGE1_LAST 0x5A
  987. #define TS_SIG1_RANGE2_FIRST 0x24
  988. #define TS_SIG1_RANGE2_LAST 0x26
  989. TSUINT8 signature2;
  990. #define TS_SIG2_RANGE_FIRST 0x20
  991. #define TS_SIG2_RANGE_LAST 0x7E
  992. TSUINT16 signature3;
  993. #define TS_SIG3_RANGE1_FIRST 0x00
  994. #define TS_SIG3_RANGE1_LAST 0x1E
  995. #define TS_SIG3_RANGE2_FIRST 0x80
  996. #define TS_SIG3_RANGE2_LAST 0xFE
  997. TSUINT16 codePage;
  998. #define TS_CODEPAGE_ALLCODEPOINTS 0
  999. #define TS_CODEPAGE_CORECODEPOINTS 255
  1000. TSUINT16 ascent;
  1001. } TS_FONT_ATTRIBUTE, FAR *PTS_FONT_ATTRIBUTE;
  1002. /****************************************************************************/
  1003. // TS_KEYBOARD_EVENT
  1004. //
  1005. // See also the fast-path keyboard format specified below.
  1006. /****************************************************************************/
  1007. typedef struct tagTS_KEYBOARD_EVENT
  1008. {
  1009. TSUINT16 keyboardFlags;
  1010. #define TS_KBDFLAGS_RIGHT 0x0001
  1011. #define TS_KBDFLAGS_QUIET 0x1000
  1012. #define TS_KBDFLAGS_DOWN 0x4000
  1013. #define TS_KBDFLAGS_RELEASE 0x8000
  1014. #define TS_KBDFLAGS_SECONDARY 0x0080
  1015. #define TS_KBDFLAGS_EXTENDED 0x0100
  1016. #define TS_KBDFLAGS_EXTENDED1 0x0200
  1017. #define TS_KBDFLAGS_ALT_DOWN 0x2000
  1018. TSUINT16 keyCode;
  1019. TSUINT16 pad2octets;
  1020. } TS_KEYBOARD_EVENT, FAR *PTS_KEYBOARD_EVENT;
  1021. /****************************************************************************/
  1022. // TS_SYNC_EVENT
  1023. //
  1024. // Sets toggle keys on server.
  1025. // See also the fast-path sync format specified below.
  1026. /****************************************************************************/
  1027. typedef struct tagTS_SYNC_EVENT
  1028. {
  1029. TSUINT16 pad2octets;
  1030. TSUINT32 toggleFlags;
  1031. #define TS_SYNC_KANA_LOCK 8
  1032. #define TS_SYNC_CAPS_LOCK 4
  1033. #define TS_SYNC_NUM_LOCK 2
  1034. #define TS_SYNC_SCROLL_LOCK 1
  1035. } TS_SYNC_EVENT, FAR *PTS_SYNC_EVENT;
  1036. /****************************************************************************/
  1037. // TS_POINTER_EVENT
  1038. //
  1039. // See also the fast-path mouse format specified below.
  1040. /****************************************************************************/
  1041. typedef struct tagTS_POINTER_EVENT
  1042. {
  1043. TSUINT16 pointerFlags;
  1044. // Extensions for wheel-mouse support.
  1045. #define TS_FLAG_MOUSE_WHEEL ((TSUINT16)0x0200)
  1046. #define TS_FLAG_MOUSE_DIRECTION ((TSUINT16)0x0100)
  1047. #define TS_FLAG_MOUSE_ROTATION_MASK ((TSUINT16)0x01FF)
  1048. #define TS_FLAG_MOUSE_DOUBLE ((TSUINT16)0x0400)
  1049. #define TS_FLAG_MOUSE_MOVE ((TSUINT16)0x0800)
  1050. #define TS_FLAG_MOUSE_BUTTON1 ((TSUINT16)0x1000)
  1051. #define TS_FLAG_MOUSE_BUTTON2 ((TSUINT16)0x2000)
  1052. #define TS_FLAG_MOUSE_BUTTON3 ((TSUINT16)0x4000)
  1053. #define TS_FLAG_MOUSE_DOWN ((TSUINT16)0x8000)
  1054. #define TS_FLAG_MOUSEX_BUTTON1 ((TSUINT16)0x0001)
  1055. #define TS_FLAG_MOUSEX_BUTTON2 ((TSUINT16)0x0002)
  1056. #define TS_FLAG_MOUSEX_DOWN ((TSUINT16)0x8000)
  1057. TSINT16 x;
  1058. TSINT16 y;
  1059. } TS_POINTER_EVENT, FAR *PTS_POINTER_EVENT;
  1060. /****************************************************************************/
  1061. // TS_INPUT_EVENT
  1062. //
  1063. // See also the fast-path input event formats specified below.
  1064. /****************************************************************************/
  1065. typedef struct tagTS_INPUT_EVENT
  1066. {
  1067. TSUINT32 eventTime;
  1068. TSUINT16 messageType;
  1069. #define TS_INPUT_EVENT_SYNC 0
  1070. #define TS_INPUT_EVENT_CODEPOINT 1
  1071. #define TS_INPUT_EVENT_VIRTUALKEY 2
  1072. #define TS_INPUT_EVENT_HOTKEY 3
  1073. // Indicates client sends all keyboard input as raw scan codes.
  1074. #define TS_INPUT_EVENT_SCANCODE 4
  1075. // Indivates support for VKPACKET input. This is the same format
  1076. // as TS_INPUT_EVENT_SCANCODE but the meaning is interpreted
  1077. // differently - scancode is a unicode character
  1078. //
  1079. #define TS_INPUT_EVENT_VKPACKET 5
  1080. #define TS_INPUT_EVENT_MOUSE 0x8001
  1081. // MOUSEX allows us to support extended mouse buttons
  1082. // It still implies TS_POINTER_EVENT, but with different flag meanings
  1083. #define TS_INPUT_EVENT_MOUSEX 0x8002
  1084. union
  1085. {
  1086. TS_KEYBOARD_EVENT key;
  1087. TS_POINTER_EVENT mouse;
  1088. TS_SYNC_EVENT sync;
  1089. } u;
  1090. } TS_INPUT_EVENT, FAR * PTS_INPUT_EVENT;
  1091. /****************************************************************************/
  1092. // TS_INPUT_PDU
  1093. //
  1094. // Variable length list of TS_INPUT_EVENTs.
  1095. // See also the fast-path input format specified below.
  1096. /****************************************************************************/
  1097. typedef struct tagTS_INPUT_PDU
  1098. {
  1099. TS_SHAREDATAHEADER shareDataHeader;
  1100. TSUINT16 numberEvents;
  1101. TSUINT16 pad2octets;
  1102. TS_INPUT_EVENT eventList[1];
  1103. } TS_INPUT_PDU, FAR * PTS_INPUT_PDU;
  1104. // Sizes are for an InputPDU with 0 events attached.
  1105. #define TS_INPUTPDU_SIZE (sizeof(TS_INPUT_PDU) - sizeof(TS_INPUT_EVENT))
  1106. #define TS_INPUTPDU_UNCOMP_LEN 8
  1107. /****************************************************************************/
  1108. // Fast-path input codes. Fast-path input is designed to reduce the wire
  1109. // overhead of all the regular input PDU headers, by collapsing all the
  1110. // headers -- including X.224, MCS, encryption, share data, and input --
  1111. // into a bit-packed, optimized bytestream. Total win for a single keydown or
  1112. // keyup: before = 60 bytes, after = 12 bytes, an 80% decrease.
  1113. //
  1114. // Fast-path bytestream format:
  1115. //
  1116. // +--------+------+---------------+-----------+--------+
  1117. // | Header | Size | MAC signature | NumEvents | Events |
  1118. // +--------+------+---------------+-----------+--------+
  1119. //
  1120. // Header: Byte 0. This byte coincides with X.224 RFC1006 header byte 0,
  1121. // which is always 0x03. In fastpath, we collapse three pieces of
  1122. // information into this byte, 2 bits for security, 2 bits for
  1123. // the action (to tell the difference between X.224 and other
  1124. // actions), and 4 bits for a NumEvents field, which holds the
  1125. // number of input events in the packet if in the range 1..15,
  1126. // or 0 if we have a NumEvents field later on.
  1127. //
  1128. // Size: Overall packet length, first byte. The high bit determines
  1129. // what the size of the size field is -- high bit 0 means the size
  1130. // field is the low 7 bits, giving a range 0..127. High bit 1 means
  1131. // the size field is the low 7 bits of this byte, plus the 8 bits of
  1132. // the next byte, in big-endian order (the second byte contains the
  1133. // low-order bits). This encoding scheme is based on ASN.1 PER
  1134. // encoding used in MCS.
  1135. //
  1136. // Encryption signature: 8 bytes for encryption MAC signature of the
  1137. // encrypted payload.
  1138. //
  1139. // NumEvents: If the header byte NumEvents is 0, there is a 1-byte field
  1140. // here containing up to 256 for NumEvents.
  1141. //
  1142. // Bytestream input events: These correspond to the same event types already
  1143. // defined for TS_INPUT_EVENT above, optimized for small size.
  1144. // In each of the events following, there is at least one byte, where
  1145. // the high 3 bits are the event type, and the bottom 5 bits are flags.
  1146. // Additionally, each order type can use a defined number of extra bytes.
  1147. // Descriptions of the event formats follow.
  1148. //
  1149. // Keyboard: 2 bytes. Byte 0 contains the event type, plus special
  1150. // extended and release flags. Byte 1 is the scan code.
  1151. // Mouse: 7 bytes. Byte 0 contains only the event type. Bytes 1-6 contain
  1152. // the same contents as a normal TS_POINTER_EVENT.
  1153. // Sync: 1 byte. Byte 0 is the event type plus the regular sync flags.
  1154. /****************************************************************************/
  1155. // Masks for first-byte bits.
  1156. #define TS_INPUT_FASTPATH_ACTION_MASK 0x03
  1157. #define TS_INPUT_FASTPATH_NUMEVENTS_MASK 0x3C
  1158. #define TS_INPUT_FASTPATH_ENCRYPTION_MASK 0xC0
  1159. // Encryption settings
  1160. #define TS_INPUT_FASTPATH_ENCRYPTED 0x80
  1161. //
  1162. // Encrypted checksum packet
  1163. //
  1164. #define TS_INPUT_FASTPATH_SECURE_CHECKSUM 0x40
  1165. // 2 values here for future expansion.
  1166. #define TS_INPUT_FASTPATH_ACTION_FASTPATH 0x0
  1167. #define TS_INPUT_FASTPATH_ACTION_X224 0x3
  1168. // Event mask and type for each event in input.
  1169. // Event is encoded into high 3 bits of first byte.
  1170. // 4 values here for future expansion.
  1171. #define TS_INPUT_FASTPATH_EVENT_MASK 0xE0
  1172. #define TS_INPUT_FASTPATH_FLAGS_MASK 0x1F
  1173. #define TS_INPUT_FASTPATH_EVENT_KEYBOARD 0x00
  1174. #define TS_INPUT_FASTPATH_EVENT_MOUSE 0x20
  1175. #define TS_INPUT_FASTPATH_EVENT_MOUSEX 0x40
  1176. #define TS_INPUT_FASTPATH_EVENT_SYNC 0x60
  1177. #define TS_INPUT_FASTPATH_EVENT_VKPACKET 0x80
  1178. // Fastpath keyboard flags. These are set to be the same values as the server
  1179. // driver KEY_BREAK, KEY_E0, and KEY_E1 to simplify translation to kernel
  1180. // input event.
  1181. #define TS_INPUT_FASTPATH_KBD_RELEASE 0x01
  1182. #define TS_INPUT_FASTPATH_KBD_EXTENDED 0x02
  1183. #define TS_INPUT_FASTPATH_KBD_EXTENDED1 0x04
  1184. /****************************************************************************/
  1185. /* Structure: TS_CONFIRM_ACTIVE_PDU */
  1186. /****************************************************************************/
  1187. typedef struct tagTS_CONFIRM_ACTIVE_PDU
  1188. {
  1189. TS_SHARECONTROLHEADER shareControlHeader;
  1190. TS_SHAREID shareID;
  1191. TSUINT16 originatorID;
  1192. TSUINT16 lengthSourceDescriptor;
  1193. TSUINT16 lengthCombinedCapabilities;
  1194. // Source descriptor and Caps start here.
  1195. TSUINT8 data[1];
  1196. } TS_CONFIRM_ACTIVE_PDU, FAR * PTS_CONFIRM_ACTIVE_PDU;
  1197. /****************************************************************************/
  1198. /* Size of Confirm Active without the data. 6 is the 3 UINT16's. */
  1199. /****************************************************************************/
  1200. #define TS_CA_NON_DATA_SIZE (sizeof(TS_SHARECONTROLHEADER) + \
  1201. sizeof(TS_SHAREID) + 6)
  1202. /****************************************************************************/
  1203. /* Structure: TS_DEMAND_ACTIVE_PDU */
  1204. /****************************************************************************/
  1205. typedef struct tagTS_DEMAND_ACTIVE_PDU
  1206. {
  1207. TS_SHARECONTROLHEADER shareControlHeader;
  1208. TS_SHAREID shareID;
  1209. TSUINT16 lengthSourceDescriptor;
  1210. TSUINT16 lengthCombinedCapabilities;
  1211. // Source descriptor and Caps start here.
  1212. TSUINT8 data[1];
  1213. } TS_DEMAND_ACTIVE_PDU, FAR * PTS_DEMAND_ACTIVE_PDU;
  1214. /****************************************************************************/
  1215. /* Structure: TS_SERVER_CERTIFICATE_PDU */
  1216. /* */
  1217. /* Description: Used during shadowing to send the target server's cert + */
  1218. /* random to the client server. */
  1219. /****************************************************************************/
  1220. typedef struct tagTS_SERVER_CERTIFICATE_PDU
  1221. {
  1222. TS_SHARECONTROLHEADER shareControlHeader;
  1223. TSUINT16 pad1;
  1224. TSUINT32 encryptionMethod;
  1225. TSUINT32 encryptionLevel;
  1226. TSUINT32 shadowRandomLen;
  1227. TSUINT32 shadowCertLen;
  1228. // server random followed by server cert start here
  1229. TSUINT8 data[1];
  1230. } TS_SERVER_CERTIFICATE_PDU, FAR * PTS_SERVER_CERTIFICATE_PDU;
  1231. /****************************************************************************/
  1232. /* Structure: TS_CLIENT_RANDOM_PDU */
  1233. /* */
  1234. /* Description: Used during shadowing to send the client's encrypted random */
  1235. /* back to the shadow target server. */
  1236. /****************************************************************************/
  1237. typedef struct tagTS_CLIENT_RANDOM_PDU
  1238. {
  1239. TS_SHARECONTROLHEADER shareControlHeader;
  1240. TSUINT16 pad1;
  1241. TSUINT32 clientRandomLen;
  1242. // client random starts here
  1243. TSUINT8 data[1];
  1244. } TS_CLIENT_RANDOM_PDU, FAR * PTS_CLIENT_RANDOM_PDU;
  1245. /****************************************************************************/
  1246. /* Structure: TS_REQUEST_ACTIVE_PDU */
  1247. /****************************************************************************/
  1248. typedef struct tagTS_REQUEST_ACTIVE_PDU
  1249. {
  1250. TS_SHARECONTROLHEADER shareControlHeader;
  1251. TSUINT16 lengthSourceDescriptor;
  1252. TSUINT16 lengthCombinedCapabilities;
  1253. // Source descriptor and Caps start here.
  1254. TSUINT8 data[1];
  1255. } TS_REQUEST_ACTIVE_PDU, FAR * PTS_REQUEST_ACTIVE_PDU;
  1256. /****************************************************************************/
  1257. /* Structure: TS_DEACTIVATE_ALL_PDU */
  1258. /****************************************************************************/
  1259. typedef struct tagTS_DEACTIVATE_ALL_PDU
  1260. {
  1261. TS_SHARECONTROLHEADER shareControlHeader;
  1262. TS_SHAREID shareID;
  1263. TSUINT16 lengthSourceDescriptor;
  1264. TSUINT8 sourceDescriptor[1];
  1265. } TS_DEACTIVATE_ALL_PDU, FAR * PTS_DEACTIVATE_ALL_PDU;
  1266. /****************************************************************************/
  1267. /* Structure: TS_DEACTIVATE_OTHER_PDU */
  1268. /****************************************************************************/
  1269. typedef struct tagTS_DEACTIVATE_OTHER_PDU
  1270. {
  1271. TS_SHARECONTROLHEADER shareControlHeader;
  1272. TS_SHAREID shareID;
  1273. TSUINT16 deactivateID;
  1274. TSUINT16 lengthSourceDescriptor;
  1275. TSUINT8 sourceDescriptor[1];
  1276. } TS_DEACTIVATE_OTHER_PDU, FAR * PTS_DEACTIVATE_OTHER_PDU;
  1277. /****************************************************************************/
  1278. /* Structure: TS_DEACTIVATE_SELF_PDU */
  1279. /****************************************************************************/
  1280. typedef struct tagTS_DEACTIVATE_SELF_PDU
  1281. {
  1282. TS_SHARECONTROLHEADER shareControlHeader;
  1283. TS_SHAREID shareID;
  1284. } TS_DEACTIVATE_SELF_PDU, FAR * PTS_DEACTIVATE_SELF_PDU;
  1285. /****************************************************************************/
  1286. /* Structure: TS_SYNCHRONIZE_PDU */
  1287. /****************************************************************************/
  1288. typedef struct tagTS_SYNCHRONIZE_PDU
  1289. {
  1290. TS_SHAREDATAHEADER shareDataHeader;
  1291. TSUINT16 messageType;
  1292. #define TS_SYNCMSGTYPE_SYNC 1
  1293. TSUINT16 targetUser;
  1294. } TS_SYNCHRONIZE_PDU, FAR * PTS_SYNCHRONIZE_PDU;
  1295. #define TS_SYNC_PDU_SIZE sizeof(TS_SYNCHRONIZE_PDU)
  1296. #define TS_SYNC_UNCOMP_LEN 8
  1297. /****************************************************************************/
  1298. /* Structure: TS_CONTROL_PDU */
  1299. /****************************************************************************/
  1300. typedef struct tagTS_CONTROL_PDU
  1301. {
  1302. TS_SHAREDATAHEADER shareDataHeader;
  1303. TSUINT16 action;
  1304. #define TS_CTRLACTION_FIRST 1
  1305. #define TS_CTRLACTION_REQUEST_CONTROL 1
  1306. #define TS_CTRLACTION_GRANTED_CONTROL 2
  1307. #define TS_CTRLACTION_DETACH 3
  1308. #define TS_CTRLACTION_COOPERATE 4
  1309. #define TS_CTRLACTION_LAST 4
  1310. TSUINT16 grantId;
  1311. TSUINT32 controlId;
  1312. } TS_CONTROL_PDU, FAR * PTS_CONTROL_PDU;
  1313. #define TS_CONTROL_PDU_SIZE sizeof(TS_CONTROL_PDU)
  1314. #define TS_CONTROL_UNCOMP_LEN 12
  1315. /****************************************************************************/
  1316. /* Structure: TS_FLOW_PDU */
  1317. /****************************************************************************/
  1318. typedef struct tagTS_FLOW_PDU
  1319. {
  1320. TSUINT16 flowMarker;
  1321. #define TS_FLOW_MARKER 0x8000
  1322. TSUINT16 pduType; /* also includes protocol version */
  1323. #define TS_PDUTYPE_FLOWTESTPDU 65
  1324. #define TS_PDUTYPE_FLOWRESPONSEPDU 66
  1325. #define TS_PDUTYPE_FLOWSTOPPDU 67
  1326. TSUINT8 flowIdentifier;
  1327. #define TS_MAX_FLOWIDENTIFIER 127
  1328. TSUINT8 flowNumber;
  1329. TSUINT16 pduSource;
  1330. } TS_FLOW_PDU, FAR * PTS_FLOW_PDU;
  1331. #define TS_FLOW_PDU_SIZE sizeof(TS_FLOW_PDU)
  1332. /****************************************************************************/
  1333. /* Structure: TS_FONT_PDU */
  1334. /****************************************************************************/
  1335. typedef struct tagTS_FONT_PDU
  1336. {
  1337. TS_SHAREDATAHEADER shareDataHeader;
  1338. TSUINT16 numberFonts;
  1339. TSUINT16 entrySize;
  1340. TS_FONT_ATTRIBUTE fontList[1];
  1341. } TS_FONT_PDU, FAR * PTS_FONT_PDU;
  1342. /****************************************************************************/
  1343. /* Structure: TS_FONT_LIST_PDU */
  1344. /****************************************************************************/
  1345. typedef struct tagTS_FONT_LIST_PDU
  1346. {
  1347. TS_SHAREDATAHEADER shareDataHeader;
  1348. TSUINT16 numberFonts;
  1349. TSUINT16 totalNumFonts;
  1350. #define TS_FONTLIST_FIRST 0x0001
  1351. #define TS_FONTLIST_LAST 0x0002
  1352. TSUINT16 listFlags;
  1353. TSUINT16 entrySize;
  1354. TS_FONT_ATTRIBUTE fontList[1];
  1355. } TS_FONT_LIST_PDU, FAR * PTS_FONT_LIST_PDU;
  1356. /****************************************************************************/
  1357. /* Structure: TS_FONTTABLE_ENTRY */
  1358. /****************************************************************************/
  1359. typedef struct tagTS_FONTTABLE_ENTRY
  1360. {
  1361. TSUINT16 serverFontID;
  1362. TSUINT16 clientFontID;
  1363. } TS_FONTTABLE_ENTRY, FAR * PTS_FONTTABLE_ENTRY;
  1364. /****************************************************************************/
  1365. /* Structure: TS_FONT_MAP_PDU */
  1366. /* */
  1367. /* Description: Font mapping table (sent from server to client) */
  1368. /****************************************************************************/
  1369. typedef struct tagTS_FONT_MAP_PDU_DATA
  1370. {
  1371. TSUINT16 numberEntries;
  1372. TSUINT16 totalNumEntries;
  1373. #define TS_FONTMAP_FIRST 0x0001
  1374. #define TS_FONTMAP_LAST 0x0002
  1375. TSUINT16 mapFlags;
  1376. TSUINT16 entrySize;
  1377. TS_FONTTABLE_ENTRY fontTable[1];
  1378. } TS_FONT_MAP_PDU_DATA, FAR * PTS_FONT_MAP_PDU_DATA;
  1379. typedef struct tagTS_FONT_MAP_PDU
  1380. {
  1381. TS_SHAREDATAHEADER shareDataHeader;
  1382. TS_FONT_MAP_PDU_DATA data;
  1383. } TS_FONT_MAP_PDU, FAR * PTS_FONT_MAP_PDU;
  1384. /****************************************************************************/
  1385. // Fast-path output codes. Fast-path output is designed to reduce the wire
  1386. // overhead of all the server-to-client output "packages." These packages
  1387. // can contain one or more of the following PDU types, each of which is
  1388. // individually compressed (if compression is enabled):
  1389. //
  1390. // Mouse pointers (TS_POINTER_PDU_DATA)
  1391. // Output sync (No PDU body in fastpath version)
  1392. // Orders (TS_UPDATE_ORDERS_PDU_DATA - fastpath version)
  1393. // Screen data (TS_UPDATE_BITMAP_PDU_DATA)
  1394. // Palettes (TS_UPDATE_PALETTE_PDU_DATA)
  1395. //
  1396. // The contents of the package can also be encrypted if high encryption
  1397. // is enabled.
  1398. //
  1399. // Fast-path output collapses a whole series of headers -- including X.224,
  1400. // MCS, encryption, and TS_SHAREDATAHEADERs included on each individual
  1401. // update PDU subpacket included in the package. It also defines a
  1402. // slightly different version of the original TS_UPDATE_XXX_PDU_DATA structs
  1403. // which optimize the TS_UPDATE_HDR space and combine the information
  1404. // into other headers in a bit-packed form.
  1405. //
  1406. // Fast-path bytestream format:
  1407. //
  1408. // +--------+------+---------------+-------------------------+
  1409. // | Header | Size | MAC signature | One or more update PDUs |
  1410. // +--------+------+---------------+-------------------------+
  1411. //
  1412. // Header: Byte 0. This byte coincides with X.224 RFC1006 header byte 0,
  1413. // which is always 0x03. In fastpath, we collapse two pieces of
  1414. // information into this byte, 2 bits for security, 2 bits for
  1415. // the action (to tell the difference between X.224 and other
  1416. // actions), and 4 bits currently unused but set to zero for possible
  1417. // future use.
  1418. //
  1419. // Size: Overall packet length, first byte. The high bit determines
  1420. // what the size of the size field is -- high bit 0 means the size
  1421. // field is the low 7 bits, giving a range 0..127. High bit 1 means
  1422. // the size field is the low 7 bits of this byte, plus the 8 bits of
  1423. // the next byte, in big-endian order (the second byte contains the
  1424. // low-order bits). This encoding scheme is based on ASN.1 PER
  1425. // encoding used in MCS.
  1426. //
  1427. // Encryption signature: 8 bytes for encryption MAC signature of the
  1428. // encrypted payload, if encryption enabled.
  1429. //
  1430. // Update PDU format:
  1431. //
  1432. // +--------+-------------------+------+-------------+
  1433. // | Header | Compression flags | Size | Update data |
  1434. // +--------+-------------------+------+-------------+
  1435. //
  1436. // Header: 1 byte. Contains two pieces of information, the update type
  1437. // (TS_UPDATETYPE_XXX values) and a compression-used flag. If
  1438. // compression-used is set, the next byte is a set of compression flags.
  1439. //
  1440. // Compression flags: Identical to the usage defined compress.h. Optional
  1441. // byte -- if compression is not enabled on the session, it is not
  1442. // included.
  1443. //
  1444. // Size: 2-byte size in little-endian (Intel) byte ordering. Fixed size
  1445. // to allow update PDU header length to be determined before encoding
  1446. // starting in the next byte after this field. Note that this is the
  1447. // size of the data following this field -- if compression
  1448. // is used the size is the compressed size.
  1449. //
  1450. // Update data: Formats as defined for individual PDUs. Some
  1451. // formats match the non-fast-path formats for low-frequency packets,
  1452. // others are special newer formats that collapse even more headers.
  1453. /****************************************************************************/
  1454. // Masks for first-byte bits.
  1455. #define TS_OUTPUT_FASTPATH_ACTION_MASK 0x03
  1456. #define TS_OUTPUT_FASTPATH_UNUSED_MASK 0x3C
  1457. #define TS_OUTPUT_FASTPATH_ENCRYPTION_MASK 0xC0
  1458. // Encryption flags
  1459. #define TS_OUTPUT_FASTPATH_ENCRYPTED 0x80
  1460. #define TS_OUTPUT_FASTPATH_SECURE_CHECKSUM 0x40
  1461. // 2 values here for future expansion.
  1462. #define TS_OUTPUT_FASTPATH_ACTION_FASTPATH 0x0
  1463. #define TS_OUTPUT_FASTPATH_ACTION_X224 0x3
  1464. // Masks and values for update PDU header byte.
  1465. // 11 values empty in update type field for future expansion of PDUs in
  1466. // packages. 1 extra bit available in compression flags for future
  1467. // expansion. 2 extra bits unused but available for future use.
  1468. #define TS_OUTPUT_FASTPATH_UPDATETYPE_MASK 0x0F
  1469. #define TS_OUTPUT_FASTPATH_UPDATE_COMPRESSION_MASK 0xC0
  1470. #define TS_OUTPUT_FASTPATH_COMPRESSION_USED 0x80
  1471. /****************************************************************************/
  1472. // TS_MONOPOINTERATTRIBUTE
  1473. /****************************************************************************/
  1474. typedef struct tagTS_MONOPOINTERATTRIBUTE
  1475. {
  1476. TS_POINT16 hotSpot;
  1477. TSUINT16 width;
  1478. TSUINT16 height;
  1479. TSUINT16 lengthPointerData;
  1480. TSUINT8 monoPointerData[1];
  1481. } TS_MONOPOINTERATTRIBUTE, FAR * PTS_MONOPOINTERATTRIBUTE;
  1482. /****************************************************************************/
  1483. // TS_COLORPOINTERATTRIBUTE
  1484. //
  1485. // 24bpp color pointer.
  1486. /****************************************************************************/
  1487. typedef struct tagTS_COLORPOINTERATTRIBUTE
  1488. {
  1489. TSUINT16 cacheIndex;
  1490. TS_POINT16 hotSpot;
  1491. TSUINT16 width;
  1492. TSUINT16 height;
  1493. TSUINT16 lengthANDMask;
  1494. TSUINT16 lengthXORMask;
  1495. TSUINT8 colorPointerData[1];
  1496. } TS_COLORPOINTERATTRIBUTE, FAR * PTS_COLORPOINTERATTRIBUTE;
  1497. /****************************************************************************/
  1498. // TS_POINTERATTRIBUTE
  1499. //
  1500. // Variable color depth pointer.
  1501. /****************************************************************************/
  1502. typedef struct tagTS_POINTERATTRIBUTE
  1503. {
  1504. TSUINT16 XORBpp;
  1505. TS_COLORPOINTERATTRIBUTE colorPtrAttr;
  1506. } TS_POINTERATTRIBUTE, FAR * PTS_POINTERATTRIBUTE;
  1507. /****************************************************************************/
  1508. // TS_POINTER_PDU
  1509. //
  1510. // Container definition for various mouse pointer types.
  1511. // See also the fast-path output pointer definitions and types defined below.
  1512. /****************************************************************************/
  1513. typedef struct tagTS_POINTER_PDU_DATA
  1514. {
  1515. TSUINT16 messageType;
  1516. #define TS_PTRMSGTYPE_SYSTEM 1
  1517. #define TS_PTRMSGTYPE_MONO 2
  1518. #define TS_PTRMSGTYPE_POSITION 3
  1519. #define TS_PTRMSGTYPE_COLOR 6
  1520. #define TS_PTRMSGTYPE_CACHED 7
  1521. #define TS_PTRMSGTYPE_POINTER 8
  1522. TSUINT16 pad2octets;
  1523. union
  1524. {
  1525. TSUINT32 systemPointerType;
  1526. #define TS_SYSPTR_NULL 0
  1527. #define TS_SYSPTR_DEFAULT 0x7f00
  1528. TS_MONOPOINTERATTRIBUTE monoPointerAttribute;
  1529. TS_COLORPOINTERATTRIBUTE colorPointerAttribute;
  1530. TS_POINTERATTRIBUTE pointerAttribute;
  1531. TSUINT16 cachedPointerIndex;
  1532. TS_POINT16 pointerPosition;
  1533. } pointerData;
  1534. } TS_POINTER_PDU_DATA, FAR * PTS_POINTER_PDU_DATA;
  1535. typedef struct tagTS_POINTER_PDU
  1536. {
  1537. TS_SHAREDATAHEADER shareDataHeader;
  1538. TS_POINTER_PDU_DATA data;
  1539. } TS_POINTER_PDU, FAR * PTS_POINTER_PDU;
  1540. #define TS_POINTER_PDU_SIZE sizeof(TS_POINTER_PDU)
  1541. /****************************************************************************/
  1542. // Fast-path output for mouse pointers - overview.
  1543. //
  1544. // We use the fast-path header packet type to contain the mouse pointer
  1545. // update type explicitly. This allows us to collapse headers inside the
  1546. // TS_POINTER_PDU definition. Following are format descriptions for each
  1547. // pointer update type:
  1548. //
  1549. // TS_UPDATETYPE_MOUSEPTR_SYSTEM_NULL: Replaces systemPointerType ==
  1550. // TS_SYSPTR_NULL. Payload is zero bytes.
  1551. //
  1552. // TS_UPDATETYPE_MOUSEPTR_SYSTEM_DEFAULT: Replaces systemPointerType ==
  1553. // TS_SYSPTR_DEFAULT. Zero-byte payload.
  1554. //
  1555. // TS_UPDATETYPE_MOUSEPTR_MONO: Payload is TS_MONOPOINTERATTRIBUTE.
  1556. //
  1557. // TS_UPDATETYPE_MOUSEPTR_POSITION: Payload is a TS_POINT16.
  1558. //
  1559. // TS_UPDATETYPE_MOUSEPTR_COLOR: Payload is TS_COLORPOINTERATTRIBUTE.
  1560. //
  1561. // TS_UPDATETYPE_MOUSEPTR_CACHED: Payload is TSUINT16 cachedPointerIndex.
  1562. //
  1563. // TS_UPDATETYPE_MOUSEPTR_POINTER: Payload is TS_POINTERATTRIBUTE.
  1564. /****************************************************************************/
  1565. /****************************************************************************/
  1566. // Update types, used by TS_UPDATE_HDR and fast-path output.
  1567. /****************************************************************************/
  1568. #define TS_UPDATETYPE_ORDERS 0
  1569. #define TS_UPDATETYPE_BITMAP 1
  1570. #define TS_UPDATETYPE_PALETTE 2
  1571. #define TS_UPDATETYPE_SYNCHRONIZE 3
  1572. // Fast-path-only mouse pointer types, see fast-path output pointer
  1573. // description above.
  1574. #define TS_UPDATETYPE_MOUSEPTR_SYSTEM_NULL 5
  1575. #define TS_UPDATETYPE_MOUSEPTR_SYSTEM_DEFAULT 6
  1576. #define TS_UPDATETYPE_MOUSEPTR_MONO 7
  1577. #define TS_UPDATETYPE_MOUSEPTR_POSITION 8
  1578. #define TS_UPDATETYPE_MOUSEPTR_COLOR 9
  1579. #define TS_UPDATETYPE_MOUSEPTR_CACHED 10
  1580. #define TS_UPDATETYPE_MOUSEPTR_POINTER 11
  1581. /****************************************************************************/
  1582. /* Structure: TS_UPDATE_HDR */
  1583. /****************************************************************************/
  1584. typedef struct tagTS_UPDATE_HDR_DATA
  1585. {
  1586. TSUINT16 updateType;
  1587. TSUINT16 pad2octets;
  1588. } TS_UPDATE_HDR_DATA, FAR * PTS_UPDATE_HDR_DATA;
  1589. typedef struct tagTS_UPDATE_HDR
  1590. {
  1591. TS_SHAREDATAHEADER shareDataHeader;
  1592. TS_UPDATE_HDR_DATA data;
  1593. } TS_UPDATE_HDR, FAR * PTS_UPDATE_HDR;
  1594. /****************************************************************************/
  1595. /* Structure: TS_BITMAP_DATA */
  1596. /* */
  1597. /* Description: Data for a single rectangle in a BitmapUpdatePDU */
  1598. /* Note: bitsPerPixel is included for backwards compatibility, although it */
  1599. /* is the same for every rectangle sent. */
  1600. /****************************************************************************/
  1601. typedef struct tagTS_BITMAP_DATA
  1602. {
  1603. TSINT16 destLeft;
  1604. TSINT16 destTop;
  1605. TSINT16 destRight;
  1606. TSINT16 destBottom;
  1607. TSUINT16 width;
  1608. TSUINT16 height;
  1609. TSUINT16 bitsPerPixel;
  1610. TSBOOL16 compressedFlag;
  1611. // Bit 1: TS_BITMAP_COMPRESSION Bitmap data is compressed or not
  1612. // Bit 10: TS_EXTRA_NO_BITMAP_COMPRESSION_HDR indicates if the compressed
  1613. // bitmap data contains the redundant BC header or not. Note this
  1614. // value is defined in REV2 bitmap extraflags value for consistency.
  1615. #define TS_BITMAP_COMPRESSION 0x0001
  1616. TSUINT16 bitmapLength;
  1617. TSUINT8 bitmapData[1]; /* variable length field */
  1618. } TS_BITMAP_DATA, FAR * PTS_BITMAP_DATA;
  1619. /****************************************************************************/
  1620. /* Structure: TS_UPDATE_BITMAP_PDU */
  1621. /****************************************************************************/
  1622. typedef struct tagTS_UPDATE_BITMAP_PDU_DATA
  1623. {
  1624. TSUINT16 updateType; /* See TS_UPDATE_HDR */
  1625. TSUINT16 numberRectangles;
  1626. TS_BITMAP_DATA rectangle[1];
  1627. } TS_UPDATE_BITMAP_PDU_DATA, FAR * PTS_UPDATE_BITMAP_PDU_DATA;
  1628. typedef struct tagTS_UPDATE_BITMAP_PDU
  1629. {
  1630. TS_SHAREDATAHEADER shareDataHeader;
  1631. TS_UPDATE_BITMAP_PDU_DATA data;
  1632. } TS_UPDATE_BITMAP_PDU, FAR * PTS_UPDATE_BITMAP_PDU;
  1633. /****************************************************************************/
  1634. /* Structure: TS_UPDATE_CAPABILITYSET */
  1635. /****************************************************************************/
  1636. typedef struct tagTS_UPDATE_CAPABILITYSET
  1637. {
  1638. TS_BITMAP_CAPABILITYSET bitmapCapabilitySet;
  1639. } TS_UPDATE_CAPABILITYSET, FAR * PTS_UPDATE_CAPABILITYSET;
  1640. /****************************************************************************/
  1641. /* Structure: TS_UPDATE_CAPABILITY_PDU */
  1642. /****************************************************************************/
  1643. typedef struct tagTS_UPDATE_CAPABILITY_PDU
  1644. {
  1645. TS_SHAREDATAHEADER shareDataHeader;
  1646. TS_UPDATE_CAPABILITYSET updateCapabilitySet;
  1647. } TS_UPDATE_CAPABILITY_PDU, FAR * PTS_UPDATE_CAPABILITY_PDU;
  1648. /****************************************************************************/
  1649. // TS_UPDATE_ORDERS_PDU
  1650. //
  1651. // Variable size UpdateOrdersPDU.
  1652. // See also the fastpath version described below.
  1653. /****************************************************************************/
  1654. typedef struct tagTS_UPDATE_ORDERS_PDU_DATA
  1655. {
  1656. TSUINT16 updateType; /* See TS_UPDATE_HDR */
  1657. TSUINT16 pad2octetsA;
  1658. TSUINT16 numberOrders;
  1659. TSUINT16 pad2octetsB;
  1660. TSUINT8 orderList[1];
  1661. } TS_UPDATE_ORDERS_PDU_DATA, FAR * PTS_UPDATE_ORDERS_PDU_DATA;
  1662. typedef struct tagTS_UPDATE_ORDERS_PDU
  1663. {
  1664. TS_SHAREDATAHEADER shareDataHeader;
  1665. TS_UPDATE_ORDERS_PDU_DATA data;
  1666. } TS_UPDATE_ORDERS_PDU, FAR * PTS_UPDATE_ORDERS_PDU;
  1667. /****************************************************************************/
  1668. // TS_UPDATE_ORDERS_PDU_DATA - fast-path bytestream version
  1669. //
  1670. // Rather than waste 6 of the 8 header bytes in the TS_UPDATE_ORDERS_PDU_DATA
  1671. // (updateType is already known in the fastpath header), we simply define
  1672. // a new optimized version: numberOrders is a 2-byte little-endian (Intel)
  1673. // format field preceding the bytestream of encoded orders.
  1674. /****************************************************************************/
  1675. /****************************************************************************/
  1676. /* Structure: TS_COLOR */
  1677. /****************************************************************************/
  1678. typedef struct tagTS_COLOR
  1679. {
  1680. TSUINT8 red;
  1681. TSUINT8 green;
  1682. TSUINT8 blue;
  1683. } TS_COLOR, FAR * PTS_COLOR;
  1684. /****************************************************************************/
  1685. /* Structure: TS_COLOR_QUAD */
  1686. /****************************************************************************/
  1687. typedef struct tagTS_COLOR_QUAD
  1688. {
  1689. TSUINT8 red;
  1690. TSUINT8 green;
  1691. TSUINT8 blue;
  1692. TSUINT8 pad1octet;
  1693. } TS_COLOR_QUAD, FAR * PTS_COLOR_QUAD;
  1694. /****************************************************************************/
  1695. // TS_ORDER_HEADER
  1696. //
  1697. // There are several types of orders available using this control flag byte.
  1698. // They include:
  1699. //
  1700. // Primary orders: Denoted by the lower two control bits 01 meaning
  1701. // TS_STANDARD but not TS_SECONDARY. Primary orders are field encoded
  1702. // using the OE2 encoding logic on the server and the OD logic on the
  1703. // client. See oe2.h in the server code for field encoding rules.
  1704. // The upper six bits of the control byte are used for further information
  1705. // about the field encoding.
  1706. //
  1707. // Secondary orders: Denoted by low 2 control bits 11 meaning TS_STANDARD |
  1708. // TS_SECONDARY. The upper 6 bits are not used. Followed by the next 5
  1709. // bytes of the TS_SECONDARY_ORDER_HEADER definition, then followed by
  1710. // order-specific data.
  1711. //
  1712. // Alternate secondary orders: Introduced in RDP 5.1, these orders are
  1713. // denoted by low 2 control bits 10, meaning TS_SECONDARY but not
  1714. // TS_STANDARD. The upper 6 bits are used to encode the order type; the
  1715. // order format following the control byte is order-specific but not field
  1716. // encoded. This order type was introduced to overcome the wastefulness
  1717. // inherent in the secondary order header, allowing nonstandard secondary
  1718. // orders to follow whatever form best suits the data being carried.
  1719. //
  1720. // Control flag low 2 bit value 00 is not used in RDP 4.0, 5.0, or 5.1,
  1721. // but is reserved for future use.
  1722. /****************************************************************************/
  1723. #define TS_STANDARD 1
  1724. #define TS_SECONDARY 2
  1725. #define TS_BOUNDS 4
  1726. #define TS_TYPE_CHANGE 8
  1727. #define TS_DELTA_COORDINATES 16
  1728. // Indicates that there are zero modified bounds coordinates.
  1729. // Used in conjunction with the TS_BOUNDS flags, the presence of this flag
  1730. // means that there is no subsequent byte for the bounds fields (it would be
  1731. // zero).
  1732. #define TS_ZERO_BOUNDS_DELTAS 32
  1733. // T.128 extension: two bits that contain the number of consecutive
  1734. // field encoding bytes that are zero. When these bits indicate that
  1735. // there are zero-value field bytes, the corresponding bytes are not
  1736. // sent. The count is for consecutive zeros from the last byte
  1737. // scanning backwards (the non-zero bytes normally appear at the
  1738. // beginning).
  1739. //
  1740. // Example: order that has three field encoding bytes
  1741. //
  1742. // field encoding bytes: 0x20 0x00 0x00
  1743. //
  1744. // There are two zeros (counting from the end backwards), so the
  1745. // control flags contain 0x80 (0x02 << 6), and the order is sent with
  1746. // just 0x20. We therefore save sending the two bytes.
  1747. #define TS_ZERO_FIELD_BYTE_BIT0 64
  1748. #define TS_ZERO_FIELD_BYTE_BIT1 128
  1749. #define TS_ZERO_FIELD_COUNT_SHIFT 6
  1750. #define TS_ZERO_FIELD_COUNT_MASK 0xC0
  1751. // Alternate secondary order mask and shift values for the order type.
  1752. #define TS_ALTSEC_ORDER_TYPE_MASK 0xFC
  1753. #define TS_ALTSEC_ORDER_TYPE_SHIFT 2
  1754. typedef struct tagTS_ORDER_HEADER
  1755. {
  1756. TSUINT8 controlFlags;
  1757. } TS_ORDER_HEADER, FAR *PTS_ORDER_HEADER;
  1758. /****************************************************************************/
  1759. // TS_SECONDARY_ORDER_HEADER
  1760. /****************************************************************************/
  1761. #define TS_CACHE_BITMAP_UNCOMPRESSED 0
  1762. #define TS_CACHE_COLOR_TABLE 1
  1763. #define TS_CACHE_BITMAP_COMPRESSED 2
  1764. #define TS_CACHE_GLYPH 3
  1765. #define TS_CACHE_BITMAP_UNCOMPRESSED_REV2 4
  1766. #define TS_CACHE_BITMAP_COMPRESSED_REV2 5
  1767. #define TS_STREAM_BITMAP 6
  1768. #define TS_CACHE_BRUSH 7
  1769. #define TS_NUM_SECONDARY_ORDERS 8
  1770. typedef struct tagTS_SECONDARY_ORDER_HEADER
  1771. {
  1772. TS_ORDER_HEADER orderHdr;
  1773. TSUINT16 orderLength;
  1774. // This field was used in RDP 4.0 to hold TS_EXTRA_SECONDARY, but was
  1775. // re-tasked to allow secondary orders to use these two bytes as encoding
  1776. // bytes and flags.
  1777. TSUINT16 extraFlags;
  1778. TSUINT8 orderType;
  1779. } TS_SECONDARY_ORDER_HEADER, FAR *PTS_SECONDARY_ORDER_HEADER;
  1780. /****************************************************************************/
  1781. /* The calculation of the value to store in the orderLength field of */
  1782. /* TS_SECONDARY_ORDER_HEADER is non-trivial. Hence we provide some macros */
  1783. /* to make life easier. */
  1784. /****************************************************************************/
  1785. #define TS_SECONDARY_ORDER_LENGTH_FUDGE_FACTOR 8
  1786. #define TS_SECONDARY_ORDER_LENGTH_ADJUSTMENT \
  1787. (sizeof(TS_SECONDARY_ORDER_HEADER) - \
  1788. FIELDSIZE(TS_SECONDARY_ORDER_HEADER, orderType) + \
  1789. TS_SECONDARY_ORDER_LENGTH_FUDGE_FACTOR)
  1790. #define TS_CALCULATE_SECONDARY_ORDER_ORDERLENGTH(actualOrderLength) \
  1791. ((actualOrderLength) - TS_SECONDARY_ORDER_LENGTH_ADJUSTMENT)
  1792. #define TS_DECODE_SECONDARY_ORDER_ORDERLENGTH(secondaryOrderLength) \
  1793. ((secondaryOrderLength) + TS_SECONDARY_ORDER_LENGTH_ADJUSTMENT)
  1794. /****************************************************************************/
  1795. // Alternate secondary order type values.
  1796. /****************************************************************************/
  1797. #define TS_ALTSEC_SWITCH_SURFACE 0
  1798. #define TS_ALTSEC_CREATE_OFFSCR_BITMAP 1
  1799. #ifdef DRAW_NINEGRID
  1800. #define TS_ALTSEC_STREAM_BITMAP_FIRST 2
  1801. #define TS_ALTSEC_STREAM_BITMAP_NEXT 3
  1802. #define TS_ALTSEC_CREATE_NINEGRID_BITMAP 4
  1803. #endif
  1804. #ifdef DRAW_GDIPLUS
  1805. #define TS_ALTSEC_GDIP_FIRST 5
  1806. #define TS_ALTSEC_GDIP_NEXT 6
  1807. #define TS_ALTSEC_GDIP_END 7
  1808. #define TS_ALTSEC_GDIP_CACHE_FIRST 8
  1809. #define TS_ALTSEC_GDIP_CACHE_NEXT 9
  1810. #define TS_ALTSEC_GDIP_CACHE_END 10
  1811. #endif // DRAW_GDIPLUS
  1812. #ifdef DRAW_GDIPLUS
  1813. #define TS_NUM_ALTSEC_ORDERS 11
  1814. #else // DRAW_GDIPLUS
  1815. #ifdef DRAW_NINEGRID
  1816. #define TS_NUM_ALTSEC_ORDERS 5
  1817. #else
  1818. #define TS_NUM_ALTSEC_ORDERS 2
  1819. #endif // DRAW_NINEGRID
  1820. #endif // DRAW_GDIPLUS
  1821. /****************************************************************************/
  1822. /* Convert BPP to number of colors. */
  1823. /****************************************************************************/
  1824. #ifdef DC_HICOLOR
  1825. /****************************************************************************/
  1826. /* This macro as it was doesn't cater for 15bpp. Consider a 64 pel wide */
  1827. /* bitmap at 15 and 16bpp. It really has the same numner of bytes per scan */
  1828. /* line but this macro gives 128 for 16bpp and only 120 for 15bpp... */
  1829. /****************************************************************************/
  1830. // WRONG: #define TS_BYTES_IN_SCANLINE(width, bpp) (((((width)*(bpp))+31)/32) * 4)
  1831. #define TS_BYTES_IN_SCANLINE(width, bpp) ((((width)*((((bpp)+3)/4)*4)+31)/32) * 4)
  1832. #else
  1833. #define TS_BYTES_IN_SCANLINE(width, bpp) (((((width)*(bpp))+31)/32) * 4)
  1834. #endif
  1835. #define TS_BYTES_IN_BITMAP(width, height, bpp) \
  1836. (TS_BYTES_IN_SCANLINE((width), (bpp)) * (height))
  1837. /****************************************************************************/
  1838. /* The Compressed Data header structure. */
  1839. /* */
  1840. /* Rather than add a field to indicate V1 vs V2 compression we use the */
  1841. /* fact that V2 compression treats all the bitmap as main body and sets */
  1842. /* the first row size to zero to distinguish them. I hesitate to do this */
  1843. /* but any bandwidth saving is important. */
  1844. /****************************************************************************/
  1845. typedef struct tagTS_CD_HEADER
  1846. {
  1847. TSUINT16 cbCompFirstRowSize;
  1848. TSUINT16 cbCompMainBodySize;
  1849. TSUINT16 cbScanWidth;
  1850. TSUINT16 cbUncompressedSize;
  1851. } TS_CD_HEADER, FAR *PTS_CD_HEADER;
  1852. typedef TS_CD_HEADER UNALIGNED FAR *PTS_CD_HEADER_UA;
  1853. /****************************************************************************/
  1854. // Structure: TS_CACHE_BITMAP_ORDER
  1855. //
  1856. // Description: First cache-bitmap order revision used in RDP 4.0.
  1857. /****************************************************************************/
  1858. typedef struct tagTS_CACHE_BITMAP_ORDER
  1859. {
  1860. TS_SECONDARY_ORDER_HEADER header;
  1861. // header.extraflags
  1862. // Bit 10: TS_EXTRA_NO_BITMAP_COMPRESSION_HDR indicates if the compressed
  1863. // bitmap data contains the redundant BC header or not. Note this value
  1864. // is defined in REV2 bitmap extraflags value for consistency
  1865. TSUINT8 cacheId;
  1866. TSUINT8 pad1octet;
  1867. TSUINT8 bitmapWidth;
  1868. TSUINT8 bitmapHeight;
  1869. TSUINT8 bitmapBitsPerPel;
  1870. TSUINT16 bitmapLength;
  1871. TSUINT16 cacheIndex;
  1872. TSUINT8 bitmapData[1];
  1873. } TS_CACHE_BITMAP_ORDER, FAR *PTS_CACHE_BITMAP_ORDER;
  1874. /****************************************************************************/
  1875. // TS_CACHE_BITMAP_ORDER_REV2_HEADER
  1876. //
  1877. // Second version of cache-bitmap order that includes the hash key and
  1878. // changes the field definitions to minimize wire bytes.
  1879. /****************************************************************************/
  1880. // Maximum worst-case order size, rounded up to the nearest DWORD boundary.
  1881. #define TS_CACHE_BITMAP_ORDER_REV2_MAX_SIZE \
  1882. (((sizeof(TS_CACHE_BITMAP_ORDER_REV2_HEADER) + 18) + 3) & ~0x03)
  1883. typedef struct
  1884. {
  1885. // Two bytes in header.extraFlags are encoded as follows:
  1886. // Bits 0..2 (mask 0x0007): CacheID.
  1887. // Bits 3..6 (mask 0x0078): BitsPerPixelID, see below for values.
  1888. // Bit 7 (mask 0x0080): bHeightSameAsWidth, set to 1 when the bitmap
  1889. // height is the same as the encoded width.
  1890. // Bit 8 (mask 0x0100): bKeyPresent, set to 1 when the persistent key
  1891. // is encoded in the stream.
  1892. // Bit 9 (mask 0x0200): bStreamBitmap, set to 1 if this cache-bitmap
  1893. // order is a bitmap-streaming header.
  1894. // Bit 10 (mask 0x0400): noBitmapCompressionHdr, set to 1 if the
  1895. // compressed bitmap doesn't contain redundent header (8 bytes)
  1896. // This mask is used by REV1 bitmap header, SDA bitmap data
  1897. // and TS_GENERAL_CAPS as well
  1898. // Bit 11 (mask 0x0800): not cache flag, set to 1 if the bitmap
  1899. // is not to be cached in the bitmap cache
  1900. TS_SECONDARY_ORDER_HEADER header;
  1901. #define TS_CacheBitmapRev2_CacheID_Mask 0x0007
  1902. #define TS_CacheBitmapRev2_BitsPerPixelID_Mask 0x0078
  1903. #define TS_CacheBitmapRev2_bHeightSameAsWidth_Mask 0x0080
  1904. #define TS_CacheBitmapRev2_bKeyPresent_Mask 0x0100
  1905. #define TS_CacheBitmapRev2_bStreamBitmap_Mask 0x0200
  1906. #define TS_EXTRA_NO_BITMAP_COMPRESSION_HDR 0x0400
  1907. #define TS_CacheBitmapRev2_bNotCacheFlag 0x0800
  1908. // These are defined to be in the same position they would be in the
  1909. // extraFlags field.
  1910. #define TS_CacheBitmapRev2_1BitPerPel (0 << 3)
  1911. #define TS_CacheBitmapRev2_2BitsPerPel (1 << 3)
  1912. #define TS_CacheBitmapRev2_4BitsPerPel (2 << 3)
  1913. #define TS_CacheBitmapRev2_8BitsPerPel (3 << 3)
  1914. #define TS_CacheBitmapRev2_16BitsPerPel (4 << 3)
  1915. #define TS_CacheBitmapRev2_24BitsPerPel (5 << 3)
  1916. #define TS_CacheBitmapRev2_32BitsPerPel (6 << 3)
  1917. // 64-bit key. These are absent from the wire encoding if the cache
  1918. // properties in the bitmap cache capabilities indicate the cache
  1919. // is not persistent and bKeyPresent is false above.
  1920. TSUINT32 Key1;
  1921. TSUINT32 Key2;
  1922. // Following fields are variable-sized and so only have a description.
  1923. // Encoding rules:
  1924. // 2-byte encoding: Uses high bit of first byte as a field length
  1925. // indicator, where 0 means the field is one byte (the 7 low
  1926. // bits of the first byte), 1 means it is 2 bytes (low 7 bits
  1927. // of the first byte are the high bits, 8 bits of next byte
  1928. // are the low bits, total 15 bits available).
  1929. // 4-byte encoding: Uses high 2 bits of first byte as a field length
  1930. // indicator: 00 means a one-byte field (low 6 bits of that byte
  1931. // are the value), 01=2-byte field (low 6 bits + next byte, with
  1932. // 1st 6 bits being most significant, 14 bits total for value),
  1933. // 10=3-byte field (22 bits total for value), 11=4-byte field (30
  1934. // bits for value).
  1935. // Bitmap width: 2-byte encoding.
  1936. // Bitmap height: If same as width, the bHeightSameAsWidth bit is
  1937. // set above, otherwise appears here as a 2-byte encoding.
  1938. // Bitmap length: 4-byte encoding.
  1939. // Streaming extended info: This field is present only if the bStreamBitmap
  1940. // flag was set in the header field. This field is a 2-byte encoding
  1941. // specifying the length of the portion of the bitmap in this PDU.
  1942. // The rest of the bitmap data will be sent later with a series of
  1943. // TS_STREAM_BITMAP secondary orders.
  1944. // Cache index: 2-byte encoding.
  1945. } TS_CACHE_BITMAP_ORDER_REV2_HEADER, FAR *PTS_CACHE_BITMAP_ORDER_REV2_HEADER;
  1946. /****************************************************************************/
  1947. // TS_STREAM_BITMAP_ORDER_HEADER
  1948. //
  1949. // Follow-up PDU to TS_CACHE_BITMAP_ORDER_REV2 that provides further blocks
  1950. // of data for the streamed bitmap. Note there are no first/last streaming
  1951. // bits provided, the block sizes sent are sufficient information to
  1952. // determine when the bitmap stream is complete.
  1953. /****************************************************************************/
  1954. // Maximum worst-case order size, rounded up to the nearest DWORD boundary.
  1955. #define TS_STREAM_BITMAP_ORDER_MAX_SIZE \
  1956. (((sizeof(TS_STREAM_BITMAP_ORDER_HEADER) + 2) + 3) & ~0x03)
  1957. typedef struct
  1958. {
  1959. TS_SECONDARY_ORDER_HEADER header;
  1960. // Following fields are variable-sized according to encoding descriptions
  1961. // given for TS_CACHE_BITMAP_ORDER_HEADER_REV2.
  1962. // Data length: 2-byte encoding.
  1963. } TS_STREAM_BITMAP_ORDER_HEADER, FAR *PTS_STREAM_BITMAP_ORDER_HEADER;
  1964. /****************************************************************************/
  1965. /* Structure: TS_CACHE_COLOR_TABLE_ORDER */
  1966. /****************************************************************************/
  1967. typedef struct tagTS_CACHE_COLOR_TABLE_ORDER
  1968. {
  1969. TS_SECONDARY_ORDER_HEADER header;
  1970. TSUINT8 cacheIndex;
  1971. TSUINT16 numberColors;
  1972. TS_COLOR_QUAD colorTable[1];
  1973. } TS_CACHE_COLOR_TABLE_ORDER, FAR * PTS_CACHE_COLOR_TABLE_ORDER;
  1974. /****************************************************************************/
  1975. /* Structure: TS_CACHE_GLYPH_DATA */
  1976. /****************************************************************************/
  1977. typedef struct tagTS_CACHE_GLYPH_DATA
  1978. {
  1979. TSUINT16 cacheIndex;
  1980. TSINT16 x;
  1981. TSINT16 y;
  1982. TSUINT16 cx;
  1983. TSUINT16 cy;
  1984. TSUINT8 aj[1];
  1985. } TS_CACHE_GLYPH_DATA, FAR * PTS_CACHE_GLYPH_DATA;
  1986. /****************************************************************************/
  1987. /* Structure: TS_CACHE_GLYPH_ORDER */
  1988. /****************************************************************************/
  1989. #define TS_EXTRA_GLYPH_UNICODE 16
  1990. typedef struct tagTS_CACHE_GLYPH_ORDER
  1991. {
  1992. TS_SECONDARY_ORDER_HEADER header;
  1993. TSUINT8 cacheId;
  1994. TSUINT8 cGlyphs;
  1995. TS_CACHE_GLYPH_DATA glyphData[1];
  1996. } TS_CACHE_GLYPH_ORDER, FAR * PTS_CACHE_GLYPH_ORDER;
  1997. /****************************************************************************/
  1998. /* Structure: TS_CACHE_GLYPH_ORDER_REV2 */
  1999. /****************************************************************************/
  2000. #define TS_GLYPH_DATA_REV2_HDR_MAX_SIZE 9
  2001. typedef struct tagTS_CACHE_GLYPH_ORDER_REV2
  2002. {
  2003. // Two bytes in header.extraFlags are encoded as follows:
  2004. // Bits 0..3 (mask 0x000f): CacheID.
  2005. // Bit 4 (mask 0x0010): glyph unicode
  2006. // Bit 5 (mask 0x0020): Glyph REV2 order
  2007. // Bits 6..7: free
  2008. // Bits 8..15 (mask 0xff00): cGlyphs
  2009. TS_SECONDARY_ORDER_HEADER header;
  2010. #define TS_CacheGlyphRev2_CacheID_Mask 0x000f
  2011. #define TS_CacheGlyphRev2_Mask 0x0020
  2012. #define TS_CacheGlyphRev2_cGlyphs_Mask 0xff00
  2013. // array of glyph data
  2014. BYTE glyphData[1];
  2015. // Following fields are variable-sized and so only have a description.
  2016. // Encoding rules:
  2017. // 2-byte encoding: Uses high bit of first byte as a field length
  2018. // indicator, where 0 means the field is one byte (the 7 low
  2019. // bits of the first byte), 1 means it is 2 bytes (low 7 bits
  2020. // of the first byte are the high bits, 8 bits of next byte
  2021. // are the low bits, total 15 bits available).
  2022. //
  2023. // 2-byte signed encoding: Uses high bit of first byte as a field length
  2024. // indicator, where 0 means the field is one byte (the 6 low
  2025. // bits of the first byte), 1 means it is 2 bytes (low 6 bits
  2026. // of the first byte are the high bits, 8 bits of next byte
  2027. // are the low bits, total 14 bits available).
  2028. // The second high bit used as a sign indicator. 0 means the
  2029. // field is unsigned, 1 means the field is signed
  2030. //
  2031. // cacheIndex: 1-byte field
  2032. // Glyph x: 2-byte signed encoding
  2033. // Glyph y: 2-byte signed encoding
  2034. // Glyph cx: 2-byte unsigned encoding
  2035. // Glyph cy: 2-byte unsigned encoding
  2036. // Glyph bitmap data: in bytes
  2037. } TS_CACHE_GLYPH_ORDER_REV2, FAR * PTS_CACHE_GLYPH_ORDER_REV2;
  2038. /****************************************************************************/
  2039. /* Structure: TS_CACHE_BRUSH_ORDER */
  2040. /****************************************************************************/
  2041. #define TS_CACHED_BRUSH 0x80
  2042. #define MAX_BRUSH_ENCODE_COLORS 4
  2043. typedef struct tagTS_CACHE_BRUSH_ORDER
  2044. {
  2045. TS_SECONDARY_ORDER_HEADER header;
  2046. TSUINT8 cacheEntry;
  2047. TSUINT8 iBitmapFormat;
  2048. TSUINT8 cx;
  2049. TSUINT8 cy;
  2050. TSUINT8 style;
  2051. TSUINT8 iBytes;
  2052. TSUINT8 brushData[1];
  2053. #ifdef DC_HICOLOR
  2054. // The layout of the brush data is dependent on the format of the
  2055. // bitmap, and if it has been compressed in any way. In particular,
  2056. // many brushes actually only use two different colors, and the
  2057. // majority use four or less.
  2058. //
  2059. // Two-color brushes are treated as mono bitmaps, so the brushData
  2060. // array contains the bits encoded in 8 bytes.
  2061. //
  2062. // Four color brushes are represented as 2-bit indices into a color
  2063. // table. The brushData array thus contains
  2064. //
  2065. // - 16 bytes of bitmap data (8x8 pels x 2bpp)
  2066. // - either
  2067. // - 4 1-byte indices into the current color table (for 8bpp
  2068. // sessions)
  2069. // - 4 4-byte color values, either color indices for 15/16bpp or full
  2070. // RGB values for 24bpp sessions
  2071. //
  2072. // The bits of brushes using more than 4 colors are simply copied into
  2073. // the brushData at the appropriate color depth.
  2074. #endif
  2075. } TS_CACHE_BRUSH_ORDER, FAR * PTS_CACHE_BRUSH_ORDER;
  2076. /****************************************************************************/
  2077. // TS_CREATE_OFFSCR_BITMAP_ORDER
  2078. //
  2079. // This alternate secondary order creates an offscreen bitmap of size
  2080. // cx by cy. The bitmap ID is stored at the ExtraFlags field in the header
  2081. /****************************************************************************/
  2082. typedef struct tagTS_CREATE_OFFSCR_BITMAP_ORDER
  2083. {
  2084. BYTE ControlFlags;
  2085. // Bit 0..14: Offscreen bitmap ID
  2086. // Bit 15: Flag to indicate if offscreen bitmap delete list is appended.
  2087. TSUINT16 Flags;
  2088. TSUINT16 cx;
  2089. TSUINT16 cy;
  2090. // Number offscreen bitmaps to delete: 2 bytes
  2091. // Offscreen bitmap ID delete list: 2-bytes list
  2092. TSUINT16 variableBytes[1];
  2093. } TS_CREATE_OFFSCR_BITMAP_ORDER, FAR * PTS_CREATE_OFFSCR_BITMAP_ORDER;
  2094. /****************************************************************************/
  2095. // TS_SWITCH_SURFACE_ORDER_HEADER
  2096. //
  2097. // This alternate secondary order switches the target drawing surface at the
  2098. // client, identified by the bitmap ID. The primary drawing surface (screen)
  2099. // has the bitmap ID of 0xFFFF.
  2100. /****************************************************************************/
  2101. #define SCREEN_BITMAP_SURFACE 0xFFFF
  2102. typedef struct tagTS_SWITCH_SURFACE_ORDER
  2103. {
  2104. BYTE ControlFlags;
  2105. TSUINT16 BitmapID;
  2106. } TS_SWITCH_SURFACE_ORDER, FAR * PTS_SWITCH_SURFACE_ORDER;
  2107. #ifdef DRAW_GDIPLUS
  2108. /****************************************************************************/
  2109. // Structure: TS_DRAW_GDIPLUS_ORDER
  2110. //
  2111. // Description: DrawGdiplus order
  2112. /****************************************************************************/
  2113. typedef struct tagTS_DRAW_GDIPLUS_ORDER_FRIST
  2114. {
  2115. BYTE ControlFlags;
  2116. BYTE Flags; // curently not used
  2117. TSUINT16 cbSize;
  2118. TSUINT32 cbTotalSize;
  2119. TSUINT32 cbTotalEmfSize;
  2120. } TS_DRAW_GDIPLUS_ORDER_FIRST, FAR * PTS_DRAW_GDIPLUS_ORDER_FIRST;
  2121. typedef struct tagTS_DRAW_GDIPLUS_ORDER_NEXT
  2122. {
  2123. BYTE ControlFlags;
  2124. BYTE Flags; // curently not used
  2125. TSUINT16 cbSize;
  2126. } TS_DRAW_GDIPLUS_ORDER_NEXT, FAR * PTS_DRAW_GDIPLUS_ORDER_NEXT;
  2127. typedef struct tagTS_DRAW_GDIPLUS_ORDER_END
  2128. {
  2129. BYTE ControlFlags;
  2130. BYTE Flags; // curently not used
  2131. TSUINT16 cbSize;
  2132. TSUINT32 cbTotalSize;
  2133. TSUINT32 cbTotalEmfSize;
  2134. } TS_DRAW_GDIPLUS_ORDER_END, FAR * PTS_DRAW_GDIPLUS_ORDER_END;
  2135. #define TS_GDIPLUS_ORDER_SIZELIMIT 4096
  2136. /****************************************************************************/
  2137. // Structure: TS_CACHE_DRAW_GDIPLUS_CACHE_ORDER
  2138. //
  2139. // Description: DrawGdiplus cache order
  2140. /****************************************************************************/
  2141. typedef struct tagTS_DRAW_GDIPLUS_CACHE_ORDER_FIRST
  2142. {
  2143. BYTE ControlFlags;
  2144. BYTE Flags;
  2145. #define TS_GDIPLUS_CACHE_ORDER_REMOVE_CACHEENTRY 0x1
  2146. TSUINT16 CacheType; // See following define for CacheType
  2147. TSUINT16 CacheID;
  2148. TSUINT16 cbSize;
  2149. TSUINT32 cbTotalSize;
  2150. } TS_DRAW_GDIPLUS_CACHE_ORDER_FIRST, FAR * PTS_DRAW_GDIPLUS_CACHE_ORDER_FIRST;
  2151. typedef struct tagTS_DRAW_GDIPLUS_CACHE_ORDER_NEXT
  2152. {
  2153. BYTE ControlFlags;
  2154. BYTE Flags;
  2155. TSUINT16 CacheType; // See following define for CacheType
  2156. TSUINT16 CacheID;
  2157. TSUINT16 cbSize;
  2158. } TS_DRAW_GDIPLUS_CACHE_ORDER_NEXT, FAR * PTS_DRAW_GDIPLUS_CACHE_ORDER_NEXT;
  2159. typedef struct tagTS_DRAW_GDIPLUS_CACHE_ORDER_END
  2160. {
  2161. BYTE ControlFlags;
  2162. BYTE Flags;
  2163. TSUINT16 CacheType; // See following define for CacheType
  2164. TSUINT16 CacheID;
  2165. TSUINT16 cbSize;
  2166. TSUINT32 cbTotalSize;
  2167. } TS_DRAW_GDIPLUS_CACHE_ORDER_END, FAR * PTS_DRAW_GDIPLUS_CACHE_ORDER_END;
  2168. #define GDIP_CACHE_GRAPHICS_DATA 0x1
  2169. #define GDIP_CACHE_OBJECT_BRUSH 0x2
  2170. #define GDIP_CACHE_OBJECT_PEN 0x3
  2171. #define GDIP_CACHE_OBJECT_IMAGE 0x4
  2172. #define GDIP_CACHE_OBJECT_IMAGEATTRIBUTES 0x5
  2173. typedef struct tagTSEmfPlusRecord
  2174. {
  2175. TSINT16 Type;
  2176. TSUINT16 Flags; // Higher 8 bits is Gdi+ object type
  2177. TSUINT32 Size; // If MSB is set, the following data will be cacheID
  2178. } TSEmfPlusRecord, FAR * PTSEmfPlusRecord;
  2179. #endif // DRAW_GDIPLUS
  2180. #ifdef DRAW_NINEGRID
  2181. /****************************************************************************/
  2182. // Structure: TS_CREATE_DRAW_NINEGRID_ORDER
  2183. //
  2184. // Description: Luna DrawNineGrid bitmap order
  2185. /****************************************************************************/
  2186. typedef struct tagTS_NINEGRID_BITMAP_INFO
  2187. {
  2188. ULONG flFlags;
  2189. TSUINT16 ulLeftWidth;
  2190. TSUINT16 ulRightWidth;
  2191. TSUINT16 ulTopHeight;
  2192. TSUINT16 ulBottomHeight;
  2193. TSCOLORREF crTransparent;
  2194. } TS_NINEGRID_BITMAP_INFO, FAR * PTS_NINEGRID_BITMAP_INFO;
  2195. typedef struct tagTS_CREATE_NINEGRID_BITMAP_ORDER
  2196. {
  2197. BYTE ControlFlags;
  2198. BYTE BitmapBpp;
  2199. TSUINT16 BitmapID;
  2200. TSUINT16 cx;
  2201. TSUINT16 cy;
  2202. TS_NINEGRID_BITMAP_INFO nineGridInfo;
  2203. } TS_CREATE_NINEGRID_BITMAP_ORDER, FAR * PTS_CREATE_NINEGRID_BITMAP_ORDER;
  2204. /****************************************************************************/
  2205. // Streaming bitmap orders
  2206. /****************************************************************************/
  2207. #define TS_STREAM_BITMAP_BLOCK 4 * 1024 // stream bitmap block is 4k chunk
  2208. #define TS_STREAM_BITMAP_END 0x1
  2209. #define TS_STREAM_BITMAP_COMPRESSED 0x2
  2210. #define TS_STREAM_BITMAP_REV2 0x4
  2211. typedef struct tagTS_STREAM_BITMAP_FIRST_PDU
  2212. {
  2213. BYTE ControlFlags;
  2214. BYTE BitmapFlags;
  2215. BYTE BitmapBpp;
  2216. TSUINT16 BitmapId;
  2217. #define TS_DRAW_NINEGRID_BITMAP_CACHE 0x1
  2218. TSUINT16 BitmapWidth;
  2219. TSUINT16 BitmapHeight;
  2220. TSUINT16 BitmapLength;
  2221. TSUINT16 BitmapBlockLength;
  2222. } TS_STREAM_BITMAP_FIRST_PDU, FAR * PTS_STREAM_BITMAP_FIRST_PDU;
  2223. typedef struct tagTS_STREAM_BITMAP_NEXT_PDU
  2224. {
  2225. BYTE ControlFlags;
  2226. BYTE BitmapFlags;
  2227. TSUINT16 BitmapId;
  2228. TSUINT16 BitmapBlockLength;
  2229. } TS_STREAM_BITMAP_NEXT_PDU, FAR * PTS_STREAM_BITMAP_NEXT_PDU;
  2230. // For DRAW_STREM_REV2, the only change is the BitmapLength in tagTS_STREAM_BITMAP_FIRST_PDU
  2231. // from TSUINT16 to TSUINT32
  2232. typedef struct tagTS_STREAM_BITMAP_FIRST_PDU_REV2
  2233. {
  2234. BYTE ControlFlags;
  2235. BYTE BitmapFlags;
  2236. BYTE BitmapBpp;
  2237. TSUINT16 BitmapId;
  2238. #define TS_DRAW_NINEGRID_BITMAP_CACHE 0x1
  2239. TSUINT16 BitmapWidth;
  2240. TSUINT16 BitmapHeight;
  2241. TSUINT32 BitmapLength;
  2242. TSUINT16 BitmapBlockLength;
  2243. } TS_STREAM_BITMAP_FIRST_PDU_REV2, FAR * PTS_STREAM_BITMAP_FIRST_PDU_REV2;
  2244. #if 0
  2245. /****************************************************************************/
  2246. // Structure: TS_CREATE_DRAW_STREAM_ORDER
  2247. //
  2248. // Description: Luna DrawStream order
  2249. /****************************************************************************/
  2250. typedef struct tagTS_CREATE_DRAW_STREAM_ORDER
  2251. {
  2252. BYTE ControlFlags;
  2253. TSUINT16 BitmapID;
  2254. TSUINT16 cx;
  2255. TSUINT16 cy;
  2256. TSUINT8 bitmapBpp;
  2257. } TS_CREATE_DRAW_STREAM_ORDER, FAR * PTS_CREATE_DRAW_STREAM_ORDER;
  2258. /****************************************************************************/
  2259. // Structure: TS_DRAW_STREAM_ORDER
  2260. //
  2261. // Description: Luna DrawStream order
  2262. /****************************************************************************/
  2263. typedef struct tagTS_DRAW_STREAM_ORDER
  2264. {
  2265. BYTE ControlFlags;
  2266. TS_RECTANGLE16 Bounds;
  2267. TSUINT16 BitmapID;
  2268. TSUINT8 nClipRects;
  2269. TSUINT16 StreamLen;
  2270. } TS_DRAW_STREAM_ORDER, FAR * PTS_DRAW_STREAM_ORDER;
  2271. typedef struct tagTS_DRAW_NINEGRID_ORDER
  2272. {
  2273. BYTE ControlFlags;
  2274. TSUINT16 BitmapID;
  2275. TS_RECTANGLE16 dstBounds;
  2276. TS_RECTANGLE16 srcBounds;
  2277. TSUINT8 nClipRects;
  2278. } TS_DRAW_NINEGRID_ORDER, FAR * PTS_DRAW_NINEGRID_ORDER;
  2279. typedef struct _RDP_DS_COPYTILE
  2280. {
  2281. BYTE ulCmdID;
  2282. TS_RECTANGLE16 rclDst;
  2283. TS_RECTANGLE16 rclSrc;
  2284. TS_POINT16 ptlOrigin;
  2285. } RDP_DS_COPYTILE;
  2286. typedef struct _RDP_DS_SOLIDFILL
  2287. {
  2288. BYTE ulCmdID;
  2289. TS_RECTANGLE16 rclDst;
  2290. TSCOLORREF crSolidColor;
  2291. } RDP_DS_SOLIDFILL;
  2292. typedef struct _RDP_DS_TRANSPARENTTILE
  2293. {
  2294. BYTE ulCmdID;
  2295. TS_RECTANGLE16 rclDst;
  2296. TS_RECTANGLE16 rclSrc;
  2297. TS_POINT16 ptlOrigin;
  2298. TSCOLORREF crTransparentColor;
  2299. } RDP_DS_TRANSPARENTTILE;
  2300. typedef struct _RDP_DS_ALPHATILE
  2301. {
  2302. BYTE ulCmdID;
  2303. TS_RECTANGLE16 rclDst;
  2304. TS_RECTANGLE16 rclSrc;
  2305. TS_POINT16 ptlOrigin;
  2306. TS_BLENDFUNC blendFunction;
  2307. } RDP_DS_ALPHATILE;
  2308. typedef struct _RDP_DS_STRETCH
  2309. {
  2310. BYTE ulCmdID;
  2311. TS_RECTANGLE16 rclDst;
  2312. TS_RECTANGLE16 rclSrc;
  2313. } RDP_DS_STRETCH;
  2314. typedef struct _RDP_DS_TRANSPARENTSTRETCH
  2315. {
  2316. BYTE ulCmdID;
  2317. TS_RECTANGLE16 rclDst;
  2318. TS_RECTANGLE16 rclSrc;
  2319. TSCOLORREF crTransparentColor;
  2320. } RDP_DS_TRANSPARENTSTRETCH;
  2321. typedef struct _RDP_DS_ALPHASTRETCH
  2322. {
  2323. BYTE ulCmdID;
  2324. TS_RECTANGLE16 rclDst;
  2325. TS_RECTANGLE16 rclSrc;
  2326. TS_BLENDFUNC blendFunction;
  2327. } RDP_DS_ALPHASTRETCH;
  2328. #endif
  2329. #endif //DRAW_NINEGRID
  2330. /****************************************************************************/
  2331. /* Structure: TS_SECONDARY_ORDER */
  2332. /****************************************************************************/
  2333. typedef struct tagTS_SECONDARY_ORDER
  2334. {
  2335. union
  2336. {
  2337. TS_CACHE_BITMAP_ORDER cacheBitmap;
  2338. TS_CACHE_COLOR_TABLE_ORDER cacheColorTable;
  2339. TS_CACHE_GLYPH_ORDER cacheGlyph;
  2340. TS_CACHE_BRUSH_ORDER cacheBrush;
  2341. } u;
  2342. } TS_SECONDARY_ORDER, FAR * PTS_SECONDARY_ORDER;
  2343. /****************************************************************************/
  2344. /* Structure: TS_UPDATE_PALETTE_PDU */
  2345. /****************************************************************************/
  2346. typedef struct tagTS_UPDATE_PALETTE_PDU_DATA
  2347. {
  2348. TSUINT16 updateType; /* See TS_UPDATE_HDR */
  2349. TSUINT16 pad2octets;
  2350. TSUINT32 numberColors;
  2351. TS_COLOR palette[1]; /* 16 or 256 entries */
  2352. } TS_UPDATE_PALETTE_PDU_DATA, FAR * PTS_UPDATE_PALETTE_PDU_DATA;
  2353. typedef struct tagTS_UPDATE_PALETTE_PDU
  2354. {
  2355. TS_SHAREDATAHEADER shareDataHeader;
  2356. TS_UPDATE_PALETTE_PDU_DATA data;
  2357. } TS_UPDATE_PALETTE_PDU, FAR * PTS_UPDATE_PALETTE_PDU;
  2358. /****************************************************************************/
  2359. /* Structure: TS_UPDATE_SYNCHRONIZE_PDU */
  2360. /****************************************************************************/
  2361. typedef struct tagTS_UPDATE_SYNCHRONIZE_PDU
  2362. {
  2363. TS_SHAREDATAHEADER shareDataHeader;
  2364. TSUINT16 updateType; /* See TS_UPDATE_HDR */
  2365. TSUINT16 pad2octets;
  2366. } TS_UPDATE_SYNCHRONIZE_PDU, FAR * PTS_UPDATE_SYNCHRONIZE_PDU;
  2367. /****************************************************************************/
  2368. /* CONSTANTS */
  2369. /****************************************************************************/
  2370. #define TS_PROTOCOL_VERSION 0x0010
  2371. /****************************************************************************/
  2372. /* MCS priorities */
  2373. /****************************************************************************/
  2374. #define TS_LOWPRIORITY 3
  2375. #define TS_MEDPRIORITY 2
  2376. #define TS_HIGHPRIORITY 1
  2377. #ifdef DC_HICOLOR
  2378. /****************************************************************************/
  2379. /* Mask definitions for high color support */
  2380. /****************************************************************************/
  2381. #define TS_RED_MASK_24BPP 0xff0000;
  2382. #define TS_GREEN_MASK_24BPP 0x00ff00;
  2383. #define TS_BLUE_MASK_24BPP 0x0000ff;
  2384. #define TS_RED_MASK_16BPP 0xf800
  2385. #define TS_GREEN_MASK_16BPP 0x07e0
  2386. #define TS_BLUE_MASK_16BPP 0x001f
  2387. #define TS_RED_MASK_15BPP 0x7c00
  2388. #define TS_GREEN_MASK_15BPP 0x03e0
  2389. #define TS_BLUE_MASK_15BPP 0x001f
  2390. #endif
  2391. /****************************************************************************/
  2392. /* Structure: TS_REFRESH_RECT_PDU */
  2393. /* */
  2394. /* Name of PDU: RefreshRectanglePDU (a T.128 extension) */
  2395. /* */
  2396. /* Description of Function: */
  2397. /* Flows from Client -> Server (and optionally: Server -> Client) */
  2398. /* Requests that the Server should send data to the client to allow */
  2399. /* the client to redraw the areas defined by the rectangles defined in */
  2400. /* the PDU. The server responds by sending updatePDUs (orders, bitmap */
  2401. /* data etc.) containing all the drawing information necessary to */
  2402. /* "fill in" the rectangle. The server will probably implement this */
  2403. /* by invalidating the rectangle - which results in a bunch of drawing */
  2404. /* orders from the affected apps, which are then remoted to the Client */
  2405. /* */
  2406. /* Field Descriptions: */
  2407. /* numberOfAreas: count of rectangles included */
  2408. /* areaToRefresh: area the client needs repainted */
  2409. /****************************************************************************/
  2410. typedef struct tagTS_REFRESH_RECT_PDU
  2411. {
  2412. TS_SHAREDATAHEADER shareDataHeader;
  2413. TSUINT8 numberOfAreas;
  2414. TSUINT8 pad3octets[3];
  2415. TS_RECTANGLE16 areaToRefresh[1]; /* inclusive */
  2416. } TS_REFRESH_RECT_PDU, FAR * PTS_REFRESH_RECT_PDU;
  2417. #define TS_REFRESH_RECT_PDU_SIZE sizeof(TS_REFRESH_RECT_PDU)
  2418. #define TS_REFRESH_RECT_UNCOMP_LEN 12
  2419. /****************************************************************************/
  2420. /* Structure: TS_SUPPRESS_OUTPUT_PDU */
  2421. /* */
  2422. /* Name of PDU: SuppressOutputPDU (a T.128 extension) */
  2423. /* */
  2424. /* Description of Function: */
  2425. /* Flows from Client -> Server */
  2426. /* Notifies the Server that there are changes in the areas of the */
  2427. /* shared desktop that are visible at the client. */
  2428. /* */
  2429. /* By default, at the start of a new session, the server assumes that */
  2430. /* the entire desktop is visible at the client and will send all */
  2431. /* remoted output to it. During a session, the client can use this */
  2432. /* PDU to notify the server that only certain areas of the shared */
  2433. /* desktop are visible. The server may then choose NOT to send output */
  2434. /* for the other areas (note: the server does not guarantee to not */
  2435. /* send the output; the client must be capable of handling such output */
  2436. /* by ignoring it). */
  2437. /* */
  2438. /* Once the client has sent one of these PDUs it is then responsible */
  2439. /* for keeping the server up to date i.e. it must send further */
  2440. /* PDUs whenever the areas that can be excluded changes. Note that */
  2441. /* processing the PDU at the server can be quite an expensive */
  2442. /* operation (because areas that were excluded but are now not- */
  2443. /* excluded need to be redrawn to ensure that the client has an */
  2444. /* up to date view of them). */
  2445. /* */
  2446. /* The intent behind this PDU is not that the Client should notify the */
  2447. /* server every time the client area is resized (by the user dragging */
  2448. /* the frame border for example) but to allow line-utilization */
  2449. /* optimization whenever there is any "significant" reason for */
  2450. /* output to be excluded. The definition of "significant" is */
  2451. /* entirely a client decision but reasons might include */
  2452. /* - the client is minimized (which suggests that the user is */
  2453. /* likely to not want to see the Client output for a lengthy */
  2454. /* period of time) */
  2455. /* - another application is maximized and has the focus (which */
  2456. /* again suggests that the client user may not be interested in */
  2457. /* output for a lengthy period of time) */
  2458. /* - with multiple-monitor configuration at the client there may */
  2459. /* be some areas of the server desktop that are simply NEVER */
  2460. /* visible at the client; selectively suppressing output for */
  2461. /* those areas is a good idea. */
  2462. /* */
  2463. /* Note that in TSE4.0 and Win2000, the Client only ever excludes */
  2464. /* output for the entire desktop, or for none of it. Similarly, the */
  2465. /* server only actually suppresses all output or none (it cannot */
  2466. /* suppress output for selected areas). */
  2467. /* */
  2468. /* Field Descriptions: */
  2469. /* numberOfRectangles: TS_QUIET_FULL_SUPPRESSION (zero): indicates */
  2470. /* that the Server may choose to stop sending */
  2471. /* all output (including sound). */
  2472. /* 1..TS_MAX_INCLUDED_RECTS: number of rectangles */
  2473. /* following. */
  2474. /* any other value: ASSERTABLE ERROR. */
  2475. /* includedRectangle[] Each rectangle defines an area of the desktop */
  2476. /* for which the client requires output. */
  2477. /****************************************************************************/
  2478. typedef struct tagTS_SUPPRESS_OUTPUT_PDU
  2479. {
  2480. TS_SHAREDATAHEADER shareDataHeader;
  2481. TSUINT8 numberOfRectangles;
  2482. #define TS_QUIET_FULL_SUPPRESSION 0
  2483. #define TS_MAX_INCLUDED_RECTS 128
  2484. TSUINT8 pad3octets[3];
  2485. TS_RECTANGLE16 includedRectangle[1]; /* optional. */
  2486. } TS_SUPPRESS_OUTPUT_PDU, FAR * PTS_SUPPRESS_OUTPUT_PDU;
  2487. #define TS_SUPPRESS_OUTPUT_PDU_SIZE(n) \
  2488. ((sizeof(TS_SUPPRESS_OUTPUT_PDU)-sizeof(TS_RECTANGLE16)) + \
  2489. (n * sizeof(TS_RECTANGLE16)))
  2490. #define TS_SUPPRESS_OUTPUT_UNCOMP_LEN(n) \
  2491. (8 + n * sizeof(TS_RECTANGLE16))
  2492. /****************************************************************************/
  2493. /* Structure: TS_PLAY_SOUND_PDU */
  2494. /* */
  2495. /* Name of PDU: PlaySoundPDU (a T.128 extension) */
  2496. /* */
  2497. /* Description of Function: */
  2498. /* Flows from Server -> Client */
  2499. /* On receipt, the Client should (if possible) generate some local */
  2500. /* audio output as indicated by the information in the packet. */
  2501. /* */
  2502. /* Field Descriptions: */
  2503. /* duration: duration in ms */
  2504. /* frequency: frequency in Hz */
  2505. /****************************************************************************/
  2506. typedef struct tagTS_PLAY_SOUND_PDU_DATA
  2507. {
  2508. TSUINT32 duration;
  2509. TSUINT32 frequency;
  2510. } TS_PLAY_SOUND_PDU_DATA, FAR * PTS_PLAY_SOUND_PDU_DATA;
  2511. typedef struct tagTS_PLAY_SOUND_PDU
  2512. {
  2513. TS_SHAREDATAHEADER shareDataHeader;
  2514. TS_PLAY_SOUND_PDU_DATA data;
  2515. } TS_PLAY_SOUND_PDU, FAR * PTS_PLAY_SOUND_PDU;
  2516. /****************************************************************************/
  2517. /* Structure: TS_SHUTDOWN_REQUEST_PDU */
  2518. /* */
  2519. /* Name of PDU: ShutdownRequestPDU (a T.128 extension) */
  2520. /* */
  2521. /* Description of Function: */
  2522. /* Flows from Client -> Server */
  2523. /* Notifies the Server that the Client wishes to terminate. If the */
  2524. /* server objects for some reason (in RNS/Ducati this reason is */
  2525. /* "the user is still logged on to the underlying session") then */
  2526. /* the server responds with a shutdownDeniedPDU. Otherwise, this */
  2527. /* PDU has no response, and the Server disconnects the Client (which */
  2528. /* then terminates). */
  2529. /****************************************************************************/
  2530. typedef struct tagTS_SHUTDOWN_REQ_PDU
  2531. {
  2532. TS_SHAREDATAHEADER shareDataHeader;
  2533. } TS_SHUTDOWN_REQ_PDU, FAR * PTS_SHUTDOWN_REQ_PDU;
  2534. #define TS_SHUTDOWN_REQ_PDU_SIZE sizeof(TS_SHUTDOWN_REQ_PDU)
  2535. #define TS_SHUTDOWN_REQ_UNCOMP_LEN 4
  2536. /****************************************************************************/
  2537. /* Structure: TS_SHUTDOWN_DENIED_PDU */
  2538. /* */
  2539. /* Name of PDU: ShutdownDeniedPDU (a T.128 extension) */
  2540. /* */
  2541. /* Description of Function: */
  2542. /* Flows from Server -> Client */
  2543. /* Notifies the Client that the remote user is still logged on to */
  2544. /* the NT session, and for this reason RNS is not going to end the */
  2545. /* conference (even though the client has signalled that this should */
  2546. /* happen by sending a ShutdownRequestPDU). */
  2547. /****************************************************************************/
  2548. typedef struct tagTS_SHUTDOWN_DENIED_PDU
  2549. {
  2550. TS_SHAREDATAHEADER shareDataHeader;
  2551. } TS_SHUTDOWN_DENIED_PDU, FAR * PTS_SHUTDOWN_DENIED_PDU;
  2552. /****************************************************************************/
  2553. /* Structure: TS_LOGON_INFO */
  2554. /****************************************************************************/
  2555. typedef struct tagTS_LOGON_INFO
  2556. {
  2557. TSUINT32 cbDomain;
  2558. TSUINT8 Domain[TS_MAX_DOMAIN_LENGTH_OLD];
  2559. TSUINT32 cbUserName;
  2560. TSUINT8 UserName[TS_MAX_USERNAME_LENGTH];
  2561. TSUINT32 SessionId;
  2562. } TS_LOGON_INFO, FAR * PTS_LOGON_INFO;
  2563. /****************************************************************************/
  2564. /* Structure: TS_LOGON_INFO_VERSION_2 ; For Supporting Long Credentials */
  2565. /****************************************************************************/
  2566. typedef struct tagTS_LOGON_INFO_VERSION_2
  2567. {
  2568. TSUINT16 Version;
  2569. #define SAVE_SESSION_PDU_VERSION_ONE 1
  2570. TSUINT32 Size;
  2571. TSUINT32 SessionId;
  2572. TSUINT32 cbDomain;
  2573. TSUINT32 cbUserName;
  2574. // NOTE -- Actual Domain and UserName follows this structure
  2575. // The actual Domain name follows this structure immediately
  2576. // The actual UserName follows the Domain Name
  2577. // Both the Domain and UserName are NULL terminated
  2578. } TS_LOGON_INFO_VERSION_2, FAR * PTS_LOGON_INFO_VERSION_2;
  2579. /****************************************************************************/
  2580. /* Structure: TS_LOGON_INFO_EXTENDED ; Supports extended logon info */
  2581. /****************************************************************************/
  2582. typedef struct tagTS_LOGON_INFO_EXTENDED
  2583. {
  2584. // Overall length of this packet, including the header fields.
  2585. TSUINT16 Length;
  2586. // Flags specify which pieces of data are present (ordered)
  2587. TSUINT32 Flags;
  2588. #define LOGON_EX_AUTORECONNECTCOOKIE 0x1
  2589. // Variable-length. For each field, it has the form
  2590. // ULONG Length
  2591. // BYTE data[]
  2592. } TS_LOGON_INFO_EXTENDED, FAR * PTS_LOGON_INFO_EXTENDED;
  2593. /****************************************************************************/
  2594. /* Structure: TS_SAVE_SESSION_INFO_PDU */
  2595. /****************************************************************************/
  2596. typedef struct tagTS_SAVE_SESSION_INFO_PDU_DATA
  2597. {
  2598. TSUINT32 InfoType;
  2599. #define TS_INFOTYPE_LOGON 0
  2600. #define TS_INFOTYPE_LOGON_LONG 1
  2601. // Plain notify just notifies of the fact that we've logged on.
  2602. #define TS_INFOTYPE_LOGON_PLAINNOTIFY 2
  2603. // Extended logon info packet (e.g contains autoreconnect cookie)
  2604. #define TS_INFOTYPE_LOGON_EXTENDED_INFO 3
  2605. union
  2606. {
  2607. TS_LOGON_INFO LogonInfo;
  2608. TS_LOGON_INFO_VERSION_2 LogonInfoVersionTwo;
  2609. TS_LOGON_INFO_EXTENDED LogonInfoEx;
  2610. } Info;
  2611. } TS_SAVE_SESSION_INFO_PDU_DATA, FAR * PTS_SAVE_SESSION_INFO_PDU_DATA;
  2612. typedef struct tagTS_SAVE_SESSION_INFO_PDU
  2613. {
  2614. TS_SHAREDATAHEADER shareDataHeader;
  2615. TS_SAVE_SESSION_INFO_PDU_DATA data;
  2616. } TS_SAVE_SESSION_INFO_PDU, FAR * PTS_SAVE_SESSION_INFO_PDU;
  2617. #define TS_SAVE_SESSION_INFO_PDU_SIZE sizeof(TS_SAVE_SESSION_INFO_PDU)
  2618. /****************************************************************************/
  2619. /* Structure: TS_SET_ERROR_INFO_PDU */
  2620. /****************************************************************************/
  2621. typedef struct tagTS_SET_ERROR_INFO_PDU
  2622. {
  2623. TS_SHAREDATAHEADER shareDataHeader;
  2624. TSUINT32 errorInfo;
  2625. } TS_SET_ERROR_INFO_PDU, FAR * PTS_SET_ERROR_INFO_PDU;
  2626. #define TS_SET_ERROR_INFO_PDU_SIZE sizeof(TS_SET_ERROR_INFO_PDU)
  2627. /****************************************************************************/
  2628. /* Structure: TS_SET_KEYBOARD_INDICATORS_PDU */
  2629. /****************************************************************************/
  2630. typedef struct tagTS_SET_KEYBOARD_INDICATORS_PDU
  2631. {
  2632. TS_SHAREDATAHEADER shareDataHeader;
  2633. TSUINT16 UnitId;
  2634. TSUINT16 LedFlags;
  2635. } TS_SET_KEYBOARD_INDICATORS_PDU, FAR * PTS_SET_KEYBOARD_INDICATORS_PDU;
  2636. #define TS_SET_KEYBOARD_INDICATORS_PDU_SIZE sizeof(TS_SET_KEYBOARD_INDICATORS_PDU)
  2637. /****************************************************************************/
  2638. /* Structure: TS_SET_KEYBOARD_IME_STATUS_PDU */
  2639. /****************************************************************************/
  2640. typedef struct tagTS_SET_KEYBOARD_IME_STATUS_PDU
  2641. {
  2642. TS_SHAREDATAHEADER shareDataHeader;
  2643. TSUINT16 UnitId;
  2644. TSUINT32 ImeOpen;
  2645. TSUINT32 ImeConvMode;
  2646. } TS_SET_KEYBOARD_IME_STATUS_PDU, FAR * PTS_SET_KEYBOARD_IME_STATUS_PDU;
  2647. #define TS_SET_KEYBOARD_IME_STATUS_PDU_SIZE sizeof(TS_SET_KEYBOARD_IME_STATUS_PDU)
  2648. /****************************************************************************/
  2649. /* Structure: TS_AUTORECONNECT_STATUS_PDU */
  2650. /****************************************************************************/
  2651. typedef struct tagTS_AUTORECONNECT_STATUS_PDU
  2652. {
  2653. TS_SHAREDATAHEADER shareDataHeader;
  2654. TSUINT32 arcStatus;
  2655. } TS_AUTORECONNECT_STATUS_PDU, FAR * PTS_AUTORECONNECT_STATUS_PDU;
  2656. #define TS_AUTORECONNECT_STATUS_PDU_SIZE sizeof(TS_AUTORECONNECT_STATUS_PDU)
  2657. /****************************************************************************/
  2658. /* Restore packing style (previous for 32-bit, default for 16-bit). */
  2659. /****************************************************************************/
  2660. #ifdef OS_WIN16
  2661. #pragma pack ()
  2662. #else
  2663. #pragma pack (pop, t128pack)
  2664. #endif
  2665. #endif /* _H_AT128 */