PChannel.h 8.3 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144
  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. /****************************************************************************/
  34. /* Virtual Channel options, passed by Client on VirtualChannelOpen */
  35. /****************************************************************************/
  36. /****************************************************************************/
  37. /* Application is initialized. If this flag is not set, a virtual channel */
  38. /* is not established for this application */
  39. /****************************************************************************/
  40. #define CHANNEL_OPTION_INITIALIZED 0x80000000
  41. /****************************************************************************/
  42. /* Encrypt according to RDP data encryption (ie if RDP data is encrypted, */
  43. /* do so for this virtual channel too) */
  44. /****************************************************************************/
  45. #define CHANNEL_OPTION_ENCRYPT_RDP 0x40000000
  46. /****************************************************************************/
  47. /* Encrypt Server to Client data (ignored if CHANNEL_OPTION_ENCRYPT_RDP is */
  48. /* set) */
  49. /****************************************************************************/
  50. #define CHANNEL_OPTION_ENCRYPT_SC 0x20000000
  51. /****************************************************************************/
  52. /* Encrypt Client to Server data (ignored if CHANNEL_OPTION_ENCRYPT_RDP is */
  53. /* set) */
  54. /****************************************************************************/
  55. #define CHANNEL_OPTION_ENCRYPT_CS 0x10000000
  56. /****************************************************************************/
  57. /* Send data at high priority (not recommended, as this may impact RDP */
  58. /* performance) */
  59. /****************************************************************************/
  60. #define CHANNEL_OPTION_PRI_HIGH 0x08000000
  61. /****************************************************************************/
  62. /* Send data at medium priority */
  63. /****************************************************************************/
  64. #define CHANNEL_OPTION_PRI_MED 0x04000000
  65. /****************************************************************************/
  66. /* Send data at low priority */
  67. /****************************************************************************/
  68. #define CHANNEL_OPTION_PRI_LOW 0x02000000
  69. /****************************************************************************/
  70. /* Compress data in this virtual channel if RDP data compression is */
  71. /* configured for this connection */
  72. /****************************************************************************/
  73. #define CHANNEL_OPTION_COMPRESS_RDP 0x00800000
  74. /****************************************************************************/
  75. /* Compress data in this virtual channel, irrespective of RDP data */
  76. /* compression (ignored if CHANNEL_OPTION_COMPRESS_RDP is set) */
  77. /****************************************************************************/
  78. #define CHANNEL_OPTION_COMPRESS 0x00400000
  79. /****************************************************************************/
  80. /* Show Server addins the full Virtual Channel protocol. This option */
  81. /* affects how data passed to VirtualChannelWrite is presented to Server */
  82. /* addins. */
  83. /* */
  84. /* - If this option is set, Server addins see the full Virtual Channel */
  85. /* protocol, including CHANNEL_PDU_HEADER (below). */
  86. /* */
  87. /* -If this option is not set, Server addins see just the data passed to */
  88. /* VirtualChannelWrite */
  89. /****************************************************************************/
  90. #define CHANNEL_OPTION_SHOW_PROTOCOL 0x00200000
  91. /****************************************************************************/
  92. /* Maximum number and size of channel names */
  93. /****************************************************************************/
  94. #define CHANNEL_MAX_COUNT 30
  95. #define CHANNEL_NAME_LEN 7
  96. /****************************************************************************/
  97. /* Structure: CHANNEL_DEF */
  98. /* */
  99. /* Description: Client to Server virtual channel information */
  100. /* - name channel name */
  101. /* - options channel options (a combination of the CHANNEL_OPTION */
  102. /* constants above) */
  103. /****************************************************************************/
  104. typedef struct tagCHANNEL_DEF
  105. {
  106. char name[CHANNEL_NAME_LEN + 1];
  107. ULONG options;
  108. } CHANNEL_DEF, FAR * PCHANNEL_DEF, FAR * FAR * PPCHANNEL_DEF;
  109. /****************************************************************************/
  110. /* Header of Virtual Channel PDUs */
  111. /****************************************************************************/
  112. /****************************************************************************/
  113. /* Structure: CHANNEL_PDU_HEADER */
  114. /* */
  115. /* Description: Header sent on Virtual Channel PDUs */
  116. /****************************************************************************/
  117. typedef struct tagCHANNEL_PDU_HEADER
  118. {
  119. UINT32 length; /* Length of data including header */
  120. UINT32 flags; /* CHANNEL_FLAG_xxx flags */
  121. } CHANNEL_PDU_HEADER, FAR * PCHANNEL_PDU_HEADER;
  122. /****************************************************************************/
  123. #endif /* _H_PCHANNEL */