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.

297 lines
12 KiB

  1. /*++ BUILD Version: 0009 // Increment this if a change has global effects
  2. Copyright (c) 1987-1993 Microsoft Corporation
  3. Module Name:
  4. rxcehdlr.h
  5. Abstract:
  6. This is the include file that defines all constants and types for
  7. accessing the redirector file system connection engine.
  8. Revision History:
  9. Balan Sethu Raman (SethuR) 06-Feb-95 Created
  10. Notes:
  11. The Connection engine is designed to map and emulate the TDI specs. as closely
  12. as possible. This implies that on NT we will have a very efficient mechanism
  13. which fully exploits the underlying TDI implementation.
  14. All the necessary types can be redefined in terms of the types defined in
  15. \nt\private\inc\tdi.h in the case of NT. For Win95 we will provide the
  16. appropriate definitions.
  17. --*/
  18. #ifndef _RXCEHDLR_H_
  19. #define _RXCEHDLR_H_
  20. #include "tdi.h"
  21. typedef TDI_PROVIDER_INFO RXCE_TRANSPORT_PROVIDER_INFO;
  22. typedef RXCE_TRANSPORT_PROVIDER_INFO* PRXCE_TRANSPORT_PROVIDER_INFO;
  23. typedef TDI_CONNECTION_INFORMATION RXCE_CONNECTION_INFORMATION;
  24. typedef RXCE_CONNECTION_INFORMATION* PRXCE_CONNECTION_INFORMATION;
  25. typedef TDI_CONNECTION_INFORMATION RXCE_CONNECTION_INFORMATION;
  26. typedef RXCE_CONNECTION_INFORMATION* PRXCE_CONNECTION_INFORMATION;
  27. typedef TDI_CONNECTION_INFO RXCE_CONNECTION_INFO;
  28. typedef RXCE_CONNECTION_INFO* PRXCE_CONNECTION_INFO;
  29. #ifdef __cplusplus
  30. typedef struct _RXCE_TRANSPORT_INFORMATION_ : public RXCE_TRANSPORT_PROVIDER_INFO {
  31. #else // !__cplusplus
  32. typedef struct _RXCE_TRANSPORT_INFORMATION_ {
  33. RXCE_TRANSPORT_PROVIDER_INFO;
  34. #endif // __cplusplus
  35. ULONG ConnectionCount;
  36. ULONG QualityOfService;
  37. } RXCE_TRANSPORT_INFORMATION, *PRXCE_TRANSPORT_INFORMATION;
  38. typedef enum _RXCE_CONNECTION_INFORMATION_CLASS_ {
  39. RxCeTransportProviderInformation = 1,
  40. RxCeConnectionInformation,
  41. RxCeConnectionEndpointInformation,
  42. RxCeRemoteAddressInformation
  43. } RXCE_CONNECTION_INFORMATION_CLASS,
  44. *PRXCE_CONNECTION_INFORMATION_CLASS;
  45. typedef struct _RXCE_VC_ *PRXCE_VC;
  46. typedef struct _RXCE_CONNECTION_ *PRXCE_CONNECTION;
  47. typedef struct _RXCE_ADDRESS_ *PRXCE_ADDRESS;
  48. typedef struct _RXCE_TRANSPORT_ *PRXCE_TRANSPORT;
  49. //
  50. // Disconnection indication prototype. This is invoked when a connection is
  51. // being disconnected for a reason other than the user requesting it.
  52. //
  53. typedef
  54. NTSTATUS
  55. (*PRXCE_IND_DISCONNECT)(
  56. IN PVOID pRxCeEventContext,
  57. IN PRXCE_VC pVc,
  58. IN int DisconnectDataLength,
  59. IN PVOID DisconnectData,
  60. IN int DisconnectInformationLength,
  61. IN PVOID DisconnectInformation,
  62. IN ULONG DisconnectFlags
  63. );
  64. //
  65. // A protocol error has occurred when this indication happens. This indication
  66. // occurs only for errors of the worst type; the address this indication is
  67. // delivered to is no longer usable for protocol-related operations, and
  68. // should not be used for operations henceforth. All connections associated
  69. // it are invalid.
  70. //
  71. typedef
  72. NTSTATUS
  73. (*PRXCE_IND_ENDPOINT_ERROR)(
  74. IN PVOID pRxCeEventContext, // the event context.
  75. IN NTSTATUS Status // status code indicating error type.
  76. );
  77. typedef
  78. NTSTATUS
  79. (*PRXCE_IND_CONNECTION_ERROR)(
  80. IN PVOID pRxCeEventContext, // the event context.
  81. PRXCE_VC pVc, // the associated VC handle
  82. IN NTSTATUS Status // status code indicating error type.
  83. );
  84. //
  85. // RXCE_IND_RECEIVE indication handler definition. This client routine is
  86. // called by the transport provider when a connection-oriented TSDU is received
  87. // that should be presented to the client.
  88. //
  89. // A Receive event handler can return one of three distinguished error codes to
  90. // initiate a different course of action in the connection engine.
  91. //
  92. // STATUS_SUCCESS -- Data was copied directly from the TSDU. The amout of data that
  93. // was taken is indicated in the parameter BytesTaken.
  94. //
  95. // STATUS_MORE_PROCESSING_REQUIRED -- The client has returned a buffer into which the
  96. // data should be copied. This is typically the case when BytesAvailable is greater than
  97. // BytesIndicated. In such cases the RxCe will copy the remaining data into the buffer
  98. // that is specified. Note that when this status code is returned from the client it is
  99. // conceivable that the client can demand more data than is available to be copied into
  100. // the buffer. In such cases the subsequent indications till this criterion is met is not
  101. // passed back to the user till the copy is completed. On completion of this copy the
  102. // RxCe notifies the client by invoking the RxCeDataReadyEventHandler.
  103. //
  104. // STATUS_DATA_NOT_ACCEPTED - The client has refused the data.
  105. //
  106. typedef
  107. NTSTATUS
  108. (*PRXCE_IND_RECEIVE)(
  109. IN PVOID pRxCeEventContext, // the context provided during registration
  110. IN PRXCE_VC pVc, // the associated VC handle
  111. IN ULONG ReceiveFlags, // the receive flags
  112. IN ULONG BytesIndicated, // the number of received bytes indicated
  113. IN ULONG BytesAvailable, // the total number of bytes available
  114. OUT ULONG *BytesTaken, // return indication of the bytes consumed
  115. IN PVOID Tsdu, // pointer describing this TSDU, typically a lump of bytes
  116. OUT PMDL *pDataBufferPointer, // the buffer for copying the bytes not indicated.
  117. OUT PULONG pDataBufferSize // amount of data to copy
  118. );
  119. //
  120. // RXCE_IND_RECEIVE_DATAGRAM indication handler definition. This client routine
  121. // is called by the transport provider when a connectionless TSDU is received
  122. // that should be presented to the client.
  123. //
  124. // A Receive event handler can return one of three distinguished error codes to
  125. // initiate a different course of action in the connection engine.
  126. //
  127. // STATUS_SUCCESS -- Data was copied directly from the TSDU. The amout of data that
  128. // was taken is indicated in the parameter BytesTaken.
  129. //
  130. // STATUS_MORE_PROCESSING_REQUIRED -- The client has returned a buffer into which the
  131. // data should be copied. This is typically the case when BytesAvailable is greater than
  132. // BytesIndicated. In such cases the RxCe will copy the remaining data into the buffer
  133. // that is specified. Note that when this status code is returned from the client it is
  134. // conceivable that the client can demand more data than is available to be copied into
  135. // the buffer. In such cases the subsequent indications till this criterion is met is not
  136. // passed back to the user till the copy is completed. On completion of this copy the
  137. // RxCe notifies the client by invoking the RxCeDataReadyEventHandler.
  138. //
  139. // STATUS_DATA_NOT_ACCEPTED - The client has refused the data.
  140. //
  141. //
  142. typedef
  143. NTSTATUS
  144. (*PRXCE_IND_RECEIVE_DATAGRAM)(
  145. IN PVOID pRxCeEventContext, // the event context
  146. IN int SourceAddressLength, // length of the originator of the datagram
  147. IN PVOID SourceAddress, // string describing the originator of the datagram
  148. IN int OptionsLength, // options for the receive
  149. IN PVOID Options, //
  150. IN ULONG ReceiveDatagramFlags, //
  151. IN ULONG BytesIndicated, // number of bytes this indication
  152. IN ULONG BytesAvailable, // number of bytes in complete Tsdu
  153. OUT ULONG *BytesTaken, // number of bytes used
  154. IN PVOID Tsdu, // pointer describing this TSDU, typically a lump of bytes
  155. OUT PMDL *pDataBufferPointer, // the buffer in which data is to be copied.
  156. OUT PULONG pDataBufferSize // amount of data to copy
  157. );
  158. //
  159. // This indication is delivered if expedited data is received on the connection.
  160. // This will only occur in providers that support expedited data.
  161. //
  162. // A Receive event handler can return one of three distinguished error codes to
  163. // initiate a different course of action in the connection engine.
  164. //
  165. // STATUS_SUCCESS -- Data was copied directly from the TSDU. The amout of data that
  166. // was taken is indicated in the parameter BytesTaken.
  167. //
  168. // STATUS_MORE_PROCESSING_REQUIRED -- The client has returned a buffer into which the
  169. // data should be copied. This is typically the case when BytesAvailable is greater than
  170. // BytesIndicated. In such cases the RxCe will copy the remaining data into the buffer
  171. // that is specified. Note that when this status code is returned from the client it is
  172. // conceivable that the client can demand more data than is available to be copied into
  173. // the buffer. In such cases the subsequent indications till this criterion is met is not
  174. // passed back to the user till the copy is completed. On completion of this copy the
  175. // RxCe notifies the client by invoking the RxCeDataReadyEventHandler.
  176. //
  177. // STATUS_DATA_NOT_ACCEPTED - The client has refused the data.
  178. //
  179. typedef
  180. NTSTATUS
  181. (*PRXCE_IND_RECEIVE_EXPEDITED)(
  182. IN PVOID pRxCeEventContext, // the context provided during registration
  183. IN PRXCE_VC pVc, // the associated VC handle
  184. IN ULONG ReceiveFlags, //
  185. IN ULONG BytesIndicated, // number of bytes in this indication
  186. IN ULONG BytesAvailable, // number of bytes in complete Tsdu
  187. OUT ULONG *BytesTaken, // number of bytes used by indication routine
  188. IN PVOID Tsdu, // pointer describing this TSDU, typically a lump of bytes
  189. OUT PMDL *pDataBufferPointer, // the buffer in which data is to be copied.
  190. OUT PULONG pDataBufferSize // amount of data to copy
  191. );
  192. //
  193. // This indication is delivered if there is room for a send in the buffer of
  194. // a buffering protocol.
  195. //
  196. typedef
  197. NTSTATUS
  198. (*PRXCE_IND_SEND_POSSIBLE)(
  199. IN PVOID pRxCeEventContext,
  200. IN PRXCE_VC pVc,
  201. IN ULONG BytesAvailable);
  202. //
  203. // RxCeDataReadyEventHandler -- This is invoked when the desired data is available
  204. // for client consumption. This always follows a receive indication in which the
  205. // client returns a buffer for copying the remaining data
  206. //
  207. typedef
  208. NTSTATUS
  209. (*PRXCE_IND_DATA_READY)(
  210. IN PVOID pEventContext,
  211. IN PMDL pBuffer,
  212. IN ULONG CopiedDataSize,
  213. IN NTSTATUS CopyDataStatus);
  214. //
  215. // RxCeSendCompleteEventHandler -- This is invoked when the send has been successfully completed
  216. // The buffer and the length sent are passed in as parameters
  217. //
  218. typedef
  219. NTSTATUS
  220. (*PRXCE_IND_SEND_COMPLETE)(
  221. IN PVOID pEventContext,
  222. IN PVOID pCompletionContext,
  223. IN NTSTATUS Status);
  224. typedef
  225. NTSTATUS
  226. (*PRXCE_IND_CONNECTION_SEND_COMPLETE)(
  227. IN PVOID pEventContext,
  228. IN PRXCE_VC pVc,
  229. IN PVOID pCompletionContext,
  230. IN NTSTATUS Status);
  231. //
  232. // Event Handler Dispatch Vector definitions ....
  233. //
  234. typedef struct _RXCE_ADDRESS_EVENT_HANDLER_ {
  235. PRXCE_IND_ENDPOINT_ERROR RxCeErrorEventHandler;
  236. PRXCE_IND_RECEIVE_DATAGRAM RxCeReceiveDatagramEventHandler;
  237. PRXCE_IND_DATA_READY RxCeDataReadyEventHandler;
  238. PRXCE_IND_SEND_POSSIBLE RxCeSendPossibleEventHandler;
  239. PRXCE_IND_SEND_COMPLETE RxCeSendCompleteEventHandler;
  240. } RXCE_ADDRESS_EVENT_HANDLER, *PRXCE_ADDRESS_EVENT_HANDLER;
  241. typedef struct _RXCE_CONNECTION_EVENT_HANDLER_ {
  242. PRXCE_IND_DISCONNECT RxCeDisconnectEventHandler;
  243. PRXCE_IND_CONNECTION_ERROR RxCeErrorEventHandler;
  244. PRXCE_IND_RECEIVE RxCeReceiveEventHandler;
  245. PRXCE_IND_RECEIVE_DATAGRAM RxCeReceiveDatagramEventHandler;
  246. PRXCE_IND_RECEIVE_EXPEDITED RxCeReceiveExpeditedEventHandler;
  247. PRXCE_IND_SEND_POSSIBLE RxCeSendPossibleEventHandler;
  248. PRXCE_IND_DATA_READY RxCeDataReadyEventHandler;
  249. PRXCE_IND_CONNECTION_SEND_COMPLETE RxCeSendCompleteEventHandler;
  250. } RXCE_CONNECTION_EVENT_HANDLER, *PRXCE_CONNECTION_EVENT_HANDLER;
  251. #endif // _RXCEHDLR_H_