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.

243 lines
8.3 KiB

  1. /*==========================================================================
  2. *
  3. * Copyright (C) 1995 Microsoft Corporation. All Rights Reserved.
  4. *
  5. * File: dnpextern.h
  6. * Content: This header exposes protocol entry points to the rest of Direct Network
  7. *
  8. * History:
  9. * Date By Reason
  10. * ==== == ======
  11. * 11/06/98 ejs Created
  12. * 07/01/2000 masonb Assumed Ownership
  13. *
  14. ***************************************************************************/
  15. #ifdef __cplusplus
  16. extern "C"
  17. {
  18. #endif // __cplusplus
  19. // FOLLOWING FLAGS GO INTO PUBLIC HEADER FILE
  20. #define DN_CONNECTFLAGS_OKTOQUERYFORADDRESSING 0x00000001
  21. #define DN_CONNECTFLAGS_ADDITIONALMULTIPLEXADAPTERS 0x00000002 // there will be more adapters for this connect operation
  22. #define DN_LISTENFLAGS_OKTOQUERYFORADDRESSING 0x00000001
  23. #define DN_ENUMQUERYFLAGS_OKTOQUERYFORADDRESSING 0x00000001
  24. #define DN_ENUMQUERYFLAGS_NOBROADCASTFALLBACK 0x00000002
  25. #define DN_ENUMQUERYFLAGS_ADDITIONALMULTIPLEXADAPTERS 0x00000004 // there will be more adapters for this enum operation
  26. #define DN_SENDFLAGS_RELIABLE 0x00000001 // Deliver Reliably
  27. #define DN_SENDFLAGS_NON_SEQUENTIAL 0x00000002 // Deliver Upon Arrival
  28. #define DN_SENDFLAGS_HIGH_PRIORITY 0x00000004
  29. #define DN_SENDFLAGS_LOW_PRIORITY 0x00000008
  30. #define DN_SENDFLAGS_SET_USER_FLAG 0x00000040 // Protocol will deliver these two...
  31. #define DN_SENDFLAGS_SET_USER_FLAG_TWO 0x00000080 // ...flags to receiver
  32. // END OF PUBLIC FLAGS
  33. typedef struct _DN_PROTOCOL_INTERFACE_VTBL DN_PROTOCOL_INTERFACE_VTBL, *PDN_PROTOCOL_INTERFACE_VTBL;
  34. //
  35. // structure used to pass enum data from the protocol to DPlay
  36. //
  37. typedef struct _PROTOCOL_ENUM_DATA
  38. {
  39. IDirectPlay8Address *pSenderAddress; //
  40. IDirectPlay8Address *pDeviceAddress; //
  41. BUFFERDESC ReceivedData; //
  42. HANDLE hEnumQuery; // handle of this query, returned in enum response
  43. } PROTOCOL_ENUM_DATA;
  44. typedef struct _PROTOCOL_ENUM_RESPONSE_DATA
  45. {
  46. IDirectPlay8Address *pSenderAddress;
  47. IDirectPlay8Address *pDeviceAddress;
  48. BUFFERDESC ReceivedData;
  49. DWORD dwRoundTripTime;
  50. } PROTOCOL_ENUM_RESPONSE_DATA;
  51. // Protocol data
  52. typedef struct protocoldata ProtocolData, *PProtocolData;
  53. // Protocol endpoint descriptor
  54. typedef struct endpointdesc EPD, *PEPD;
  55. // Service Provider interface
  56. typedef struct IDP8ServiceProvider IDP8ServiceProvider;
  57. // Service Provider info data strucure
  58. typedef struct _SPGETADDRESSINFODATA SPGETADDRESSINFODATA, *PSPGETADDRESSINFODATA;
  59. // Service Provider event type
  60. typedef enum _SP_EVENT_TYPE SP_EVENT_TYPE;
  61. // Init/Term calls
  62. extern BOOL DNPPoolsInit();
  63. extern void DNPPoolsDeinit();
  64. extern HRESULT DNPProtocolInitialize(PVOID, PProtocolData, PDN_PROTOCOL_INTERFACE_VTBL);
  65. extern HRESULT DNPAddServiceProvider(PProtocolData, IDP8ServiceProvider*, HANDLE *);
  66. extern HRESULT DNPRemoveServiceProvider(PProtocolData, HANDLE);
  67. extern HRESULT DNPProtocolShutdown(PProtocolData);
  68. // Data Transfer
  69. extern HRESULT DNPConnect(PProtocolData, IDirectPlay8Address *const, IDirectPlay8Address *const, const HANDLE, const ULONG, PVOID, PHANDLE);
  70. extern HRESULT DNPListen(PProtocolData, IDirectPlay8Address *const, const HANDLE, ULONG, PVOID, PHANDLE);
  71. extern HRESULT DNPSendData(PProtocolData, HANDLE, UINT, PBUFFERDESC, UINT, ULONG, PVOID, PHANDLE);
  72. extern HRESULT DNPDisconnectEndPoint(PProtocolData, HANDLE, PVOID, PHANDLE);
  73. // Misc Commands
  74. extern HRESULT DNPCrackEndPointDescriptor(HANDLE, PSPGETADDRESSINFODATA);
  75. extern HRESULT DNPCancelCommand(PProtocolData, HANDLE);
  76. extern HRESULT DNPEnumQuery( PProtocolData pPData,
  77. IDirectPlay8Address *const pHostAddress,
  78. IDirectPlay8Address *const pDeviceAddress,
  79. const HANDLE,
  80. BUFFERDESC *const pBuffers,
  81. const DWORD dwBufferCount,
  82. const DWORD dwRetryCount,
  83. const DWORD dwRetryInterval,
  84. const DWORD dwTimeout,
  85. const DWORD dwFlags,
  86. void *const pUserContext,
  87. HANDLE *const pCommandHandle );
  88. extern HRESULT DNPEnumRespond( PProtocolData pPData,
  89. const HANDLE hSPHandle,
  90. const HANDLE hQueryHandle, // handle of enum query being responded to
  91. BUFFERDESC *const pResponseBuffers,
  92. const DWORD dwResponseBufferCount,
  93. const DWORD dwFlags,
  94. void *const pUserContext,
  95. HANDLE *const pCommandHandle );
  96. extern HRESULT DNPReleaseReceiveBuffer(HANDLE);
  97. extern HRESULT DNPGetListenAddressInfo(HANDLE hCommand, PSPGETADDRESSINFODATA pSPData);
  98. extern HRESULT DNPGetEPCaps(HANDLE, PDPN_CONNECTION_INFO);
  99. extern HRESULT DNPSetProtocolCaps(PProtocolData pPData, const DPN_CAPS * const pData);
  100. extern HRESULT DNPGetProtocolCaps(PProtocolData pPData, PDPN_CAPS pData);
  101. extern HRESULT WINAPI DNP_Debug(ProtocolData *, UINT OpCode, HANDLE EndPoint, PVOID Data);
  102. // Lower Edge Entries
  103. extern HRESULT WINAPI DNSP_IndicateEvent(IDP8SPCallback *, SP_EVENT_TYPE, PVOID);
  104. extern HRESULT WINAPI DNSP_CommandComplete(IDP8SPCallback *, HANDLE, HRESULT, PVOID);
  105. // V-TABLE FOR CALLS INTO CORE LAYER
  106. typedef HRESULT (*PFN_PINT_INDICATE_ENUM_QUERY)
  107. (void *const pvUserContext,
  108. void *const pvEndPtContext,
  109. const HANDLE hCommand,
  110. void *const pvEnumQueryData,
  111. const DWORD dwEnumQueryDataSize);
  112. typedef HRESULT (*PFN_PINT_INDICATE_ENUM_RESPONSE)
  113. (void *const pvUserContext,
  114. const HANDLE hCommand,
  115. void *const pvCommandContext,
  116. void *const pvEnumResponseData,
  117. const DWORD dwEnumResponseDataSize);
  118. typedef HRESULT (*PFN_PINT_INDICATE_CONNECT)
  119. (void *const pvUserContext,
  120. void *const pvListenContext,
  121. const HANDLE hEndPt,
  122. void **const ppvEndPtContext);
  123. typedef HRESULT (*PFN_PINT_INDICATE_DISCONNECT)
  124. (void *const pvUserContext,
  125. void *const pvEndPtContext);
  126. typedef HRESULT (*PFN_PINT_INDICATE_CONNECTION_TERMINATED)
  127. (void *const pvUserContext,
  128. void *const pvEndPtContext,
  129. const HRESULT hr);
  130. typedef HRESULT (*PFN_PINT_INDICATE_RECEIVE)
  131. (void *const pvUserContext,
  132. void *const pvEndPtContext,
  133. void *const pvData,
  134. const DWORD dwDataSize,
  135. const HANDLE hBuffer,
  136. const DWORD dwFlags);
  137. typedef HRESULT (*PFN_PINT_COMPLETE_LISTEN)
  138. (void *const pvUserContext,
  139. void **const ppvCommandContext,
  140. const HRESULT hr,
  141. const HANDLE hEndPt);
  142. typedef HRESULT (*PFN_PINT_COMPLETE_LISTEN_TERMINATE)
  143. (void *const pvUserContext,
  144. void *const pvCommandContext,
  145. const HRESULT hr);
  146. typedef HRESULT (*PFN_PINT_COMPLETE_ENUM_QUERY)
  147. (void *const pvUserContext,
  148. void *const pvCommandContext,
  149. const HRESULT hr);
  150. typedef HRESULT (*PFN_PINT_COMPLETE_ENUM_RESPONSE)
  151. (void *const pvUserContext,
  152. void *const pvCommandContext,
  153. const HRESULT hr);
  154. typedef HRESULT (*PFN_PINT_COMPLETE_CONNECT)
  155. (void *const pvUserContext,
  156. void *const pvCommandContext,
  157. const HRESULT hr,
  158. const HANDLE hEndPt,
  159. void **const ppvEndPtContext);
  160. typedef HRESULT (*PFN_PINT_COMPLETE_DISCONNECT)
  161. (void *const pvUserContext,
  162. void *const pvCommandContext,
  163. const HRESULT hr);
  164. typedef HRESULT (*PFN_PINT_COMPLETE_SEND)
  165. (void *const pvUserContext,
  166. void *const pvCommandContext,
  167. const HRESULT hr);
  168. typedef HRESULT (*PFN_PINT_ADDRESS_INFO_CONNECT)
  169. (void *const pvUserContext,
  170. void *const pvCommandContext,
  171. const HRESULT hr,
  172. IDirectPlay8Address *const pHostAddress,
  173. IDirectPlay8Address *const pDeviceAddress );
  174. typedef HRESULT (*PFN_PINT_ADDRESS_INFO_ENUM)
  175. (void *const pvUserContext,
  176. void *const pvCommandContext,
  177. const HRESULT hr,
  178. IDirectPlay8Address *const pHostAddress,
  179. IDirectPlay8Address *const pDeviceAddress );
  180. typedef HRESULT (*PFN_PINT_ADDRESS_INFO_LISTEN)
  181. (void *const pvUserContext,
  182. void *const pvCommandContext,
  183. const HRESULT hr,
  184. IDirectPlay8Address *const pDeviceAddress );
  185. struct _DN_PROTOCOL_INTERFACE_VTBL
  186. {
  187. PFN_PINT_INDICATE_ENUM_QUERY IndicateEnumQuery;
  188. PFN_PINT_INDICATE_ENUM_RESPONSE IndicateEnumResponse;
  189. PFN_PINT_INDICATE_CONNECT IndicateConnect;
  190. PFN_PINT_INDICATE_DISCONNECT IndicateDisconnect;
  191. PFN_PINT_INDICATE_CONNECTION_TERMINATED IndicateConnectionTerminated;
  192. PFN_PINT_INDICATE_RECEIVE IndicateReceive;
  193. PFN_PINT_COMPLETE_LISTEN CompleteListen;
  194. PFN_PINT_COMPLETE_LISTEN_TERMINATE CompleteListenTerminate;
  195. PFN_PINT_COMPLETE_ENUM_QUERY CompleteEnumQuery;
  196. PFN_PINT_COMPLETE_ENUM_RESPONSE CompleteEnumResponse;
  197. PFN_PINT_COMPLETE_CONNECT CompleteConnect;
  198. PFN_PINT_COMPLETE_DISCONNECT CompleteDisconnect;
  199. PFN_PINT_COMPLETE_SEND CompleteSend;
  200. PFN_PINT_ADDRESS_INFO_CONNECT AddressInfoConnect;
  201. PFN_PINT_ADDRESS_INFO_ENUM AddressInfoEnum;
  202. PFN_PINT_ADDRESS_INFO_LISTEN AddressInfoListen;
  203. };
  204. #ifdef __cplusplus
  205. }
  206. #endif // __cplusplus