home *** CD-ROM | disk | FTP | other *** search
/ PC Format (South-Africa) 2001 May / PCFMay2001.iso / Xenon / C++ / FreeCommandLineTools.exe / Include / pchannel.h < prev    next >
Encoding:
C/C++ Source or Header  |  2000-01-31  |  8.5 KB  |  147 lines

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