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

3635 lines
102 KiB

  1. //
  2. // T.SHARE protocol
  3. //
  4. #ifndef _H_T_SHARE
  5. #define _H_T_SHARE
  6. //
  7. // TSHARE PROTOCOL STRUCTURES
  8. // These are defined in a way that keeps the offsets and total sizes the
  9. // same, regardless of whether this header is included in 32-bit code,
  10. // 16-bit code, big-endian code, etc.
  11. //
  12. // We make special types to avoid inadvertenly altering something else and
  13. // breaking the structure. The TSHR_ prefix helps make this clear.
  14. //
  15. ////////////////////////////////
  16. //
  17. // BASIC TYPES
  18. //
  19. ////////////////////////////////
  20. typedef char TSHR_CHAR;
  21. typedef TSHR_CHAR FAR* LPTSHR_CHAR;
  22. typedef TSHR_CHAR UNALIGNED FAR* LPTSHR_CHAR_UA;
  23. typedef signed char TSHR_INT8;
  24. typedef TSHR_INT8 FAR* LPTSHR_INT8;
  25. typedef TSHR_INT8 UNALIGNED FAR* LPTSHR_INT8_UA;
  26. typedef BYTE TSHR_UINT8;
  27. typedef TSHR_UINT8 FAR* LPTSHR_UINT8;
  28. typedef TSHR_UINT8 UNALIGNED FAR * LPTSHR_UINT8_UA;
  29. typedef short TSHR_INT16;
  30. typedef TSHR_INT16 FAR* LPTSHR_INT16;
  31. typedef TSHR_INT16 UNALIGNED FAR * LPTSHR_INT16_UA;
  32. typedef unsigned short TSHR_UINT16;
  33. typedef TSHR_UINT16 FAR* LPTSHR_UINT16;
  34. typedef TSHR_UINT16 UNALIGNED FAR * LPTSHR_UINT16_UA;
  35. typedef long TSHR_INT32;
  36. typedef TSHR_INT32 FAR* LPTSHR_INT32;
  37. typedef TSHR_INT32 UNALIGNED FAR * LPTSHR_INT32_UA;
  38. typedef unsigned long TSHR_UINT32;
  39. typedef TSHR_UINT32 FAR* LPTSHR_UINT32;
  40. typedef TSHR_UINT32 UNALIGNED FAR * LPTSHR_UINT32_UA;
  41. // TSHR_PERSONID
  42. typedef TSHR_UINT32 TSHR_PERSONID;
  43. typedef TSHR_PERSONID * LPTSHR_PERSONID;
  44. // TSHR_POINT16 -- POINT with WORD fields
  45. typedef struct tagTSHR_POINT16
  46. {
  47. TSHR_INT16 x;
  48. TSHR_INT16 y;
  49. }
  50. TSHR_POINT16;
  51. typedef TSHR_POINT16 FAR * LPTSHR_POINT16;
  52. // TSHR_POINT32 -- POINT with DWORD fields
  53. typedef struct tagTSHR_POINT32
  54. {
  55. TSHR_INT32 x;
  56. TSHR_INT32 y;
  57. }
  58. TSHR_POINT32;
  59. typedef TSHR_POINT32 FAR * LPTSHR_POINT32;
  60. // Conversion Macros
  61. _inline void TSHR_POINT16_FROM_POINT(LPTSHR_POINT16 pPt16, POINT pt)
  62. {
  63. pPt16->x = (TSHR_INT16)pt.x;
  64. pPt16->y = (TSHR_INT16)pt.y;
  65. }
  66. _inline void POINT_FROM_TSHR_POINT16(LPPOINT pPt, TSHR_POINT16 pt16)
  67. {
  68. pPt->x = pt16.x;
  69. pPt->y = pt16.y;
  70. }
  71. // TSHR_RECT16 -- RECT with WORD fields
  72. typedef struct tagTSHR_RECT16
  73. {
  74. TSHR_INT16 left;
  75. TSHR_INT16 top;
  76. TSHR_INT16 right;
  77. TSHR_INT16 bottom;
  78. }
  79. TSHR_RECT16;
  80. typedef TSHR_RECT16 FAR * LPTSHR_RECT16;
  81. // TSHR_RECT32 -- RECT with DWORD fields
  82. typedef struct tagTSHR_RECT32
  83. {
  84. TSHR_INT32 left;
  85. TSHR_INT32 top;
  86. TSHR_INT32 right;
  87. TSHR_INT32 bottom;
  88. }
  89. TSHR_RECT32;
  90. typedef TSHR_RECT32 FAR * LPTSHR_RECT32;
  91. // Conversion Macros
  92. #ifdef IS_16
  93. #define TSHR_RECT16_FROM_RECT(lprcTshr, rc) \
  94. CopyRect((LPRECT)lprcTshr, &rc)
  95. #define RECT_FROM_TSHR_RECT16(lprc, tshrrc) \
  96. CopyRect(lprc, (LPRECT)&tshrrc)
  97. #else
  98. _inline void TSHR_RECT16_FROM_RECT(LPTSHR_RECT16 pRect16, RECT rect)
  99. {
  100. pRect16->left = (TSHR_INT16)rect.left;
  101. pRect16->top = (TSHR_INT16)rect.top;
  102. pRect16->right = (TSHR_INT16)rect.right;
  103. pRect16->bottom = (TSHR_INT16)rect.bottom;
  104. }
  105. __inline void RECT_FROM_TSHR_RECT16(LPRECT pRect, TSHR_RECT16 rect16)
  106. {
  107. pRect->left = rect16.left;
  108. pRect->top = rect16.top;
  109. pRect->right = rect16.right;
  110. pRect->bottom = rect16.bottom;
  111. }
  112. #endif // IS_16
  113. //
  114. // TSHR_RGBQUAD
  115. // =======
  116. // rgbBlue : blue value.
  117. // rgbGreen : green value.
  118. //
  119. // rgbRed : red value.
  120. // rgbReserved : reserved.
  121. //
  122. typedef struct tagTSHR_RGBQUAD
  123. {
  124. TSHR_UINT8 rgbBlue;
  125. TSHR_UINT8 rgbGreen;
  126. TSHR_UINT8 rgbRed;
  127. TSHR_UINT8 rgbReserved;
  128. }
  129. TSHR_RGBQUAD;
  130. typedef TSHR_RGBQUAD FAR * LPTSHR_RGBQUAD;
  131. //
  132. // TSHR_COLOR
  133. // =======
  134. // red : red value.
  135. // green : green value.
  136. // blue : blue value.
  137. //
  138. typedef struct tagTSHR_COLOR
  139. {
  140. TSHR_UINT8 red;
  141. TSHR_UINT8 green;
  142. TSHR_UINT8 blue;
  143. }
  144. TSHR_COLOR;
  145. typedef TSHR_COLOR FAR * LPTSHR_COLOR;
  146. //
  147. // TSHR_COLORS
  148. // ========
  149. // fg : foreground color.
  150. // bg : background color.
  151. //
  152. typedef struct tagTSHR_COLORS
  153. {
  154. TSHR_COLOR fg;
  155. TSHR_COLOR bg;
  156. }
  157. TSHR_COLORS;
  158. typedef TSHR_COLORS FAR * LPTSHR_COLORS;
  159. //
  160. // BITMAPINFO_ours
  161. // ===============
  162. // bmiHeader :
  163. // bmiColors :
  164. //
  165. typedef struct tagBITMAPINFO_ours
  166. {
  167. BITMAPINFOHEADER bmiHeader;
  168. TSHR_RGBQUAD bmiColors[256];
  169. }
  170. BITMAPINFO_ours;
  171. #define TSHR_RGBQUAD_TO_TSHR_COLOR(TshrRGBQuad, TshrColor) \
  172. TshrColor.red = TshrRGBQuad.rgbRed; \
  173. TshrColor.green = TshrRGBQuad.rgbGreen; \
  174. TshrColor.blue = TshrRGBQuad.rgbBlue
  175. #define TSHR_COLOR_TO_PALETTEENTRY(TshrColor, pe) \
  176. pe.peGreen = TshrColor.green; \
  177. pe.peRed = TshrColor.red; \
  178. pe.peBlue = TshrColor.blue; \
  179. pe.peFlags = 0
  180. #define TSHR_RGBQUAD_TO_PALETTEENTRY(TshrRGBQuad, pe) \
  181. pe.peRed = TshrRGBQuad.rgbRed; \
  182. pe.peGreen = TshrRGBQuad.rgbGreen; \
  183. pe.peBlue = TshrRGBQuad.rgbBlue; \
  184. pe.peFlags = 0
  185. //
  186. // DATE
  187. // =======
  188. // day : day of the month (1-31).
  189. // month : month (1-12).
  190. // year : year (e.g. 1996).
  191. //
  192. typedef struct tagTSHR_DATE
  193. {
  194. TSHR_UINT8 day;
  195. TSHR_UINT8 month;
  196. TSHR_UINT16 year;
  197. } TSHR_DATE;
  198. typedef TSHR_DATE FAR * LPTSHR_DATE;
  199. //
  200. // TSHR_TIME
  201. // =======
  202. // hour : hour (0-23).
  203. // min : minute (0-59).
  204. // sec : seconds (0-59).
  205. // hundredths : hundredths of a second (0-99).
  206. //
  207. typedef struct tagTSHR_TIME
  208. {
  209. TSHR_UINT8 hour;
  210. TSHR_UINT8 min;
  211. TSHR_UINT8 sec;
  212. TSHR_UINT8 hundredths;
  213. }
  214. TSHR_TIME;
  215. typedef TSHR_TIME FAR * LPTSHR_TIME;
  216. //
  217. // Maximum length of a person name
  218. //
  219. #define TSHR_MAX_PERSON_NAME_LEN 48
  220. //
  221. // Common person information: This is an ObMan object
  222. //
  223. typedef struct tagTSHR_PERSON_DATA
  224. {
  225. char personName[TSHR_MAX_PERSON_NAME_LEN];
  226. TSHR_PERSONID personHandle; // Call manager ID
  227. }
  228. TSHR_PERSON_DATA;
  229. typedef TSHR_PERSON_DATA * PTSHR_PERSON_DATA;
  230. ////////////////////////////////
  231. //
  232. // CAPABILITIES
  233. //
  234. ////////////////////////////////
  235. //
  236. // Version numbers.
  237. //
  238. #define CAPS_VERSION_20 0x0200 // NM 2.x
  239. #define CAPS_VERSION_30 0x0300 // NM 3.0
  240. #define CAPS_VERSION_OLDEST_SUPPORTED CAPS_VERSION_20
  241. #define CAPS_VERSION_CURRENT CAPS_VERSION_30
  242. //
  243. // Operating system and operating system version numbers.
  244. //
  245. #define CAPS_WINDOWS 0x0001
  246. #define CAPS_WINDOWS_31 0x0001
  247. #define CAPS_WINDOWS_95 0x0002
  248. #define CAPS_WINDOWS_NT 0x0003
  249. //
  250. // Logical capabilities field values.
  251. //
  252. #define CAPS_UNDEFINED 0
  253. #define CAPS_SUPPORTED 1
  254. #define CAPS_UNSUPPORTED 2
  255. //
  256. // Number of order fields in the orders array. This must never change
  257. // because the fields within the capabilities structure must never move.
  258. // If more orders fields are required then they must be added to the end of
  259. // the capabilities structure.
  260. //
  261. #define CAPS_MAX_NUM_ORDERS 32
  262. //
  263. // String length of the driver name field in the capabilities structure.
  264. // This allows for an 8.3 driver name (eg VGA.DRV), a NULL, and padding.
  265. //
  266. #define CAPS_DRIVER_NAME_LENGTH 16
  267. //
  268. // Capabilities (group structures) IDs currently defined. Each ID
  269. // corresponds to a different PROTCAPS structure. (See below).
  270. //
  271. #define CAPS_ID_GENERAL 1
  272. #define CAPS_ID_SCREEN 2
  273. #define CAPS_ID_ORDERS 3
  274. #define CAPS_ID_BITMAPCACHE 4
  275. #define CAPS_UNUSED_HCA 5
  276. #define CAPS_UNUSED_FE 6
  277. #define CAPS_UNUSED_AWC 7
  278. #define CAPS_ID_CM 8
  279. #define CAPS_ID_SC 9
  280. #define CAPS_ID_PM 10
  281. #define CAPS_UNUSED_SWL 11 // Used to be for regional window stuff
  282. //
  283. // Capabilities structure header.
  284. //
  285. typedef struct tagPROTCAPSHEADER
  286. {
  287. TSHR_UINT16 capID;
  288. TSHR_UINT16 capSize;
  289. }
  290. PROTCAPSHEADER;
  291. //
  292. // Structure passed to CPC_RegisterCapabilities and returned by
  293. // CPC_EnumerateCapabilities. The data field is of variable length (but
  294. // always ends dword aligned).
  295. //
  296. typedef struct tagPROTCAPS
  297. {
  298. PROTCAPSHEADER header;
  299. TSHR_UINT32 data[1];
  300. }
  301. PROTCAPS;
  302. typedef PROTCAPS *PPROTCAPS;
  303. //
  304. // Structure returned by CPC_GetCombinedCapabilities and as part of a
  305. // NET_EV_PERSON_ADD event.
  306. //
  307. typedef struct tagPROTCOMBINEDCAPS_HEADER
  308. {
  309. TSHR_UINT16 numCapabilities;
  310. TSHR_UINT16 pad1;
  311. }
  312. PROTCOMBINEDCAPS_HEADER;
  313. typedef PROTCOMBINEDCAPS_HEADER * PPROTCOMBINEDCAPS_HEADER;
  314. typedef struct tagPROTCOMBINEDCAPS
  315. {
  316. PROTCOMBINEDCAPS_HEADER header;
  317. PROTCAPS capabilities[1];
  318. }
  319. PROTCOMBINEDCAPS;
  320. typedef PROTCOMBINEDCAPS * PPROTCOMBINEDCAPS;
  321. typedef PPROTCOMBINEDCAPS * PPPROTCOMBINEDCAPS;
  322. //
  323. //
  324. // Curent capabilities structure (corresponding to the generic structures
  325. // defined above)....
  326. //
  327. // Note that these must be DWORD padded in size for the current code to
  328. // work correctly on all platforms.
  329. //
  330. //
  331. //
  332. // AS type flags
  333. //
  334. #define AS_SERVICE 0x0001
  335. #define AS_UNATTENDED 0x0002
  336. //
  337. // General capabilities.
  338. //
  339. typedef struct tagPROTCAPS_GENERAL
  340. {
  341. PROTCAPSHEADER header;
  342. TSHR_UINT16 OS;
  343. TSHR_UINT16 OSVersion;
  344. TSHR_UINT16 version;
  345. TSHR_UINT16 supportsDOS6Compression; // OBSOLETE
  346. TSHR_UINT16 genCompressionType; // OBSOLETE
  347. TSHR_UINT16 typeFlags; // NEW FOR 3.0
  348. TSHR_UINT16 supportsCapsUpdate; // almost OBSOLETE
  349. TSHR_UINT16 supportsRemoteUnshare; // OBSOLETE
  350. // NEW FOR NM 2.0 NT && NM 2.1 WIN95
  351. TSHR_UINT16 genCompressionLevel;
  352. TSHR_UINT16 pad1;
  353. }
  354. PROTCAPS_GENERAL;
  355. typedef PROTCAPS_GENERAL *PPROTCAPS_GENERAL;
  356. #define PROTCAPS_GENERAL_SIZE_NM20 FIELD_OFFSET(PROTCAPS_GENERAL, genCompressionLevel)
  357. //
  358. // Values for genCompressionLevel
  359. //
  360. // Level 0 : Only GDC_PKZIP compression is allowed in entire share session
  361. // (genCompressionType indicates if a node supports it)
  362. // Bit 15 (PT_COMPRESSED) of packetType field is used to
  363. // indicate if a packet is compressed.
  364. //
  365. // Level 1 : Each nodes genCompressionType indicates which compression
  366. // algorithms it can use to DECOMPRESS packets.
  367. // A node can compress a packet with any compression algorithm
  368. // that the receiving node(s) can decompress with.
  369. // The top byte of packetType indicates which compression
  370. // algorithm a packet ahs been compressed with.
  371. //
  372. // If the genCompressionLevel field is not present in a nodes GENERAL
  373. // capabilities then that node is assumed to be use level 0.
  374. //
  375. #define CAPS_GEN_COMPRESSION_LEVEL_0 ((TSHR_UINT16)0x0000)
  376. #define CAPS_GEN_COMPRESSION_LEVEL_1 ((TSHR_UINT16)0x0001)
  377. //
  378. // Bitmap capabilities.
  379. //
  380. typedef struct tagPROTCAPS_SCREEN
  381. {
  382. PROTCAPSHEADER header;
  383. TSHR_UINT16 capsBPP;
  384. TSHR_UINT16 capsSupports1BPP; // OBSOLETE 3.0
  385. TSHR_UINT16 capsSupports4BPP; // Almost OBSOLETE
  386. TSHR_UINT16 capsSupports8BPP; // Almost OBSOLETE
  387. TSHR_UINT16 capsScreenWidth;
  388. TSHR_UINT16 capsScreenHeight;
  389. //
  390. // Need to keep this field unused for NM 2.0 interop.
  391. // Can be reused when only care about NM 2.1 and above.
  392. //
  393. TSHR_UINT16 capsSupportsV1Compression; // OBSOLETE
  394. TSHR_UINT16 capsSupportsDesktopResize;
  395. TSHR_UINT16 capsSupportsV2Compression; // OBSOLETE
  396. //
  397. // NM 2.1 and earlier did NOT zero-init the caps structures. Therefore
  398. // old pad fields can't be recovered until we only care about NM 3.0
  399. // compatibility and above.
  400. //
  401. TSHR_UINT16 pad1;
  402. // NEW FOR NM 3.0
  403. TSHR_UINT16 capsSupports24BPP;
  404. TSHR_UINT16 pad2; // INIT THIS TO 0 ALWAYS; THEN IT CAN BE USED IN THE FUTURE
  405. }
  406. PROTCAPS_SCREEN;
  407. typedef PROTCAPS_SCREEN *PPROTCAPS_SCREEN;
  408. #define PROTCAPS_SCREEN_SIZE_NM21 FIELD_OFFSET(PROTCAPS_SCREEN, capsSupportsTrueColor)
  409. //
  410. // Orders capabilities.
  411. //
  412. typedef struct tagPROTCAPS_ORDERS
  413. {
  414. PROTCAPSHEADER header;
  415. TSHR_CHAR capsDisplayDriver[CAPS_DRIVER_NAME_LENGTH]; // OBSOLETE
  416. TSHR_UINT32 capsSaveBitmapSize;
  417. TSHR_UINT16 capsSaveBitmapXGranularity;
  418. TSHR_UINT16 capsSaveBitmapYGranularity;
  419. TSHR_UINT16 capsSaveBitmapMaxSaveLevel; // OBSOLETE
  420. TSHR_UINT16 capsMaxOrderlevel;
  421. TSHR_UINT16 capsNumFonts; // OBSOLETE
  422. TSHR_UINT16 capsEncodingLevel; // See below
  423. BYTE capsOrders[CAPS_MAX_NUM_ORDERS];
  424. TSHR_UINT16 capsfFonts; // only introduced at r1.1
  425. TSHR_UINT16 pad1; // For DWORD alignment
  426. //
  427. // The size of the SSI save bitmap.
  428. //
  429. TSHR_UINT32 capsSendSaveBitmapSize; // OBSOLETE
  430. //
  431. // The size of the SSI receive bitmap.
  432. //
  433. TSHR_UINT32 capsReceiveSaveBitmapSize; // OBSOLETE
  434. TSHR_UINT16 capsfSendScroll; // OBSOLETE
  435. // NEW FOR NM 2.0 NT && NM 2.1 WIN95
  436. TSHR_UINT16 pad2;
  437. }
  438. PROTCAPS_ORDERS;
  439. typedef PROTCAPS_ORDERS *PPROTCAPS_ORDERS;
  440. #define PROTCAPS_ORDERS_SIZE_NM20 FIELD_OFFSET(PROTCAPS_ORDERS, pad2)
  441. //
  442. // Define the size of the bitmap used for the SaveBitmap order.
  443. // These dimensions must be multiples of the granularity values below.
  444. //
  445. #define TSHR_SSI_BITMAP_WIDTH 400
  446. #define TSHR_SSI_BITMAP_HEIGHT 400
  447. #define TSHR_SSI_BITMAP_SIZE (TSHR_SSI_BITMAP_WIDTH * TSHR_SSI_BITMAP_HEIGHT)
  448. #define TSHR_SSI_BITMAP_X_GRANULARITY 1
  449. #define TSHR_SSI_BITMAP_Y_GRANULARITY 20
  450. //
  451. //
  452. // These flags can be set in the capsfFonts fields. See also the defines
  453. // below related to these flags (which must be updated when a new flag
  454. // is defined).
  455. //
  456. #define CAPS_FONT_ASPECT 0x0001
  457. #define CAPS_FONT_SIGNATURE 0x0002
  458. #define CAPS_FONT_CODEPAGE 0x0004
  459. #define CAPS_FONT_RESERVED1 0x0008 // Reserved for future BiDi support
  460. #define CAPS_FONT_OLD_NEED_X 0x0010
  461. #define CAPS_FONT_NEED_X_SOMETIMES 0x0020
  462. #define CAPS_FONT_NEED_X_ALWAYS 0x0040
  463. #define CAPS_FONT_R20_SIGNATURE 0x0080
  464. #define CAPS_FONT_EM_HEIGHT 0x0100
  465. #define CAPS_FONT_ALLOW_BASELINE 0x0200
  466. //
  467. // How the CAPS_FONT_XXX flags should be combined when adding a person to
  468. // the share.
  469. //
  470. //
  471. // AND these flags... the capability is relevant only if ALL parties
  472. // have it
  473. //
  474. #define CAPS_FONT_AND_FLAGS ( CAPS_FONT_ASPECT \
  475. | CAPS_FONT_SIGNATURE \
  476. | CAPS_FONT_R20_SIGNATURE \
  477. | CAPS_FONT_EM_HEIGHT \
  478. | CAPS_FONT_CODEPAGE \
  479. | CAPS_FONT_RESERVED1 \
  480. | CAPS_FONT_ALLOW_BASELINE )
  481. //
  482. // OR these flags... the capability is relevant if ANY ONE party
  483. // requires it.
  484. //
  485. #define CAPS_FONT_OR_FLAGS ( CAPS_FONT_OLD_NEED_X \
  486. | CAPS_FONT_NEED_X_SOMETIMES \
  487. | CAPS_FONT_NEED_X_ALWAYS )
  488. //
  489. // Which of the CAPS_FONT_XXX flags should be switched on/off in the
  490. // combined received capabilities when a person joins the call who does not
  491. // have the capsfFonts field.
  492. //
  493. #define CAPS_FONT_OFF_FLAGS ( CAPS_FONT_ASPECT \
  494. | CAPS_FONT_SIGNATURE \
  495. | CAPS_FONT_CODEPAGE \
  496. | CAPS_FONT_RESERVED1 \
  497. | CAPS_FONT_ALLOW_BASELINE )
  498. #define CAPS_FONT_ON_FLAGS ( 0 )
  499. #ifdef _DEBUG // for assertion
  500. #define CAPS_FONT_R11_TEST_FLAGS ( CAPS_FONT_ASPECT \
  501. | CAPS_FONT_SIGNATURE \
  502. | CAPS_FONT_CODEPAGE \
  503. | CAPS_FONT_RESERVED1 )
  504. #endif
  505. #define CAPS_FONT_R20_TEST_FLAGS ( CAPS_FONT_R20_SIGNATURE \
  506. | CAPS_FONT_EM_HEIGHT )
  507. //
  508. // Level of order encoding support (capsEncodingLevel)
  509. //
  510. // These flags specify the types of order encoding and the level of
  511. // negotiation supported. The flags and their meanings are as follows.
  512. //
  513. // CAPS_ENCODING_BASE_OE
  514. // - The base OE protocol is supported. R1.1 does not support this.
  515. // CAPS_ENCODING_OE2_NEGOTIABLE
  516. // - We can negotiate whether OE2 is supported. R1.1 does not support this.
  517. // CAPS_ENCODING_OE2_DISABLED
  518. // - OE2 is disabled on this machine. This flag is apparently upside down
  519. // so that we can support R1,1, which will set it to 0 (because the
  520. // capability didn;t exist in R1.1).
  521. // CAPS_ENCODING_ALIGNED_OE
  522. // - The aligned OE protocol is supported. R1.1 does not support this.
  523. //
  524. //
  525. #define CAPS_ENCODING_BASE_OE 0x0001
  526. #define CAPS_ENCODING_OE2_NEGOTIABLE 0x0002
  527. #define CAPS_ENCODING_OE2_DISABLED 0x0004
  528. #define CAPS_ENCODING_ALIGNED_OE 0x0008
  529. //
  530. // Encoding level
  531. //
  532. #define CAPS_ENCODING_DCGC20 ( CAPS_ENCODING_BASE_OE \
  533. | CAPS_ENCODING_OE2_NEGOTIABLE)
  534. //
  535. // Encoding level supported by Millennium codebase
  536. //
  537. #define CAPS_ENCODING_DEFAULT ( CAPS_ENCODING_OE2_NEGOTIABLE )
  538. //
  539. // Bitmap Cache capabilities.
  540. //
  541. typedef struct tagPROTCAPS_BITMAPCACHE_DETAILS
  542. {
  543. TSHR_UINT16 capsSmallCacheNumEntries;
  544. TSHR_UINT16 capsSmallCacheCellSize;
  545. TSHR_UINT16 capsMediumCacheNumEntries;
  546. TSHR_UINT16 capsMediumCacheCellSize;
  547. TSHR_UINT16 capsLargeCacheNumEntries;
  548. TSHR_UINT16 capsLargeCacheCellSize;
  549. }
  550. PROTCAPS_BITMAPCACHE_DETAILS;
  551. typedef struct tagPROTCAPS_BITMAPCACHE
  552. {
  553. PROTCAPSHEADER header;
  554. //
  555. // The following fields (which MUST immediately follow the header) are
  556. // used by the point to point R1.1 implementation only {
  557. //
  558. PROTCAPS_BITMAPCACHE_DETAILS r11Obsolete; // OBSOLETE
  559. //
  560. // } end of fields used by point to point implementation only.
  561. //
  562. // The rest of this structure is only used by the multi-party code.
  563. //
  564. PROTCAPS_BITMAPCACHE_DETAILS sender;
  565. PROTCAPS_BITMAPCACHE_DETAILS receiver; // OBSOLETE
  566. }
  567. PROTCAPS_BITMAPCACHE;
  568. typedef PROTCAPS_BITMAPCACHE *PPROTCAPS_BITMAPCACHE;
  569. //
  570. // CM capabilities.
  571. //
  572. typedef struct tagPROTCAPS_CM
  573. {
  574. PROTCAPSHEADER header;
  575. TSHR_UINT16 capsSupportsColorCursors;
  576. TSHR_UINT16 capsCursorCacheSize;
  577. }
  578. PROTCAPS_CM;
  579. typedef PROTCAPS_CM * PPROTCAPS_CM;
  580. #define TSHR_CM_CACHE_ENTRIES 25
  581. //
  582. // PM capabilities.
  583. //
  584. typedef struct tagPROTCAPS_PM
  585. {
  586. PROTCAPSHEADER header;
  587. TSHR_UINT16 capsColorTableCacheSize;
  588. // NEW FOR NM 2.0 NT && NM 2.1 WIN95
  589. TSHR_UINT16 pad1;
  590. }
  591. PROTCAPS_PM;
  592. typedef PROTCAPS_PM * PPROTCAPS_PM;
  593. #define PROTCAPS_PM_SIZE_NM20 FIELD_OFFSET(PROTCAPS_PM, pad1)
  594. #define TSHR_PM_CACHE_ENTRIES 6
  595. //
  596. // SC capabilities.
  597. //
  598. typedef struct tagPROTCAPS_SC
  599. {
  600. PROTCAPSHEADER header;
  601. TSHR_PERSONID gccID;
  602. }
  603. PROTCAPS_SC;
  604. typedef PROTCAPS_SC * PPROTCAPS_SC;
  605. // If you add a PROTCAPS_ strcuture to CPCALLCAPS, update the count
  606. #define PROTCAPS_COUNT 7
  607. typedef struct tagCPCALLCAPS
  608. {
  609. PROTCOMBINEDCAPS_HEADER header;
  610. PROTCAPS_GENERAL general;
  611. PROTCAPS_SCREEN screen;
  612. PROTCAPS_ORDERS orders;
  613. PROTCAPS_BITMAPCACHE bitmaps;
  614. PROTCAPS_CM cursor;
  615. PROTCAPS_PM palette;
  616. PROTCAPS_SC share;
  617. }
  618. CPCALLCAPS;
  619. typedef CPCALLCAPS * PCPCALLCAPS;
  620. #if 0
  621. //
  622. // New 3.0 CAPS. We've accumulated a lot of obsolete or garbage caps. This
  623. // is a condensed new basic set. Note that orders is separated from general
  624. // since it is the most likely one to be periodically added to.
  625. // * General
  626. // * Orders
  627. // * Hosting
  628. //
  629. #define ASCAPS_GENERAL 0
  630. #define ASCAPS_ORDERS 1
  631. #define ASCAPS_HOSTING 2
  632. typedef struct tagTSHRCAPS_GENERAL
  633. {
  634. PROTCAPSHEADER header;
  635. TSHR_UINT16 protVersion;
  636. TSHR_UINT16 asMode; // Unattended, streaming, service, no host, no view, etc.
  637. TSHR_UINT16 gccPersonID; // GCC node ID;
  638. TSHR_UINT16 pktCompression; // None, PKZIP, PersistPKZIP
  639. TSHR_UINT16 protBPPs; // Color depths supported (4, 8, 24)
  640. TSHR_UINT16 screenBPP;
  641. TSHR_UINT16 screenWidth;
  642. TSHR_UINT16 screenHeight;
  643. }
  644. TSHRCAPS_GENERAL;
  645. typedef TSHRCAPS_GENERAL * PTSHRCAPS_GENERAL;
  646. typedef struct tagTSHRCAPS_ORDERS
  647. {
  648. PROTCAPSHEADER header;
  649. }
  650. TSHRCAPS_ORDERS;
  651. typedef TSHRCAPS_ORDERS * PTSHRCAPS_ORDERS;
  652. typedef struct tagTSHRCAPS_HOSTING
  653. {
  654. PROTCAPSHEADER header;
  655. //
  656. // These are zero if the host doesn't have such a thing, and viewers
  657. // should not therefore allocate memory for the caches.
  658. //
  659. TSHR_UINT32 ssiSaveBitsPixels;
  660. TSHR_UINT16 ssiSaveBitsXGranularity;
  661. TSHR_UINT16 ssiSaveBitsYGranularity;
  662. TSHR_UINT16 cmCursorCacheEntries;
  663. TSHR_UINT16 fhGlyphSetCacheEntries;
  664. TSHR_UINT16 pmPaletteCacheEntries;
  665. TSHR_UINT16 pad1;
  666. TSHR_UINT16 sbcSmallBmpCacheEntries;
  667. TSHR_UINT16 sbcSmallBmpCacheBytes;
  668. TSHR_UINT16 sbcMediumBmpCacheEntries;
  669. TSHR_UINT16 sbcMediumBmpCacheEntries;
  670. TSHR_UINT16 sbcLargeBmpCacheEntries;
  671. TSHR_UINT16 sbcLargeBmpCacheBytes;
  672. }
  673. TSHRCAPS_HOSTING;
  674. typedef TSHRCAPS_HOSTING * PTSHRCAPS_HOSTING;
  675. typedef struct tagTSHRCAPS_ORDERS
  676. {
  677. PROTCAPSHEADER header;
  678. TSHR_UINT16 ordCompression; // Encoding types
  679. TSHR_UINT16 fhFontMatching; // Font matching
  680. TSHR_UINT32 localeID;
  681. TSHR_UINT16 fhInternational; // International text stuff
  682. TSHR_UINT16 ordNumOrders; // Size of orders array
  683. TSHR_UINT8 ordOrders[CAPS_MAX_NUM_ORDERS];
  684. }
  685. TSHRCAPS_ORDERS;
  686. typedef TSHRCAPS_ORDERS * PTSHRCAPS_ORDERS;
  687. #endif
  688. ////////////////////////////////
  689. //
  690. // ORDERS
  691. //
  692. ////////////////////////////////
  693. //
  694. //
  695. // COM_ORDER_HEADER
  696. //
  697. // Any orders supplied to the accumulation functions must have
  698. // the following fields filled in:
  699. //
  700. // cbOrderDataLength
  701. // The length in bytes of the order data (i.e. EXCLUDING the
  702. // header - which is always a fixed size).
  703. //
  704. // fOrderFlags
  705. // This can hold a combination of the following flags:
  706. //
  707. // OF_SPOILER - the order can spoil earlier SPOILABLE ones that it
  708. // overlaps
  709. //
  710. // OF_SPOILABLE - the order can be spoilt by SPOILER orders that overlap
  711. // it
  712. //
  713. // OF_BLOCKER - no orders before this one may be spoilt
  714. //
  715. // OF_PRIVATE - a private order (used by bitmap caching code)
  716. //
  717. // OF_NOTCLIPPED - this flag is set by OD2 on the DECODING side of the
  718. // order processing to indicate that the order is not
  719. // clipped. ie the rectangle is the bounding rectangle
  720. // but does not result in any clipping taking place.
  721. // THIS FLAG IS NOT TRANSMITTED ACROSS THE NETWORK.
  722. //
  723. // OF_INTERNAL - the order is an internal order, and should not be sent
  724. // over the wire. An internal order is used to pass data
  725. // from the device driver to the share core.
  726. //
  727. // OF_DESTROP - the order has a ROP which relies on the contents of the
  728. // destination (relies on what is already on the screen).
  729. //
  730. // rcsDst
  731. // The bounding rectangle of the order in INCLUSIVE screen (pel) coords.
  732. //
  733. //
  734. typedef struct tagCOM_ORDER_HEADER
  735. {
  736. TSHR_UINT16 cbOrderDataLength;
  737. TSHR_UINT16 fOrderFlags;
  738. TSHR_RECT16 rcsDst;
  739. }
  740. COM_ORDER_HEADER;
  741. typedef COM_ORDER_HEADER FAR * LPCOM_ORDER_HEADER;
  742. //
  743. // COM_ORDER_HEADER fOrderFlags values
  744. //
  745. #define OF_SPOILER 0x0001
  746. #define OF_SPOILABLE 0x0002
  747. #define OF_BLOCKER 0x0004
  748. #define OF_PRIVATE 0x0008
  749. #define OF_NOTCLIPPED 0x0010
  750. #define OF_SPOILT 0x0020
  751. #define OF_INTERNAL 0x0040
  752. #define OF_DESTROP 0x0080
  753. //
  754. // Each type of order's structure is the bytes in abOrderData[].
  755. //
  756. typedef struct tagCOM_ORDER
  757. {
  758. COM_ORDER_HEADER OrderHeader;
  759. BYTE abOrderData[1];
  760. }
  761. COM_ORDER;
  762. typedef COM_ORDER FAR * LPCOM_ORDER;
  763. typedef COM_ORDER UNALIGNED FAR * LPCOM_ORDER_UA;
  764. //
  765. // Macro to calculate a basic common order size (including the Order
  766. // Header).
  767. //
  768. #define COM_ORDER_SIZE(pOrder) \
  769. (pOrder->OrderHeader.cbOrderDataLength + sizeof(COM_ORDER_HEADER))
  770. //
  771. // The various drawing order structures have the following design objectives
  772. //
  773. // the first field - type - is common to all orders.
  774. // field ordering is kept as regular as possible amongst similar
  775. // orders so that compression may find more regular sequences
  776. // fields are naturally aligned (dwords on dword boundaries etc)
  777. // fields are reordered so to preserve alignment rather than add
  778. // padding
  779. // padding is added as a last resort.
  780. // variable sized data comes at the end of the structure.
  781. //
  782. // All rectangles are inclusive of start and end points.
  783. //
  784. // All points are in screen coordinates, with (0,0) at top left.
  785. //
  786. // Interpretation of individual field values is as in Windows
  787. // in particular pens, brushes and font are as defined for Windows 3.1
  788. //
  789. //
  790. // Orders - the high word is used as an index into a table
  791. // - the low word is a 2 character ASCII type descriptor and is the
  792. // only part actually passed in the order.
  793. //
  794. #define ORD_DSTBLT_INDEX 0x0000
  795. #define ORD_PATBLT_INDEX 0x0001
  796. #define ORD_SCRBLT_INDEX 0x0002
  797. #define ORD_MEMBLT_INDEX 0x0003
  798. #define ORD_MEM3BLT_INDEX 0x0004
  799. #define ORD_TEXTOUT_INDEX 0x0005
  800. #define ORD_EXTTEXTOUT_INDEX 0x0006
  801. #define ORD_RECTANGLE_INDEX 0x0007
  802. #define ORD_LINETO_INDEX 0x0008
  803. #define ORD_UNUSED_INDEX 0x0009
  804. #define ORD_OPAQUERECT_INDEX 0x000A
  805. #define ORD_SAVEBITMAP_INDEX 0x000B
  806. #define ORD_RESERVED_INDEX 0x000C
  807. #define ORD_MEMBLT_R2_INDEX 0x000D
  808. #define ORD_MEM3BLT_R2_INDEX 0x000E
  809. #define ORD_POLYGON_INDEX 0x000F
  810. #define ORD_PIE_INDEX 0x0010
  811. #define ORD_ELLIPSE_INDEX 0x0011
  812. #define ORD_ARC_INDEX 0x0012
  813. #define ORD_CHORD_INDEX 0x0013
  814. #define ORD_POLYBEZIER_INDEX 0x0014
  815. #define ORD_ROUNDRECT_INDEX 0x0015
  816. //
  817. // It IS OK to use order 000C! These numbers don't clash with OE2_* in
  818. // aoe2int.h. Replace ORD_RESERVED_INDEX (0xC) for the next new order.
  819. //
  820. // NOTE: When you use this index, OE_GetLocalOrderSupport must be updated
  821. // to allow the order.
  822. //
  823. #define ORD_DSTBLT_TYPE 0x4244 // "DB"
  824. #define ORD_PATBLT_TYPE 0x4250 // "PB"
  825. #define ORD_SCRBLT_TYPE 0x4253 // "SB"
  826. #define ORD_MEMBLT_TYPE 0x424d // "MB"
  827. #define ORD_MEM3BLT_TYPE 0x4233 // "3B"
  828. #define ORD_TEXTOUT_TYPE 0x4f54 // "TO"
  829. #define ORD_EXTTEXTOUT_TYPE 0x5445 // "ET"
  830. #define ORD_RECTANGLE_TYPE 0x5452 // "RT"
  831. #define ORD_LINETO_TYPE 0x544c // "LT"
  832. #define ORD_OPAQUERECT_TYPE 0x524f // "OR"
  833. #define ORD_SAVEBITMAP_TYPE 0x5653 // "SV"
  834. #define ORD_MEMBLT_R2_TYPE 0x434d // "MC"
  835. #define ORD_MEM3BLT_R2_TYPE 0x4333 // "3C"
  836. #define ORD_POLYGON_TYPE 0x4750 // "PG"
  837. #define ORD_PIE_TYPE 0x4950 // "PI"
  838. #define ORD_ELLIPSE_TYPE 0x4c45 // "EL"
  839. #define ORD_ARC_TYPE 0x5241 // "AR"
  840. #define ORD_CHORD_TYPE 0x4443 // "CD"
  841. #define ORD_POLYBEZIER_TYPE 0x5A50 // "PZ"
  842. #define ORD_ROUNDRECT_TYPE 0x5252 // "RR"
  843. #define ORD_DSTBLT MAKELONG(ORD_DSTBLT_TYPE, ORD_DSTBLT_INDEX)
  844. #define ORD_PATBLT MAKELONG(ORD_PATBLT_TYPE, ORD_PATBLT_INDEX)
  845. #define ORD_SCRBLT MAKELONG(ORD_SCRBLT_TYPE, ORD_SCRBLT_INDEX)
  846. #define ORD_MEMBLT MAKELONG(ORD_MEMBLT_TYPE, ORD_MEMBLT_INDEX)
  847. #define ORD_MEM3BLT MAKELONG(ORD_MEM3BLT_TYPE, ORD_MEM3BLT_INDEX)
  848. #define ORD_TEXTOUT MAKELONG(ORD_TEXTOUT_TYPE, ORD_TEXTOUT_INDEX)
  849. #define ORD_EXTTEXTOUT MAKELONG(ORD_EXTTEXTOUT_TYPE, ORD_EXTTEXTOUT_INDEX)
  850. #define ORD_RECTANGLE MAKELONG(ORD_RECTANGLE_TYPE, ORD_RECTANGLE_INDEX)
  851. #define ORD_LINETO MAKELONG(ORD_LINETO_TYPE, ORD_LINETO_INDEX)
  852. #define ORD_OPAQUERECT MAKELONG(ORD_OPAQUERECT_TYPE, ORD_OPAQUERECT_INDEX)
  853. #define ORD_SAVEBITMAP MAKELONG(ORD_SAVEBITMAP_TYPE, ORD_SAVEBITMAP_INDEX)
  854. #define ORD_MEMBLT_R2 MAKELONG(ORD_MEMBLT_R2_TYPE, ORD_MEMBLT_R2_INDEX)
  855. #define ORD_MEM3BLT_R2 MAKELONG(ORD_MEM3BLT_R2_TYPE, ORD_MEM3BLT_R2_INDEX)
  856. #define ORD_POLYGON MAKELONG(ORD_POLYGON_TYPE, ORD_POLYGON_INDEX)
  857. #define ORD_PIE MAKELONG(ORD_PIE_TYPE, ORD_PIE_INDEX)
  858. #define ORD_ELLIPSE MAKELONG(ORD_ELLIPSE_TYPE, ORD_ELLIPSE_INDEX)
  859. #define ORD_ARC MAKELONG(ORD_ARC_TYPE, ORD_ARC_INDEX)
  860. #define ORD_CHORD MAKELONG(ORD_CHORD_TYPE, ORD_CHORD_INDEX)
  861. #define ORD_POLYBEZIER MAKELONG(ORD_POLYBEZIER_TYPE, ORD_POLYBEZIER_INDEX)
  862. #define ORD_ROUNDRECT MAKELONG(ORD_ROUNDRECT_TYPE, ORD_ROUNDRECT_INDEX)
  863. //
  864. // The following order is special - support is not negotiated by the
  865. // capsOrders field in the orders capabilities structure.
  866. // The high words start at 32, ie after CAPS_MAX_NUM_ORDERS.
  867. //
  868. // ORD_NUM_INTERNAL_ORDERS is the number of orders we use internally - this
  869. // include all CAPS_MAX_NUM_ORDERS, plus any of these special orders.
  870. //
  871. #define ORD_DESKSCROLL_INDEX 0x0020
  872. #define ORD_DESKSCROLL_TYPE 0x5344 // "DS"
  873. #define ORD_DESKSCROLL MAKELONG(ORD_DESKSCROLL_TYPE, ORD_DESKSCROLL_INDEX)
  874. #define INTORD_COLORTABLE_INDEX 0x000C
  875. #define INTORD_COLORTABLE_TYPE 0x5443 // "CT"
  876. #define INTORD_COLORTABLE MAKELONG(INTORD_COLORTABLE_TYPE, INTORD_COLORTABLE_INDEX)
  877. #define ORD_NUM_INTERNAL_ORDERS 33
  878. #define ORD_NUM_LEVEL_1_ORDERS 22
  879. #define ORD_LEVEL_1_ORDERS 1
  880. //
  881. // The maximum length of string which we will send as an order (either as
  882. // TextOut or ExtTextOut) when a delta X array is supplied or not.
  883. //
  884. //
  885. // NOTE: THESE MUST TOTAL LESS THAN 256 BECAUSE THE TOTAL ENCODED SIZE
  886. // MUST FIT IN ONE BYTE.
  887. //
  888. // STRING_LEN_WITHOUT_DELTAS -- 1 byte per char
  889. // STRING_LEN_WITH_DELTAS -- 1 byte per char + 1 byte per delta
  890. // ORD_MAX_POLYGON_POINTS -- 4 bytes per point (2 each coord)
  891. // ORD_MAX_POLYBEZIER_POINTS -- 4 bytes per point (2 each coord)
  892. //
  893. #define ORD_MAX_STRING_LEN_WITHOUT_DELTAS 255
  894. #define ORD_MAX_STRING_LEN_WITH_DELTAS 127
  895. #define ORD_MAX_POLYGON_POINTS 63
  896. #define ORD_MAX_POLYBEZIER_POINTS 63
  897. //
  898. // Direction codes for arc drawing orders (pie, arc, chord).
  899. // Specifies direction that pie, arc, and chord figures are drawn.
  900. //
  901. #define ORD_ARC_COUNTERCLOCKWISE 1
  902. #define ORD_ARC_CLOCKWISE 2
  903. //
  904. // Fill-mode codes for polygon drawing.
  905. //
  906. // Alternate fills area between odd-numbered and even-numbered polygon
  907. // sides on each scan line.
  908. //
  909. // Winding fills any region with a nonzero winding value.
  910. //
  911. #define ORD_FILLMODE_ALTERNATE 1
  912. #define ORD_FILLMODE_WINDING 2
  913. //
  914. // DstBlt (Destination only Screen Blt)
  915. //
  916. typedef struct _DSTBLT_ORDER
  917. {
  918. TSHR_UINT16 type; // holds "DB" - ORD_DSTBLT
  919. TSHR_INT16 pad1;
  920. TSHR_INT32 nLeftRect; // x upper left
  921. TSHR_INT32 nTopRect; // y upper left
  922. TSHR_INT32 nWidth; // dest width
  923. TSHR_INT32 nHeight; // dest height
  924. TSHR_UINT8 bRop; // ROP
  925. TSHR_UINT8 pad2[3];
  926. } DSTBLT_ORDER, FAR * LPDSTBLT_ORDER;
  927. //
  928. // PatBlt (Pattern to Screen Blt)
  929. //
  930. typedef struct _PATBLT_ORDER
  931. {
  932. TSHR_UINT16 type; // holds "PB" - ORD_PATBLT
  933. TSHR_INT16 pad1;
  934. TSHR_INT32 nLeftRect; // x upper left
  935. TSHR_INT32 nTopRect; // y upper left
  936. TSHR_INT32 nWidth; // dest width
  937. TSHR_INT32 nHeight; // dest height
  938. TSHR_UINT32 bRop; // ROP
  939. TSHR_COLOR BackColor;
  940. TSHR_UINT8 pad2;
  941. TSHR_COLOR ForeColor;
  942. TSHR_UINT8 pad3;
  943. TSHR_INT32 BrushOrgX;
  944. TSHR_INT32 BrushOrgY;
  945. TSHR_UINT32 BrushStyle;
  946. TSHR_UINT32 BrushHatch;
  947. TSHR_UINT8 BrushExtra[7];
  948. TSHR_UINT8 pad4;
  949. } PATBLT_ORDER, FAR * LPPATBLT_ORDER;
  950. //
  951. // ScrBlt (Screen to Screen Blt)
  952. //
  953. typedef struct _SCRBLT_ORDER
  954. {
  955. TSHR_UINT16 type; // holds "SB" - ORD_SCRBLT
  956. TSHR_INT16 pad1;
  957. TSHR_INT32 nLeftRect; // x upper left
  958. TSHR_INT32 nTopRect; // y upper left
  959. TSHR_INT32 nWidth; // dest width
  960. TSHR_INT32 nHeight; // dest height
  961. TSHR_UINT32 bRop; // ROP
  962. TSHR_INT32 nXSrc;
  963. TSHR_INT32 nYSrc;
  964. } SCRBLT_ORDER, FAR * LPSCRBLT_ORDER;
  965. //
  966. // @@@ The common parts of MEMBLT_ORDER / MEMBLT_R2_ORDER and MEM3BLT_ORDER
  967. // / MEM3BLT_R2_ORDER should be merged into a single structure. There is
  968. // code which assumes that the common fields have the same types which goes
  969. // wrong if these are not the same.
  970. //
  971. //
  972. // Define the structure for Bitmap Cache Orders.
  973. // These are sent in Order Packets as "private" orders.
  974. //
  975. //
  976. // Define the possible Bitmap Cache Packet Types.
  977. //
  978. #define BMC_PT_BITMAP_BITS_UNCOMPRESSED 0
  979. #define BMC_PT_COLOR_TABLE 1
  980. #define BMC_PT_BITMAP_BITS_COMPRESSED 2
  981. //
  982. // NOTE: avoid unions to get structure size / alignment correct.
  983. //
  984. // Structure: BMC_BITMAP_BITS_DATA
  985. //
  986. // Description: This is the part of the bitmap bits order which is common
  987. // to both R1 and R2 protocols.
  988. //
  989. typedef struct tagBMC_BITMAP_BITS_DATA
  990. {
  991. TSHR_UINT8 bmcPacketType; // One of:
  992. // BMC_PT_BITMAP_BITS_COMPRESSED
  993. // BMC_PT_BITMAP_BITS_UNCOMPRESSED
  994. TSHR_UINT8 cacheID; // Cache ID
  995. // lonchanc: do not remove iCacheEntryR1 for backward compatibility
  996. TSHR_UINT8 iCacheEntryR1; // Cache index (only used for R1
  997. // protocol
  998. TSHR_UINT8 cxSubBitmapWidth; // Bitmap width
  999. TSHR_UINT8 cySubBitmapHeight; // Bitmap height
  1000. TSHR_UINT8 bpp; // Number of bits per pel of bitmap
  1001. TSHR_UINT16 cbBitmapBits; // Number of bytes of data required to
  1002. // send the bits.
  1003. }
  1004. BMC_BITMAP_BITS_DATA;
  1005. typedef BMC_BITMAP_BITS_DATA FAR * PBMC_BITMAP_BITS_DATA;
  1006. typedef BMC_BITMAP_BITS_DATA UNALIGNED FAR * PBMC_BITMAP_BITS_DATA_UA;
  1007. // Structure: BMC_BITMAP_BITS_ORDER_R2
  1008. //
  1009. // Description: The data which is sent across the wire for an R2 bitmap
  1010. // bits order. The data field is the start of an array of bytes of length
  1011. // header.cbBitmapBits
  1012. //
  1013. // We need a 16 bit cache index in R2. We could add another 8 bit entry
  1014. // and merge with the R1 field, but in the interests of protocol
  1015. // cleanliness we should add a whole 16 bit field and make the R1 index
  1016. // "reserved" in the protocol documentation.
  1017. //
  1018. //
  1019. typedef struct tagBMC_BITMAP_BITS_ORDER_R2
  1020. {
  1021. BMC_BITMAP_BITS_DATA header; // Common header information
  1022. TSHR_UINT16 iCacheEntryR2; // R2 cache index. The high
  1023. // byte is a color table
  1024. // index, and the low byte
  1025. // is the bitmap bits cache
  1026. // index.
  1027. TSHR_UINT8 data[2]; // Start of the bitmap bits.
  1028. }
  1029. BMC_BITMAP_BITS_ORDER_R2;
  1030. typedef BMC_BITMAP_BITS_ORDER_R2 FAR * PBMC_BITMAP_BITS_ORDER_R2;
  1031. typedef BMC_BITMAP_BITS_ORDER_R2 UNALIGNED FAR * PBMC_BITMAP_BITS_ORDER_R2_UA;
  1032. //
  1033. // Structure sent for color data. The data field is the first entry in an
  1034. // array of colorTableSize entries.
  1035. //
  1036. typedef struct tagBMC_COLOR_TABLE_ORDER
  1037. {
  1038. TSHR_UINT8 bmcPacketType; // BMC_PT_COLORTABLE
  1039. TSHR_UINT8 index; // Color table cache index
  1040. TSHR_UINT16 colorTableSize; // Number of entries in the
  1041. // color table being sent.
  1042. TSHR_RGBQUAD data[1]; // Start of an array of color table
  1043. // entries.
  1044. }
  1045. BMC_COLOR_TABLE_ORDER;
  1046. typedef BMC_COLOR_TABLE_ORDER FAR * PBMC_COLOR_TABLE_ORDER;
  1047. typedef BMC_COLOR_TABLE_ORDER UNALIGNED FAR * PBMC_COLOR_TABLE_ORDER_UA;
  1048. //
  1049. // MemBlt (Memory to Screen Blt)
  1050. // R1 protocol
  1051. //
  1052. typedef struct _MEMBLT_ORDER
  1053. {
  1054. TSHR_UINT16 type; // holds "MB" - ORD_MEMBLT
  1055. TSHR_UINT16 cacheId;
  1056. TSHR_INT32 nLeftRect; // x upper left
  1057. TSHR_INT32 nTopRect; // y upper left
  1058. TSHR_INT32 nWidth; // dest width
  1059. TSHR_INT32 nHeight; // dest height
  1060. TSHR_UINT32 bRop; // ROP
  1061. TSHR_INT32 nXSrc;
  1062. TSHR_INT32 nYSrc;
  1063. }
  1064. MEMBLT_ORDER, FAR * LPMEMBLT_ORDER;
  1065. //
  1066. // MemBltR2 (Memory to Screen Blt for R2 protocol)
  1067. // Added cache index
  1068. //
  1069. typedef struct _MEMBLT_R2_ORDER
  1070. {
  1071. TSHR_UINT16 type; // holds "MC" - ORD_MEMBLT
  1072. TSHR_UINT16 cacheId;
  1073. TSHR_INT32 nLeftRect; // x upper left
  1074. TSHR_INT32 nTopRect; // y upper left
  1075. TSHR_INT32 nWidth; // dest width
  1076. TSHR_INT32 nHeight; // dest height
  1077. TSHR_UINT32 bRop; // ROP
  1078. TSHR_INT32 nXSrc;
  1079. TSHR_INT32 nYSrc;
  1080. TSHR_UINT16 cacheIndex;
  1081. } MEMBLT_R2_ORDER, FAR * LPMEMBLT_R2_ORDER;
  1082. //
  1083. // Mem3Blt (Memory Pattern to Screen 3 way ROP Blt)
  1084. //
  1085. typedef struct _MEM3BLT_ORDER
  1086. {
  1087. TSHR_UINT16 type; // holds "MB" - ORD_MEMBLT
  1088. TSHR_UINT16 cacheId;
  1089. TSHR_INT32 nLeftRect; // x upper left
  1090. TSHR_INT32 nTopRect; // y upper left
  1091. TSHR_INT32 nWidth; // dest width
  1092. TSHR_INT32 nHeight; // dest height
  1093. TSHR_UINT32 bRop; // ROP
  1094. TSHR_INT32 nXSrc;
  1095. TSHR_INT32 nYSrc;
  1096. TSHR_COLOR BackColor;
  1097. TSHR_UINT8 pad1;
  1098. TSHR_COLOR ForeColor;
  1099. TSHR_UINT8 pad2;
  1100. TSHR_INT32 BrushOrgX;
  1101. TSHR_INT32 BrushOrgY;
  1102. TSHR_UINT32 BrushStyle;
  1103. TSHR_UINT32 BrushHatch;
  1104. TSHR_UINT8 BrushExtra[7];
  1105. TSHR_UINT8 pad3;
  1106. } MEM3BLT_ORDER, FAR * LPMEM3BLT_ORDER;
  1107. //
  1108. // Mem3Blt (Memory to Screen Blt) for R2 (multipoint) protocols
  1109. // Add a cache index field rather than using nXSrc.
  1110. //
  1111. typedef struct _MEM3BLT_R2_ORDER
  1112. {
  1113. TSHR_UINT16 type; // holds "MB" - ORD_MEMBLT
  1114. TSHR_UINT16 cacheId;
  1115. TSHR_INT32 nLeftRect; // x upper left
  1116. TSHR_INT32 nTopRect; // y upper left
  1117. TSHR_INT32 nWidth; // dest width
  1118. TSHR_INT32 nHeight; // dest height
  1119. TSHR_UINT32 bRop; // ROP
  1120. TSHR_INT32 nXSrc;
  1121. TSHR_INT32 nYSrc;
  1122. TSHR_COLOR BackColor;
  1123. TSHR_UINT8 pad1;
  1124. TSHR_COLOR ForeColor;
  1125. TSHR_UINT8 pad2;
  1126. TSHR_INT32 BrushOrgX;
  1127. TSHR_INT32 BrushOrgY;
  1128. TSHR_UINT32 BrushStyle;
  1129. TSHR_UINT32 BrushHatch;
  1130. TSHR_UINT8 BrushExtra[7];
  1131. TSHR_UINT8 pad3;
  1132. TSHR_UINT16 cacheIndex;
  1133. } MEM3BLT_R2_ORDER, FAR * LPMEM3BLT_R2_ORDER;
  1134. //
  1135. // Variable length text structure as used by TextOut and ExtTextOut orders
  1136. //
  1137. typedef struct tagVARIABLE_STRING
  1138. {
  1139. TSHR_UINT32 len;
  1140. TSHR_CHAR string[ORD_MAX_STRING_LEN_WITHOUT_DELTAS];
  1141. TSHR_UINT8 pad;
  1142. } VARIABLE_STRING;
  1143. //
  1144. // Variable length position deltas as used by ExtTextOut.
  1145. //
  1146. typedef struct tagVARIABLE_DELTAX
  1147. {
  1148. TSHR_UINT32 len;
  1149. TSHR_INT32 deltaX[ORD_MAX_STRING_LEN_WITH_DELTAS];
  1150. } VARIABLE_DELTAX, FAR * LPVARIABLE_DELTAX;
  1151. //
  1152. // Variable length point array used by Polygon.
  1153. //
  1154. typedef struct tagVARIABLE_POINTS
  1155. {
  1156. TSHR_UINT32 len; // byte count of point array
  1157. TSHR_POINT16 aPoints[ORD_MAX_POLYGON_POINTS];
  1158. } VARIABLE_POINTS, FAR * LPVARIABLE_POINTS;
  1159. //
  1160. // Variable length point array used by PolyBezier.
  1161. //
  1162. typedef struct tagVARIABLE_BEZIERPOINTS
  1163. {
  1164. TSHR_UINT32 len; // byte count of point array
  1165. TSHR_POINT16 aPoints[ORD_MAX_POLYBEZIER_POINTS];
  1166. } VARIABLE_BEZIERPOINTS, FAR * LPVARIABLE_BEZIERPOINTS;
  1167. //
  1168. // The common part of the TEXTOUT and EXTTEXTOUT orders
  1169. //
  1170. typedef struct tagCOMMON_TEXTORDER
  1171. {
  1172. TSHR_INT32 BackMode; // background mix mode
  1173. TSHR_INT32 nXStart; // X location of string
  1174. TSHR_INT32 nYStart; // Y location of string
  1175. TSHR_COLOR BackColor; // background color
  1176. TSHR_UINT8 pad2;
  1177. TSHR_COLOR ForeColor; // foreground color
  1178. TSHR_UINT8 pad3;
  1179. TSHR_INT32 CharExtra; // extra character spacing
  1180. TSHR_INT32 BreakExtra; // justification break amount
  1181. TSHR_INT32 BreakCount; // justification break count
  1182. TSHR_INT32 FontHeight;
  1183. TSHR_INT32 FontWidth;
  1184. TSHR_UINT32 FontWeight;
  1185. TSHR_UINT32 FontFlags;
  1186. TSHR_UINT32 FontIndex;
  1187. } COMMON_TEXTORDER, FAR * LPCOMMON_TEXTORDER;
  1188. //
  1189. // TextOut
  1190. //
  1191. typedef struct _TEXTOUT_ORDER
  1192. {
  1193. TSHR_UINT16 type; // holds "TO" - ORD_TEXTOUT
  1194. TSHR_INT16 pad1;
  1195. COMMON_TEXTORDER common;
  1196. //
  1197. // The following variable data occurs here. (Remember to change the
  1198. // code in OD2CalculateTextOutBounds if you change these).
  1199. //
  1200. VARIABLE_STRING variableString;
  1201. } TEXTOUT_ORDER, FAR * LPTEXTOUT_ORDER;
  1202. //
  1203. // ExtTextOut
  1204. //
  1205. typedef struct _EXTTEXTOUT_ORDER
  1206. {
  1207. TSHR_UINT16 type; // holds "ET" - ORD_EXTTEXTOUT
  1208. TSHR_INT16 pad1;
  1209. COMMON_TEXTORDER common;
  1210. TSHR_UINT16 fuOptions; // option flags
  1211. TSHR_UINT16 pad4;
  1212. TSHR_RECT32 rectangle;
  1213. //
  1214. // The following variable data occurs here.
  1215. //
  1216. // char[cbString] - the string of chars to be output
  1217. // TSHR_INT32[cbString] - X deltas for the string
  1218. //
  1219. // (Remember to change the code in OD2CalculateExtTextOutBounds if you
  1220. // change these).
  1221. //
  1222. VARIABLE_STRING variableString;
  1223. VARIABLE_DELTAX variableDeltaX;
  1224. } EXTTEXTOUT_ORDER, FAR * LPEXTTEXTOUT_ORDER;
  1225. //
  1226. // Rectangle
  1227. //
  1228. typedef struct _RECTANGLE_ORDER
  1229. {
  1230. TSHR_UINT16 type; // holds "RT" - ORD_RECTANGLE
  1231. TSHR_INT16 pad1;
  1232. TSHR_INT32 BackMode; // background mix mode
  1233. TSHR_INT32 nLeftRect; // x left
  1234. TSHR_INT32 nTopRect; // y top
  1235. TSHR_INT32 nRightRect; // x right
  1236. TSHR_INT32 nBottomRect; // y bottom
  1237. TSHR_COLOR BackColor; // background color
  1238. TSHR_UINT8 pad2;
  1239. TSHR_COLOR ForeColor; // foreground color
  1240. TSHR_UINT8 pad3;
  1241. TSHR_INT32 BrushOrgX;
  1242. TSHR_INT32 BrushOrgY;
  1243. TSHR_UINT32 BrushStyle;
  1244. TSHR_UINT32 BrushHatch;
  1245. TSHR_UINT8 BrushExtra[7];
  1246. TSHR_UINT8 pad4;
  1247. TSHR_UINT32 ROP2; // drawing mode
  1248. TSHR_UINT32 PenStyle;
  1249. TSHR_UINT32 PenWidth; // always 1 - field retained for
  1250. // backwards compatibility
  1251. TSHR_COLOR PenColor;
  1252. TSHR_UINT8 pad5;
  1253. } RECTANGLE_ORDER, FAR * LPRECTANGLE_ORDER;
  1254. //
  1255. // LineTo
  1256. //
  1257. typedef struct _LINETO_ORDER
  1258. {
  1259. TSHR_UINT16 type; // holds "LT" - ORD_LINETO
  1260. TSHR_INT16 pad1;
  1261. TSHR_INT32 BackMode; // background mix mode
  1262. TSHR_INT32 nXStart; // x line start
  1263. TSHR_INT32 nYStart; // y line start
  1264. TSHR_INT32 nXEnd; // x line end
  1265. TSHR_INT32 nYEnd; // y line end
  1266. TSHR_COLOR BackColor; // background color
  1267. TSHR_UINT8 pad2;
  1268. TSHR_UINT32 ROP2; // drawing mode
  1269. TSHR_UINT32 PenStyle;
  1270. TSHR_UINT32 PenWidth; // always 1 - field retained for
  1271. // backwards compatibility
  1272. TSHR_COLOR PenColor;
  1273. TSHR_UINT8 pad3;
  1274. } LINETO_ORDER, FAR * LPLINETO_ORDER;
  1275. //
  1276. // OpaqueRect
  1277. //
  1278. typedef struct _OPAQUE_RECT
  1279. {
  1280. TSHR_UINT16 type; // holds "OR" - ORD_OPAQUERECT
  1281. TSHR_INT16 pad1;
  1282. TSHR_INT32 nLeftRect; // x upper left
  1283. TSHR_INT32 nTopRect; // y upper left
  1284. TSHR_INT32 nWidth; // dest width
  1285. TSHR_INT32 nHeight; // dest height
  1286. TSHR_COLOR Color; // opaque color
  1287. TSHR_UINT8 pad2;
  1288. } OPAQUERECT_ORDER, FAR * LPOPAQUERECT_ORDER;
  1289. //
  1290. // SaveBitmap (incorporating RestoreBitmap)
  1291. //
  1292. #define SV_SAVEBITS 0
  1293. #define SV_RESTOREBITS 1
  1294. typedef struct _SAVEBITMAP_ORDER
  1295. {
  1296. TSHR_UINT16 type; // holds "SV" - ORD_SAVEBITMAP
  1297. TSHR_INT16 pad1;
  1298. TSHR_UINT32 SavedBitmapPosition;
  1299. TSHR_INT32 nLeftRect; // x left
  1300. TSHR_INT32 nTopRect; // y top
  1301. TSHR_INT32 nRightRect; // x right
  1302. TSHR_INT32 nBottomRect; // y bottom
  1303. TSHR_UINT32 Operation; // SV_xxxxxxxx
  1304. } SAVEBITMAP_ORDER, FAR * LPSAVEBITMAP_ORDER;
  1305. //
  1306. // Desktop scroll order
  1307. //
  1308. // The desktop order is special - it is a non-private order which is second
  1309. // level encoded, BUT support is not negotiated via its own entry in the
  1310. // capsOrdesr array in the orders capabilities.
  1311. //
  1312. // (Sending support is determined via a number of factors - at r2.x receive
  1313. // support for ORD_SCRBLT implies support for ORD_DESKSCROLL as well).
  1314. //
  1315. //
  1316. typedef struct _DESKSCROLL_ORDER
  1317. {
  1318. TSHR_UINT16 type; // holds "DS" - ORD_DESKSCROLL
  1319. TSHR_INT16 pad1;
  1320. TSHR_INT32 xOrigin;
  1321. TSHR_INT32 yOrigin;
  1322. } DESKSCROLL_ORDER, FAR * LPDESKSCROLL_ORDER;
  1323. //
  1324. // Polygon
  1325. //
  1326. typedef struct _POLYGON_ORDER
  1327. {
  1328. TSHR_UINT16 type; // holds "PG" - ORD_POLYGON
  1329. TSHR_INT16 pad1;
  1330. TSHR_INT32 BackMode; // background mix mode
  1331. TSHR_COLOR BackColor; // background color
  1332. TSHR_UINT8 pad2;
  1333. TSHR_COLOR ForeColor; // foreground color
  1334. TSHR_UINT8 pad3;
  1335. TSHR_INT32 BrushOrgX;
  1336. TSHR_INT32 BrushOrgY;
  1337. TSHR_UINT32 BrushStyle;
  1338. TSHR_UINT32 BrushHatch;
  1339. TSHR_UINT8 BrushExtra[7];
  1340. TSHR_UINT8 pad4;
  1341. TSHR_UINT32 ROP2; // drawing mode
  1342. TSHR_UINT32 PenStyle;
  1343. TSHR_UINT32 PenWidth; // always 1 - field retained for
  1344. // backwards compatibility
  1345. TSHR_COLOR PenColor;
  1346. TSHR_UINT8 pad5;
  1347. TSHR_UINT32 FillMode; // ORD_FILLMODE_ALTERNATE or
  1348. // ORD_FILLMODE_WINDING
  1349. //
  1350. // The following variable data occurs here.
  1351. //
  1352. VARIABLE_POINTS variablePoints;
  1353. } POLYGON_ORDER, FAR * LPPOLYGON_ORDER;
  1354. //
  1355. // Pie
  1356. //
  1357. typedef struct _PIE_ORDER
  1358. {
  1359. TSHR_UINT16 type; // holds "PI" - ORD_PIE
  1360. TSHR_INT16 pad1;
  1361. TSHR_INT32 BackMode; // background mix mode
  1362. TSHR_INT32 nLeftRect; // x left of bounding box
  1363. TSHR_INT32 nTopRect; // y top of bounding box
  1364. TSHR_INT32 nRightRect; // x right of bounding box
  1365. TSHR_INT32 nBottomRect; // y bottom of bounding box
  1366. TSHR_INT32 nXStart; // x of starting point
  1367. TSHR_INT32 nYStart; // y of starting point
  1368. TSHR_INT32 nXEnd; // x of ending point
  1369. TSHR_INT32 nYEnd; // y of ending point
  1370. TSHR_COLOR BackColor; // background color
  1371. TSHR_UINT8 pad2;
  1372. TSHR_COLOR ForeColor; // foreground color
  1373. TSHR_UINT8 pad3;
  1374. TSHR_INT32 BrushOrgX;
  1375. TSHR_INT32 BrushOrgY;
  1376. TSHR_UINT32 BrushStyle;
  1377. TSHR_UINT32 BrushHatch;
  1378. TSHR_UINT8 BrushExtra[7];
  1379. TSHR_UINT8 pad4;
  1380. TSHR_UINT32 ROP2; // drawing mode
  1381. TSHR_UINT32 PenStyle;
  1382. TSHR_UINT32 PenWidth; // always 1 - field retained for
  1383. // backwards compatibility
  1384. TSHR_COLOR PenColor;
  1385. TSHR_UINT8 pad5;
  1386. TSHR_UINT32 ArcDirection; // ORD_ARC_COUNTERCLOCKWISE or
  1387. // ORD_ARC_CLOCKWISE
  1388. } PIE_ORDER, FAR * LPPIE_ORDER;
  1389. //
  1390. // Ellipse
  1391. //
  1392. typedef struct _ELLIPSE_ORDER
  1393. {
  1394. TSHR_UINT16 type; // holds "EL" - ORD_ELLIPSE
  1395. TSHR_INT16 pad1;
  1396. TSHR_INT32 BackMode; // background mix mode
  1397. TSHR_INT32 nLeftRect; // x left of bounding box
  1398. TSHR_INT32 nTopRect; // y top of bounding box
  1399. TSHR_INT32 nRightRect; // x right of bounding box
  1400. TSHR_INT32 nBottomRect; // y bottom of bounding box
  1401. TSHR_COLOR BackColor; // background color
  1402. TSHR_UINT8 pad2;
  1403. TSHR_COLOR ForeColor; // foreground color
  1404. TSHR_UINT8 pad3;
  1405. TSHR_INT32 BrushOrgX;
  1406. TSHR_INT32 BrushOrgY;
  1407. TSHR_UINT32 BrushStyle;
  1408. TSHR_UINT32 BrushHatch;
  1409. TSHR_UINT8 BrushExtra[7];
  1410. TSHR_UINT8 pad4;
  1411. TSHR_UINT32 ROP2; // drawing mode
  1412. TSHR_UINT32 PenStyle;
  1413. TSHR_UINT32 PenWidth; // always 1 - field retained for
  1414. // backwards compatibility
  1415. TSHR_COLOR PenColor;
  1416. TSHR_UINT8 pad5;
  1417. } ELLIPSE_ORDER, FAR * LPELLIPSE_ORDER;
  1418. //
  1419. // Arc
  1420. //
  1421. typedef struct _ARC_ORDER
  1422. {
  1423. TSHR_UINT16 type; // holds "AR" - ORD_ARC
  1424. TSHR_INT16 pad1;
  1425. TSHR_INT32 BackMode; // background mix mode
  1426. TSHR_INT32 nLeftRect; // x left of bounding box
  1427. TSHR_INT32 nTopRect; // y top of bounding box
  1428. TSHR_INT32 nRightRect; // x right of bounding box
  1429. TSHR_INT32 nBottomRect; // y bottom of bounding box
  1430. TSHR_INT32 nXStart; // x of starting point
  1431. TSHR_INT32 nYStart; // y of starting point
  1432. TSHR_INT32 nXEnd; // x of ending point
  1433. TSHR_INT32 nYEnd; // y of ending point
  1434. TSHR_COLOR BackColor; // background color
  1435. TSHR_UINT8 pad2;
  1436. TSHR_UINT32 ROP2; // drawing mode
  1437. TSHR_UINT32 PenStyle;
  1438. TSHR_UINT32 PenWidth; // always 1 - field retained for
  1439. // backwards compatibility
  1440. TSHR_COLOR PenColor;
  1441. TSHR_UINT8 pad3;
  1442. TSHR_UINT32 ArcDirection; // AD_COUNTERCLOCKWISE or AS_CLOCKWISE
  1443. } ARC_ORDER, FAR * LPARC_ORDER;
  1444. //
  1445. // Chord
  1446. //
  1447. typedef struct _CHORD_ORDER
  1448. {
  1449. TSHR_UINT16 type; // holds "CD" - ORD_CHORD
  1450. TSHR_INT16 pad1;
  1451. TSHR_INT32 BackMode; // background mix mode
  1452. TSHR_INT32 nLeftRect; // x left of bounding box
  1453. TSHR_INT32 nTopRect; // y top of bounding box
  1454. TSHR_INT32 nRightRect; // x right of bounding box
  1455. TSHR_INT32 nBottomRect; // y bottom of bounding box
  1456. TSHR_INT32 nXStart; // x of starting point
  1457. TSHR_INT32 nYStart; // y of starting point
  1458. TSHR_INT32 nXEnd; // x of ending point
  1459. TSHR_INT32 nYEnd; // y of ending point
  1460. TSHR_COLOR BackColor; // background color
  1461. TSHR_UINT8 pad2;
  1462. TSHR_COLOR ForeColor; // foreground color
  1463. TSHR_UINT8 pad3;
  1464. TSHR_INT32 BrushOrgX;
  1465. TSHR_INT32 BrushOrgY;
  1466. TSHR_UINT32 BrushStyle;
  1467. TSHR_UINT32 BrushHatch;
  1468. TSHR_UINT8 BrushExtra[7];
  1469. TSHR_UINT8 pad4;
  1470. TSHR_UINT32 ROP2; // drawing mode
  1471. TSHR_UINT32 PenStyle;
  1472. TSHR_UINT32 PenWidth; // always 1 - field retained for
  1473. // backwards compatibility
  1474. TSHR_COLOR PenColor;
  1475. TSHR_UINT8 pad5;
  1476. TSHR_UINT32 ArcDirection; // AD_COUNTERCLOCKWISE or AD_CLOCKWISE
  1477. } CHORD_ORDER, FAR * LPCHORD_ORDER;
  1478. //
  1479. // PolyBezier
  1480. //
  1481. typedef struct _POLYBEZIER_ORDER
  1482. {
  1483. TSHR_UINT16 type; // holds "PZ" - ORD_POLYBEZIER
  1484. TSHR_INT16 pad1;
  1485. TSHR_INT32 BackMode; // background mix mode
  1486. TSHR_COLOR BackColor; // background color
  1487. TSHR_UINT8 pad2;
  1488. TSHR_COLOR ForeColor; // foreground color
  1489. TSHR_UINT8 pad3;
  1490. TSHR_UINT32 ROP2; // drawing mode
  1491. TSHR_UINT32 PenStyle;
  1492. TSHR_UINT32 PenWidth; // always 1 - field retained for
  1493. // backwards compatibility
  1494. TSHR_COLOR PenColor;
  1495. TSHR_UINT8 pad4;
  1496. //
  1497. // The following variable data occurs here.
  1498. //
  1499. VARIABLE_BEZIERPOINTS variablePoints;
  1500. } POLYBEZIER_ORDER, FAR * LPPOLYBEZIER_ORDER;
  1501. //
  1502. // RoundRect
  1503. //
  1504. typedef struct _ROUNDRECT_ORDER
  1505. {
  1506. TSHR_UINT16 type; // holds "RR" - ORD_ROUNDRECT
  1507. TSHR_INT16 pad1;
  1508. TSHR_INT32 BackMode; // background mix mode
  1509. TSHR_INT32 nLeftRect; // x left
  1510. TSHR_INT32 nTopRect; // y top
  1511. TSHR_INT32 nRightRect; // x right
  1512. TSHR_INT32 nBottomRect; // y bottom
  1513. TSHR_INT32 nEllipseWidth; // ellipse width
  1514. TSHR_INT32 nEllipseHeight; // ellipse height
  1515. TSHR_COLOR BackColor; // background color
  1516. TSHR_UINT8 pad2;
  1517. TSHR_COLOR ForeColor; // foreground color
  1518. TSHR_UINT8 pad3;
  1519. TSHR_INT32 BrushOrgX;
  1520. TSHR_INT32 BrushOrgY;
  1521. TSHR_UINT32 BrushStyle;
  1522. TSHR_UINT32 BrushHatch;
  1523. TSHR_UINT8 BrushExtra[7];
  1524. TSHR_UINT8 pad4;
  1525. TSHR_UINT32 ROP2; // drawing mode
  1526. TSHR_UINT32 PenStyle;
  1527. TSHR_UINT32 PenWidth; // always 1 - field retained for
  1528. // backwards compatibility
  1529. TSHR_COLOR PenColor;
  1530. TSHR_UINT8 pad5;
  1531. }
  1532. ROUNDRECT_ORDER, FAR * LPROUNDRECT_ORDER;
  1533. ////////////////////////////////
  1534. //
  1535. // ORDER ENCODING
  1536. //
  1537. ////////////////////////////////
  1538. //
  1539. // Overview of Second Order Encoding
  1540. //
  1541. // Second order encoding works by only sending over the network the fields
  1542. // in an order which have changed since the last time the order was sent.
  1543. // A copy of the last example of each order sent is maintained at the
  1544. // encoding end and at the decoding end. Whilst encoding, the fields in
  1545. // the order being encoded are checked against the fields in the copy of
  1546. // the last order of this type encoded. The data in the field is only
  1547. // encoded if it has changed. The decoding end then only needs to copy the
  1548. // changed fields into its copy of the order.
  1549. //
  1550. //
  1551. // Encoded Order types.
  1552. //
  1553. // Note that most of these agree with the ORD_XXXXX defines, but not all,
  1554. // which is probably a mistake. However it doesn't matter since the code
  1555. // does not assume equivalence. It is unfortunately too late to change
  1556. // since the the shipping code uses the 2 sets of numbers:
  1557. //
  1558. // - the OE2 protocol uses these numbers
  1559. // - the capabilities structure uses the ORD_XXXXX numbers.
  1560. //
  1561. // Since this split exists, the DESKTOP SCROLL order, whose highword places
  1562. // it outside the CAPS_MAX_NUM_ORDERS range, is also mapped to a different
  1563. // number, so that the OE2 values have no gaps.
  1564. //
  1565. #define OE2_DSTBLT_ORDER (HIWORD(ORD_DSTBLT))
  1566. #define OE2_PATBLT_ORDER (HIWORD(ORD_PATBLT))
  1567. #define OE2_SCRBLT_ORDER (HIWORD(ORD_SCRBLT))
  1568. #define OE2_MEMBLT_ORDER (HIWORD(ORD_MEMBLT))
  1569. #define OE2_MEM3BLT_ORDER (HIWORD(ORD_MEM3BLT))
  1570. #define OE2_TEXTOUT_ORDER (HIWORD(ORD_TEXTOUT))
  1571. #define OE2_EXTTEXTOUT_ORDER (HIWORD(ORD_EXTTEXTOUT))
  1572. // 0x07 was FastFrame, which is no longer supported.
  1573. #define OE2_RECTANGLE_ORDER 0x08
  1574. #define OE2_LINETO_ORDER 0x09
  1575. #define OE2_OPAQUERECT_ORDER (HIWORD(ORD_OPAQUERECT))
  1576. #define OE2_SAVEBITMAP_ORDER (HIWORD(ORD_SAVEBITMAP))
  1577. #define OE2_DESKSCROLL_ORDER 0x0c
  1578. #define OE2_MEMBLT_R2_ORDER (HIWORD(ORD_MEMBLT_R2))
  1579. #define OE2_MEM3BLT_R2_ORDER (HIWORD(ORD_MEM3BLT_R2))
  1580. #define OE2_POLYGON_ORDER (HIWORD(ORD_POLYGON))
  1581. #define OE2_PIE_ORDER (HIWORD(ORD_PIE))
  1582. #define OE2_ELLIPSE_ORDER (HIWORD(ORD_ELLIPSE))
  1583. #define OE2_ARC_ORDER (HIWORD(ORD_ARC))
  1584. #define OE2_CHORD_ORDER (HIWORD(ORD_CHORD))
  1585. #define OE2_POLYBEZIER_ORDER (HIWORD(ORD_POLYBEZIER))
  1586. #define OE2_ROUNDRECT_ORDER (HIWORD(ORD_ROUNDRECT))
  1587. #define OE2_UNKNOWN_ORDER 0xFF
  1588. //
  1589. // #defines used to extract fields from a pointer to one of the text orders
  1590. //
  1591. #define TEXTFIELD(order) ((TEXTOUT_ORDER*)(order->abOrderData))
  1592. #define EXTTEXTFIELD(order) ((EXTTEXTOUT_ORDER*)(order->abOrderData))
  1593. //
  1594. // Number of order types.
  1595. //
  1596. #define OE2_NUM_TYPES 22
  1597. //
  1598. // Constants defining the number of changeable fields in an ORDER
  1599. // (including the "type" field which is always a word at the beginning of
  1600. // each order)
  1601. //
  1602. #define OE2_NUM_DSTBLT_FIELDS 6
  1603. #define OE2_NUM_PATBLT_FIELDS 13
  1604. #define OE2_NUM_SCRBLT_FIELDS 8
  1605. #define OE2_NUM_MEMBLT_FIELDS 9
  1606. #define OE2_NUM_MEM3BLT_FIELDS 16
  1607. #define OE2_NUM_TEXTOUT_FIELDS 15
  1608. #define OE2_NUM_EXTTEXTOUT_FIELDS 22
  1609. #define OE2_NUM_RECTANGLE_FIELDS 17
  1610. #define OE2_NUM_LINETO_FIELDS 11
  1611. #define OE2_NUM_OPAQUERECT_FIELDS 6
  1612. #define OE2_NUM_SAVEBITMAP_FIELDS 7
  1613. #define OE2_NUM_DESKSCROLL_FIELDS 3
  1614. #define OE2_NUM_MEMBLT_R2_FIELDS 10
  1615. #define OE2_NUM_MEM3BLT_R2_FIELDS 17
  1616. #define OE2_NUM_POLYGON_FIELDS 15
  1617. #define OE2_NUM_PIE_FIELDS 22
  1618. #define OE2_NUM_ELLIPSE_FIELDS 17
  1619. #define OE2_NUM_ARC_FIELDS 16
  1620. #define OE2_NUM_CHORD_FIELDS 22
  1621. #define OE2_NUM_POLYBEZIER_FIELDS 9
  1622. #define OE2_NUM_ROUNDRECT_FIELDS 19
  1623. //
  1624. // ControlFlags:
  1625. //
  1626. // Information about how the order is encoded. (See OE2_CF_XXX flags
  1627. // description).
  1628. //
  1629. // EncodedOrder:
  1630. //
  1631. // Contains N bytes of flags followed by an array of bytes containing the
  1632. // fields which have changed since this order was last encoded. (If there
  1633. // are M fields in the order then N is M/8). The position of each bit set
  1634. // in the flags gives the relative position of the entry for a field in the
  1635. // encoding table (if the first bit is set, then the entry is the first one
  1636. // in the encoding table etc.)
  1637. //
  1638. //
  1639. typedef struct tagDCEO2ORDER
  1640. {
  1641. BYTE ControlFlags;
  1642. BYTE EncodedOrder[1];
  1643. }
  1644. DCEO2ORDER;
  1645. typedef DCEO2ORDER FAR * PDCEO2ORDER;
  1646. //
  1647. // FLAGS USED INTERNALLY BY OE2
  1648. //
  1649. // The encoded order (DCEO2ORDER) Flags field contains information
  1650. // about which fields in the ORDER HEADER need updating
  1651. // These control bits are the same for all orders and have the following
  1652. // values:
  1653. //
  1654. #define OE2_CF_STANDARD_ENC 0x01U // standard encoding follows...
  1655. #define OE2_CF_UNENCODED 0x02U // not encoded
  1656. #define OE2_CF_BOUNDS 0x04U // bounding (clip) rectangle supplied
  1657. #define OE2_CF_TYPE_CHANGE 0x08U // type of order different from previous
  1658. #define OE2_CF_DELTACOORDS 0x10U // coords are TSHR_INT8 deltas from previous
  1659. #define OE2_CF_RESERVED1 0x20U //
  1660. #define OE2_CF_RESERVED2 0x40U //
  1661. #define OE2_CF_RESERVED3 0x80U //
  1662. //
  1663. // Flags use by OE2EncodeBounds and OE2DecodeBounds to indicate how the
  1664. // four coordinates in the bounding rectangle were encoded relative the the
  1665. // previous bounding rectangle. The encoding used is a byte of flags
  1666. // followed by a variable number of 16bit coordinate values and 8bit delta
  1667. // coordinate values (which may be interleaved). See functions for more
  1668. // information.
  1669. //
  1670. #define OE2_BCF_LEFT 0x01
  1671. #define OE2_BCF_TOP 0x02
  1672. #define OE2_BCF_RIGHT 0x04
  1673. #define OE2_BCF_BOTTOM 0x08
  1674. #define OE2_BCF_DELTA_LEFT 0x10
  1675. #define OE2_BCF_DELTA_TOP 0x20
  1676. #define OE2_BCF_DELTA_RIGHT 0x40
  1677. #define OE2_BCF_DELTA_BOTTOM 0x80
  1678. //
  1679. // OE2ETFIELD entry flag types.
  1680. //
  1681. #define OE2_ETF_FIXED 0x01
  1682. #define OE2_ETF_VARIABLE 0x02
  1683. #define OE2_ETF_COORDINATES 0x04
  1684. #define OE2_ETF_DATA 0x08
  1685. //
  1686. // Define the maximum sizes of fields within encoded orders.
  1687. //
  1688. #define OE2_CONTROL_FLAGS_FIELD_SIZE 1
  1689. #define OE2_TYPE_FIELD_SIZE 1
  1690. #define OE2_MAX_FIELD_FLAG_BYTES 4
  1691. #define OE2_MAX_ADDITIONAL_BOUNDS_BYTES 1
  1692. //////////////////////////////////////////
  1693. //
  1694. // T.SHARE PACKETS, FLOW CONTROL
  1695. //
  1696. //////////////////////////////////////////
  1697. //
  1698. // Maximum size of application packets (bytes).
  1699. // NOTE:
  1700. // Packet size can not just change. There are no caps for it currently.
  1701. // Moreover, even though theoretically the field size is a WORD, flow
  1702. // control uses the high bit to determine flow packets.
  1703. //
  1704. //
  1705. // HEADER in front of TSHR_FLO_CONTROL/S20PACKETs
  1706. //
  1707. typedef struct tagTSHR_NET_PKT_HEADER
  1708. {
  1709. TSHR_UINT16 pktLength;
  1710. }
  1711. TSHR_NET_PKT_HEADER;
  1712. typedef TSHR_NET_PKT_HEADER * PTSHR_NET_PKT_HEADER;
  1713. //
  1714. // Packet types:
  1715. // S20 packets have pktLength < TSHR_PKT_FLOW
  1716. // FLO packets have pktLength == TSHR_PKT_FLOW
  1717. //
  1718. #define TSHR_PKT_FLOW 0x8000
  1719. // WE'RE STUCK WITH THIS OUTGOING VALUE BECAUSE OF FLOW CONTROL! IT ASSUMES
  1720. // PACKETS of size > MG_PKT_FLOW are flow control packets. Back level dudes
  1721. // are hosted because of it...
  1722. #define TSHR_MAX_SEND_PKT 32000
  1723. typedef struct TSHR_FLO_CONTROL
  1724. {
  1725. TSHR_UINT16 packetType;
  1726. TSHR_UINT8 stream;
  1727. TSHR_UINT8 pingPongID;
  1728. TSHR_UINT16 userID;
  1729. }
  1730. TSHR_FLO_CONTROL;
  1731. typedef TSHR_FLO_CONTROL * PTSHR_FLO_CONTROL;
  1732. //
  1733. // TSHR_FLO_CONTROL packetType values
  1734. //
  1735. #define PACKET_TYPE_NOPING 0x0040
  1736. #define PACKET_TYPE_PING 0x0041
  1737. #define PACKET_TYPE_PONG 0x0042
  1738. #define PACKET_TYPE_PANG 0x0043
  1739. //////////////////////////////////////////
  1740. //
  1741. // T.SHARE CONTROL PACKETS
  1742. //
  1743. //////////////////////////////////////////
  1744. //
  1745. // CORRELATORS
  1746. //
  1747. // Most S20 messsages contain a correlator field. This field is used
  1748. // to identify which share the message belongs to and is used to
  1749. // resolve races at share start up and discard stale messages received.
  1750. //
  1751. // A correlator is a 32 bit number which contains two parts. The first
  1752. // 16 bits (the low word in Intel format) contains the user ID of the
  1753. // party which created the share. The second 16 bits contains a count
  1754. // supplied by the party which created the share (ie the first share
  1755. // they create is 1 the second 2 etc). This should ensure unique
  1756. // correlators for every share created for a long enough period to
  1757. // ensure no stale data is left.
  1758. //
  1759. // A new correlator is always present on a create message. All
  1760. // respond, delete and leave messages must contain the correct
  1761. // correlator for the share. A join message does not contain a
  1762. // correlator. A party which issues a join message will find out the
  1763. // share's correlator on the first respond message they receive.
  1764. //
  1765. // Respond messages also contain the user ID of the party which sent
  1766. // out the original create or join to which they are responding. There
  1767. // is one exception when a `sweep-up' respond is sent which contains
  1768. // zero in the originator field. This respond is sent by a party which
  1769. // is joining a share as soon as they receive the first response (and
  1770. // therefore know the share correlator). This sweep-up respond handles
  1771. // simultaneous joiners where a party was joining when it too received
  1772. // a join message. When this happens the party ignores the join and
  1773. // will later receive a sweep-up respond message which they will
  1774. // process.
  1775. //
  1776. typedef struct tagS20PACKETHEADER
  1777. {
  1778. TSHR_UINT16 packetType;
  1779. TSHR_UINT16 user;
  1780. }
  1781. S20PACKETHEADER;
  1782. typedef S20PACKETHEADER * PS20PACKETHEADER;
  1783. //
  1784. // S20PACKETHEADER packetType values
  1785. //
  1786. // A single bit means that this version will only interoperate
  1787. // with itself. More than one bit indicates cross version
  1788. // interoperability.
  1789. //
  1790. // IN NM 4.0, GET RID OF S20_2X_VERSION SUPPORT!
  1791. //
  1792. #define S20_PACKET_TYPE_MASK 0x000F
  1793. #define S20_2X_VERSION 0x0010
  1794. #define S20_30_VERSION 0x0020
  1795. #define S20_CURRENT_VERSION S20_30_VERSION
  1796. #define S20_ALL_VERSIONS (S20_2X_VERSION | S20_30_VERSION)
  1797. #define S20_CREATE 1
  1798. #define S20_JOIN 2
  1799. #define S20_RESPOND 3
  1800. #define S20_DELETE 4
  1801. #define S20_LEAVE 5
  1802. #define S20_END 6
  1803. #define S20_DATA 7
  1804. #define S20_COLLISION 8
  1805. //
  1806. // To create the share
  1807. //
  1808. typedef struct tagS20CREATEPACKET
  1809. {
  1810. S20PACKETHEADER header;
  1811. TSHR_UINT32 correlator;
  1812. TSHR_UINT16 lenName;
  1813. TSHR_UINT16 lenCaps;
  1814. TSHR_UINT8 data[1]; // Name & Caps
  1815. }
  1816. S20CREATEPACKET;
  1817. typedef S20CREATEPACKET * PS20CREATEPACKET;
  1818. //
  1819. // To join a share created by somebody else
  1820. //
  1821. typedef struct tagS20JOINPACKET
  1822. {
  1823. S20PACKETHEADER header;
  1824. TSHR_UINT16 lenName;
  1825. TSHR_UINT16 lenCaps;
  1826. TSHR_UINT8 data[1]; // Name & Caps
  1827. }
  1828. S20JOINPACKET;
  1829. typedef S20JOINPACKET * PS20JOINPACKET;
  1830. //
  1831. // To respond to a create packet
  1832. //
  1833. typedef struct tagS20RESPONDPACKET
  1834. {
  1835. S20PACKETHEADER header;
  1836. TSHR_UINT32 correlator;
  1837. TSHR_UINT16 originator;
  1838. TSHR_UINT16 lenName;
  1839. TSHR_UINT16 lenCaps;
  1840. TSHR_UINT8 data[1]; // Name & Caps
  1841. }
  1842. S20RESPONDPACKET;
  1843. typedef S20RESPONDPACKET * PS20RESPONDPACKET;
  1844. //
  1845. // To remove a person from a share (if the creator can't join the person in)
  1846. //
  1847. typedef struct tagS20DELETEPACKET
  1848. {
  1849. S20PACKETHEADER header;
  1850. TSHR_UINT32 correlator;
  1851. TSHR_UINT16 target;
  1852. TSHR_UINT16 lenName; // OBSOLETE - no name/caps at end
  1853. TSHR_UINT8 data[1];
  1854. }
  1855. S20DELETEPACKET;
  1856. typedef S20DELETEPACKET * PS20DELETEPACKET;
  1857. //
  1858. // To leave a share yourself
  1859. //
  1860. typedef struct tagS20LEAVEPACKET
  1861. {
  1862. S20PACKETHEADER header;
  1863. TSHR_UINT32 correlator;
  1864. }
  1865. S20LEAVEPACKET;
  1866. typedef S20LEAVEPACKET * PS20LEAVEPACKET;
  1867. //
  1868. // To end a share you created
  1869. //
  1870. typedef struct tagS20ENDPACKET
  1871. {
  1872. S20PACKETHEADER header;
  1873. TSHR_UINT32 correlator;
  1874. TSHR_UINT16 lenName; // OBSOLETE - no name/caps at end
  1875. TSHR_UINT8 data[1];
  1876. }
  1877. S20ENDPACKET;
  1878. typedef S20ENDPACKET * PS20ENDPACKET;
  1879. //
  1880. // To tell somebody creating a share that one already exists
  1881. //
  1882. typedef struct tagS20COLLISIONPACKET
  1883. {
  1884. S20PACKETHEADER header;
  1885. TSHR_UINT32 correlator;
  1886. }
  1887. S20COLLISIONPACKET;
  1888. typedef S20COLLISIONPACKET * PS20COLLISIONPACKET;
  1889. /////////////////////////////////
  1890. //
  1891. // T.SHARE DATA PACKETS
  1892. //
  1893. /////////////////////////////////
  1894. //
  1895. // Data sent when in share (this structure is followed by the different
  1896. // packets described below)
  1897. //
  1898. typedef struct tagDATAPACKETHEADER
  1899. {
  1900. TSHR_UINT8 dataType; // DT_ identifier
  1901. TSHR_UINT8 compressionType;
  1902. TSHR_UINT16 compressedLength;
  1903. }
  1904. DATAPACKETHEADER;
  1905. typedef DATAPACKETHEADER * PDATAPACKETHEADER;
  1906. //
  1907. // DATAPACKETHEADER dataType values
  1908. //
  1909. #define DT_UP 0x02
  1910. #define DT_UNUSED_USR_FH_10 0x09 // OBSOLETE
  1911. #define DT_UNUSED_USR_FH_11 0x0A // OBSOLETE
  1912. #define DT_FH 0x0B
  1913. #define DT_CA 0x14 // OLD (2.x)
  1914. #define DT_CA30 0x15 // NEW (3.0)
  1915. #define DT_HET30 0x16 // NEW (3.0)
  1916. #define DT_AWC 0x17
  1917. #define DT_SWL 0x18
  1918. #define DT_HET 0x19 // OLD (2.x)
  1919. #define DT_UNUSED_DS 0x1A // OBSOLETE
  1920. #define DT_CM 0x1B
  1921. #define DT_IM 0x1C
  1922. #define DT_UNUSED_HCA 0x1D // OBSOLETE
  1923. #define DT_UNUSED_SC 0x1E // OBSOLETE
  1924. #define DT_SNI 0x1F
  1925. #define DT_CPC 0x20
  1926. //
  1927. // DATAPACKETHEADER compressionType values
  1928. //
  1929. // There are two formats for this field.
  1930. //
  1931. // If all nodes participating in the share session have the capability
  1932. // genCompressionLevel >= 1 then the compressionType is a one of the
  1933. // following 8bit integers.
  1934. //
  1935. // Otherwise the the packet is compressed with GCT_PKZIP if the top bit is
  1936. // set and the packet is not compressed if it is not set. The remaining
  1937. // bits are undefined (and will NOT be all zero)
  1938. //
  1939. //
  1940. // Note: Each of these values has a GCT_... value associated with it.
  1941. // These values indicate which bit of the GCT_... values this
  1942. // compression type represents. Eg. a value of 5 here pairs with the
  1943. // value 0x0010 (ie bit 5 set)
  1944. //
  1945. #define CT_NONE 0
  1946. #define CT_PKZIP 1
  1947. #define CT_PERSIST_PKZIP 2
  1948. #define CT_OLD_COMPRESSED 0x80
  1949. typedef struct tagS20DATAPACKET
  1950. {
  1951. S20PACKETHEADER header;
  1952. TSHR_UINT32 correlator;
  1953. TSHR_UINT8 ackID; // OBSOLETE
  1954. TSHR_UINT8 stream;
  1955. TSHR_UINT16 dataLength;
  1956. DATAPACKETHEADER data;
  1957. // data specific to DT_ type follows here
  1958. }
  1959. S20DATAPACKET;
  1960. typedef S20DATAPACKET * PS20DATAPACKET;
  1961. //
  1962. // S20DATAPACKET stream values
  1963. //
  1964. //
  1965. // The streams and priotities used by AppSharing
  1966. //
  1967. #define PROT_STR_INVALID 0
  1968. #define PROT_STR_UPDATES 1 // SNI_STREAM_LOW
  1969. #define PROT_STR_MISC 2
  1970. #define PROT_STR_UNUSED 3 // NOT USED!
  1971. #define PROT_STR_INPUT 4
  1972. #define NUM_PROT_STR 5
  1973. //
  1974. // DT_AWC
  1975. // Active Window packets
  1976. //
  1977. typedef struct tagAWCPACKET
  1978. {
  1979. S20DATAPACKET header;
  1980. TSHR_UINT16 msg;
  1981. TSHR_UINT16 token; // OBSOLETE
  1982. UINT_PTR data1;
  1983. UINT_PTR data2;
  1984. }
  1985. AWCPACKET;
  1986. typedef AWCPACKET *PAWCPACKET;
  1987. //
  1988. // AWCPACKET msg values
  1989. //
  1990. #define AWC_MSG_INVALID 0x0000
  1991. #define AWC_MSG_ACTIVE_CHANGE_LOCAL 0x0001
  1992. #define AWC_MSG_ACTIVE_CHANGE_SHARED 0x0002
  1993. #define AWC_MSG_ACTIVE_CHANGE_INVISIBLE 0x0003
  1994. #define AWC_MSG_ACTIVE_CHANGE_CAPTURED 0x0004 // OBSOLETE
  1995. #define AWC_MSG_ACTIVATE_WINDOW 0x8001
  1996. #define AWC_MSG_CLOSE_WINDOW 0x8002 // OBSOLETE
  1997. #define AWC_MSG_RESTORE_WINDOW 0x8003
  1998. #define AWC_MSG_TASKBAR_RBUTTON 0x8004 // OBSOLETE
  1999. #define AWC_MSG_SAS 0x8005
  2000. #define AWC_MSG_SYSCOMMAND_HELPKEYS 0x8011 // OBSOLETE
  2001. #define AWC_MSG_SYSCOMMAND_HELPINDEX 0x8012 // OBSOLETE
  2002. #define AWC_MSG_SYSCOMMAND_HELPEXTENDED 0x8013 // OBSOLETE
  2003. //
  2004. // DT_CA
  2005. // OLD Control Arbitration packets
  2006. //
  2007. typedef struct tagCAPACKET
  2008. {
  2009. S20DATAPACKET header;
  2010. TSHR_UINT16 msg;
  2011. TSHR_UINT16 data1;
  2012. UINT_PTR data2;
  2013. }
  2014. CAPACKET;
  2015. typedef CAPACKET *PCAPACKET;
  2016. //
  2017. // CAPACKET msg values, 2.x
  2018. // These are all broadcasted, control is global
  2019. //
  2020. #define CA_MSG_NOTIFY_STATE 0 // NEW FOR NM 3.0
  2021. #define CA_OLDMSG_REQUEST_CONTROL 1 // NM 2.x
  2022. #define CA_OLDMSG_GRANTED_CONTROL 2 // NM 2.x
  2023. #define CA_OLDMSG_DETACH 3 // NM 2.x
  2024. #define CA_OLDMSG_COOPERATE 4 // NM 2.x
  2025. //
  2026. // Notification (broadcast) packet
  2027. //
  2028. typedef struct tagCANOTPACKET
  2029. {
  2030. S20DATAPACKET header;
  2031. TSHR_UINT16 msg;
  2032. TSHR_UINT16 state;
  2033. UINT_PTR controllerID;
  2034. }
  2035. CANOTPACKET;
  2036. typedef CANOTPACKET * PCANOTPACKET;
  2037. //
  2038. // CA_MSG_NOTIFY_STATE
  2039. // state - controllable or not
  2040. // controllerID - controller net ID or 0 if nobody
  2041. //
  2042. // state flags:
  2043. #define CASTATE_ALLOWCONTROL 0x0001
  2044. //
  2045. // CA_OLDMSG_REQUEST_CONTROL
  2046. // Broadcasted to request taking of global control
  2047. // data1 - unused
  2048. // data2 - unused
  2049. //
  2050. //
  2051. // CA_OLDMSG_GRANTED_CONTROL
  2052. // Broadcasted by node(s) who think they own the control token, when they
  2053. // grant the control token to node who asked for it via REQUEST.
  2054. // data1 - netID of person given control
  2055. // data2 - control token generation
  2056. //
  2057. //
  2058. // CA_OLDMSG_DETACH
  2059. // Broadcasted when node stops collaborating
  2060. // data1 - unused
  2061. // data2 - unused
  2062. //
  2063. //
  2064. // CA_OLDMSG_COOPERATE
  2065. // Broadcasted when node starts collaborating
  2066. // data1 - unused
  2067. // data2 - unused
  2068. //
  2069. //
  2070. // DT_CA30
  2071. // NEW Control packets
  2072. //
  2073. //
  2074. // These are PRIVATE SEND packets, on PROT_STR_INPUT, from one node to another.
  2075. // They go out in order, and are queued if not able to send for retry later.
  2076. //
  2077. //
  2078. // Common header for CA30 packets.
  2079. //
  2080. typedef struct tagCA30PACKETHEADER
  2081. {
  2082. S20DATAPACKET header;
  2083. TSHR_UINT32 msg;
  2084. }
  2085. CA30PACKETHEADER;
  2086. typedef CA30PACKETHEADER * PCA30PACKETHEADER;
  2087. //
  2088. // CA30PACKETHEADER msg values
  2089. //
  2090. #define CA_REQUEST_TAKECONTROL 1 // From viewer to host
  2091. #define CA_REPLY_REQUEST_TAKECONTROL 2 // From host to viewer
  2092. #define CA_REQUEST_GIVECONTROL 3 // From host to viewer
  2093. #define CA_REPLY_REQUEST_GIVECONTROL 4 // From viewer to host
  2094. #define CA_PREFER_PASSCONTROL 5 // From controller to host
  2095. #define CA_INFORM_RELEASEDCONTROL 0x8001 // From controller to host
  2096. #define CA_INFORM_REVOKEDCONTROL 0x8002 // From host to controller
  2097. #define CA_INFORM_PAUSEDCONTROL 0x8003 // From host to controller
  2098. #define CA_INFORM_UNPAUSEDCONTROL 0x8004 // From host to controller
  2099. //
  2100. // REPLY packet result values
  2101. //
  2102. #define CARESULT_CONFIRMED 0
  2103. #define CARESULT_DENIED 1
  2104. #define CARESULT_DENIED_BUSY 2
  2105. #define CARESULT_DENIED_USER 3
  2106. #define CARESULT_DENIED_WRONGSTATE 4
  2107. #define CARESULT_DENIED_TIMEDOUT 5
  2108. //
  2109. // ALL packets also have a CA30PACKETHEADER in front of them.
  2110. //
  2111. //
  2112. // CA_REQUEST_TAKECONTROL
  2113. // Sender is viewer
  2114. // Receiver is host
  2115. // viewerControlID - unique viewer request ID
  2116. //
  2117. // Receiver should reply with CA_REPLY_REQUEST_TAKECONTROL
  2118. // Sender should cancel with CA_INFORM_RELEASEDCONTROL
  2119. //
  2120. typedef struct tagCA_RTC_PACKET
  2121. {
  2122. TSHR_UINT32 viewerControlID;
  2123. }
  2124. CA_RTC_PACKET;
  2125. typedef CA_RTC_PACKET * PCA_RTC_PACKET;
  2126. //
  2127. // CA_REPLY_REQUEST_TAKECONTROL
  2128. // Sender is host
  2129. // Receiver is viewer, who sent original TAKECONTROL request
  2130. // viewerControlID - viewer request ID from TAKECONTROL request
  2131. // hostControlID - unique host request ID
  2132. // result - CARESULT value, success or failure
  2133. //
  2134. typedef struct tagCA_REPLY_RTC_PACKET
  2135. {
  2136. TSHR_UINT32 viewerControlID;
  2137. TSHR_UINT32 result;
  2138. TSHR_UINT32 hostControlID;
  2139. }
  2140. CA_REPLY_RTC_PACKET;
  2141. typedef CA_REPLY_RTC_PACKET * PCA_REPLY_RTC_PACKET;
  2142. //
  2143. // CA_PREFER_PASSCONTROL
  2144. // Sender is controller
  2145. // Receiver is host
  2146. // viewerControlID - controller request ID from take operation
  2147. // hostControlID - host request ID from reply to take operation.
  2148. // mcsPassTo - MCS ID of viewer to pass to
  2149. //
  2150. // No reply is required
  2151. // Sender is not in control when this gets out
  2152. // Receiver can then, if he chooses, turn around and ask 3rd party to control
  2153. //
  2154. typedef struct tagCA_PPC_PACKET
  2155. {
  2156. TSHR_UINT32 viewerControlID;
  2157. TSHR_UINT32 hostControlID;
  2158. UINT_PTR mcsPassTo;
  2159. }
  2160. CA_PPC_PACKET;
  2161. typedef CA_PPC_PACKET * PCA_PPC_PACKET;
  2162. //
  2163. // CA_REQUEST_GIVECONTROL
  2164. // Sender is host
  2165. // Receiver is viewer
  2166. // hostControlID - unique host request ID
  2167. // mcsPassFrom - person passing control, zero if none
  2168. //
  2169. // Receiver should reply with CA_REPLY_REQUEST_GIVECONTROL
  2170. // Sender should cancel with CA_INFORM_REVOKEDCONTROL
  2171. //
  2172. typedef struct tagCA_RGC_PACKET
  2173. {
  2174. TSHR_UINT32 hostControlID;
  2175. UINT_PTR mcsPassFrom;
  2176. }
  2177. CA_RGC_PACKET;
  2178. typedef CA_RGC_PACKET * PCA_RGC_PACKET;
  2179. //
  2180. // CA_REPLY_REQUEST_GIVECONTROL
  2181. // Sender is viewer
  2182. // Receiver is host, who sent original TAKECONTROL invite
  2183. // hostControlID - host request ID from TAKECONTROL invite
  2184. // mcsPassFrom - person passing us control, 0 if none
  2185. // result - CARESULT value, success or failure
  2186. // viewerControlID - unique viewer request ID
  2187. //
  2188. typedef struct tagCA_REPLY_RGC_PACKET
  2189. {
  2190. TSHR_UINT32 hostControlID;
  2191. TSHR_UINT32 mcsPassFrom;
  2192. TSHR_UINT32 result;
  2193. TSHR_UINT32 viewerControlID;
  2194. }
  2195. CA_REPLY_RGC_PACKET;
  2196. typedef CA_REPLY_RGC_PACKET * PCA_REPLY_RGC_PACKET;
  2197. //
  2198. // INFORM packets
  2199. // These are sent to cancel a REQUEST packet, or after the control
  2200. // operation has completed, to terminate it. If cancelling, then the
  2201. // other party's controlID will be zero since we won't have heard back from
  2202. // them yet to get it.
  2203. //
  2204. typedef struct tagCA_INFORM_PACKET
  2205. {
  2206. TSHR_UINT32 viewerControlID;
  2207. TSHR_UINT32 hostControlID;
  2208. }
  2209. CA_INFORM_PACKET;
  2210. typedef CA_INFORM_PACKET * PCA_INFORM_PACKET;
  2211. //
  2212. // CA_INFORM_RELEASEDCONTROL
  2213. // Sender is controller
  2214. // Receiver is host
  2215. // viewerControlID - viewer request ID from
  2216. // REQUEST_TAKECONTROL
  2217. // REPLY_REQUEST_GIVECONTROL
  2218. // hostControlID - host request ID from
  2219. // REPLY_REQUEST_TAKECONTROL
  2220. // REQUEST_GIVECONTROL
  2221. //
  2222. // If viewer is cancelling REQUEST_TAKECONTROL then hostControlID is 0
  2223. //
  2224. //
  2225. // CA_INFORM_REVOKEDCONTROL
  2226. // Sender is host
  2227. // Receiver is controller
  2228. // viewerControlID - viewer request ID from
  2229. // REQUEST_TAKECONTROL
  2230. // REPLY_REQUEST_GIVECONTROL
  2231. // hostControlID - host request ID from
  2232. // REPLY_REQUEST_TAKECONTROL
  2233. // REQUEST_GIVECONTROL
  2234. //
  2235. // If host is cancelling REQUEST_GIVECONTROL then viewerControlID is 0
  2236. //
  2237. //
  2238. // CA_INFORM_PAUSEDCONTROL
  2239. // CA_INFORM_UNPAUSEDCONTROL
  2240. // Sender is host
  2241. // Receiver is controller
  2242. // viewerControlID - viewer request ID from
  2243. // REQUEST_TAKECONTROL
  2244. // REPLY_REQUEST_GIVECONTROL
  2245. // hostControlID - host request ID from
  2246. // REPLY_REQUEST_TAKECONTROL
  2247. // REQUEST_GIVECONTROL
  2248. //
  2249. //
  2250. // DT_CM
  2251. // Cursor shape/position packets
  2252. // There are three types of shape packets: mono bitmaps, color cached,
  2253. // constant IDs
  2254. //
  2255. typedef struct tagCMPACKETHEADER
  2256. {
  2257. S20DATAPACKET header;
  2258. TSHR_UINT16 type;
  2259. TSHR_UINT16 flags;
  2260. }
  2261. CMPACKETHEADER;
  2262. typedef CMPACKETHEADER * PCMPACKETHEADER;
  2263. //
  2264. // CMPACKETHEADER type values
  2265. //
  2266. #define CM_CURSOR_ID 1
  2267. #define CM_CURSOR_MONO_BITMAP 2
  2268. #define CM_CURSOR_MOVE 3
  2269. #define CM_CURSOR_BITMAP_COMPRESSED 4 // OBSOLETE
  2270. #define CM_CURSOR_COLORTABLE 5 // OBSOLETE
  2271. #define CM_CURSOR_COLOR_BITMAP 6
  2272. #define CM_CURSOR_COLOR_CACHE 7
  2273. //
  2274. // CMPACKETHEADER sync flag values
  2275. //
  2276. #define CM_SYNC_CURSORPOS 0x0001
  2277. //
  2278. // This will be set if, when we played back input, the cursor
  2279. // didn't end up where it was asked to go. This could happen if an
  2280. // app clips the cursor or snaps it. As such, we mark this field
  2281. // when we send a notification of our current pos so that the controller
  2282. // knows to move his cursor to be in line with ours.
  2283. //
  2284. //
  2285. // type CM_CURSOR_ID
  2286. //
  2287. // This packet is sent when the cursor has changed and it is now one of
  2288. // the system cursors.
  2289. //
  2290. typedef struct tagCMPACKETID
  2291. {
  2292. CMPACKETHEADER header;
  2293. TSHR_UINT32 idc;
  2294. }
  2295. CMPACKETID;
  2296. typedef CMPACKETID * PCMPACKETID;
  2297. //
  2298. // CMPACKETID idc values
  2299. //
  2300. #define CM_IDC_NULL 0
  2301. #define CM_IDC_ARROW 32512
  2302. //
  2303. // type CM_CURSOR_MONO_BITMAP
  2304. //
  2305. // This packet is sent when the cursor has changed and it is now an
  2306. // application defined mono cursor.
  2307. //
  2308. // The cursor size cannot be greater than 32x32.
  2309. typedef struct tagCMPACKETMONOBITMAP
  2310. {
  2311. CMPACKETHEADER header;
  2312. TSHR_UINT16 xHotSpot;
  2313. TSHR_UINT16 yHotSpot;
  2314. TSHR_UINT16 width;
  2315. TSHR_UINT16 height;
  2316. TSHR_UINT16 cbBits;
  2317. BYTE aBits[1];
  2318. }
  2319. CMPACKETMONOBITMAP;
  2320. typedef CMPACKETMONOBITMAP * PCMPACKETMONOBITMAP;
  2321. //
  2322. // type CM_CURSOR_COLOR_BITMAP
  2323. //
  2324. // This packet is sent when the cursor has changed and it is now an
  2325. // application defined color cursor.
  2326. //
  2327. typedef struct tagCMPACKETCOLORBITMAP
  2328. {
  2329. CMPACKETHEADER header;
  2330. TSHR_UINT16 cacheIndex;
  2331. TSHR_UINT16 xHotSpot;
  2332. TSHR_UINT16 yHotSpot;
  2333. TSHR_UINT16 cxWidth;
  2334. TSHR_UINT16 cyHeight;
  2335. TSHR_UINT16 cbANDMask;
  2336. TSHR_UINT16 cbXORBitmap;
  2337. BYTE aBits[1];
  2338. }
  2339. CMPACKETCOLORBITMAP;
  2340. typedef CMPACKETCOLORBITMAP * PCMPACKETCOLORBITMAP;
  2341. //
  2342. // type CM_CURSOR_COLOR_CACHE
  2343. //
  2344. // This packet is sent out when the cursor changes and the new
  2345. // definition resides in the cache.
  2346. //
  2347. //
  2348. typedef struct tagCMPACKETCOLORCACHE
  2349. {
  2350. CMPACKETHEADER header;
  2351. TSHR_UINT16 cacheIndex;
  2352. }
  2353. CMPACKETCOLORCACHE;
  2354. typedef CMPACKETCOLORCACHE * PCMPACKETCOLORCACHE;
  2355. //
  2356. // type CM_CURSOR_MOVE
  2357. //
  2358. // This packet is sent whenever the CM is told that the application has
  2359. // moved the cursor.
  2360. //
  2361. typedef struct tagCMPACKETMOVE
  2362. {
  2363. CMPACKETHEADER header;
  2364. TSHR_UINT16 xPos;
  2365. TSHR_UINT16 yPos;
  2366. }
  2367. CMPACKETMOVE;
  2368. typedef CMPACKETMOVE * PCMPACKETMOVE;
  2369. //
  2370. // DT_CPC
  2371. // Capabilities change packet
  2372. //
  2373. typedef struct tagCPCPACKET
  2374. {
  2375. S20DATAPACKET header;
  2376. PROTCAPS caps;
  2377. }
  2378. CPCPACKET;
  2379. typedef CPCPACKET * PCPCPACKET;
  2380. //
  2381. // DT_FH
  2382. // Supported local font list packet
  2383. //
  2384. //
  2385. // The NETWORKFONT is the font description which is sent across the network
  2386. // when negotiating font support.
  2387. //
  2388. //
  2389. // Flags for the nfFontFlags field
  2390. //
  2391. #define NF_FIXED_PITCH 0x0001
  2392. #define NF_FIXED_SIZE 0x0002
  2393. #define NF_ITALIC 0x0004
  2394. #define NF_UNDERLINE 0x0008
  2395. #define NF_STRIKEOUT 0x0010
  2396. #define NF_OEM_CHARSET 0x0020
  2397. #define NF_RESERVED1 0x0040 // Reserved for future BiDi support
  2398. #define NF_TRUE_TYPE 0x0080
  2399. #define NF_BASELINE 0x0100
  2400. #define NF_PRE_R11 (NF_FIXED_PITCH | NF_FIXED_SIZE | \
  2401. NF_ITALIC | NF_UNDERLINE | NF_STRIKEOUT)
  2402. //
  2403. // Mask for local-only font flags - that must not flow on the wire.
  2404. //
  2405. #define NF_LOCAL (NF_OEM_CHARSET | NF_TRUE_TYPE)
  2406. //
  2407. // A special value for the signature field which means no signature.
  2408. //
  2409. #define NF_NO_SIGNATURE 0
  2410. //
  2411. // The FH_FACESIZE is equal to the Windows specific constant LF_FACESIZE.
  2412. //
  2413. #define FH_FACESIZE 32
  2414. //
  2415. // SFRFONT
  2416. // Let us define these things more fully...
  2417. // nfFaceName font face name (not family name, not style)
  2418. // nfFontFlags see above
  2419. // nfAveWidth in Windows set to tmAveCharWidth
  2420. // nfAveHeight NOT THE AVERAGE HEIGHT but the height of a character with
  2421. // full ascender (but no accent) AND descender. There is no
  2422. // such character but never mind.
  2423. // Windows: set to tmHeight - tmInternalLeading
  2424. // nfAspectX
  2425. // nfAspectY
  2426. // nfSignature: in R11 set to an obscure checksum
  2427. // in R20 set to two one-byte values and one two byte value.
  2428. // Based on the widths of the actual text for fixed width
  2429. // fonts and on 16x16 scalable fonts. .
  2430. // (The 16x16 is effectively part of the protocol)
  2431. // nfSigFats the sum of the widths (in pels) of the chars
  2432. // 0-9,@-Z,$,%,&. divided by two: the fat chars
  2433. // nfSigThins the sum of the widths (in pels) of the chars
  2434. // 0x20->0x7F EXCLUDING those summed in nfSigFats.
  2435. // Again - divided by two. The thin chars.
  2436. // nfSigSymbol The sum of the widths (in pels) of the chars
  2437. // x80->xFF.
  2438. // nfCodePage: new use in R20: code page (not charset)
  2439. // This field is set to 0 for ANSI (meaning WINDOWS ANSI)
  2440. // is set to 255 for OEM (meaning Windows OEM font)
  2441. // is set to the defined codepage if known
  2442. // is set to 0xFFFF when not known.
  2443. //
  2444. // nfMaxAscent: The height of a character with no descender, plus any
  2445. // internal leading.
  2446. // = tmAscent in windows
  2447. // For fixed size fonts we send the values you would expect.
  2448. // For scalable fonts, we get the tmAscent (or equivalent) for
  2449. // a very large font (say height-by-width of 100x100). The
  2450. // size selected must be the same on ALL platforms so is
  2451. // effectively part of the protocol - hence is defined in
  2452. // this file as NF_MAXASCENT_HEIGHT and .._WIDTH.
  2453. //
  2454. //
  2455. #define NF_CP_WIN_ANSI 0
  2456. #define NF_CP_WIN_SYMBOL 2
  2457. #define NF_CP_WIN_OEM 255
  2458. #define NF_CP_UNKNOWN 0xFFFF
  2459. //
  2460. // Define the start and end point of the ASCII sub-range
  2461. //
  2462. #define NF_ASCII_FIRST 0x20
  2463. #define NF_ASCII_LAST 0x7F
  2464. #define NF_ASCII_ZERO 0x30
  2465. #define NF_ASCII_Z 0x5B
  2466. #define NF_ASCII_DOLLAR 0x24
  2467. #define NF_ASCII_PERCENT 0x25
  2468. #define NF_ASCII_AMPERSAND 0x26
  2469. //
  2470. // The height/width of the font to ask for when getting the metrics info
  2471. // for scalable fonts.
  2472. // These (in particular the height) are CHARACTER SIZES not CELL sizes.
  2473. // This is because the font protocol exchanges character sizes not cell
  2474. // sizes. (The char height is the cell height minus any internal leading.)
  2475. //
  2476. #define NF_METRICS_HEIGHT 100
  2477. #define NF_METRICS_WIDTH 100
  2478. //
  2479. // The wire-format font information structure
  2480. //
  2481. typedef struct tagNETWORKFONT
  2482. {
  2483. TSHR_CHAR nfFaceName[FH_FACESIZE];
  2484. TSHR_UINT16 nfFontFlags;
  2485. TSHR_UINT16 nfAveWidth;
  2486. TSHR_UINT16 nfAveHeight;
  2487. TSHR_UINT16 nfAspectX; // New field for r1.1
  2488. TSHR_UINT16 nfAspectY; // New field for r1.1
  2489. TSHR_UINT8 nfSigFats; // New field for r2.0
  2490. TSHR_UINT8 nfSigThins; // New field for r2.0
  2491. TSHR_UINT16 nfSigSymbol; // New field for r2.0
  2492. TSHR_UINT16 nfCodePage; // New field for R2.0
  2493. TSHR_UINT16 nfMaxAscent; // New field for R2.0
  2494. }
  2495. NETWORKFONT;
  2496. typedef NETWORKFONT * LPNETWORKFONT;
  2497. typedef struct tagFHPACKET
  2498. {
  2499. S20DATAPACKET header;
  2500. TSHR_UINT16 cFonts;
  2501. TSHR_UINT16 cbFontSize;
  2502. NETWORKFONT aFonts[1];
  2503. }
  2504. FHPACKET;
  2505. typedef FHPACKET * PFHPACKET;
  2506. //
  2507. // DT_HET
  2508. // Hosting state (nothing, apps, desktop)
  2509. //
  2510. typedef struct tagHETPACKET
  2511. {
  2512. S20DATAPACKET header;
  2513. TSHR_UINT16 msg;
  2514. TSHR_UINT16 hostState; // ONLY ONE VALUE FOR MSG; IF MORE MAKE MORE STRUCTS
  2515. }
  2516. HETPACKET;
  2517. typedef HETPACKET * PHETPACKET;
  2518. //
  2519. // HETPACKET msg values
  2520. //
  2521. #define HET_MSG_NUMHOSTED 1
  2522. //
  2523. // HETPACKET hostState values
  2524. //
  2525. #define HET_NOTHOSTING 0
  2526. #define HET_APPSSHARED 0x0001 // Packet only
  2527. #define HET_DESKTOPSHARED 0xFFFF // Packet and per-person data
  2528. //
  2529. // DT_IM
  2530. // Input events
  2531. //
  2532. //
  2533. // This is the base keyboard event (IM_TYPE_ASCII, IM_TYPE_VK1,
  2534. // IM_TYPE_VK2). Future keyboard events may append extra fields. The
  2535. // flags defined in the base keyboard event must be set to reasonable
  2536. // values in all future keyboard events.
  2537. //
  2538. // flags:
  2539. //
  2540. // bit 0-6: unused (available for future keyboard events)
  2541. // bit 7: Secondary key (unused).
  2542. // bit 8: SET - extended key, RESET - normal key
  2543. // bit 9-11: unused (available for future keyboard events)
  2544. // bit 12: SET - when replayed this key stroke should NOT cause
  2545. // anything to happen
  2546. // bit 13: reserved - this flag is not part of the protocol and is
  2547. // never sent. It is used internally by IEM when processing received
  2548. // packets.
  2549. // bit 14: SET - previously down, RESET previously up
  2550. // bit 15: SET - key release, RESET key press
  2551. //
  2552. //
  2553. typedef struct tagIMKEYBOARD
  2554. {
  2555. TSHR_UINT16 flags;
  2556. TSHR_UINT16 keyCode;
  2557. }
  2558. IMKEYBOARD;
  2559. typedef IMKEYBOARD * PIMKEYBOARD;
  2560. //
  2561. // IMKEYBOARD flags values
  2562. //
  2563. #define IM_FLAG_KEYBOARD_RIGHT 0x0001
  2564. #define IM_FLAG_KEYBOARD_UPDATESTATE 0x0002 // not sent; just internal
  2565. #define IM_FLAG_KEYBOARD_SECONDARY 0x0080
  2566. #define IM_FLAG_KEYBOARD_EXTENDED 0x0100
  2567. #define IM_FLAG_KEYBOARD_QUIET 0x1000
  2568. #define IM_FLAG_KEYBOARD_ALT_DOWN 0x2000
  2569. #define IM_FLAG_KEYBOARD_DOWN 0x4000
  2570. #define IM_FLAG_KEYBOARD_RELEASE 0x8000
  2571. //
  2572. // This is the base mouse event (IM_TYPE_3BUTTON). Future mouse events
  2573. // may append extra fields but they must include all the fields in the
  2574. // base mouse event and these must be set to reasonable values.
  2575. //
  2576. // flags:
  2577. //
  2578. // bit 0-8: ignored by old systems
  2579. // new systems: signed wheel rotation amount if bit 9 set
  2580. // bit 9: ignored by old systems
  2581. // new systems: SET - wheel rotate, RESET - other event
  2582. // (takes precedent over bit 11 - mouse move)
  2583. //
  2584. // bit 10: SET - double click, RESET - single click
  2585. // bit 11: SET - mouse move (ignore bits 9,10, 12-15), RESET - mouse
  2586. // action
  2587. // bit 12: SET - button 1 (left button)
  2588. // bit 13: SET - button 2 (right button)
  2589. // bit 14: SET - button 3 (middle button)
  2590. // bit 15: SET - button press, RESET - button release
  2591. //
  2592. //
  2593. typedef struct tagIMMOUSE
  2594. {
  2595. TSHR_UINT16 flags;
  2596. TSHR_INT16 x;
  2597. TSHR_INT16 y;
  2598. }
  2599. IMMOUSE;
  2600. typedef IMMOUSE * PIMMOUSE;
  2601. //
  2602. // IMMOUSE flags values
  2603. //
  2604. #define IM_FLAG_MOUSE_WHEEL 0x0200
  2605. #define IM_FLAG_MOUSE_DIRECTION 0x0100
  2606. #define IM_FLAG_MOUSE_ROTATION_MASK 0x01FF
  2607. #define IM_FLAG_MOUSE_DOUBLE 0x0400
  2608. #define IM_FLAG_MOUSE_MOVE 0x0800
  2609. #define IM_FLAG_MOUSE_BUTTON1 0x1000
  2610. #define IM_FLAG_MOUSE_BUTTON2 0x2000
  2611. #define IM_FLAG_MOUSE_BUTTON3 0x4000
  2612. #define IM_FLAG_MOUSE_DOWN 0x8000
  2613. typedef struct tagIMEVENT
  2614. {
  2615. TSHR_UINT32 timeMS;
  2616. TSHR_UINT16 type;
  2617. union
  2618. {
  2619. IMKEYBOARD keyboard;
  2620. IMMOUSE mouse;
  2621. }
  2622. data;
  2623. }
  2624. IMEVENT;
  2625. typedef IMEVENT * PIMEVENT;
  2626. typedef IMEVENT FAR * LPIMEVENT;
  2627. //
  2628. // IMEVENT type values
  2629. //
  2630. #define IM_TYPE_SYNC 0x0000 // OBSOLETE 2.X
  2631. #define IM_TYPE_ASCII 0x0001
  2632. #define IM_TYPE_VK1 0x0002
  2633. #define IM_TYPE_VK2 0x0003
  2634. #define IM_TYPE_3BUTTON 0x8001
  2635. typedef struct tagIMPACKET
  2636. {
  2637. S20DATAPACKET header;
  2638. TSHR_UINT16 numEvents;
  2639. TSHR_UINT16 padding;
  2640. IMEVENT aEvents[1];
  2641. }
  2642. IMPACKET;
  2643. typedef IMPACKET * PIMPACKET;
  2644. typedef IMPACKET FAR * LPIMPACKET;
  2645. //
  2646. // DT_UP
  2647. // Update packet (orders, screen data, palettes)
  2648. //
  2649. typedef struct tagUPPACKETHEADER
  2650. {
  2651. S20DATAPACKET header;
  2652. TSHR_UINT16 updateType;
  2653. TSHR_UINT16 padding;
  2654. }
  2655. UPPACKETHEADER;
  2656. typedef UPPACKETHEADER * PUPPACKETHEADER;
  2657. //
  2658. // UPPACKETHEADER updateType values
  2659. //
  2660. #define UPD_ORDERS 0
  2661. #define UPD_SCREEN_DATA 1
  2662. #define UPD_PALETTE 2
  2663. #define UPD_SYNC 3
  2664. //
  2665. // UPD_ORDERS
  2666. //
  2667. typedef struct tagORDPACKET
  2668. {
  2669. UPPACKETHEADER header;
  2670. TSHR_UINT16 cOrders;
  2671. TSHR_UINT16 sendBPP;
  2672. BYTE data[1];
  2673. }
  2674. ORDPACKET;
  2675. typedef ORDPACKET * PORDPACKET;
  2676. //
  2677. // UPD_SCREEN_DATA
  2678. //
  2679. // Bitmap packet contains bitmap image of window changes made by a shared
  2680. // application. These packets are sent when a screen update occurs that
  2681. // can not be sent as an order. The structure contains the following
  2682. // fields:
  2683. //
  2684. // winID - window handle of the shared window from which the update came
  2685. // position - virtual desktop position of the update
  2686. // realWidth - width of update bitmap
  2687. // realHeight - height of update bitmap
  2688. // format - bits per pel of update bitmap
  2689. // dataSize - size in bytes of following bitmap data
  2690. // firstData - first byte in array of bytes that contains the bitmap
  2691. //
  2692. // Note that the realWidth is not always the same as the width of the
  2693. // update as given by the position field rectangle. This is because a
  2694. // number of fixed size cached bitmaps are used for speed when generating
  2695. // the update packets. The bitmap data (firstData onwards) should be
  2696. // set into a bitmap of realWidth, realHeight dimensions by the receiver
  2697. // and then the appropriate portion blted to the desired destination
  2698. // determined by the position rectangle. The valid portion of the bitmap
  2699. // always starts 0,0 within the bitmap.
  2700. //
  2701. typedef struct tagSDPACKET
  2702. {
  2703. UPPACKETHEADER header;
  2704. TSHR_RECT16 position;
  2705. TSHR_UINT16 realWidth;
  2706. TSHR_UINT16 realHeight;
  2707. TSHR_UINT16 format;
  2708. TSHR_UINT16 compressed;
  2709. TSHR_UINT16 dataSize;
  2710. BYTE data[1];
  2711. }
  2712. SDPACKET;
  2713. typedef SDPACKET * PSDPACKET;
  2714. //
  2715. // UPD_PALETTE
  2716. //
  2717. // Palette packet. This is sent before any SDPACKETS to define the
  2718. // colors in the bitmap data. The fields are as follows:
  2719. //
  2720. // numColors - the number of colors in the palette
  2721. // firstColor - the first entry in an array of TSHR_COLORs
  2722. //
  2723. // The TSHR_COLOR structures are 3 bytes long (r,g,b) and are NOT padded.
  2724. //
  2725. //
  2726. typedef struct tagPMPACKET
  2727. {
  2728. UPPACKETHEADER header;
  2729. TSHR_UINT32 numColors;
  2730. TSHR_COLOR aColors[1];
  2731. }
  2732. PMPACKET;
  2733. typedef PMPACKET * PPMPACKET;
  2734. //
  2735. // UPD_SYNC
  2736. //
  2737. typedef struct tagUPSPACKET
  2738. {
  2739. UPPACKETHEADER header;
  2740. }
  2741. UPSPACKET;
  2742. typedef UPSPACKET * PUPSPACKET;
  2743. //
  2744. // DT_SNI
  2745. // Share controller packet
  2746. //
  2747. typedef struct tagSNIPACKET
  2748. {
  2749. S20DATAPACKET header;
  2750. TSHR_UINT16 message;
  2751. TSHR_UINT16 destination;
  2752. }
  2753. SNIPACKET;
  2754. typedef SNIPACKET * PSNIPACKET;
  2755. //
  2756. // SNIPACKET message values
  2757. //
  2758. #define SNI_MSG_SYNC 1
  2759. //
  2760. // For a SNI_MSG_SYNC,
  2761. // The network ID of the destination (all syncs are broadcast
  2762. // and discarded at the destination if they are not for the
  2763. // destination).
  2764. //
  2765. //
  2766. // DT_SWL
  2767. // Shared window list packet
  2768. //
  2769. #define SWL_MAX_WINDOW_TITLE_SEND 50
  2770. #define SWL_MAX_NONRECT_SIZE 10240
  2771. //
  2772. // Structures used to define the window structure (Z-order and
  2773. // position).
  2774. //
  2775. typedef struct tagSWLWINATTRIBUTES
  2776. {
  2777. UINT_PTR winID;
  2778. //
  2779. // The window ID for shared windows - otherwise 0. Note that
  2780. // this is the window ID on the machine hosting the application
  2781. // even for view frames.
  2782. //
  2783. TSHR_UINT32 extra;
  2784. //
  2785. // Extra information for the window. The contents depend on
  2786. // the flags.
  2787. //
  2788. // For SWL_FLAG_WINDOW_HOSTED this contains the appID of the
  2789. // application which owns the window.
  2790. //
  2791. // For SWL_FLAG_WINDOW_SHADOW this contains the person ID of
  2792. // the party which is hosting the app
  2793. //
  2794. // For SWL_FLAG_WINDOW_LOCAL this entry is 0.
  2795. //
  2796. TSHR_UINT32 ownerWinID;
  2797. //
  2798. // The window ID of the owner of this window. Only valid for
  2799. // shared, hosted windows. NULL is a valid owner ID.
  2800. //
  2801. TSHR_UINT32 flags;
  2802. //
  2803. // Flags describing window
  2804. //
  2805. // SWL_FLAG_WINDOW_MINIMIZED
  2806. // SWL_FLAG_WINDOW_TAGGABLE
  2807. // SWL_FLAG_WINDOW_HOSTED
  2808. // SWL_FLAG_WINDOW_SHADOW
  2809. // SWL_FLAG_WINDOW_LOCAL
  2810. // SWL_FLAG_WINDOW_TOPMOST
  2811. //
  2812. // SWL_FLAG_WINDOW_TASKBAR - window appears on Win95 task bar
  2813. // SWL_FLAG_WINDOW_NOTASKBAR - window not on Win95 task bar
  2814. //
  2815. // (SWL_FLAG_WINDOW_TRANSPARENT - this is not sent but is used
  2816. // during the creation of the packet)
  2817. //
  2818. #define SWL_FLAG_WINDOW_MINIMIZED 0x00000001
  2819. #define SWL_FLAG_WINDOW_TAGGABLE 0x00000002
  2820. #define SWL_FLAG_WINDOW_HOSTED 0x00000004
  2821. #define SWL_FLAG_WINDOW_LOCAL 0x00000010
  2822. #define SWL_FLAG_WINDOW_TOPMOST 0x00000020
  2823. //
  2824. // New for NM 1.0, non-R11
  2825. //
  2826. #define SWL_FLAG_WINDOW_TASKBAR 0x00010000
  2827. #define SWL_FLAG_WINDOW_NOTASKBAR 0x00020000
  2828. #define SWL_FLAG_WINDOW_TRANSPARENT 0x40000000
  2829. //
  2830. // New for NM 2.0
  2831. //
  2832. #define SWL_FLAG_WINDOW_NONRECTANGLE 0x00040000
  2833. //
  2834. // Obsolete in NM 3.0
  2835. // These were used at some point in backlevel versions.
  2836. // If you reuse these bits, DO A LOT OF INTEROP TESTING.
  2837. //
  2838. #define SWL_FLAG_WINDOW_SHADOW 0x00000008
  2839. #define SWL_FLAG_WINDOW_DESKTOP 0x00080000
  2840. #define SWL_FLAG_WINDOW_REQD 0x80000000
  2841. //
  2842. // NM 3.0 INTERNAL only; not transmitted
  2843. //
  2844. #define SWL_FLAG_INTERNAL_SEEN 0x000001000
  2845. //
  2846. // These are valid to SEND in a packet or PROCESS when RECEIVED
  2847. //
  2848. #define SWL_FLAGS_VALIDPACKET \
  2849. (SWL_FLAG_WINDOW_MINIMIZED | \
  2850. SWL_FLAG_WINDOW_TAGGABLE | \
  2851. SWL_FLAG_WINDOW_HOSTED | \
  2852. SWL_FLAG_WINDOW_TOPMOST | \
  2853. SWL_FLAG_WINDOW_TASKBAR | \
  2854. SWL_FLAG_WINDOW_NONRECTANGLE | \
  2855. SWL_FLAG_WINDOW_SHADOW)
  2856. TSHR_RECT16 position;
  2857. //
  2858. // The bounding rectangle of the window in inclusive virtual
  2859. // desktop coordinates.
  2860. //
  2861. }
  2862. SWLWINATTRIBUTES;
  2863. typedef SWLWINATTRIBUTES *PSWLWINATTRIBUTES;
  2864. //
  2865. // The SWL packet consists of an array of SWLWINATTRIBUTES structures,
  2866. // followed by some variable length string data (the window titles)
  2867. // followed by zero or more, word aligned, additional chunks of data.
  2868. //
  2869. // The only currently defined chunk is for the non-rectangular window
  2870. // data.
  2871. //
  2872. typedef struct
  2873. {
  2874. TSHR_UINT16 size;
  2875. //
  2876. // Total size in bytes of this chunk
  2877. //
  2878. TSHR_UINT16 idChunk;
  2879. //
  2880. // An identifier for the contents of this chunk.
  2881. //
  2882. #define SWL_PACKET_ID_NONRECT 0x524e // "NR"
  2883. }
  2884. SWLPACKETCHUNK;
  2885. typedef SWLPACKETCHUNK * PSWLPACKETCHUNK;
  2886. typedef struct tagSWLPACKET
  2887. {
  2888. S20DATAPACKET header;
  2889. TSHR_UINT16 msg; // ONLY ONE VALUE FOR MSG; MAKE MORE STRUCTS IF ADDED
  2890. TSHR_UINT16 flags;
  2891. TSHR_UINT16 numWindows;
  2892. TSHR_UINT16 tick;
  2893. TSHR_UINT16 token;
  2894. TSHR_UINT16 reserved;
  2895. SWLWINATTRIBUTES aWindows[1];
  2896. //
  2897. // The last SWLWINATTRIBUTES structure is followed by the
  2898. // window title data. This is made up as follows.
  2899. //
  2900. // For each window which is a window from a shared, hosted
  2901. // application (ie winID and appID are non-zero) #either -
  2902. //
  2903. // (char)0xFF - not a `task window' - give it a NULL title
  2904. // or -
  2905. // a null terminated string up to MAX_WINDOW_TITLE_SEND
  2906. // characters
  2907. //
  2908. // The titles appear in the same order as the corresponding
  2909. // windows in the SWLWINSTRUCTURE.
  2910. //
  2911. //
  2912. // The last TITLE is followed by the regional data,
  2913. // SWLPACKETCHUNK, if there is any. One for each NONRECT window in
  2914. // the list.
  2915. //
  2916. }
  2917. SWLPACKET;
  2918. typedef SWLPACKET *PSWLPACKET;
  2919. //
  2920. // SWLPACKET msg values
  2921. //
  2922. #define SWL_MSG_WINSTRUCT 1
  2923. //
  2924. // SWLPACKET flags values
  2925. //
  2926. #define SWL_FLAG_STATE_SYNCING 0x0001
  2927. #endif // _H_T_SHARE