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.

702 lines
30 KiB

  1. /*==========================================================================;
  2. *
  3. * Copyright (C) 1996-1997 Microsoft Corporation. All Rights Reserved.
  4. *
  5. * File: lobbysp.h
  6. * Content: DirectPlayLobby data structures for Service Providers
  7. *@@BEGIN_MSINTERNAL
  8. * History:
  9. * Date By Reason
  10. * ==== == ======
  11. * 7/23/96 myronth Created it
  12. * 10/23/96 myronth Added IDPLobbySP interface stuff
  13. * 10/28/96 myronth Changed to DX5 methods
  14. * 11/20/96 myronth Added DPLOGONINFO to LogonServer data
  15. * 2/12/97 myronth Mass DX5 changes
  16. * 2/18/97 myronth Implemented GetObjectCaps
  17. * 3/12/97 myronth Implemented EnumSessions, Removed Open & Close Responses
  18. * 3/13/97 myronth Added link to global DPlay SP count (imported)
  19. * 3/17/97 myronth Create/DestroyGroup/Player, Removed unnecessary
  20. * Enum functions & structures
  21. * 3/21/97 myronth SetGroup/PlayerName, Get/SetGroup/PlayerData, Removed
  22. * more unnecessary response functions
  23. * 3/31/97 myronth Removed dead code, Added new IDPLobbySP method structs
  24. * 4/4/97 myronth Added new IDPLobbySP method structures
  25. * 4/9/97 myronth Cleaned up SPINIT structure elements, Added
  26. * GetCaps and GetPlayerCaps
  27. * 5/8/97 myronth Subgroup methods, GroupConnSettings, StartSession
  28. * 5/13/97 myronth Added Credentials to Open data struct
  29. * 5/17/97 myronth SendChatMessage callback functions, structs, etc.
  30. * 5/23/97 myronth Removed dwPlayerToID from the SPDATA structs
  31. * 6/3/97 myronth Added dwPlayerFlags to SPDATA_ADDREMOTEPLAYERTOGROUP
  32. * 6/5/97 myronth Added parent to SPDATA_ADDREMOTEPLAYERTOGROUP and
  33. * added SPDATA_BUILDPARENTALHEIRARCHY message & structs
  34. * 7/30/97 myronth Added dwFlags member to SPDATA_HANDLEMESSAGE
  35. * 10/3/97 myronth Added dwDPlayVersion to DPLSPInit data struct
  36. * Added player & group data to several remote structs
  37. * Bumped version to DX6 (#12667)
  38. * 10/8/97 myronth Rolled back the fix to #10961 which added lpData and
  39. * dwDataSize to all remote structs -- It's not needed
  40. * 10/29/97 myronth Added support for group owner and it's methods
  41. * 11/6/97 myronth Added version existence flag and dwReserved values
  42. * to SPDATA_INIT (#12916, #12917)
  43. * 12/29/97 myronth Fixed DX6 macros (#15739)
  44. *@@END_MSINTERNAL
  45. ***************************************************************************/
  46. #ifndef __LOBBYSP_INCLUDED__
  47. #define __LOBBYSP_INCLUDED__
  48. #include "dplobby.h"
  49. #ifdef __cplusplus
  50. extern "C" {
  51. #endif // __cplusplus
  52. /*
  53. * gdwDPlaySPRefCount
  54. *
  55. * To ensure that the DPLAYX.DLL will not be unloaded before the lobby
  56. * provider, the lobby provider should statically link to DPLAYX.LIB and
  57. * increment this global during the DPLSPInit call and decrement this global
  58. * during Shutdown.
  59. */
  60. extern __declspec(dllimport) DWORD gdwDPlaySPRefCount;
  61. // A few forward declarations
  62. typedef struct SPDATA_ADDGROUPTOGROUP * LPSPDATA_ADDGROUPTOGROUP;
  63. typedef struct SPDATA_ADDPLAYERTOGROUP *LPSPDATA_ADDPLAYERTOGROUP;
  64. typedef struct SPDATA_ADDREMOTEGROUPTOGROUP *LPSPDATA_ADDREMOTEGROUPTOGROUP;
  65. typedef struct SPDATA_ADDREMOTEPLAYERTOGROUP *LPSPDATA_ADDREMOTEPLAYERTOGROUP;
  66. typedef struct SPDATA_BUILDPARENTALHEIRARCHY *LPSPDATA_BUILDPARENTALHEIRARCHY;
  67. typedef struct SPDATA_CHATMESSAGE *LPSPDATA_CHATMESSAGE;
  68. typedef struct SPDATA_CLOSE *LPSPDATA_CLOSE;
  69. typedef struct SPDATA_CREATEGROUP *LPSPDATA_CREATEGROUP;
  70. typedef struct SPDATA_CREATEGROUPINGROUP *LPSPDATA_CREATEGROUPINGROUP;
  71. typedef struct SPDATA_CREATEREMOTEGROUP *LPSPDATA_CREATEREMOTEGROUP;
  72. typedef struct SPDATA_CREATEREMOTEGROUPINGROUP *LPSPDATA_CREATEREMOTEGROUPINGROUP;
  73. typedef struct SPDATA_CREATEPLAYER *LPSPDATA_CREATEPLAYER;
  74. typedef struct SPDATA_DELETEGROUPFROMGROUP * LPSPDATA_DELETEGROUPFROMGROUP;
  75. typedef struct SPDATA_DELETEPLAYERFROMGROUP *LPSPDATA_DELETEPLAYERFROMGROUP;
  76. typedef struct SPDATA_DELETEREMOTEGROUPFROMGROUP *LPSPDATA_DELETEREMOTEGROUPFROMGROUP;
  77. typedef struct SPDATA_DELETEREMOTEPLAYERFROMGROUP *LPSPDATA_DELETEREMOTEPLAYERFROMGROUP;
  78. typedef struct SPDATA_DESTROYGROUP *LPSPDATA_DESTROYGROUP;
  79. typedef struct SPDATA_DESTROYREMOTEGROUP *LPSPDATA_DESTROYREMOTEGROUP;
  80. typedef struct SPDATA_DESTROYPLAYER *LPSPDATA_DESTROYPLAYER;
  81. typedef struct SPDATA_ENUMSESSIONS *LPSPDATA_ENUMSESSIONS;
  82. typedef struct SPDATA_ENUMSESSIONSRESPONSE * LPSPDATA_ENUMSESSIONSRESPONSE;
  83. typedef struct SPDATA_GETCAPS *LPSPDATA_GETCAPS;
  84. typedef struct SPDATA_GETGROUPCONNECTIONSETTINGS *LPSPDATA_GETGROUPCONNECTIONSETTINGS;
  85. typedef struct SPDATA_GETGROUPDATA *LPSPDATA_GETGROUPDATA;
  86. typedef struct SPDATA_GETPLAYERCAPS *LPSPDATA_GETPLAYERCAPS;
  87. typedef struct SPDATA_GETPLAYERDATA *LPSPDATA_GETPLAYERDATA;
  88. typedef struct SPDATA_HANDLEMESSAGE *LPSPDATA_HANDLEMESSAGE;
  89. typedef struct SPDATA_OPEN *LPSPDATA_OPEN;
  90. typedef struct SPDATA_SEND *LPSPDATA_SEND;
  91. typedef struct SPDATA_SETGROUPDATA *LPSPDATA_SETGROUPDATA;
  92. typedef struct SPDATA_SETGROUPNAME *LPSPDATA_SETGROUPNAME;
  93. typedef struct SPDATA_SETGROUPOWNER *LPSPDATA_SETGROUPOWNER;
  94. typedef struct SPDATA_SETREMOTEGROUPNAME *LPSPDATA_SETREMOTEGROUPNAME;
  95. typedef struct SPDATA_SETREMOTEGROUPOWNER *LPSPDATA_SETREMOTEGROUPOWNER;
  96. typedef struct SPDATA_SETGROUPCONNECTIONSETTINGS *LPSPDATA_SETGROUPCONNECTIONSETTINGS;
  97. typedef struct SPDATA_SETPLAYERDATA *LPSPDATA_SETPLAYERDATA;
  98. typedef struct SPDATA_SETPLAYERNAME *LPSPDATA_SETPLAYERNAME;
  99. typedef struct SPDATA_SETREMOTEPLAYERNAME *LPSPDATA_SETREMOTEPLAYERNAME;
  100. typedef struct SPDATA_SETSESSIONDESC *LPSPDATA_SETSESSIONDESC;
  101. typedef struct SPDATA_SHUTDOWN *LPSPDATA_SHUTDOWN;
  102. typedef struct SPDATA_STARTSESSION *LPSPDATA_STARTSESSION;
  103. typedef struct SPDATA_STARTSESSIONCOMMAND *LPSPDATA_STARTSESSIONCOMMAND;
  104. /*
  105. * IDPLobbySP
  106. *
  107. * Lobby Service Providers are passed an IDPLobbySP interface
  108. * in the LobbySPInit method. This interface is used to call
  109. * back into DirectPlayLobby.
  110. */
  111. struct IDPLobbySP;
  112. typedef struct IDPLobbySP FAR* LPDPLOBBYSP;
  113. #undef INTERFACE
  114. #define INTERFACE IDPLobbySP
  115. DECLARE_INTERFACE_( IDPLobbySP, IUnknown )
  116. {
  117. /*** IUnknown methods ***/
  118. STDMETHOD(QueryInterface) (THIS_ REFIID riid, LPVOID * ppvObj) PURE;
  119. STDMETHOD_(ULONG,AddRef) (THIS) PURE;
  120. STDMETHOD_(ULONG,Release) (THIS) PURE;
  121. /*** IDPLobbySP methods ***/
  122. STDMETHOD(AddGroupToGroup) (THIS_ LPSPDATA_ADDREMOTEGROUPTOGROUP) PURE;
  123. STDMETHOD(AddPlayerToGroup) (THIS_ LPSPDATA_ADDREMOTEPLAYERTOGROUP) PURE;
  124. STDMETHOD(CreateGroup) (THIS_ LPSPDATA_CREATEREMOTEGROUP) PURE;
  125. STDMETHOD(CreateGroupInGroup) (THIS_ LPSPDATA_CREATEREMOTEGROUPINGROUP) PURE;
  126. STDMETHOD(DeleteGroupFromGroup) (THIS_ LPSPDATA_DELETEREMOTEGROUPFROMGROUP) PURE;
  127. STDMETHOD(DeletePlayerFromGroup) (THIS_ LPSPDATA_DELETEREMOTEPLAYERFROMGROUP) PURE;
  128. STDMETHOD(DestroyGroup) (THIS_ LPSPDATA_DESTROYREMOTEGROUP) PURE;
  129. STDMETHOD(EnumSessionsResponse) (THIS_ LPSPDATA_ENUMSESSIONSRESPONSE) PURE;
  130. STDMETHOD(GetSPDataPointer) (THIS_ LPVOID *) PURE;
  131. STDMETHOD(HandleMessage) (THIS_ LPSPDATA_HANDLEMESSAGE) PURE;
  132. STDMETHOD(SendChatMessage) (THIS_ LPSPDATA_CHATMESSAGE) PURE;
  133. STDMETHOD(SetGroupName) (THIS_ LPSPDATA_SETREMOTEGROUPNAME) PURE;
  134. STDMETHOD(SetPlayerName) (THIS_ LPSPDATA_SETREMOTEPLAYERNAME) PURE;
  135. STDMETHOD(SetSessionDesc) (THIS_ LPSPDATA_SETSESSIONDESC) PURE;
  136. STDMETHOD(SetSPDataPointer) (THIS_ LPVOID) PURE;
  137. STDMETHOD(StartSession) (THIS_ LPSPDATA_STARTSESSIONCOMMAND) PURE;
  138. /*** Methods added for DX6 ***/
  139. STDMETHOD(CreateCompoundAddress) (THIS_ LPCDPCOMPOUNDADDRESSELEMENT,DWORD,LPVOID,LPDWORD) PURE;
  140. STDMETHOD(EnumAddress) (THIS_ LPDPENUMADDRESSCALLBACK, LPCVOID, DWORD, LPVOID) PURE;
  141. STDMETHOD(SetGroupOwner) (THIS_ LPSPDATA_SETREMOTEGROUPOWNER) PURE;
  142. };
  143. /*
  144. * GUID for IDPLobbySP
  145. */
  146. // IID_IDPLobbySP {5A4E5A20-2CED-11d0-A889-00A0C905433C}
  147. DEFINE_GUID(IID_IDPLobbySP, 0x5a4e5a20, 0x2ced, 0x11d0, 0xa8, 0x89, 0x0, 0xa0, 0xc9, 0x5, 0x43, 0x3c);
  148. /*
  149. * Major version number for service provider.
  150. *
  151. * The most-significant 16 bits are reserved for the DirectPlay
  152. * major version number. The least-significant 16 bits are for
  153. * use by the service provider.
  154. */
  155. #define DPLSP_MAJORVERSION 0x00060000
  156. // Major version used by DX5
  157. #define DPLSP_DX5VERSION 0x00050000
  158. // Size of the SPDATA_INIT structure in DX5
  159. #define DPLSP_SIZE_DX5_INIT_STRUCT (16)
  160. //--------------------------------------------------------------------------
  161. //
  162. // Service Provider Callback Stuff
  163. //
  164. //--------------------------------------------------------------------------
  165. // Callback prototypes
  166. typedef HRESULT (WINAPI *LPSP_ADDGROUPTOGROUP)(LPSPDATA_ADDGROUPTOGROUP);
  167. typedef HRESULT (WINAPI *LPSP_ADDPLAYERTOGROUP)(LPSPDATA_ADDPLAYERTOGROUP);
  168. typedef HRESULT (WINAPI *LPSP_BUILDPARENTALHEIRARCHY)(LPSPDATA_BUILDPARENTALHEIRARCHY);
  169. typedef HRESULT (WINAPI *LPSP_CLOSE)(LPSPDATA_CLOSE);
  170. typedef HRESULT (WINAPI *LPSP_CREATEGROUP)(LPSPDATA_CREATEGROUP);
  171. typedef HRESULT (WINAPI *LPSP_CREATEGROUPINGROUP)(LPSPDATA_CREATEGROUPINGROUP);
  172. typedef HRESULT (WINAPI *LPSP_CREATEPLAYER)(LPSPDATA_CREATEPLAYER);
  173. typedef HRESULT (WINAPI *LPSP_DELETEGROUPFROMGROUP)(LPSPDATA_DELETEGROUPFROMGROUP);
  174. typedef HRESULT (WINAPI *LPSP_DELETEPLAYERFROMGROUP)(LPSPDATA_DELETEPLAYERFROMGROUP);
  175. typedef HRESULT (WINAPI *LPSP_DESTROYGROUP)(LPSPDATA_DESTROYGROUP);
  176. typedef HRESULT (WINAPI *LPSP_DESTROYPLAYER)(LPSPDATA_DESTROYPLAYER);
  177. typedef HRESULT (WINAPI *LPSP_ENUMSESSIONS)(LPSPDATA_ENUMSESSIONS);
  178. typedef HRESULT (WINAPI *LPSP_GETCAPS)(LPSPDATA_GETCAPS);
  179. typedef HRESULT (WINAPI *LPSP_GETGROUPCONNECTIONSETTINGS)(LPSPDATA_GETGROUPCONNECTIONSETTINGS);
  180. typedef HRESULT (WINAPI *LPSP_GETGROUPDATA)(LPSPDATA_GETGROUPDATA);
  181. typedef HRESULT (WINAPI *LPSP_GETPLAYERCAPS)(LPSPDATA_GETPLAYERCAPS);
  182. typedef HRESULT (WINAPI *LPSP_GETPLAYERDATA)(LPSPDATA_GETPLAYERDATA);
  183. typedef HRESULT (WINAPI *LPSP_HANDLEMESSAGE)(LPSPDATA_HANDLEMESSAGE);
  184. typedef HRESULT (WINAPI *LPSP_OPEN)(LPSPDATA_OPEN);
  185. typedef HRESULT (WINAPI *LPSP_SEND)(LPSPDATA_SEND);
  186. typedef HRESULT (WINAPI *LPSP_SENDCHATMESSAGE)(LPSPDATA_CHATMESSAGE);
  187. typedef HRESULT (WINAPI *LPSP_SETGROUPCONNECTIONSETTINGS)(LPSPDATA_SETGROUPCONNECTIONSETTINGS);
  188. typedef HRESULT (WINAPI *LPSP_SETGROUPDATA)(LPSPDATA_SETGROUPDATA);
  189. typedef HRESULT (WINAPI *LPSP_SETGROUPNAME)(LPSPDATA_SETGROUPNAME);
  190. typedef HRESULT (WINAPI *LPSP_SETGROUPOWNER)(LPSPDATA_SETGROUPOWNER);
  191. typedef HRESULT (WINAPI *LPSP_SETPLAYERDATA)(LPSPDATA_SETPLAYERDATA);
  192. typedef HRESULT (WINAPI *LPSP_SETPLAYERNAME)(LPSPDATA_SETPLAYERNAME);
  193. typedef HRESULT (WINAPI *LPSP_SHUTDOWN)(LPSPDATA_SHUTDOWN);
  194. typedef HRESULT (WINAPI *LPSP_STARTSESSION)(LPSPDATA_STARTSESSION);
  195. // Callback table for dplay to call into service provider
  196. typedef struct SP_CALLBACKS
  197. {
  198. DWORD dwSize;
  199. DWORD dwDPlayVersion;
  200. LPSP_ADDGROUPTOGROUP AddGroupToGroup;
  201. LPSP_ADDPLAYERTOGROUP AddPlayerToGroup;
  202. LPSP_BUILDPARENTALHEIRARCHY BuildParentalHeirarchy;
  203. LPSP_CLOSE Close;
  204. LPSP_CREATEGROUP CreateGroup;
  205. LPSP_CREATEGROUPINGROUP CreateGroupInGroup;
  206. LPSP_CREATEPLAYER CreatePlayer;
  207. LPSP_DELETEGROUPFROMGROUP DeleteGroupFromGroup;
  208. LPSP_DELETEPLAYERFROMGROUP DeletePlayerFromGroup;
  209. LPSP_DESTROYGROUP DestroyGroup;
  210. LPSP_DESTROYPLAYER DestroyPlayer;
  211. LPSP_ENUMSESSIONS EnumSessions;
  212. LPSP_GETCAPS GetCaps;
  213. LPSP_GETGROUPCONNECTIONSETTINGS GetGroupConnectionSettings;
  214. LPSP_GETGROUPDATA GetGroupData;
  215. LPSP_GETPLAYERCAPS GetPlayerCaps;
  216. LPSP_GETPLAYERDATA GetPlayerData;
  217. LPSP_OPEN Open;
  218. LPSP_SEND Send;
  219. LPSP_SENDCHATMESSAGE SendChatMessage;
  220. LPSP_SETGROUPCONNECTIONSETTINGS SetGroupConnectionSettings;
  221. LPSP_SETGROUPDATA SetGroupData;
  222. LPSP_SETGROUPNAME SetGroupName;
  223. LPSP_SETPLAYERDATA SetPlayerData;
  224. LPSP_SETPLAYERNAME SetPlayerName;
  225. LPSP_SHUTDOWN Shutdown;
  226. LPSP_STARTSESSION StartSession;
  227. LPSP_SETGROUPOWNER SetGroupOwner;
  228. } SP_CALLBACKS, * LPSP_CALLBACKS;
  229. // CALLBACK DATA STRUCTURES. These are passed by DPLAY to the sp when
  230. // the callback is invoked
  231. typedef struct SPDATA_ADDGROUPTOGROUP
  232. {
  233. DWORD dwSize; // Size of this structure
  234. LPDPLOBBYSP lpISP; // Pointer to an IDPLobbySP interface
  235. DWORD dwParentID; // ID of the parent group
  236. DWORD dwGroupID; // ID of the new group to be created (output param)
  237. } SPDATA_ADDGROUPTOGROUP;
  238. typedef struct SPDATA_ADDPLAYERTOGROUP
  239. {
  240. DWORD dwSize; // Size of this structure
  241. LPDPLOBBYSP lpISP; // Pointer to an IDPLobbySP interface
  242. DWORD dwGroupID; // ID of the group
  243. DWORD dwPlayerID; // ID of the player
  244. } SPDATA_ADDPLAYERTOGROUP;
  245. typedef struct SPDATA_ADDREMOTEGROUPTOGROUP
  246. {
  247. DWORD dwSize; // Size of this structure
  248. LPDPLOBBYSP lpISP; // Pointer to an IDPLobbySP interface
  249. DWORD dwAnchorID; // ID of the anchor group (group the shortcut is added to)
  250. DWORD dwGroupID; // ID of the group the shortcut references
  251. DWORD dwParentID; // ID of the group's parent (not the group being added to)
  252. LPDPNAME lpName; // Pointer to DPNAME struct for group name
  253. DWORD dwGroupFlags; // Group flags for the group the shortcut references
  254. DWORD dwGroupOwnerID; // ID of the owner of the group the shortcut references
  255. } SPDATA_ADDREMOTEGROUPTOGROUP;
  256. typedef struct SPDATA_ADDREMOTEPLAYERTOGROUP
  257. {
  258. DWORD dwSize; // Size of this structure
  259. LPDPLOBBYSP lpISP; // Pointer to an IDPLobbySP interface
  260. DWORD dwGroupID; // ID of the group
  261. DWORD dwPlayerID; // ID of the player
  262. DWORD dwPlayerFlags; // Player flags
  263. LPDPNAME lpName; // Name of the player
  264. } SPDATA_ADDREMOTEPLAYERTOGROUP;
  265. typedef struct SPDATA_BUILDPARENTALHEIRARCHY
  266. {
  267. DWORD dwSize; // Size of this structure
  268. LPDPLOBBYSP lpISP; // Pointer to an IDPLobbySP interface
  269. DWORD dwGroupID; // ID of the group to build the heirarchy for
  270. DWORD dwMessage; // Message type the lobby errored on
  271. DWORD dwParentID; // ID of the parent (for an AddGroupToGroup call)
  272. } SPDATA_BUILDPARENTALHEIRARCHY;
  273. typedef struct SPDATA_CLOSE
  274. {
  275. DWORD dwSize; // Size of this structure
  276. LPDPLOBBYSP lpISP; // Pointer to an IDPLobbySP interface
  277. } SPDATA_CLOSE;
  278. typedef struct SPDATA_CREATEGROUP
  279. {
  280. DWORD dwSize; // Size of this structure
  281. LPDPLOBBYSP lpISP; // Pointer to an IDPLobbySP interface
  282. DWORD dwGroupID; // ID of the group (output parameter)
  283. LPDPNAME lpName; // Pointer to DPNAME struct for group name
  284. LPVOID lpData; // Pointer to group data
  285. DWORD dwDataSize; // Size of the group data
  286. DWORD dwFlags; // CreateGroup flags
  287. DWORD dwGroupOwnerID; // ID of the group's owner
  288. } SPDATA_CREATEGROUP;
  289. typedef struct SPDATA_CREATEGROUPINGROUP
  290. {
  291. DWORD dwSize; // Size of this structure
  292. LPDPLOBBYSP lpISP; // Pointer to an IDPLobbySP interface
  293. DWORD dwParentID; // ID of the parent group
  294. DWORD dwGroupID; // ID of the new group to be created (output param)
  295. LPDPNAME lpName; // Pointer to DPNAME struct for group name
  296. LPVOID lpData; // Pointer to group data
  297. DWORD dwDataSize; // Size of the group data
  298. DWORD dwFlags; // CreateGroup flags
  299. DWORD dwGroupOwnerID; // ID of the group's owner
  300. } SPDATA_CREATEGROUPINGROUP;
  301. typedef struct SPDATA_CREATEREMOTEGROUP
  302. {
  303. DWORD dwSize; // Size of this structure
  304. LPDPLOBBYSP lpISP; // Pointer to an IDPLobbySP interface
  305. DWORD dwGroupID; // ID of the group (output parameter)
  306. LPDPNAME lpName; // Pointer to DPNAME struct for group name
  307. LPVOID lpData; // Pointer to group data
  308. DWORD dwDataSize; // Size of the group data
  309. DWORD dwFlags; // CreateGroup flags
  310. DWORD dwGroupOwnerID; // ID of the group's owner
  311. } SPDATA_CREATEREMOTEGROUP;
  312. typedef struct SPDATA_CREATEREMOTEGROUPINGROUP
  313. {
  314. DWORD dwSize; // Size of this structure
  315. LPDPLOBBYSP lpISP; // Pointer to an IDPLobbySP interface
  316. DWORD dwParentID; // ID of the parent group
  317. DWORD dwGroupID; // ID of the new group to be created (output param)
  318. LPDPNAME lpName; // Pointer to DPNAME struct for group name
  319. DWORD dwFlags; // CreateGroupInGroup flags
  320. DWORD dwGroupOwnerID; // ID of the group's owner
  321. } SPDATA_CREATEREMOTEGROUPINGROUP;
  322. typedef struct SPDATA_CREATEPLAYER
  323. {
  324. DWORD dwSize; // Size of this structure
  325. LPDPLOBBYSP lpISP; // Pointer to an IDPLobbySP interface
  326. DWORD dwPlayerID; // ID of the group (output parameter)
  327. LPDPNAME lpName; // Pointer to DPNAME struct for group name
  328. LPVOID lpData; // Pointer to group data
  329. DWORD dwDataSize; // Size of the group data
  330. DWORD dwFlags; // CreatePlayer flags
  331. } SPDATA_CREATEPLAYER;
  332. typedef struct SPDATA_DELETEGROUPFROMGROUP
  333. {
  334. DWORD dwSize; // Size of this structure
  335. LPDPLOBBYSP lpISP; // Pointer to an IDPLobbySP interface
  336. DWORD dwParentID; // ID of the Parent Group
  337. DWORD dwGroupID; // ID of the Group to be deleted
  338. } SPDATA_DELETEGROUPFROMGROUP;
  339. typedef struct SPDATA_DELETEPLAYERFROMGROUP
  340. {
  341. DWORD dwSize; // Size of this structure
  342. LPDPLOBBYSP lpISP; // Pointer to an IDPLobbySP interface
  343. DWORD dwGroupID; // ID of the Group
  344. DWORD dwPlayerID; // ID of the Player
  345. } SPDATA_DELETEPLAYERFROMGROUP;
  346. typedef struct SPDATA_DELETEREMOTEGROUPFROMGROUP
  347. {
  348. DWORD dwSize; // Size of this structure
  349. LPDPLOBBYSP lpISP; // Pointer to an IDPLobbySP interface
  350. DWORD dwParentID; // ID of the Parent Group
  351. DWORD dwGroupID; // ID of the Group to be deleted
  352. } SPDATA_DELETEREMOTEGROUPFROMGROUP;
  353. typedef struct SPDATA_DELETEREMOTEPLAYERFROMGROUP
  354. {
  355. DWORD dwSize; // Size of this structure
  356. LPDPLOBBYSP lpISP; // Pointer to an IDPLobbySP interface
  357. DWORD dwGroupID; // ID of the Group
  358. DWORD dwPlayerID; // ID of the Player
  359. } SPDATA_DELETEREMOTEPLAYERFROMGROUP;
  360. typedef struct SPDATA_DESTROYGROUP
  361. {
  362. DWORD dwSize; // Size of this structure
  363. LPDPLOBBYSP lpISP; // Pointer to an IDPLobbySP interface
  364. DWORD dwGroupID; // ID of the player on the lobby
  365. } SPDATA_DESTROYGROUP;
  366. typedef struct SPDATA_DESTROYREMOTEGROUP
  367. {
  368. DWORD dwSize; // Size of this structure
  369. LPDPLOBBYSP lpISP; // Pointer to an IDPLobbySP interface
  370. DWORD dwGroupID; // ID of the player on the lobby
  371. } SPDATA_DESTROYREMOTEGROUP;
  372. typedef struct SPDATA_DESTROYPLAYER
  373. {
  374. DWORD dwSize; // Size of this structure
  375. LPDPLOBBYSP lpISP; // Pointer to an IDPLobbySP interface
  376. DWORD dwPlayerID; // ID of the player on the lobby
  377. } SPDATA_DESTROYPLAYER;
  378. typedef struct SPDATA_ENUMSESSIONS
  379. {
  380. DWORD dwSize; // Size of this structure
  381. LPDPLOBBYSP lpISP; // Pointer to an IDPLobbySP interface
  382. LPDPSESSIONDESC2 lpsd; // SessionDesc to enumerate on
  383. DWORD dwTimeout; // Timeout value
  384. DWORD dwFlags; // Flags
  385. } SPDATA_ENUMSESSIONS;
  386. typedef struct SPDATA_ENUMSESSIONSRESPONSE
  387. {
  388. DWORD dwSize; // Size of this structure
  389. LPDPSESSIONDESC2 lpsd; // SessionDesc returned by server
  390. } SPDATA_ENUMSESSIONSRESPONSE;
  391. typedef struct SPDATA_GETCAPS
  392. {
  393. DWORD dwSize; // Size of this structure
  394. LPDPLOBBYSP lpISP; // Pointer to an IDPLobbySP interface
  395. DWORD dwFlags; // Flags
  396. LPDPCAPS lpcaps; // Pointer to DPCAPS structure
  397. } SPDATA_GETCAPS;
  398. typedef struct SPDATA_GETGROUPCONNECTIONSETTINGS
  399. {
  400. DWORD dwSize; // Size of this structure
  401. DWORD dwFlags; // Flags
  402. LPDPLOBBYSP lpISP; // Pointer to an IDPLobbySP interface
  403. DWORD dwGroupID; // ID of the Group
  404. LPDWORD lpdwBufferSize; // Pointer to the size of the buffer
  405. LPVOID lpBuffer; // Pointer to a buffer
  406. } SPDATA_GETGROUPCONNECTIONSETTINGS;
  407. typedef struct SPDATA_GETGROUPDATA
  408. {
  409. DWORD dwSize; // Size of this structure
  410. LPDPLOBBYSP lpISP; // Pointer to an IDPLobbySP interface
  411. DWORD dwGroupID; // ID of the Group
  412. LPDWORD lpdwDataSize; // Pointer to the size of the lpData buffer
  413. LPVOID lpData; // Pointer to a data buffer
  414. } SPDATA_GETGROUPDATA;
  415. typedef struct SPDATA_GETPLAYERCAPS
  416. {
  417. DWORD dwSize; // Size of this structure
  418. LPDPLOBBYSP lpISP; // Pointer to an IDPLobbySP interface
  419. DWORD dwFlags; // Flags
  420. DWORD dwPlayerID; // ID of the Player
  421. LPDPCAPS lpcaps; // Pointer to DPCAPS structure
  422. } SPDATA_GETPLAYERCAPS;
  423. typedef struct SPDATA_GETPLAYERDATA
  424. {
  425. DWORD dwSize; // Size of this structure
  426. LPDPLOBBYSP lpISP; // Pointer to an IDPLobbySP interface
  427. DWORD dwPlayerID; // ID of the Player
  428. LPDWORD lpdwDataSize; // Pointer to the size of the lpData buffer
  429. LPVOID lpData; // Pointer to a data buffer
  430. } SPDATA_GETPLAYERDATA;
  431. typedef struct SPDATA_HANDLEMESSAGE
  432. {
  433. DWORD dwSize; // Size of this structure
  434. DWORD dwFromID; // ID of the player from
  435. DWORD dwToID; // ID of the player to
  436. LPVOID lpBuffer; // Message buffer
  437. DWORD dwBufSize; // Size of the message buffer
  438. DWORD dwFlags; // Message flags
  439. } SPDATA_HANDLEMESSAGE;
  440. typedef struct SPDATA_OPEN
  441. {
  442. DWORD dwSize; // Size of this structure (including data)
  443. LPDPLOBBYSP lpISP; // Pointer to an IDPLobbySP interface
  444. LPDPSESSIONDESC2 lpsd; // Pointer to SessionDesc of the Lobby to open
  445. DWORD dwFlags; // Flags
  446. LPCDPCREDENTIALS lpCredentials; // Pointer to a Credentials structure
  447. } SPDATA_OPEN;
  448. typedef struct SPDATA_SEND
  449. {
  450. DWORD dwSize; // Size of this structure
  451. LPDPLOBBYSP lpISP; // Pointer to an IDPLobbySP interface
  452. DWORD dwFromID; // ID of the player from
  453. DWORD dwToID; // ID of the player to
  454. DWORD dwFlags; // Flags
  455. LPVOID lpBuffer; // Message buffer
  456. DWORD dwBufSize; // Size of the message buffer
  457. } SPDATA_SEND;
  458. typedef struct SPDATA_CHATMESSAGE
  459. {
  460. DWORD dwSize; // Size of this structure
  461. LPDPLOBBYSP lpISP; // Pointer to an IDPLobbySP interface
  462. DWORD dwFromID; // ID of the player from
  463. DWORD dwToID; // ID of the player to
  464. DWORD dwFlags; // Send Flags
  465. LPDPCHAT lpChat; // Pointer to a DPCHAT structure
  466. } SPDATA_CHATMESSAGE;
  467. typedef struct SPDATA_SETGROUPCONNECTIONSETTINGS
  468. {
  469. DWORD dwSize; // Size of this structure
  470. DWORD dwFlags; // Flags
  471. LPDPLOBBYSP lpISP; // Pointer to an IDPLobbySP interface
  472. DWORD dwGroupID; // ID of the group
  473. LPDPLCONNECTION lpConn; // Pointer to a DPLCONNECTION structure
  474. } SPDATA_SETGROUPCONNECTIONSETTINGS;
  475. typedef struct SPDATA_SETGROUPDATA
  476. {
  477. DWORD dwSize; // Size of this structure
  478. LPDPLOBBYSP lpISP; // Pointer to an IDPLobbySP interface
  479. DWORD dwGroupID; // ID of the group
  480. LPVOID lpData; // Pointer to the new group data
  481. DWORD dwDataSize; // Size of lpData
  482. DWORD dwFlags; // Flags
  483. } SPDATA_SETGROUPDATA;
  484. typedef struct SPDATA_SETGROUPNAME
  485. {
  486. DWORD dwSize; // Size of this structure
  487. LPDPLOBBYSP lpISP; // Pointer to an IDPLobbySP interface
  488. DWORD dwGroupID; // ID of the group
  489. LPDPNAME lpName; // Pointer to the new DPNAME struct
  490. DWORD dwFlags; // Flags
  491. } SPDATA_SETGROUPNAME;
  492. typedef struct SPDATA_SETREMOTEGROUPNAME
  493. {
  494. DWORD dwSize; // Size of this structure
  495. LPDPLOBBYSP lpISP; // Pointer to an IDPLobbySP interface
  496. DWORD dwGroupID; // ID of the group
  497. LPDPNAME lpName; // Pointer to the new DPNAME struct
  498. DWORD dwFlags; // Flags
  499. } SPDATA_SETREMOTEGROUPNAME;
  500. typedef struct SPDATA_SETGROUPOWNER
  501. {
  502. DWORD dwSize; // Size of this structure
  503. LPDPLOBBYSP lpISP; // Pointer to an IDPLobbySP interface
  504. DWORD dwGroupID; // ID of the group
  505. DWORD dwOwnerID; // ID of the group's owner
  506. } SPDATA_SETGROUPOWNER;
  507. typedef struct SPDATA_SETREMOTEGROUPOWNER
  508. {
  509. DWORD dwSize; // Size of this structure
  510. DWORD dwGroupID; // ID of the group
  511. DWORD dwOwnerID; // ID of the group's owner
  512. } SPDATA_SETREMOTEGROUPOWNER;
  513. typedef struct SPDATA_SETPLAYERDATA
  514. {
  515. DWORD dwSize; // Size of this structure
  516. LPDPLOBBYSP lpISP; // Pointer to an IDPLobbySP interface
  517. DWORD dwPlayerID; // ID of the player
  518. LPVOID lpData; // Pointer to the new player data
  519. DWORD dwDataSize; // Size of lpData
  520. DWORD dwFlags; // Flags
  521. } SPDATA_SETPLAYERDATA;
  522. typedef struct SPDATA_SETPLAYERNAME
  523. {
  524. DWORD dwSize; // Size of this structure
  525. LPDPLOBBYSP lpISP; // Pointer to an IDPLobbySP interface
  526. DWORD dwPlayerID; // ID of the player
  527. LPDPNAME lpName; // Pointer to the new DPNAME struct
  528. DWORD dwFlags; // Flags
  529. } SPDATA_SETPLAYERNAME;
  530. typedef struct SPDATA_SETREMOTEPLAYERNAME
  531. {
  532. DWORD dwSize; // Size of this structure
  533. LPDPLOBBYSP lpISP; // Pointer to an IDPLobbySP interface
  534. DWORD dwPlayerID; // ID of the player
  535. LPDPNAME lpName; // Pointer to the new DPNAME struct
  536. DWORD dwFlags; // Flags
  537. } SPDATA_SETREMOTEPLAYERNAME;
  538. typedef struct SPDATA_SETSESSIONDESC
  539. {
  540. DWORD dwSize; // Size of this structure
  541. LPDPSESSIONDESC2 lpsd; // Pointer to a SessionDesc struct
  542. LPDPLOBBYSP lpISP; // Pointer to an IDPLobbySP interface
  543. } SPDATA_SETSESSIONDESC;
  544. typedef struct SPDATA_SHUTDOWN
  545. {
  546. DWORD dwSize; // Size of this structure
  547. LPDPLOBBYSP lpISP; // Pointer to an IDPLobbySP interface
  548. } SPDATA_SHUTDOWN;
  549. typedef struct SPDATA_STARTSESSION
  550. {
  551. DWORD dwSize; // Size of this structure
  552. LPDPLOBBYSP lpISP; // Pointer to an IDPLobbySP interface
  553. DWORD dwFlags; // Flags
  554. DWORD dwGroupID; // ID of the group who's session to start
  555. } SPDATA_STARTSESSION;
  556. typedef struct SPDATA_STARTSESSIONCOMMAND
  557. {
  558. DWORD dwFlags; // Flags
  559. DWORD dwGroupID; // Group ID of the group to start the session on
  560. DWORD dwHostID; // ID of the host player for the session
  561. LPDPLCONNECTION lpConn; // Pointer to a DPLCONNECTION struct for the session information
  562. } SPDATA_STARTSESSIONCOMMAND;
  563. // Data structure passed to the service provider at DPLSPInit
  564. typedef struct SPDATA_INIT
  565. {
  566. LPSP_CALLBACKS lpCB; // Lobby Provider fills in entry points
  567. DWORD dwSPVersion; // Lobby provider fills in version number 16 | 16 , major | minor version
  568. LPDPLOBBYSP lpISP; // DPLobbySP interface pointer
  569. LPDPADDRESS lpAddress; // DPADDRESS of the Lobby (partial or complete)
  570. DWORD dwReserved1; // Reserved DWORD from the registry entry for the LP
  571. DWORD dwReserved2; // Reserved DWORD from the registry entry for the LP
  572. } SPDATA_INIT, * LPSPDATA_INIT;
  573. // This is the function that DPLobby calls to
  574. // get the SP to fill in callbacks
  575. typedef HRESULT (WINAPI *LPSP_INIT)(LPSPDATA_INIT);
  576. HRESULT WINAPI DPLSPInit(LPSPDATA_INIT);
  577. /****************************************************************************
  578. *
  579. * IDirectPlayLobby interface macros
  580. *
  581. ****************************************************************************/
  582. #if !defined(__cplusplus) || defined(CINTERFACE)
  583. #define IDPLobbySP_QueryInterface(p,a,b) (p)->lpVtbl->QueryInterface(p,a,b)
  584. #define IDPLobbySP_AddRef(p) (p)->lpVtbl->AddRef(p)
  585. #define IDPLobbySP_Release(p) (p)->lpVtbl->Release(p)
  586. #define IDPLobbySP_AddGroupToGroup(p,a) (p)->lpVtbl->AddGroupToGroup(p,a)
  587. #define IDPLobbySP_AddPlayerToGroup(p,a) (p)->lpVtbl->AddPlayerToGroup(p,a)
  588. #define IDPLobbySP_CreateCompoundAddress(p,a,b,c,d) (p)->lpVtbl->CreateCompoundAddress(p,a,b,c,d)
  589. #define IDPLobbySP_CreateGroup(p,a) (p)->lpVtbl->CreateGroup(p,a)
  590. #define IDPLobbySP_CreateGroupInGroup(p,a) (p)->lpVtbl->CreateGroupInGroup(p,a)
  591. #define IDPLobbySP_DeleteGroupFromGroup(p,a) (p)->lpVtbl->DeleteGroupFromGroup(p,a)
  592. #define IDPLobbySP_DeletePlayerFromGroup(p,a) (p)->lpVtbl->DeletePlayerFromGroup(p,a)
  593. #define IDPLobbySP_DestroyGroup(p,a) (p)->lpVtbl->DestroyGroup(p,a)
  594. #define IDPLobbySP_EnumAddress(p,a,b,c,d) (p)->lpVtbl->EnumAddress(p,a,b,c,d)
  595. #define IDPLobbySP_EnumSessionsResponse(p,a) (p)->lpVtbl->EnumSessionsResponse(p,a)
  596. #define IDPLobbySP_GetSPDataPointer(p,a) (p)->lpVtbl->GetSPDataPointer(p,a)
  597. #define IDPLobbySP_HandleMessage(p,a) (p)->lpVtbl->HandleMessage(p,a)
  598. #define IDPLobbySP_SetGroupName(p,a) (p)->lpVtbl->SetGroupName(p,a)
  599. #define IDPLobbySP_SetPlayerName(p,a) (p)->lpVtbl->SetPlayerName(p,a)
  600. #define IDPLobbySP_SetSessionDesc(p,a) (p)->lpVtbl->SetSessionDesc(p,a)
  601. #define IDPLobbySP_StartSession(p,a) (p)->lpVtbl->StartSession(p,a)
  602. #define IDPLobbySP_SetGroupOwner(p,a) (p)->lpVtbl->SetGroupOwner(p,a)
  603. #define IDPLobbySP_SetSPDataPointer(p,a) (p)->lpVtbl->SetSPDataPointer(p,a)
  604. #else /* C++ */
  605. #define IDPLobbySP_QueryInterface(p,a,b) (p)->QueryInterface(a,b)
  606. #define IDPLobbySP_AddRef(p) (p)->AddRef()
  607. #define IDPLobbySP_Release(p) (p)->Release()
  608. #define IDPLobbySP_AddGroupToGroup(p,a) (p)->AddGroupToGroup(a)
  609. #define IDPLobbySP_AddPlayerToGroup(p,a) (p)->AddPlayerToGroup(a)
  610. #define IDPLobbySP_CreateCompoundAddress(p,a,b,c,d) (p)->CreateCompoundAddress(a,b,c,d)
  611. #define IDPLobbySP_CreateGroup(p,a) (p)->CreateGroup(a)
  612. #define IDPLobbySP_CreateGroupInGroup(p,a) (p)->CreateGroupInGroup(a)
  613. #define IDPLobbySP_DeleteGroupFromGroup(p,a) (p)->DeleteGroupFromGroup(a)
  614. #define IDPLobbySP_DeletePlayerFromGroup(p,a) (p)->DeletePlayerFromGroup(a)
  615. #define IDPLobbySP_DestroyGroup(p,a) (p)->DestroyGroup(a)
  616. #define IDPLobbySP_EnumAddress(p,a,b,c,d) (p)->EnumAddress(a,b,c,d)
  617. #define IDPLobbySP_EnumSessionsResponse(p,a) (p)->EnumSessionsResponse(a)
  618. #define IDPLobbySP_GetSPDataPointer(p,a) (p)->GetSPDataPointer(a)
  619. #define IDPLobbySP_HandleMessage(p,a) (p)->HandleMessage(a)
  620. #define IDPLobbySP_SetGroupName(p,a) (p)->SetGroupName(a)
  621. #define IDPLobbySP_SetPlayerName(p,a) (p)->SetPlayerName(a)
  622. #define IDPLobbySP_SetSessionDesc(p,a) (p)->SetSessionDesc(a)
  623. #define IDPLobbySP_StartSession(p,a) (p)->StartSession(a)
  624. #define IDPLobbySP_SetGroupOwner(p,a) (p)->SetGroupOwner(a)
  625. #define IDPLobbySP_SetSPDataPointer(p,a) (p)->SetSPDataPointer(a)
  626. #endif /* C or C++ */
  627. #ifdef __cplusplus
  628. };
  629. #endif // __cplusplus
  630. #endif // __LOBBYSP_INCLUDED__