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.

818 lines
28 KiB

  1. /*==========================================================================;
  2. *
  3. * Copyright (C) 1994-1997 Microsoft Corporation. All Rights Reserved.
  4. *
  5. * File: dplaysp.h
  6. * Content: DirectPlay Service Provider header
  7. *@@BEGIN_MSINTERNAL
  8. * History:
  9. * Date By Reason
  10. * ==== == ======
  11. * 1/96 andyco created it
  12. * 1/26/96 andyco list data structures
  13. * 2/15/96 andyco packed structures (for net xport)
  14. * 3/16/96 andyco added shutdown callback
  15. * 3/25/96 andyco added sp nodes for sp enum
  16. * 3/28/96 andyco added free receive buffer callback
  17. * 4/9/96 andyco moved dplayi_dplay, packed player, spnode, etc. to dplaypr.h
  18. * 4/10/96 andyco added getmessagesize,isvalidmessage fn's
  19. * 4/11/96 andyco added spdata instead of reserving a bunch of dwords
  20. * 4/12/96 andyco added dplay_xxx methods to get rid of dpmess.h macros
  21. * 4/18/96 andyco added remote players to createplayer, getplayer + group
  22. * list fn's
  23. * 4/25/96 andyco got rid of dwreservedx. added dwSPHeaderSize. spblob
  24. * follows message
  25. * 5/2/96 andyco replaced idirectplay * with iunknown *
  26. * 5/9/96 andyco idirectplay2
  27. * 6/8/96 andyco moved dplayi_player/group to dplaypr.h. ported from
  28. * (now defunct) dplayi.h.
  29. * 6/19/96 andyco changed names, etc. for consistency
  30. * 6/22/96 andyco tossed dwCookies. removed pUnk from callbacks. removed sessiondesc
  31. * from callbacks. alphapathetical order.
  32. * 6/22/96 andyco made DPlay_xxx functions a COM interface (IDirectPlaySP)
  33. * 6/22/96 kipo added EnumConnectionData() method.
  34. * 6/23/96 andyco updated comments. removed bLocal from Create fn's (look
  35. * at flags).
  36. * 6/23/96 kipo cleanup for service provider lab.
  37. * 6/24/96 kipo added version number
  38. * 6/24/96 andyco added getaddress
  39. * 6/25/96 kipo added WINAPI prototypes and updated for DPADDRESS
  40. * 6/28/96 kipo added support for CreateAddress() method.
  41. * 7/10/96 andyco added dwflags to createaddress. changed guid * to
  42. * refguid in createaddress call.
  43. * 7/16/96 kipo changed address types to be GUIDs instead of 4CC
  44. * 7/30/96 kipo added DPLAYI_PLAYER_CREATEDPLAYEREVENT
  45. * 8/23/96 kipo incremented major version number
  46. * 10/10/96 andyco added optimized groups
  47. * 2/7/97 andyco added idpsp to each callback
  48. * 3/04/97 kipo updated gdwDPlaySPRefCount definition
  49. * 3/17/97 kipo added support for CreateCompoundAddress()
  50. * 5/8/97 myronth added DPLAYI_GROUP_STAGINGAREA (internal)
  51. * 5/18/97 kipo added DPLAYI_PLAYER_SPECTATOR
  52. * 5/23/97 kipo Added support for return status codes
  53. * 10/21/97 myronth Added DPLAYI_GROUP_HIDDEN
  54. * 10/29/97 myronth Added DPLAYI_PLAYER_OWNER (internal)
  55. * 10/31/97 andyco added voice call
  56. * 1/20/98 myronth #ifdef'd out voice support
  57. * 1/28/98 sohailm Added dwSessionFlags to DPSP_OPENDATA
  58. * 4/1/98 aarono Added DPLAYI_PLAYER_DOESNT_HAVE_NAMETABLE
  59. * 6/2/98 aarono Added DPLAYI_PLAYER_BEING_DESTROYED to avoid
  60. * deleting more than once.
  61. *@@END_MSINTERNAL
  62. *
  63. ***************************************************************************/
  64. #ifndef __DPLAYSP_INCLUDED__
  65. #define __DPLAYSP_INCLUDED__
  66. #include "dplay.h"
  67. #include "dplobby.h"
  68. #ifdef __cplusplus
  69. extern "C" {
  70. #endif
  71. /*============================================================================
  72. *
  73. * DirectPlay Service Provider Structures
  74. *
  75. * Various structures used to invoke DirectPlay Service Providers.
  76. *
  77. *==========================================================================*/
  78. /*
  79. * Callback for EnumMRU()
  80. */
  81. typedef BOOL (PASCAL *LPENUMMRUCALLBACK)(
  82. LPCVOID lpData,
  83. DWORD dwDataSize,
  84. LPVOID lpContext);
  85. /*
  86. * Major version number for service provider.
  87. *
  88. * The most-significant 16 bits are reserved for the DirectPlay
  89. * major version number. The least-significant 16 bits are for
  90. * use by the service provider.
  91. */
  92. #define DPSP_MAJORVERSION 0x00060000
  93. /*
  94. * This is the major version number that DirectX 3 (DX3) shipped with
  95. */
  96. #define DPSP_DX3VERSION 0x00040000
  97. /*
  98. * This is the major version number that DirectX 5 (DX5) shipped with
  99. */
  100. #define DPSP_DX5VERSION 0x00050000
  101. /*
  102. * Masks to help check the version info
  103. */
  104. #define DPSP_MAJORVERSIONMASK 0xFFFF0000
  105. #define DPSP_MINORVERSIONMASK 0x0000FFFF
  106. //@@BEGIN_MSINTERNAL
  107. #ifdef BIGMESSAGEDEFENSE
  108. /*
  109. * warning types that could be returned from the SP via HandleSPWarning
  110. * see below for corresponding structures
  111. */
  112. #define DPSPWARN_MESSAGETOOBIG 0xB0FF0001
  113. #define DPSPWARN_PLAYERDEAD 0xB0FF0002
  114. #endif
  115. //@@END_MSINTERNAL
  116. /*
  117. * DPLAYI_PLAYER_FLAGS
  118. *
  119. * These flags may be used with players or groups, as appropriate.
  120. * The service provider can get these by calling IDirectPlaySP->GetFlags()
  121. * as defined below. The flags are also available in the dwFlags field
  122. * for most of the callback data structures.
  123. *
  124. * These flags are set by DirectPlay - they are read only for the
  125. * service provider
  126. *
  127. */
  128. /*
  129. * Player is the system player (player only).
  130. */
  131. #define DPLAYI_PLAYER_SYSPLAYER 0x00000001
  132. /*
  133. * Player is the name server (player only). Only valid when
  134. * DPLAYI_PLAYER_SYSPLAYER is also set.
  135. */
  136. #define DPLAYI_PLAYER_NAMESRVR 0x00000002
  137. /*
  138. * Player belongs to a group (player only).
  139. */
  140. #define DPLAYI_PLAYER_PLAYERINGROUP 0x00000004
  141. /*
  142. * Player allocated on this IDirectPlay (player or group).
  143. */
  144. #define DPLAYI_PLAYER_PLAYERLOCAL 0x00000008
  145. //@@BEGIN_MSINTERNAL
  146. /*
  147. * Player event allocated by DirectPlay (player only).
  148. * Used for compatability with the IDirectPlay1 API.
  149. * INTERNAL USE ONLY
  150. */
  151. #define DPLAYI_PLAYER_CREATEDPLAYEREVENT 0x00000010
  152. //@@END_MSINTERNAL
  153. /*
  154. * This group is the system group. If the service provider returns
  155. * DPCAPS_GROUPOPTIMIZED on a GetCaps call, then DirectPlay will create
  156. * a system group containing all players in the game. Sends by the application
  157. * to DPID_ALLPLAYERS will be sent to this group. (group only).
  158. *
  159. */
  160. #define DPLAYI_GROUP_SYSGROUP 0x00000020
  161. /*
  162. * DirectPlay "owns" this group. Sends to this group will be emulated by DirectPlay
  163. * (sends go to each individual member). This flag is set on a group if the
  164. * Service Provider returns failure to the CreateGroup or AddPlayerToGroup
  165. * callback. (group only).
  166. *
  167. */
  168. #define DPLAYI_GROUP_DPLAYOWNS 0x00000040
  169. /*
  170. * This player is the app's server player
  171. */
  172. #define DPLAYI_PLAYER_APPSERVER 0x00000080
  173. //@@BEGIN_MSINTERNAL
  174. /*
  175. * This group is a staging area
  176. */
  177. #define DPLAYI_GROUP_STAGINGAREA 0x00000100
  178. //@@END_MSINTERNAL
  179. /*
  180. * This player is a spectator
  181. */
  182. #define DPLAYI_PLAYER_SPECTATOR 0x00000200
  183. /*
  184. * This group is hidden
  185. */
  186. #define DPLAYI_GROUP_HIDDEN 0x00000400
  187. //@@BEGIN_MSINTERNAL
  188. /*
  189. * Player is the owner of a group. (Only used
  190. * internally, and only used during EnumGroupPlayers).
  191. * INTERNAL USE ONLY
  192. */
  193. #define DPLAYI_PLAYER_OWNER 0x00000800
  194. // a-josbor: Internal flag that gets set when the Keepalive has
  195. // determined that this player should be killed
  196. #define DPLAYI_PLAYER_ON_DEATH_ROW 0x00001000
  197. // aarono: use this flag to mark players waiting for nametable.
  198. // any sends to these players just return DPERR_UNAVAILABLE
  199. // this bit is cleared when we transmit the nametable.
  200. #define DPLAYI_PLAYER_DOESNT_HAVE_NAMETABLE 0x00002000
  201. // a-josbor: set when we get an error back on a reliable
  202. // send. We don't kill them right away because there might
  203. // be messages pending from them
  204. #define DPLAYI_PLAYER_CONNECTION_LOST 0x00004000
  205. /*
  206. * Used to stop re-entering destory player
  207. */
  208. #define DPLAYI_PLAYER_BEING_DESTROYED 0x00010000
  209. #define DPLAYI_PLAYER_NONPROP_FLAGS ( DPLAYI_PLAYER_DOESNT_HAVE_NAMETABLE | \
  210. DPLAYI_PLAYER_BEING_DESTROYED | \
  211. DPLAYI_PLAYER_ON_DEATH_ROW |\
  212. DPLAYI_PLAYER_CONNECTION_LOST )
  213. //@@END_MSINTERNAL
  214. /*
  215. * IDirectPlaySP
  216. *
  217. * Service providers are passed an IDirectPlaySP interface
  218. * in the SPInit method. This interface is used to call DirectPlay.
  219. */
  220. struct IDirectPlaySP;
  221. typedef struct IDirectPlaySP FAR* LPDIRECTPLAYSP;
  222. #undef INTERFACE
  223. #define INTERFACE IDirectPlaySP
  224. DECLARE_INTERFACE_( IDirectPlaySP, IUnknown )
  225. {
  226. /*** IUnknown methods ***/
  227. STDMETHOD(QueryInterface) (THIS_ REFIID riid, LPVOID * ppvObj) PURE;
  228. STDMETHOD_(ULONG,AddRef) (THIS) PURE;
  229. STDMETHOD_(ULONG,Release) (THIS) PURE;
  230. /*** IDirectPlaySP methods ***/
  231. STDMETHOD(AddMRUEntry) (THIS_ LPCWSTR, LPCWSTR, LPCVOID, DWORD, DWORD) PURE;
  232. STDMETHOD(CreateAddress) (THIS_ REFGUID,REFGUID,LPCVOID,DWORD,LPVOID,LPDWORD) PURE;
  233. STDMETHOD(EnumAddress) (THIS_ LPDPENUMADDRESSCALLBACK,LPCVOID,DWORD,LPVOID) PURE;
  234. STDMETHOD(EnumMRUEntries) (THIS_ LPCWSTR, LPCWSTR, LPENUMMRUCALLBACK, LPVOID) PURE;
  235. STDMETHOD(GetPlayerFlags) (THIS_ DPID,LPDWORD) PURE;
  236. STDMETHOD(GetSPPlayerData) (THIS_ DPID,LPVOID *,LPDWORD,DWORD) PURE;
  237. STDMETHOD(HandleMessage) (THIS_ LPVOID,DWORD,LPVOID) PURE;
  238. STDMETHOD(SetSPPlayerData) (THIS_ DPID,LPVOID,DWORD,DWORD) PURE;
  239. /*** IDirectPlaySP methods added for DX 5 ***/
  240. STDMETHOD(CreateCompoundAddress)(THIS_ LPCDPCOMPOUNDADDRESSELEMENT,DWORD,LPVOID,LPDWORD) PURE;
  241. STDMETHOD(GetSPData) (THIS_ LPVOID *,LPDWORD,DWORD) PURE;
  242. STDMETHOD(SetSPData) (THIS_ LPVOID,DWORD,DWORD) PURE;
  243. /*** IDirectPlaySP methods added for DX 6 ***/
  244. STDMETHOD_(VOID,SendComplete) (THIS_ LPVOID,DWORD) PURE;
  245. //@@BEGIN_MSINTERNAL
  246. #ifdef BIGMESSAGEDEFENSE
  247. STDMETHOD(HandleSPWarning) (THIS_ LPVOID,DWORD,LPVOID) PURE;
  248. #endif
  249. //@@END_MSINTERNAL
  250. };
  251. /*
  252. * GUID for IDirectPlaySP
  253. */
  254. // {0C9F6360-CC61-11cf-ACEC-00AA006886E3}
  255. DEFINE_GUID(IID_IDirectPlaySP, 0xc9f6360, 0xcc61, 0x11cf, 0xac, 0xec, 0x0, 0xaa, 0x0, 0x68, 0x86, 0xe3);
  256. /* CALLBACK DATA STRUCTURES
  257. *
  258. * These are passed by DirectPlay to the service provider when
  259. * the callback is invoked.
  260. */
  261. /*
  262. * DPSP_ADDPLAYERTOGROUPDATA
  263. */
  264. typedef struct _DPSP_ADDPLAYERTOGROUPDATA
  265. {
  266. DPID idPlayer;
  267. DPID idGroup;
  268. /*** fields added for DX 5 ***/
  269. IDirectPlaySP * lpISP;
  270. } DPSP_ADDPLAYERTOGROUPDATA;
  271. typedef DPSP_ADDPLAYERTOGROUPDATA FAR* LPDPSP_ADDPLAYERTOGROUPDATA;
  272. /*
  273. * DPSP_CLOSEDATA - used with CloseEx
  274. */
  275. typedef struct _DPSP_CLOSEDATA
  276. {
  277. /*** fields added for DX 5 ***/
  278. IDirectPlaySP * lpISP;
  279. } DPSP_CLOSEDATA;
  280. typedef DPSP_CLOSEDATA FAR* LPDPSP_CLOSEDATA;
  281. /*
  282. * DPSP_CREATEGROUPDATA
  283. */
  284. typedef struct _DPSP_CREATEGROUPDATA
  285. {
  286. DPID idGroup;
  287. DWORD dwFlags; // DPLAYI_PLAYER_xxx flags
  288. LPVOID lpSPMessageHeader; // For local groups, lpSPMessageHeader will be
  289. // NULL. For remote groups, lpSPMessageHeader
  290. // will be the header that was received with
  291. // the AddPlayer message.
  292. /*** fields added for DX 5 ***/
  293. IDirectPlaySP * lpISP;
  294. } DPSP_CREATEGROUPDATA;
  295. typedef DPSP_CREATEGROUPDATA FAR* LPDPSP_CREATEGROUPDATA;
  296. /*
  297. * DPSP_CREATEPLAYERDATA
  298. */
  299. typedef struct _DPSP_CREATEPLAYERDATA
  300. {
  301. DPID idPlayer;
  302. DWORD dwFlags; // DPLAYI_PLAYER_xxx flags
  303. LPVOID lpSPMessageHeader; // For local groups, lpSPMessageHeader will be
  304. // NULL. For remote groups, lpSPMessageHeader
  305. // will be the header that was received with
  306. // the AddPlayer message.
  307. /*** fields added for DX 5 ***/
  308. IDirectPlaySP * lpISP;
  309. } DPSP_CREATEPLAYERDATA;
  310. typedef DPSP_CREATEPLAYERDATA FAR* LPDPSP_CREATEPLAYERDATA;
  311. /*
  312. * DPSP_DELETEGROUPDATA
  313. */
  314. typedef struct _DPSP_DELETEGROUPDATA
  315. {
  316. DPID idGroup;
  317. DWORD dwFlags; // DPLAYI_PLAYER_xxx flags
  318. /*** fields added for DX 5 ***/
  319. IDirectPlaySP * lpISP;
  320. } DPSP_DELETEGROUPDATA;
  321. typedef DPSP_DELETEGROUPDATA FAR* LPDPSP_DELETEGROUPDATA;
  322. /*
  323. * DPSP_DELETEPLAYERDATA
  324. */
  325. typedef struct _DPSP_DELETEPLAYERDATA
  326. {
  327. DPID idPlayer; // player being deleted
  328. DWORD dwFlags; // DPLAYI_PLAYER_xxx flags
  329. /*** fields added for DX 5 ***/
  330. IDirectPlaySP * lpISP;
  331. } DPSP_DELETEPLAYERDATA;
  332. typedef DPSP_DELETEPLAYERDATA FAR* LPDPSP_DELETEPLAYERDATA;
  333. /*
  334. * DPSP_ENUMSESSIONSDATA
  335. */
  336. typedef struct _DPSP_ENUMSESSIONSDATA
  337. {
  338. LPVOID lpMessage; // enum message to send
  339. DWORD dwMessageSize; // size of message to send (including sp header)
  340. /*** fields added for DX 5 ***/
  341. IDirectPlaySP * lpISP;
  342. BOOL bReturnStatus; // TRUE to return status on progress of enum
  343. } DPSP_ENUMSESSIONSDATA;
  344. typedef DPSP_ENUMSESSIONSDATA FAR* LPDPSP_ENUMSESSIONSDATA;
  345. /*
  346. * DPSP_GETADDRESSDATA
  347. */
  348. typedef struct _DPSP_GETADDRESSDATA
  349. {
  350. DPID idPlayer; // player (or group) to get ADDRESS for
  351. DWORD dwFlags; // DPLAYI_PLAYER_xxx flags for idPlayer
  352. LPDPADDRESS lpAddress; // return buffer for address of idPlayer
  353. LPDWORD lpdwAddressSize; // pointer to size of address buffer. If
  354. // this is less than the required size
  355. // (or is 0) the service provider should
  356. // set *lpdwAddressSize to the required
  357. // size and return DPERR_BUFFERTOOSMALL
  358. /*** fields added for DX 5 ***/
  359. IDirectPlaySP * lpISP;
  360. } DPSP_GETADDRESSDATA;
  361. typedef DPSP_GETADDRESSDATA FAR* LPDPSP_GETADDRESSDATA;
  362. /*
  363. * DPSP_GETADDRESSCHOICESDATA
  364. */
  365. typedef struct _DPSP_GETADDRESSCHOICESDATA
  366. {
  367. LPDPADDRESS lpAddress; // return buffer for address choices
  368. LPDWORD lpdwAddressSize; // pointer to size of address buffer. If
  369. // this is less than the required size
  370. // (or is 0) the service provider should
  371. // set *lpdwAddressSize to the required
  372. // size and return DPERR_BUFFERTOOSMALL
  373. IDirectPlaySP * lpISP;
  374. } DPSP_GETADDRESSCHOICESDATA;
  375. typedef DPSP_GETADDRESSCHOICESDATA FAR* LPDPSP_GETADDRESSCHOICESDATA;
  376. /*
  377. * DPSP_GETCAPSDATA
  378. */
  379. typedef struct _DPSP_GETCAPSDATA
  380. {
  381. DPID idPlayer; // player to get caps for
  382. LPDPCAPS lpCaps;
  383. DWORD dwFlags; // DPGETCAPS_xxx
  384. /*** fields added for DX 5 ***/
  385. IDirectPlaySP * lpISP;
  386. } DPSP_GETCAPSDATA;
  387. typedef DPSP_GETCAPSDATA FAR* LPDPSP_GETCAPSDATA;
  388. /*
  389. * DPSP_OPENDATA
  390. */
  391. typedef struct _DPSP_OPENDATA
  392. {
  393. BOOL bCreate; // TRUE if creating, FALSE if joining
  394. LPVOID lpSPMessageHeader; // If we are joining a session, lpSPMessageData
  395. // is the message data received with the
  396. // EnumSessionsReply message. If we are creating
  397. // a session, it will be set to NULL.
  398. /*** fields added for DX 5 ***/
  399. IDirectPlaySP * lpISP;
  400. BOOL bReturnStatus; // TRUE to return status on progress of open
  401. /*** fields added for DX 6 ***/
  402. DWORD dwOpenFlags; // flags passed by app to IDirectPlayX->Open(...)
  403. DWORD dwSessionFlags; // flags passed by app in the session desc
  404. } DPSP_OPENDATA;
  405. typedef DPSP_OPENDATA FAR* LPDPSP_OPENDATA;
  406. /*
  407. * DPSP_REMOVEPLAYERFROMGROUPDATA
  408. */
  409. typedef struct _DPSP_REMOVEPLAYERFROMGROUPDATA
  410. {
  411. DPID idPlayer;
  412. DPID idGroup;
  413. /*** fields added for DX 5 ***/
  414. IDirectPlaySP * lpISP;
  415. } DPSP_REMOVEPLAYERFROMGROUPDATA;
  416. typedef DPSP_REMOVEPLAYERFROMGROUPDATA FAR* LPDPSP_REMOVEPLAYERFROMGROUPDATA;
  417. /*
  418. * DPSP_REPLYDATA
  419. */
  420. typedef struct _DPSP_REPLYDATA
  421. {
  422. LPVOID lpSPMessageHeader; // header that was received by dplay
  423. // (with the message we're replying to)
  424. LPVOID lpMessage; // message to send
  425. DWORD dwMessageSize; // size of message to send (including sp header)
  426. DPID idNameServer; // player id of nameserver
  427. /*** fields added for DX 5 ***/
  428. IDirectPlaySP * lpISP;
  429. } DPSP_REPLYDATA;
  430. typedef DPSP_REPLYDATA FAR* LPDPSP_REPLYDATA;
  431. /*
  432. * DPSP_SENDDATA
  433. */
  434. typedef struct _DPSP_SENDDATA
  435. {
  436. DWORD dwFlags; // e.g. DPSEND_GUARANTEE
  437. DPID idPlayerTo; // player we're sending to
  438. DPID idPlayerFrom; // player we're sending from
  439. LPVOID lpMessage; // message to send
  440. DWORD dwMessageSize; // size of message to send (including sp header)
  441. BOOL bSystemMessage; // TRUE if this is a system message
  442. /*** fields added for DX 5 ***/
  443. IDirectPlaySP * lpISP;
  444. } DPSP_SENDDATA;
  445. typedef DPSP_SENDDATA FAR* LPDPSP_SENDDATA;
  446. /*
  447. * DPSP_SENDTOGROUPDATA
  448. */
  449. typedef struct _DPSP_SENDTOGROUPDATA
  450. {
  451. DWORD dwFlags; // e.g. DPSEND_GUARANTEE
  452. DPID idGroupTo; // group we're sending to
  453. DPID idPlayerFrom; // player we're sending from
  454. LPVOID lpMessage; // message to send
  455. DWORD dwMessageSize; // size of message to send (including sp header)
  456. /*** fields added for DX 5 ***/
  457. IDirectPlaySP * lpISP;
  458. } DPSP_SENDTOGROUPDATA;
  459. typedef DPSP_SENDTOGROUPDATA FAR* LPDPSP_SENDTOGROUPDATA;
  460. /*
  461. * DPSP_SENDEXDATA
  462. */
  463. typedef struct _DPSP_SENDEXDATA
  464. {
  465. IDirectPlaySP * lpISP; // indication interface
  466. DWORD dwFlags; // e.g. DPSEND_GUARANTEE
  467. DPID idPlayerTo; // player we're sending to
  468. DPID idPlayerFrom; // player we're sending from
  469. LPSGBUFFER lpSendBuffers; // scatter gather array of send data
  470. DWORD cBuffers; // count of buffers
  471. DWORD dwMessageSize; // total size of message
  472. DWORD dwPriority; // message priority
  473. DWORD dwTimeout; // timeout for message in ms (don't send after t/o)
  474. LPVOID lpDPContext; // async only: context value to use when notifying completion
  475. LPDWORD lpdwSPMsgID; // async only: message id to be assigned by SP for use in other apis.
  476. BOOL bSystemMessage; // TRUE if this is a system message
  477. } DPSP_SENDEXDATA;
  478. typedef DPSP_SENDEXDATA FAR* LPDPSP_SENDEXDATA;
  479. /*
  480. * DPSP_SENDTOGROUPEXDATA
  481. */
  482. typedef struct _DPSP_SENDTOGROUPEXDATA
  483. {
  484. IDirectPlaySP * lpISP; // indication interface
  485. DWORD dwFlags; // e.g. DPSEND_GUARANTEE
  486. DPID idGroupTo; // group we're sending to
  487. DPID idPlayerFrom; // player we're sending from
  488. LPSGBUFFER lpSendBuffers; // scatter gather array of send data
  489. DWORD cBuffers; // count of buffers
  490. DWORD dwMessageSize; // total size of message
  491. DWORD dwPriority; // message priority
  492. DWORD dwTimeout; // timeout for message in ms (don't send after t/o)
  493. LPVOID lpDPContext; // async only: context value to use when notifying completion
  494. LPDWORD lpdwSPMsgID; // async only: message id to be assigned by SP for use in other apis.
  495. } DPSP_SENDTOGROUPEXDATA;
  496. typedef DPSP_SENDTOGROUPEXDATA FAR* LPDPSP_SENDTOGROUPEXDATA;
  497. /*
  498. * DPSP_GETMESSAGEQUEUE
  499. */
  500. typedef struct _DPSP_GETMESSAGEQUEUEDATA
  501. {
  502. IDirectPlaySP * lpISP; // indication interface
  503. DWORD dwFlags;
  504. DPID idFrom;
  505. DPID idTo;
  506. LPDWORD lpdwNumMsgs;
  507. LPDWORD lpdwNumBytes;
  508. } DPSP_GETMESSAGEQUEUEDATA;
  509. typedef DPSP_GETMESSAGEQUEUEDATA FAR* LPDPSP_GETMESSAGEQUEUEDATA;
  510. /*
  511. * DPSP_CANCELSEND
  512. */
  513. #define DPCANCELSEND_PRIORITY 0x00000001
  514. #define DPCANCELSEND_ALL 0x00000002
  515. typedef struct _DPSP_CANCELDATA
  516. {
  517. IDirectPlaySP * lpISP; // indication interface
  518. DWORD dwFlags; // 0,DPCANCELSEND_PRIORITY,DPCANCELSEND_ALL,etc.
  519. LPRGLPVOID lprglpvSPMsgID; // cancel just these messages (dwFlags == 0)
  520. DWORD cSPMsgID; // number of message id's in array (dwFlags == 0)
  521. DWORD dwMinPriority; // cancel all sends at this priority (dwFlags==DPCANCELSEND_PRIORITY)
  522. DWORD dwMaxPriority; // cancel all sends between Min and Max.
  523. } DPSP_CANCELDATA;
  524. typedef DPSP_CANCELDATA FAR* LPDPSP_CANCELDATA;
  525. /*
  526. * DPSP_SHUTDOWNDATA - used with ShutdownEx
  527. */
  528. typedef struct _DPSP_SHUTDOWNDATA
  529. {
  530. /*** fields added for DX 5 ***/
  531. IDirectPlaySP * lpISP;
  532. } DPSP_SHUTDOWNDATA;
  533. typedef DPSP_SHUTDOWNDATA FAR* LPDPSP_SHUTDOWNDATA;
  534. //@@BEGIN_MSINTERNAL
  535. #ifdef BIGMESSAGEDEFENSE
  536. /*
  537. * DPSP_MSGTOOBIG - used with HandleSPNotification (DPSPWARN_MESSAGETOOBIG)
  538. */
  539. typedef struct _DPSP_MSGTOOBIG
  540. {
  541. DWORD dwType;
  542. LPBYTE pReceiveBuffer; // --> pointer to the message data
  543. DWORD dwBytesReceived;// --> the number of bytes of the message actually received
  544. DWORD dwMessageSize; // --> the size of the message as understood by the SP
  545. } DPSP_MSGTOOBIG;
  546. typedef DPSP_MSGTOOBIG FAR* LPDPSP_MSGTOOBIG;
  547. /*
  548. * DPSP_PLAYERDEAD - used with HandleSPNotification (DPSPWARN_PLAYERDEAD)
  549. */
  550. typedef struct _DPSP_PLAYERDISCONNECT
  551. {
  552. DWORD dwType;
  553. DPID dwID; // ID of the Sys player that has been disconnected
  554. } DPSP_PLAYERDEAD;
  555. typedef DPSP_PLAYERDEAD FAR* LPDPSP_PLAYERDEAD;
  556. #endif
  557. //@@END_MSINTERNAL
  558. /*
  559. * Prototypes for callbacks returned by SPInit.
  560. */
  561. typedef HRESULT (WINAPI *LPDPSP_CREATEPLAYER)(LPDPSP_CREATEPLAYERDATA);
  562. typedef HRESULT (WINAPI *LPDPSP_DELETEPLAYER)(LPDPSP_DELETEPLAYERDATA);
  563. typedef HRESULT (WINAPI *LPDPSP_SEND)(LPDPSP_SENDDATA);
  564. typedef HRESULT (WINAPI *LPDPSP_ENUMSESSIONS)(LPDPSP_ENUMSESSIONSDATA);
  565. typedef HRESULT (WINAPI *LPDPSP_REPLY)(LPDPSP_REPLYDATA);
  566. typedef HRESULT (WINAPI *LPDPSP_SHUTDOWN)(void);
  567. typedef HRESULT (WINAPI *LPDPSP_CREATEGROUP)(LPDPSP_CREATEGROUPDATA);
  568. typedef HRESULT (WINAPI *LPDPSP_DELETEGROUP)(LPDPSP_DELETEGROUPDATA);
  569. typedef HRESULT (WINAPI *LPDPSP_ADDPLAYERTOGROUP)(LPDPSP_ADDPLAYERTOGROUPDATA);
  570. typedef HRESULT (WINAPI *LPDPSP_REMOVEPLAYERFROMGROUP)(LPDPSP_REMOVEPLAYERFROMGROUPDATA);
  571. typedef HRESULT (WINAPI *LPDPSP_GETCAPS)(LPDPSP_GETCAPSDATA);
  572. typedef HRESULT (WINAPI *LPDPSP_GETADDRESS)(LPDPSP_GETADDRESSDATA);
  573. typedef HRESULT (WINAPI *LPDPSP_GETADDRESSCHOICES)(LPDPSP_GETADDRESSCHOICESDATA);
  574. typedef HRESULT (WINAPI *LPDPSP_OPEN)(LPDPSP_OPENDATA);
  575. typedef HRESULT (WINAPI *LPDPSP_CLOSE)(void);
  576. typedef HRESULT (WINAPI *LPDPSP_SENDTOGROUP)(LPDPSP_SENDTOGROUPDATA);
  577. typedef HRESULT (WINAPI *LPDPSP_SHUTDOWNEX)(LPDPSP_SHUTDOWNDATA);
  578. typedef HRESULT (WINAPI *LPDPSP_CLOSEEX)(LPDPSP_CLOSEDATA);
  579. typedef HRESULT (WINAPI *LPDPSP_SENDEX)(LPDPSP_SENDEXDATA);
  580. typedef HRESULT (WINAPI *LPDPSP_SENDTOGROUPEX)(LPDPSP_SENDTOGROUPEXDATA);
  581. typedef HRESULT (WINAPI *LPDPSP_CANCEL)(LPDPSP_CANCELDATA);
  582. typedef HRESULT (WINAPI *LPDPSP_GETMESSAGEQUEUE)(LPDPSP_GETMESSAGEQUEUEDATA);
  583. /*
  584. * DPSP_SPCALLBACKS
  585. *
  586. * Table of callback pointers passed to SPInit. The service provider should fill
  587. * in the functions it implements. If the service provider does not implement
  588. * a callback, it should not set the table value for the unimplemented callback.
  589. */
  590. typedef struct _DPSP_SPCALLBACKS
  591. {
  592. DWORD dwSize; // size of table
  593. DWORD dwVersion; // the DPSP_MAJORVERSION of this DPLAY object
  594. // for DX3, this was 0.
  595. LPDPSP_ENUMSESSIONS EnumSessions; // required
  596. LPDPSP_REPLY Reply; // required
  597. LPDPSP_SEND Send; // required
  598. LPDPSP_ADDPLAYERTOGROUP AddPlayerToGroup; // optional
  599. LPDPSP_CLOSE Close; // optional - for DX3 compat only
  600. LPDPSP_CREATEGROUP CreateGroup; // optional
  601. LPDPSP_CREATEPLAYER CreatePlayer; // optional
  602. LPDPSP_DELETEGROUP DeleteGroup; // optional
  603. LPDPSP_DELETEPLAYER DeletePlayer; // optional
  604. LPDPSP_GETADDRESS GetAddress; // optional
  605. LPDPSP_GETCAPS GetCaps; // required
  606. LPDPSP_OPEN Open; // optional
  607. LPDPSP_REMOVEPLAYERFROMGROUP RemovePlayerFromGroup; // optional
  608. LPDPSP_SENDTOGROUP SendToGroup; // optional
  609. LPDPSP_SHUTDOWN Shutdown; // optional - for DX3 compat only
  610. /*** fields added for DX 5 ***/
  611. LPDPSP_CLOSEEX CloseEx; // optional
  612. LPDPSP_SHUTDOWNEX ShutdownEx; // optional
  613. LPDPSP_GETADDRESSCHOICES GetAddressChoices; // optional
  614. /*** fields added for DX 6 ***/
  615. /*** for async ***/
  616. LPDPSP_SENDEX SendEx; // optional - required for async
  617. LPDPSP_SENDTOGROUPEX SendToGroupEx; // optional - optional for async
  618. LPDPSP_CANCEL Cancel; // optional - optional for async, highly recommended
  619. LPDPSP_GETMESSAGEQUEUE GetMessageQueue; // optional - optional for async, highly recommended
  620. } DPSP_SPCALLBACKS;
  621. typedef DPSP_SPCALLBACKS FAR *LPDPSP_SPCALLBACKS;
  622. /*
  623. * SPINITDATA
  624. *
  625. * Data structure passed to the service provider at SPInit.
  626. */
  627. typedef struct _SPINITDATA
  628. {
  629. LPDPSP_SPCALLBACKS lpCB; // service provider fills in entry points
  630. IDirectPlaySP * lpISP; // used to call back into DirectPlay
  631. // (e.g. when message is received)
  632. LPWSTR lpszName; // service provider name from registry
  633. LPGUID lpGuid; // service provider GUID from registry
  634. DWORD dwReserved1; // service provider-specific data from registry
  635. DWORD dwReserved2; // service provider-specific data from registry
  636. DWORD dwSPHeaderSize; // dwSPHeaderSize is the size of the
  637. // data the sp wants stored with each message.
  638. // DirectPlay will allocate dwSPHeaderSize
  639. // bytes at the beginning of each message.
  640. // The service provider can then do what
  641. // they want with these.
  642. LPDPADDRESS lpAddress; // address to use for connection
  643. DWORD dwAddressSize; // size of address data
  644. DWORD dwSPVersion; // version number 16 | 16 , major | minor version
  645. } SPINITDATA;
  646. typedef SPINITDATA FAR* LPSPINITDATA;
  647. /*
  648. * SPInit
  649. *
  650. * DirectPlay calls this function to initialize the service provider.
  651. * All service providers must export this entry point from their DLL.
  652. */
  653. typedef HRESULT (WINAPI *LPDPSP_SPINIT)(LPSPINITDATA);
  654. HRESULT WINAPI SPInit(LPSPINITDATA);
  655. /*
  656. * gdwDPlaySPRefCount
  657. *
  658. * To ensure that the DPLAYX.DLL will not be unloaded before the service
  659. * provider, the server provider should statically link to DPLAYX.LIB and
  660. * increment this global during the SPINIT call and decrement this global
  661. * during Shutdown.
  662. */
  663. extern __declspec(dllimport) DWORD gdwDPlaySPRefCount;
  664. /*@@BEGIN_MSINTERNAL */
  665. /*
  666. * All of the following entries are part of the voice support that was
  667. * removed from dplay before DX6. It is currently still part of the
  668. * code base and is just #ifdef'd out.
  669. */
  670. #ifdef DPLAY_VOICE_SUPPORT
  671. /*
  672. * Player was created on a system that has voice capability
  673. *
  674. * INTERNAL USE ONLY
  675. * THIS ENTRY SHOULD BE SURROUNDED BY MSINTERNALS!!!!!
  676. */
  677. #define DPLAYI_PLAYER_HASVOICE 0x00001000
  678. /*
  679. * DPSP_CLOSEVOICEDATA - used with CloseVoice
  680. */
  681. typedef struct _DPSP_CLOSEVOICEDATA
  682. {
  683. IDirectPlaySP * lpISP;
  684. DWORD dwFlags;
  685. } DPSP_CLOSEVOICEDATA;
  686. typedef DPSP_CLOSEVOICEDATA FAR* LPDPSP_CLOSEVOICEDATA;
  687. /*
  688. * DPSP_OPENVOICEDATA - used with OpenVoice
  689. */
  690. typedef struct _DPSP_OPENVOICEDATA
  691. {
  692. IDirectPlaySP * lpISP;
  693. DWORD dwFlags;
  694. DPID idTo;
  695. DPID idFrom;
  696. BOOL bToPlayer; // TRUE if idTo is a Player
  697. } DPSP_OPENVOICEDATA;
  698. typedef DPSP_OPENVOICEDATA FAR* LPDPSP_OPENVOICEDATA;
  699. typedef HRESULT (WINAPI *LPDPSP_CLOSEVOICE)(LPDPSP_CLOSEVOICEDATA);
  700. typedef HRESULT (WINAPI *LPDPSP_OPENVOICE)(LPDPSP_OPENVOICEDATA);
  701. // From interface declaration
  702. LPDPSP_CLOSEVOICE CloseVoice; // optional
  703. LPDPSP_OPENVOICE OpenVoice; // optional
  704. #endif // DPLAY_VOICE_SUPPORT
  705. /*@@END_MSINTERNAL */
  706. #ifdef __cplusplus
  707. };
  708. #endif
  709. #endif