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.

244 lines
8.8 KiB

  1. /*==========================================================================
  2. *
  3. * Copyright (C) 2000 Microsoft Corporation. All Rights Reserved.
  4. *
  5. * File: Common.h
  6. * Content: DirectNet common code header file
  7. *@@BEGIN_MSINTERNAL
  8. * History:
  9. * Date By Reason
  10. * ==== == ======
  11. * 10/08/99 jtk Created
  12. * 01/14/00 mjn Added pvUserContext to DN_Host
  13. * 01/23/00 mjn Added DN_DestroyPlayer and DNTerminateSession
  14. * 01/28/00 mjn Added DN_ReturnBuffer
  15. * 02/01/00 mjn Added DN_GetCaps, DN_SetCaps
  16. * 02/15/00 mjn Implement INFO flags in SetInfo and return context in GetInfo
  17. * 02/17/00 mjn Implemented GetPlayerContext and GetGroupContext
  18. * 02/17/00 mjn Reordered parameters in EnumServiceProviders,EnumHosts,Connect,Host
  19. * 02/18/00 mjn Converted DNADDRESS to IDirectPlayAddress8
  20. * 03/17/00 rmt Moved caps funcs to caps.h/caps.cpp
  21. * 04/06/00 mjn Added DN_GetHostAddress()
  22. * 04/19/00 mjn Changed DN_SendTo to accept a range of DPN_BUFFER_DESCs and a count
  23. * 06/23/00 mjn Removed dwPriority from DN_SendTo()
  24. * 06/25/00 mjn Added DNUpdateLobbyStatus()
  25. * 07/09/00 rmt Bug #38323 - RegisterLobby needs a DPNHANDLE parameter.
  26. * 07/30/00 mjn Added hrReason to DNTerminateSession()
  27. * 08/15/00 mjn Added hProtocol tp DNRegisterWithDPNSVR()
  28. * 03/30/01 mjn Changes to prevent multiple loading/unloading of SP's
  29. *@@END_MSINTERNAL
  30. *
  31. ***************************************************************************/
  32. #ifndef __COMMON_H__
  33. #define __COMMON_H__
  34. //**********************************************************************
  35. // Constant definitions
  36. //**********************************************************************
  37. #define DN_UPDATE_LISTEN_FLAG_DPNSVR 0x0001
  38. #define DN_UPDATE_LISTEN_FLAG_HOST_MIGRATE 0x0002
  39. #define DN_UPDATE_LISTEN_FLAG_ALLOW_ENUMS 0x0004
  40. #define DN_UPDATE_LISTEN_FLAG_DISALLOW_ENUMS 0x0008
  41. //**********************************************************************
  42. // Macro definitions
  43. //**********************************************************************
  44. //**********************************************************************
  45. // Structure definitions
  46. //**********************************************************************
  47. typedef struct _PROTOCOL_ENUM_DATA PROTOCOL_ENUM_DATA;
  48. typedef struct _PROTOCOL_ENUM_RESPONSE_DATA PROTOCOL_ENUM_RESPONSE_DATA;
  49. //**********************************************************************
  50. // Variable definitions
  51. //**********************************************************************
  52. //**********************************************************************
  53. // Function prototypes
  54. //**********************************************************************
  55. STDMETHODIMP DN_Initialize(PVOID pInterface,
  56. PVOID const pvUserContext,
  57. const PFNDPNMESSAGEHANDLER pfn,
  58. const DWORD dwFlags);
  59. STDMETHODIMP DN_Close(PVOID pInterface,
  60. const DWORD dwFlags);
  61. STDMETHODIMP DN_EnumServiceProviders( PVOID pInterface,
  62. const GUID *const pguidServiceProvider,
  63. const GUID *const pguidApplication,
  64. DPN_SERVICE_PROVIDER_INFO *const pSPInfoBuffer,
  65. DWORD *const pcbEnumData,
  66. DWORD *const pcReturned,
  67. const DWORD dwFlags );
  68. STDMETHODIMP DN_CancelAsyncOperation(PVOID pvInterface,
  69. const DPNHANDLE hAsyncOp,
  70. const DWORD dwFlags);
  71. STDMETHODIMP DN_Connect( PVOID pInterface,
  72. const DPN_APPLICATION_DESC *const pdnAppDesc,
  73. IDirectPlay8Address *const pHostAddr,
  74. IDirectPlay8Address *const pDeviceInfo,
  75. const DPN_SECURITY_DESC *const pdnSecurity,
  76. const DPN_SECURITY_CREDENTIALS *const pdnCredentials,
  77. const void *const pvUserConnectData,
  78. const DWORD dwUserConnectDataSize,
  79. void *const pvPlayerContext,
  80. void *const pvAsyncContext,
  81. DPNHANDLE *const phAsyncHandle,
  82. const DWORD dwFlags);
  83. STDMETHODIMP DN_GetSendQueueInfo(PVOID pInterface,
  84. const DPNID dpnid,
  85. DWORD *const pdwNumMsgs,
  86. DWORD *const pdwNumBytes,
  87. const DWORD dwFlags);
  88. STDMETHODIMP DN_GetApplicationDesc(PVOID pInterface,
  89. DPN_APPLICATION_DESC *const pAppDescBuffer,
  90. DWORD *const pcbDataSize,
  91. const DWORD dwFlags);
  92. STDMETHODIMP DN_SetApplicationDesc(PVOID pInterface,
  93. const DPN_APPLICATION_DESC *const pdnApplicationDesc,
  94. const DWORD dwFlags);
  95. STDMETHODIMP DN_SendTo( PVOID pv,
  96. const DPNID dpnid,
  97. const DPN_BUFFER_DESC *const prgBufferDesc,
  98. const DWORD cBufferDesc,
  99. const DWORD dwTimeOut,
  100. void *const pvAsyncContext,
  101. DPNHANDLE *const phAsyncHandle,
  102. const DWORD dwFlags);
  103. STDMETHODIMP DN_Host( PVOID pInterface,
  104. const DPN_APPLICATION_DESC *const pdnAppDesc,
  105. IDirectPlay8Address **const prgpDeviceInfo,
  106. const DWORD cDeviceInfo,
  107. const DPN_SECURITY_DESC *const pdnSecurity,
  108. const DPN_SECURITY_CREDENTIALS *const pdnCredentials,
  109. void *const pvPlayerContext,
  110. const DWORD dwFlags);
  111. STDMETHODIMP DN_CreateGroup(PVOID pInterface,
  112. const DPN_GROUP_INFO *const pdpnGroupInfo,
  113. void *const pvGroupContext,
  114. void *const pvAsyncContext,
  115. DPNHANDLE *const phAsyncHandle,
  116. const DWORD dwFlags);
  117. STDMETHODIMP DN_DestroyGroup(PVOID pInterface,
  118. const DPNID dpnidGroup,
  119. PVOID const pvAsyncContext,
  120. DPNHANDLE *const phAsyncHandle,
  121. const DWORD dwFlags);
  122. STDMETHODIMP DN_AddClientToGroup(PVOID pInterface,
  123. const DPNID dpnidGroup,
  124. const DPNID dpnidClient,
  125. PVOID const pvAsyncContext,
  126. DPNHANDLE *const phAsyncHandle,
  127. const DWORD dwFlags);
  128. STDMETHODIMP DN_RemoveClientFromGroup(PVOID pInterface,
  129. const DPNID dpnidGroup,
  130. const DPNID dpnidClient,
  131. PVOID const pvAsyncContext,
  132. DPNHANDLE *const phAsyncHandle,
  133. const DWORD dwFlags);
  134. STDMETHODIMP DN_SetGroupInfo( PVOID pv,
  135. const DPNID dpnid,
  136. DPN_GROUP_INFO *const pdpnGroupInfo,
  137. PVOID const pvAsyncContext,
  138. DPNHANDLE *const phAsyncHandle,
  139. const DWORD dwFlags);
  140. STDMETHODIMP DN_GetGroupInfo(PVOID pv,
  141. const DPNID dpnid,
  142. DPN_GROUP_INFO *const pdpnGroupInfo,
  143. DWORD *const pdwSize,
  144. const DWORD dwFlags);
  145. STDMETHODIMP DN_EnumClientsAndGroups(LPVOID lpv, DPNID *const lprgdpnid, DWORD *const lpcdpnid, const DWORD dwFlags);
  146. STDMETHODIMP DN_EnumGroupMembers(LPVOID lpv,DPNID dpnid, DPNID *const lprgdpnid, DWORD *const lpcdpnid, const DWORD dwFlags);
  147. STDMETHODIMP DN_EnumHosts( PVOID pv,
  148. DPN_APPLICATION_DESC *const pApplicationDesc,
  149. IDirectPlay8Address *const pAddrHost,
  150. IDirectPlay8Address *const pDeviceInfo,
  151. PVOID const pUserEnumData,
  152. const DWORD dwUserEnumDataSize,
  153. const DWORD dwRetryCount,
  154. const DWORD dwRetryInterval,
  155. const DWORD dwTimeOut,
  156. PVOID const pvUserContext,
  157. DPNHANDLE *const pAsyncHandle,
  158. const DWORD dwFlags );
  159. STDMETHODIMP DN_DestroyPlayer(PVOID pv,
  160. const DPNID dnid,
  161. const void *const pvDestroyData,
  162. const DWORD dwDestroyDataSize,
  163. const DWORD dwFlags);
  164. STDMETHODIMP DN_ReturnBuffer(PVOID pv,
  165. const DPNHANDLE hBufferHandle,
  166. const DWORD dwFlags);
  167. STDMETHODIMP DN_GetPlayerContext(PVOID pv,
  168. const DPNID dpnid,
  169. PVOID *const ppvPlayerContext,
  170. const DWORD dwFlags);
  171. STDMETHODIMP DN_GetGroupContext(PVOID pv,
  172. const DPNID dpnid,
  173. PVOID *const ppvGroupContext,
  174. const DWORD dwFlags);
  175. HRESULT DNTerminateSession(DIRECTNETOBJECT *const pdnObject,
  176. const HRESULT hrReason);
  177. STDMETHODIMP DN_RegisterLobby(PVOID pInterface,
  178. const DPNHANDLE dpnhLobbyConnection,
  179. IDirectPlay8LobbiedApplication *const pIDP8LobbiedApplication,
  180. const DWORD dwFlags);
  181. #ifndef DPNBUILD_NOLOBBY
  182. HRESULT DNUpdateLobbyStatus(DIRECTNETOBJECT *const pdnObject,
  183. const DWORD dwStatus);
  184. #endif // ! DPNBUILD_NOLOBBY
  185. STDMETHODIMP DN_TerminateSession(PVOID pInterface,
  186. void *const pvTerminateData,
  187. const DWORD dwTerminateDataSize,
  188. const DWORD dwFlags);
  189. STDMETHODIMP DN_GetHostAddress(PVOID pInterface,
  190. IDirectPlay8Address **const prgpAddress,
  191. DWORD *const pcAddress,
  192. const DWORD dwFlags);
  193. HRESULT DNUpdateListens(DIRECTNETOBJECT *const pdnObject,
  194. const DWORD dwFlags);
  195. #ifndef DPNBUILD_SINGLEPROCESS
  196. HRESULT DNRegisterListenWithDPNSVR(DIRECTNETOBJECT *const pdnObject,
  197. CAsyncOp *const pListen);
  198. #endif // ! DPNBUILD_SINGLEPROCESS
  199. HRESULT DNAddRefLock(DIRECTNETOBJECT *const pdnObject);
  200. void DNDecRefLock(DIRECTNETOBJECT *const pdnObject);
  201. #endif // __COMMON_H__