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.

334 lines
12 KiB

  1. //+-------------------------------------------------------------------------
  2. //
  3. // Microsoft Windows
  4. //
  5. // Copyright (C) Microsoft Corporation, 1998 - 1998
  6. //
  7. // File: dplay4obj.h
  8. //
  9. //--------------------------------------------------------------------------
  10. // _dxj_DirectPlay4Obj.h : Declaration of the C_dxj_DirectPlay4Object
  11. // DHF begin - entire file
  12. #include "resource.h" // main symbols
  13. #define typedef__dxj_DirectPlay4 LPDIRECTPLAY4
  14. /////////////////////////////////////////////////////////////////////////////
  15. // DirectPlay4
  16. //REVIEW -- using pointers to ID's is necessary because some compilers don't like
  17. //references as template arguments.
  18. class C_dxj_DirectPlay4Object :
  19. #ifdef USING_IDISPATCH
  20. public CComDualImpl<I_dxj_DirectPlay4, &IID_I_dxj_DirectPlay4, &LIBID_DIRECTLib>,
  21. public ISupportErrorInfo,
  22. #else
  23. public I_dxj_DirectPlay4,
  24. #endif
  25. // public CComCoClass<C_dxj_DirectPlay4Object, &CLSID__dxj_DirectPlay4>,
  26. public CComObjectRoot
  27. {
  28. public:
  29. C_dxj_DirectPlay4Object() ;
  30. ~C_dxj_DirectPlay4Object() ;
  31. BEGIN_COM_MAP(C_dxj_DirectPlay4Object)
  32. COM_INTERFACE_ENTRY(I_dxj_DirectPlay4)
  33. #ifdef USING_IDISPATCH
  34. COM_INTERFACE_ENTRY(IDispatch)
  35. COM_INTERFACE_ENTRY(ISupportErrorInfo)
  36. #endif
  37. END_COM_MAP()
  38. // DECLARE_REGISTRY(CLSID__dxj_DirectPlay4, "DIRECT.DirectPlay4.3", "DIRECT.DiectPlay2.3", IDS_DPLAY2_DESC, THREADFLAGS_BOTH)
  39. // Use DECLARE_NOT_AGGREGATABLE(C_dxj_DirectPlay4Object) if you don't want your object
  40. // to support aggregation
  41. DECLARE_AGGREGATABLE(C_dxj_DirectPlay4Object)
  42. #ifdef USING_IDISPATCH
  43. // ISupportsErrorInfo
  44. STDMETHOD(InterfaceSupportsErrorInfo)(REFIID riid);
  45. #endif
  46. // I_dxj_DirectPlay4
  47. public:
  48. /* [hidden] */ HRESULT STDMETHODCALLTYPE InternalSetObject(
  49. /* [in] */ IUnknown __RPC_FAR *lpdd);
  50. /* [hidden] */ HRESULT STDMETHODCALLTYPE InternalGetObject(
  51. /* [retval][out] */ IUnknown __RPC_FAR *__RPC_FAR *lpdd);
  52. HRESULT STDMETHODCALLTYPE addGroupToGroup(
  53. /* [in] */ long ParentGroupId,
  54. /* [in] */ long GroupId);
  55. HRESULT STDMETHODCALLTYPE addPlayerToGroup(
  56. /* [in] */ long groupId,
  57. /* [in] */ long playerId);
  58. HRESULT STDMETHODCALLTYPE cancelMessage(
  59. /* [in] */ long msgid);
  60. HRESULT STDMETHODCALLTYPE cancelPriority(
  61. /* [in] */ long minPrority,
  62. /* [in] */ long maxPriority);
  63. HRESULT STDMETHODCALLTYPE close( void);
  64. HRESULT STDMETHODCALLTYPE createGroup(
  65. /* [in] */ BSTR friendlyName,
  66. /* [in] */ BSTR formalName,
  67. /* [in] */ long flags,
  68. /* [retval][out] */ long __RPC_FAR *v1);
  69. HRESULT STDMETHODCALLTYPE createGroupInGroup(
  70. /* [in] */ long parentid,
  71. /* [in] */ BSTR friendlyName,
  72. /* [in] */ BSTR formalName,
  73. /* [in] */ long flags,
  74. /* [retval][out] */ long __RPC_FAR *v1);
  75. HRESULT STDMETHODCALLTYPE createPlayer(
  76. /* [in] */ BSTR friendlyName,
  77. /* [in] */ BSTR formalName,
  78. /* [in] */ long receiveEvent,
  79. /* [in] */ long flags,
  80. /* [retval][out] */ long __RPC_FAR *v1);
  81. HRESULT STDMETHODCALLTYPE deleteGroupFromGroup(
  82. /* [in] */ long groupParentId,
  83. /* [in] */ long groupId);
  84. HRESULT STDMETHODCALLTYPE deletePlayerFromGroup(
  85. /* [in] */ long groupId,
  86. /* [in] */ long playerId);
  87. HRESULT STDMETHODCALLTYPE destroyGroup(
  88. /* [in] */ long groupId);
  89. HRESULT STDMETHODCALLTYPE destroyPlayer(
  90. /* [in] */ long playerId);
  91. HRESULT STDMETHODCALLTYPE getDPEnumConnections(
  92. /* [in] */ BSTR guid,
  93. /* [in] */ long flags,
  94. /* [retval][out] */ I_dxj_DPEnumConnections __RPC_FAR *__RPC_FAR *retVal);
  95. HRESULT STDMETHODCALLTYPE getDPEnumGroupPlayers(
  96. /* [in] */ long groupId,
  97. /* [in] */ BSTR sessionGuid,
  98. /* [in] */ long flags,
  99. /* [retval][out] */ I_dxj_DPEnumPlayers2 __RPC_FAR *__RPC_FAR *retVal);
  100. HRESULT STDMETHODCALLTYPE getDPEnumGroups(
  101. /* [in] */ BSTR sessionGuid,
  102. /* [in] */ long flags,
  103. /* [retval][out] */ I_dxj_DPEnumPlayers2 __RPC_FAR *__RPC_FAR *retVal);
  104. HRESULT STDMETHODCALLTYPE getDPEnumGroupsInGroup(
  105. /* [in] */ long groupId,
  106. /* [in] */ BSTR sessionGuid,
  107. /* [in] */ long flags,
  108. /* [retval][out] */ I_dxj_DPEnumPlayers2 __RPC_FAR *__RPC_FAR *retVal);
  109. HRESULT STDMETHODCALLTYPE getDPEnumPlayers(
  110. /* [in] */ BSTR sessionGuid,
  111. /* [in] */ long flags,
  112. /* [retval][out] */ I_dxj_DPEnumPlayers2 __RPC_FAR *__RPC_FAR *retVal);
  113. HRESULT STDMETHODCALLTYPE getDPEnumSessions(
  114. /* [in] */ I_dxj_DirectPlaySessionData __RPC_FAR *sessionDesc,
  115. /* [in] */ long timeOut,
  116. /* [in] */ long flags,
  117. /* [retval][out] */ I_dxj_DPEnumSessions2 __RPC_FAR *__RPC_FAR *retVal);
  118. HRESULT STDMETHODCALLTYPE getCaps(
  119. /* [out][in] */ DPCaps __RPC_FAR *caps,
  120. /* [in] */ long flags);
  121. HRESULT STDMETHODCALLTYPE getGroupData(
  122. /* [in] */ long groupId,
  123. /* [in] */ long flags,
  124. /* [retval][out] */ BSTR __RPC_FAR *ret);
  125. HRESULT STDMETHODCALLTYPE getGroupFlags(
  126. /* [in] */ long groupId,
  127. /* [retval][out] */ long __RPC_FAR *flags);
  128. HRESULT STDMETHODCALLTYPE getGroupLongName(
  129. /* [in] */ long groupId,
  130. /* [retval][out] */ BSTR __RPC_FAR *name);
  131. HRESULT STDMETHODCALLTYPE getGroupShortName(
  132. /* [in] */ long groupId,
  133. /* [retval][out] */ BSTR __RPC_FAR *name);
  134. HRESULT STDMETHODCALLTYPE getGroupParent(
  135. /* [in] */ long groupId,
  136. /* [retval][out] */ long __RPC_FAR *ret);
  137. HRESULT STDMETHODCALLTYPE getGroupOwner(
  138. /* [in] */ long groupId,
  139. /* [retval][out] */ long __RPC_FAR *ret);
  140. HRESULT STDMETHODCALLTYPE getMessageCount(
  141. /* [in] */ long playerId,
  142. /* [retval][out] */ long __RPC_FAR *count);
  143. HRESULT STDMETHODCALLTYPE getMessageQueue(
  144. /* [in] */ long from,
  145. /* [in] */ long to,
  146. /* [in] */ long flags,
  147. /* [out][in] */ long __RPC_FAR *nMessage,
  148. /* [out][in] */ long __RPC_FAR *nBytes);
  149. HRESULT STDMETHODCALLTYPE getPlayerAccountId(
  150. /* [in] */ long playerid,
  151. /* [retval][out] */ BSTR __RPC_FAR *acctid);
  152. HRESULT STDMETHODCALLTYPE getPlayerAddress(
  153. /* [in] */ long playerId,
  154. /* [retval][out] */ I_dxj_DPAddress __RPC_FAR *__RPC_FAR *ret);
  155. HRESULT STDMETHODCALLTYPE getPlayerCaps(
  156. /* [in] */ long playerId,
  157. /* [out] */ DPCaps __RPC_FAR *caps,
  158. /* [in] */ long flags);
  159. HRESULT STDMETHODCALLTYPE getPlayerData(
  160. /* [in] */ long playerId,
  161. /* [in] */ long flags,
  162. /* [retval][out] */ BSTR __RPC_FAR *ret);
  163. HRESULT STDMETHODCALLTYPE getPlayerFlags(
  164. /* [in] */ long id,
  165. /* [retval][out] */ long __RPC_FAR *retflags);
  166. HRESULT STDMETHODCALLTYPE getPlayerFormalName(
  167. /* [in] */ long playerId,
  168. /* [retval][out] */ BSTR __RPC_FAR *name);
  169. HRESULT STDMETHODCALLTYPE getPlayerFriendlyName(
  170. /* [in] */ long playerId,
  171. /* [retval][out] */ BSTR __RPC_FAR *name);
  172. HRESULT STDMETHODCALLTYPE getSessionDesc(
  173. /* [out][in] */ I_dxj_DirectPlaySessionData __RPC_FAR **sessionDesc);
  174. HRESULT STDMETHODCALLTYPE initializeConnection(
  175. /* [in] */ I_dxj_DPAddress __RPC_FAR *address);
  176. HRESULT STDMETHODCALLTYPE open(
  177. /* [out][in] */ I_dxj_DirectPlaySessionData __RPC_FAR *sessionDesc,
  178. /* [in] */ long flags);
  179. HRESULT STDMETHODCALLTYPE receive(
  180. /* [out][in] */ long __RPC_FAR *fromPlayerId,
  181. /* [out][in] */ long __RPC_FAR *toPlayerId,
  182. /* [in] */ long flags,
  183. /* [retval][out] */ I_dxj_DirectPlayMessage __RPC_FAR *__RPC_FAR *ret);
  184. HRESULT STDMETHODCALLTYPE receiveSize(
  185. /* [out][in] */ long __RPC_FAR *fromPlayerId,
  186. /* [out][in] */ long __RPC_FAR *toPlayerId,
  187. /* [in] */ long flags,
  188. /* [retval][out] */ int __RPC_FAR *dataSize);
  189. HRESULT STDMETHODCALLTYPE secureOpen(
  190. /* [in] */ I_dxj_DirectPlaySessionData __RPC_FAR *sessiondesc,
  191. /* [in] */ long flags,
  192. /* [in] */ DPSecurityDesc __RPC_FAR *security,
  193. /* [in] */ DPCredentials __RPC_FAR *credentials);
  194. HRESULT STDMETHODCALLTYPE send(
  195. /* [in] */ long fromPlayerId,
  196. /* [in] */ long toPlayerId,
  197. /* [in] */ long flags,
  198. /* [in] */ I_dxj_DirectPlayMessage __RPC_FAR *msg);
  199. HRESULT STDMETHODCALLTYPE sendChatMessage(
  200. /* [in] */ long fromPlayerId,
  201. /* [in] */ long toPlayerId,
  202. /* [in] */ long flags,
  203. /* [in] */ BSTR message);
  204. HRESULT STDMETHODCALLTYPE sendEx(
  205. /* [in] */ long fromPlayerId,
  206. /* [in] */ long toPlayerId,
  207. /* [in] */ long flags,
  208. /* [in] */ I_dxj_DirectPlayMessage __RPC_FAR *msg,
  209. /* [in] */ long priority,
  210. /* [in] */ long timeout,
  211. /* [in] */ long context,
  212. /* [retval][out] */ long __RPC_FAR *messageid);
  213. HRESULT STDMETHODCALLTYPE createMessage(
  214. /* [retval][out] */ I_dxj_DirectPlayMessage __RPC_FAR *__RPC_FAR *msg);
  215. HRESULT STDMETHODCALLTYPE setGroupConnectionSettings(
  216. /* [in] */ long id,
  217. /* [in] */ I_dxj_DPLConnection __RPC_FAR *connection);
  218. HRESULT STDMETHODCALLTYPE setGroupData(
  219. /* [in] */ long groupId,
  220. /* [in] */ BSTR data,
  221. /* [in] */ long flags);
  222. HRESULT STDMETHODCALLTYPE setGroupName(
  223. /* [in] */ long groupId,
  224. /* [in] */ BSTR friendlyName,
  225. /* [in] */ BSTR formalName,
  226. /* [in] */ long flags);
  227. HRESULT STDMETHODCALLTYPE setGroupOwner(
  228. /* [in] */ long groupId,
  229. /* [in] */ long ownerId);
  230. HRESULT STDMETHODCALLTYPE setPlayerData(
  231. /* [in] */ long playerId,
  232. /* [in] */ BSTR data,
  233. /* [in] */ long flags);
  234. HRESULT STDMETHODCALLTYPE setPlayerName(
  235. /* [in] */ long playerId,
  236. /* [in] */ BSTR friendlyName,
  237. /* [in] */ BSTR formalName,
  238. /* [in] */ long flags);
  239. HRESULT STDMETHODCALLTYPE setSessionDesc(
  240. /* [in] */ I_dxj_DirectPlaySessionData __RPC_FAR *sessionDesc);
  241. HRESULT STDMETHODCALLTYPE startSession(
  242. /* [in] */ long id);
  243. HRESULT STDMETHODCALLTYPE createSessionData(
  244. /* [retval][out] */ I_dxj_DirectPlaySessionData __RPC_FAR *__RPC_FAR *sessionDesc);
  245. ////////////////////////////////////////////////////////////////////////////////////
  246. //
  247. // note: this is public for the callbacks
  248. DECL_VARIABLE(_dxj_DirectPlay4);
  249. C_dxj_DirectPlay4Object *nextPlayObj;
  250. private:
  251. void doRemoveThisPlayObj();
  252. public:
  253. DX3J_GLOBAL_LINKS( _dxj_DirectPlay4 )
  254. };
  255. //MUST DEFINE THIS IN DIRECT.CPP
  256. extern C_dxj_DirectPlay4Object *Play4Objs;