Source code of Windows XP (NT5)
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

153 lines
8.7 KiB

  1. /****************************************************************************/
  2. /* Header: pchannel.h */
  3. /* */
  4. /* Purpose: Virtual Channel protocol header - VC stuff common to Client & */
  5. /* Server */
  6. /* */
  7. /* Copyright(C) Microsoft Corporation 1999 */
  8. /* */
  9. /****************************************************************************/
  10. #ifndef _H_PCHANNEL
  11. #define _H_PCHANNEL
  12. /****************************************************************************/
  13. /* Maximum amount of data that is sent in one operation. Data larger than */
  14. /* this is segmented into chunks of this size and sent as multiple */
  15. /* operations. */
  16. /****************************************************************************/
  17. #define CHANNEL_CHUNK_LENGTH 1600
  18. #define CHANNEL_PDU_LENGTH (CHANNEL_CHUNK_LENGTH + sizeof(CHANNEL_PDU_HEADER))
  19. /****************************************************************************/
  20. /* Header flags (also passed to VirtualChannelOpenEventFn) */
  21. /****************************************************************************/
  22. #define CHANNEL_FLAG_FIRST 0x01
  23. #define CHANNEL_FLAG_LAST 0x02
  24. #define CHANNEL_FLAG_ONLY (CHANNEL_FLAG_FIRST | CHANNEL_FLAG_LAST)
  25. #define CHANNEL_FLAG_MIDDLE 0
  26. #define CHANNEL_FLAG_FAIL 0x100
  27. /****************************************************************************/
  28. /* Header flags (internal protocol use only) */
  29. /****************************************************************************/
  30. #define CHANNEL_FLAG_SHOW_PROTOCOL 0x10
  31. #define CHANNEL_FLAG_SUSPEND 0x20
  32. #define CHANNEL_FLAG_RESUME 0x40
  33. #define CHANNEL_FLAG_SHADOW_PERSISTENT 0x80
  34. /****************************************************************************/
  35. /* Virtual Channel options, passed by Client on VirtualChannelOpen */
  36. /****************************************************************************/
  37. /****************************************************************************/
  38. /* Application is initialized. If this flag is not set, a virtual channel */
  39. /* is not established for this application */
  40. /****************************************************************************/
  41. #define CHANNEL_OPTION_INITIALIZED 0x80000000
  42. /****************************************************************************/
  43. /* Encrypt according to RDP data encryption (ie if RDP data is encrypted, */
  44. /* do so for this virtual channel too) */
  45. /****************************************************************************/
  46. #define CHANNEL_OPTION_ENCRYPT_RDP 0x40000000
  47. /****************************************************************************/
  48. /* Encrypt Server to Client data (ignored if CHANNEL_OPTION_ENCRYPT_RDP is */
  49. /* set) */
  50. /****************************************************************************/
  51. #define CHANNEL_OPTION_ENCRYPT_SC 0x20000000
  52. /****************************************************************************/
  53. /* Encrypt Client to Server data (ignored if CHANNEL_OPTION_ENCRYPT_RDP is */
  54. /* set) */
  55. /****************************************************************************/
  56. #define CHANNEL_OPTION_ENCRYPT_CS 0x10000000
  57. /****************************************************************************/
  58. /* Send data at high priority (not recommended, as this may impact RDP */
  59. /* performance) */
  60. /****************************************************************************/
  61. #define CHANNEL_OPTION_PRI_HIGH 0x08000000
  62. /****************************************************************************/
  63. /* Send data at medium priority */
  64. /****************************************************************************/
  65. #define CHANNEL_OPTION_PRI_MED 0x04000000
  66. /****************************************************************************/
  67. /* Send data at low priority */
  68. /****************************************************************************/
  69. #define CHANNEL_OPTION_PRI_LOW 0x02000000
  70. /****************************************************************************/
  71. /* Compress data in this virtual channel if RDP data compression is */
  72. /* configured for this connection */
  73. /****************************************************************************/
  74. #define CHANNEL_OPTION_COMPRESS_RDP 0x00800000
  75. /****************************************************************************/
  76. /* Compress data in this virtual channel, irrespective of RDP data */
  77. /* compression (ignored if CHANNEL_OPTION_COMPRESS_RDP is set) */
  78. /****************************************************************************/
  79. #define CHANNEL_OPTION_COMPRESS 0x00400000
  80. /****************************************************************************/
  81. /* Show Server addins the full Virtual Channel protocol. This option */
  82. /* affects how data passed to VirtualChannelWrite is presented to Server */
  83. /* addins. */
  84. /* */
  85. /* - If this option is set, Server addins see the full Virtual Channel */
  86. /* protocol, including CHANNEL_PDU_HEADER (below). */
  87. /* */
  88. /* -If this option is not set, Server addins see just the data passed to */
  89. /* VirtualChannelWrite */
  90. /****************************************************************************/
  91. #define CHANNEL_OPTION_SHOW_PROTOCOL 0x00200000
  92. /****************************************************************************/
  93. /* Specify that this channel is persistent accross remote control */
  94. /* transitions. */
  95. /****************************************************************************/
  96. #define CHANNEL_OPTION_REMOTE_CONTROL_PERSISTENT 0x00100000
  97. /****************************************************************************/
  98. /* Maximum number and size of channel names */
  99. /****************************************************************************/
  100. #define CHANNEL_MAX_COUNT 30
  101. #define CHANNEL_NAME_LEN 7
  102. /****************************************************************************/
  103. /* Structure: CHANNEL_DEF */
  104. /* */
  105. /* Description: Client to Server virtual channel information */
  106. /* - name channel name */
  107. /* - options channel options (a combination of the CHANNEL_OPTION */
  108. /* constants above) */
  109. /****************************************************************************/
  110. typedef struct tagCHANNEL_DEF
  111. {
  112. char name[CHANNEL_NAME_LEN + 1];
  113. ULONG options;
  114. } CHANNEL_DEF;
  115. typedef CHANNEL_DEF UNALIGNED FAR *PCHANNEL_DEF;
  116. typedef PCHANNEL_DEF UNALIGNED FAR *PPCHANNEL_DEF;
  117. /****************************************************************************/
  118. /* Header of Virtual Channel PDUs */
  119. /****************************************************************************/
  120. /****************************************************************************/
  121. /* Structure: CHANNEL_PDU_HEADER */
  122. /* */
  123. /* Description: Header sent on Virtual Channel PDUs */
  124. /****************************************************************************/
  125. typedef struct tagCHANNEL_PDU_HEADER
  126. {
  127. UINT32 length; /* Length of data including header */
  128. UINT32 flags; /* CHANNEL_FLAG_xxx flags */
  129. } CHANNEL_PDU_HEADER, FAR * PCHANNEL_PDU_HEADER;
  130. /****************************************************************************/
  131. #endif /* _H_PCHANNEL */