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.

303 lines
8.4 KiB

  1. /* (C) 1997 Microsoft Corp.
  2. *
  3. * file : MCSIOCTL.h
  4. * author : Erik Mavrinac
  5. *
  6. * description: Definitions for the interface between MCSMUX and PDMCS.
  7. */
  8. #ifndef __MCSIOCTL_H
  9. #define __MCSIOCTL_H
  10. /*
  11. * Defines
  12. */
  13. // From uportmsg.h in NetMeeting project (defined there as
  14. // MAXIMUM_DOMAIN_SELECTOR).
  15. #define MaxDomainSelectorLength 32
  16. // Max allowable GCC data for connect-initial and connect-response PDUs.
  17. // Used to reduce memory allocations for handling these PDUs -- if too large
  18. // we will send a bad response PDU and/or disconnect.
  19. #define MaxGCCConnectDataLength 1024
  20. /*
  21. * T.120 IOCTLs.
  22. */
  23. #define IOCTL_T120_BASE (0x500)
  24. // Used by MCSMUX to signal on a stack IOCTL that the included data is an MCS
  25. // request/response. An MCSXxxYyyIoctl struct is expected as the
  26. // pSdIoctl->InputBuffer; the Header.Type value in the struct will be used
  27. // to determine the type of the request.
  28. #define IOCTL_T120_REQUEST _ICA_CTL_CODE (IOCTL_T120_BASE, METHOD_NEITHER)
  29. /*
  30. * Used as the header of all data passed via IOCTL_T120_REQUEST or channel
  31. * input.
  32. */
  33. typedef struct {
  34. UserHandle hUser; // PDMCS-supplied handle (NULL for node controller).
  35. int Type; // MCS request/indication type.
  36. } IoctlHeader;
  37. /*
  38. * Connect provider (node controller only). These are special in that they
  39. * only come from user mode and so the assoicated user data (if any)
  40. * will always be packed at the end of the struct by MCSMUX.
  41. */
  42. // Passed in by node controller. Confirm is defined next.
  43. typedef struct
  44. {
  45. IoctlHeader Header; // Contains MCS_CONNECT_PROVIDER_REQUEST.
  46. unsigned char CallingDomain[MaxDomainSelectorLength];
  47. unsigned CallingDomainLength;
  48. unsigned char CalledDomain[MaxDomainSelectorLength];
  49. unsigned CalledDomainLength;
  50. BOOLEAN bUpwardConnection;
  51. DomainParameters DomainParams;
  52. unsigned UserDataLength;
  53. BYTE UserData[MaxGCCConnectDataLength];
  54. } ConnectProviderRequestIoctl;
  55. typedef struct
  56. {
  57. IoctlHeader Header; // Contains MCS_CONNECT_PROVIDER_CONFIRM.
  58. ConnectionHandle hConn;
  59. DomainParameters DomainParams;
  60. MCSResult Result;
  61. } ConnectProviderConfirmIoctl;
  62. // Asynchronous indication triggered when another node connects.
  63. typedef struct
  64. {
  65. IoctlHeader Header; // Contains MCS_CONNECT_PROVIDER_INDICATION.
  66. ConnectionHandle hConn;
  67. BOOLEAN bUpwardConnection;
  68. DomainParameters DomainParams;
  69. unsigned UserDataLength;
  70. BYTE UserData[MaxGCCConnectDataLength];
  71. } ConnectProviderIndicationIoctl;
  72. // Reply to connect-provider indication.
  73. typedef struct
  74. {
  75. IoctlHeader Header; // Contains MCS_CONNECT_PROVIDER_RESPONSE.
  76. ConnectionHandle hConn;
  77. MCSResult Result;
  78. unsigned UserDataLength;
  79. BYTE * pUserData;
  80. } ConnectProviderResponseIoctl;
  81. /*
  82. * Disconnect provider (node controller only).
  83. */
  84. // Passed in by node controller. There is no confirm.
  85. typedef struct
  86. {
  87. IoctlHeader Header; // Contains MCS_DISCONNECT_PROVIDER_REQUEST/INDICATION.
  88. ConnectionHandle hConn;
  89. MCSReason Reason;
  90. } DisconnectProviderRequestIoctl;
  91. // Asynchronous indication.
  92. typedef struct
  93. {
  94. IoctlHeader Header; // Contains MCS_DISCONNECT_PROVIDER_REQUEST/INDICATION.
  95. ConnectionHandle hConn;
  96. MCSReason Reason;
  97. } DisconnectProviderIndicationIoctl;
  98. /*
  99. * Attach user
  100. */
  101. // Chosen domain is implicit since each PDMCS instance is a domain.
  102. // Header.hUser is filled in during call to contain the user handle.
  103. typedef struct
  104. {
  105. IoctlHeader Header; // Contains MCS_ATTACH_USER_REQUEST.
  106. void *UserDefined;
  107. } AttachUserRequestIoctl;
  108. typedef struct {
  109. UserHandle hUser;
  110. UserID UserID; // Valid only if bCompleted is TRUE.
  111. unsigned MaxSendSize;
  112. MCSError MCSErr;
  113. BOOLEAN bCompleted;
  114. } AttachUserReturnIoctl;
  115. // Used only in the case where an attach-user request was sent across the net
  116. // to the top provider. Hydra 4.0 is always top provider so this is not used.
  117. typedef struct
  118. {
  119. IoctlHeader Header; // Contains MCS_ATTACH_USER_CONFIRM.
  120. UserHandle hUser;
  121. void *UserDefined; // As passed into attach-user request.
  122. MCSResult Result;
  123. } AttachUserConfirmIoctl;
  124. /*
  125. * Detach user
  126. */
  127. // Passed in by application. This is synchronous -- no confirm is issued.
  128. typedef struct
  129. {
  130. IoctlHeader Header; // Contains MCS_DETACH_USER_REQUEST and the hUser.
  131. } DetachUserRequestIoctl;
  132. // Asynchronous indication triggered when another user detaches.
  133. typedef struct
  134. {
  135. IoctlHeader Header; // Contains MCS_DETACH_USER_INDICATION.
  136. void *UserDefined; // As passed into attach-user request.
  137. DetachUserIndication DUin;
  138. } DetachUserIndicationIoctl;
  139. /*
  140. * Channel join
  141. */
  142. // Passed in by application. Confirm is defined next.
  143. typedef struct
  144. {
  145. IoctlHeader Header; // Contains MCS_CHANNEL_JOIN_REQUEST.
  146. ChannelID ChannelID;
  147. } ChannelJoinRequestIoctl;
  148. typedef struct
  149. {
  150. ChannelHandle hChannel;
  151. ChannelID ChannelID; // Valid only if bCompleted is TRUE.
  152. MCSError MCSErr;
  153. BOOLEAN bCompleted;
  154. } ChannelJoinReturnIoctl;
  155. // Used in the case where a channel-join request is sent across the net to
  156. // the top provider. Should not be used in Hydra 4.0 -- we are always TP.
  157. typedef struct
  158. {
  159. IoctlHeader Header; // Contains MCS_CHANNEL_JOIN_CONFIRM.
  160. void *UserDefined; // As passed into attach-user request.
  161. MCSResult Result;
  162. ChannelID ChannelID;
  163. } ChannelJoinConfirmIoctl;
  164. /*
  165. * Channel leave
  166. */
  167. // Passed in by application. This is synchronous -- no confirm is issued.
  168. typedef struct
  169. {
  170. IoctlHeader Header; // Contains MCS_CHANNEL_LEAVE_REQUEST.
  171. ChannelHandle hChannel;
  172. } ChannelLeaveRequestIoctl;
  173. /*
  174. * (Uniform) send data
  175. */
  176. // Asynchronous indication triggered when data arrives. Used by both
  177. // send-data and uniform-send-data indications.
  178. // Data is packed right after this struct.
  179. typedef struct
  180. {
  181. IoctlHeader Header; // Contains (UNIFORM)SEND_DATA_INDICATION.
  182. void *UserDefined; // As passed into attach-user request.
  183. ChannelHandle hChannel;
  184. UserID SenderID;
  185. MCSPriority Priority;
  186. Segmentation Segmentation;
  187. unsigned DataLength;
  188. } SendDataIndicationIoctl;
  189. // Passed in by application. This is synchronous -- no confirm is issued.
  190. // This struct is used both for send-data and uniform-send-data requests.
  191. typedef struct
  192. {
  193. IoctlHeader Header; // Contains (UNIFORM_)MCS_SEND_DATA_REQUEST.
  194. DataRequestType RequestType; // Redundant but useful info.
  195. ChannelHandle hChannel; // Kernel-mode hChannel.
  196. ChannelID ChannelID; // If hChn==NULL, unjoined chn to send to.
  197. MCSPriority Priority;
  198. Segmentation Segmentation;
  199. unsigned DataLength;
  200. } SendDataRequestIoctl;
  201. /*
  202. * Request and response types for use in differentiating requests.
  203. */
  204. // User attachment requests.
  205. // These values must be contiguously numbered, since a dispatch table is used
  206. // to quickly call handler functions.
  207. #define MCS_ATTACH_USER_REQUEST 0
  208. #define MCS_DETACH_USER_REQUEST 1
  209. #define MCS_CHANNEL_JOIN_REQUEST 2
  210. #define MCS_CHANNEL_LEAVE_REQUEST 3
  211. #define MCS_SEND_DATA_REQUEST 4
  212. #define MCS_UNIFORM_SEND_DATA_REQUEST 5
  213. #define MCS_CHANNEL_CONVENE_REQUEST 6
  214. #define MCS_CHANNEL_DISBAND_REQUEST 7
  215. #define MCS_CHANNEL_ADMIT_REQUEST 8
  216. #define MCS_CHANNEL_EXPEL_REQUEST 9
  217. #define MCS_TOKEN_GRAB_REQUEST 10
  218. #define MCS_TOKEN_INHIBIT_REQUEST 11
  219. #define MCS_TOKEN_GIVE_REQUEST 12
  220. #define MCS_TOKEN_GIVE_RESPONSE 13
  221. #define MCS_TOKEN_PLEASE_REQUEST 14
  222. #define MCS_TOKEN_RELEASE_REQUEST 15
  223. #define MCS_TOKEN_TEST_REQUEST 16
  224. // NC-only requests.
  225. #define MCS_CONNECT_PROVIDER_REQUEST 17
  226. #define MCS_CONNECT_PROVIDER_RESPONSE 18
  227. #define MCS_DISCONNECT_PROVIDER_REQUEST 19
  228. // Startup synchonization trigger. This message is sent when the rest of the
  229. // system is ready for MCS to start processing inputs.
  230. #define MCS_T120_START 20
  231. /*
  232. * ICA virtual channel definitions for the T.120 input channel.
  233. */
  234. #define Virtual_T120 "MS_T120"
  235. #define Virtual_T120ChannelNum 31
  236. #endif // !defined(__MCSIOCTL_H)