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.

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