2 * Copyright 2001 Peter Hunnisett
4 * This library is free software; you can redistribute it and/or
5 * modify it under the terms of the GNU Lesser General Public
6 * License as published by the Free Software Foundation; either
7 * version 2.1 of the License, or (at your option) any later version.
9 * This library is distributed in the hope that it will be useful,
10 * but WITHOUT ANY WARRANTY; without even the implied warranty of
11 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
12 * Lesser General Public License for more details.
14 * You should have received a copy of the GNU Lesser General Public
15 * License along with this library; if not, write to the Free Software
16 * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
19 #ifndef __WINE_LOBBY_SP_H
20 #define __WINE_LOBBY_SP_H
29 /* GUID for IDPLobbySP {5A4E5A20-2CED-11d0-A889-00A0C905433C} */
30 DEFINE_GUID(IID_IDPLobbySP, 0x5a4e5a20, 0x2ced, 0x11d0, 0xa8, 0x89, 0x0, 0xa0, 0xc9, 0x5, 0x43, 0x3c);
31 typedef struct IDPLobbySP IDPLobbySP, *LPDPLOBBYSP;
33 /* For SP. Top 16 bits is dplay, bottom 16 is SP */
34 #define DPLSP_MAJORVERSION 0x00050000
36 typedef struct SPDATA_ADDGROUPTOGROUP
42 } SPDATA_ADDGROUPTOGROUP, *LPSPDATA_ADDGROUPTOGROUP;
44 typedef struct SPDATA_ADDPLAYERTOGROUP
50 } SPDATA_ADDPLAYERTOGROUP, *LPSPDATA_ADDPLAYERTOGROUP;
52 typedef struct SPDATA_ADDREMOTEGROUPTOGROUP
61 } SPDATA_ADDREMOTEGROUPTOGROUP, *LPSPDATA_ADDREMOTEGROUPTOGROUP;
63 typedef struct SPDATA_ADDREMOTEPLAYERTOGROUP
71 } SPDATA_ADDREMOTEPLAYERTOGROUP, *LPSPDATA_ADDREMOTEPLAYERTOGROUP;
73 typedef struct SPDATA_BUILDPARENTALHEIRARCHY
80 } SPDATA_BUILDPARENTALHEIRARCHY, *LPSPDATA_BUILDPARENTALHEIRARCHY;
82 typedef struct SPDATA_CLOSE
86 } SPDATA_CLOSE, *LPSPDATA_CLOSE;
88 typedef struct SPDATA_CREATEGROUP
97 } SPDATA_CREATEGROUP, *LPSPDATA_CREATEGROUP;
99 typedef struct SPDATA_CREATEGROUPINGROUP
109 } SPDATA_CREATEGROUPINGROUP, *LPSPDATA_CREATEGROUPINGROUP;
111 typedef struct SPDATA_CREATEREMOTEGROUP
120 } SPDATA_CREATEREMOTEGROUP, *LPSPDATA_CREATEREMOTEGROUP;
122 typedef struct SPDATA_CREATEREMOTEGROUPINGROUP
130 } SPDATA_CREATEREMOTEGROUPINGROUP, *LPSPDATA_CREATEREMOTEGROUPINGROUP;
132 typedef struct SPDATA_CREATEPLAYER
141 } SPDATA_CREATEPLAYER, *LPSPDATA_CREATEPLAYER;
143 typedef struct SPDATA_DELETEGROUPFROMGROUP
149 } SPDATA_DELETEGROUPFROMGROUP, *LPSPDATA_DELETEGROUPFROMGROUP;
151 typedef struct SPDATA_DELETEPLAYERFROMGROUP
157 } SPDATA_DELETEPLAYERFROMGROUP, *LPSPDATA_DELETEPLAYERFROMGROUP;
159 typedef struct SPDATA_DELETEREMOTEGROUPFROMGROUP
165 } SPDATA_DELETEREMOTEGROUPFROMGROUP, *LPSPDATA_DELETEREMOTEGROUPFROMGROUP;
167 typedef struct SPDATA_DELETEREMOTEPLAYERFROMGROUP
173 } SPDATA_DELETEREMOTEPLAYERFROMGROUP, *LPSPDATA_DELETEREMOTEPLAYERFROMGROUP;
175 typedef struct SPDATA_DESTROYGROUP
180 } SPDATA_DESTROYGROUP, *LPSPDATA_DESTROYGROUP;
182 typedef struct SPDATA_DESTROYREMOTEGROUP
187 } SPDATA_DESTROYREMOTEGROUP, *LPSPDATA_DESTROYREMOTEGROUP;
189 typedef struct SPDATA_DESTROYPLAYER
194 } SPDATA_DESTROYPLAYER, *LPSPDATA_DESTROYPLAYER;
196 typedef struct SPDATA_ENUMSESSIONS
200 LPDPSESSIONDESC2 lpsd;
203 } SPDATA_ENUMSESSIONS, *LPSPDATA_ENUMSESSIONS;
205 typedef struct SPDATA_ENUMSESSIONSRESPONSE
208 LPDPSESSIONDESC2 lpsd;
209 } SPDATA_ENUMSESSIONSRESPONSE, *LPSPDATA_ENUMSESSIONSRESPONSE;
211 typedef struct SPDATA_GETCAPS
217 } SPDATA_GETCAPS, *LPSPDATA_GETCAPS;
219 typedef struct SPDATA_GETGROUPCONNECTIONSETTINGS
225 LPDWORD lpdwBufferSize;
227 } SPDATA_GETGROUPCONNECTIONSETTINGS, *LPSPDATA_GETGROUPCONNECTIONSETTINGS;
229 typedef struct SPDATA_GETGROUPDATA
234 LPDWORD lpdwDataSize;
236 } SPDATA_GETGROUPDATA, *LPSPDATA_GETGROUPDATA;
238 typedef struct SPDATA_GETPLAYERCAPS
245 } SPDATA_GETPLAYERCAPS, *LPSPDATA_GETPLAYERCAPS;
247 typedef struct SPDATA_GETPLAYERDATA
252 LPDWORD lpdwDataSize;
254 } SPDATA_GETPLAYERDATA, *LPSPDATA_GETPLAYERDATA;
256 typedef struct SPDATA_HANDLEMESSAGE
263 } SPDATA_HANDLEMESSAGE, *LPSPDATA_HANDLEMESSAGE;
265 typedef struct SPDATA_OPEN
269 LPDPSESSIONDESC2 lpsd;
271 LPCDPCREDENTIALS lpCredentials;
272 } SPDATA_OPEN, *LPSPDATA_OPEN;
274 typedef struct SPDATA_SEND
283 } SPDATA_SEND, *LPSPDATA_SEND;
285 typedef struct SPDATA_CHATMESSAGE
293 } SPDATA_CHATMESSAGE, *LPSPDATA_CHATMESSAGE;
295 typedef struct SPDATA_SETGROUPCONNECTIONSETTINGS
301 LPDPLCONNECTION lpConn;
302 } SPDATA_SETGROUPCONNECTIONSETTINGS, *LPSPDATA_SETGROUPCONNECTIONSETTINGS;
304 typedef struct SPDATA_SETGROUPDATA
312 } SPDATA_SETGROUPDATA, *LPSPDATA_SETGROUPDATA;
314 typedef struct SPDATA_SETGROUPNAME
321 } SPDATA_SETGROUPNAME, *LPSPDATA_SETGROUPNAME;
323 typedef struct SPDATA_SETREMOTEGROUPNAME
330 } SPDATA_SETREMOTEGROUPNAME, *LPSPDATA_SETREMOTEGROUPNAME;
332 typedef struct SPDATA_SETPLAYERDATA
340 } SPDATA_SETPLAYERDATA, *LPSPDATA_SETPLAYERDATA;
342 typedef struct SPDATA_SETPLAYERNAME
349 } SPDATA_SETPLAYERNAME, *LPSPDATA_SETPLAYERNAME;
351 typedef struct SPDATA_SETREMOTEPLAYERNAME
358 } SPDATA_SETREMOTEPLAYERNAME, *LPSPDATA_SETREMOTEPLAYERNAME;
360 typedef struct SPDATA_SETSESSIONDESC
363 LPDPSESSIONDESC2 lpsd;
364 } SPDATA_SETSESSIONDESC, *LPSPDATA_SETSESSIONDESC;
366 typedef struct SPDATA_SHUTDOWN
370 } SPDATA_SHUTDOWN, *LPSPDATA_SHUTDOWN;
372 typedef struct SPDATA_STARTSESSION
378 } SPDATA_STARTSESSION, *LPSPDATA_STARTSESSION;
380 typedef struct SPDATA_STARTSESSIONCOMMAND
385 LPDPLCONNECTION lpConn;
386 } SPDATA_STARTSESSIONCOMMAND, *LPSPDATA_STARTSESSIONCOMMAND;
388 /* Prototypes for callbacks returned by DPLSPInit */
389 typedef HRESULT (WINAPI *LPSP_ADDGROUPTOGROUP)(LPSPDATA_ADDGROUPTOGROUP);
390 typedef HRESULT (WINAPI *LPSP_ADDPLAYERTOGROUP)(LPSPDATA_ADDPLAYERTOGROUP);
391 typedef HRESULT (WINAPI *LPSP_BUILDPARENTALHEIRARCHY)(LPSPDATA_BUILDPARENTALHEIRARCHY);
392 typedef HRESULT (WINAPI *LPSP_CLOSE)(LPSPDATA_CLOSE);
393 typedef HRESULT (WINAPI *LPSP_CREATEGROUP)(LPSPDATA_CREATEGROUP);
394 typedef HRESULT (WINAPI *LPSP_CREATEGROUPINGROUP)(LPSPDATA_CREATEGROUPINGROUP);
395 typedef HRESULT (WINAPI *LPSP_CREATEPLAYER)(LPSPDATA_CREATEPLAYER);
396 typedef HRESULT (WINAPI *LPSP_DELETEGROUPFROMGROUP)(LPSPDATA_DELETEGROUPFROMGROUP);
397 typedef HRESULT (WINAPI *LPSP_DELETEPLAYERFROMGROUP)(LPSPDATA_DELETEPLAYERFROMGROUP);
398 typedef HRESULT (WINAPI *LPSP_DESTROYGROUP)(LPSPDATA_DESTROYGROUP);
399 typedef HRESULT (WINAPI *LPSP_DESTROYPLAYER)(LPSPDATA_DESTROYPLAYER);
400 typedef HRESULT (WINAPI *LPSP_ENUMSESSIONS)(LPSPDATA_ENUMSESSIONS);
401 typedef HRESULT (WINAPI *LPSP_GETCAPS)(LPSPDATA_GETCAPS);
402 typedef HRESULT (WINAPI *LPSP_GETGROUPCONNECTIONSETTINGS)(LPSPDATA_GETGROUPCONNECTIONSETTINGS);
403 typedef HRESULT (WINAPI *LPSP_GETGROUPDATA)(LPSPDATA_GETGROUPDATA);
404 typedef HRESULT (WINAPI *LPSP_GETPLAYERCAPS)(LPSPDATA_GETPLAYERCAPS);
405 typedef HRESULT (WINAPI *LPSP_GETPLAYERDATA)(LPSPDATA_GETPLAYERDATA);
406 typedef HRESULT (WINAPI *LPSP_HANDLEMESSAGE)(LPSPDATA_HANDLEMESSAGE);
407 typedef HRESULT (WINAPI *LPSP_OPEN)(LPSPDATA_OPEN);
408 typedef HRESULT (WINAPI *LPSP_SEND)(LPSPDATA_SEND);
409 typedef HRESULT (WINAPI *LPSP_SENDCHATMESSAGE)(LPSPDATA_CHATMESSAGE);
410 typedef HRESULT (WINAPI *LPSP_SETGROUPCONNECTIONSETTINGS)(LPSPDATA_SETGROUPCONNECTIONSETTINGS);
411 typedef HRESULT (WINAPI *LPSP_SETGROUPDATA)(LPSPDATA_SETGROUPDATA);
412 typedef HRESULT (WINAPI *LPSP_SETGROUPNAME)(LPSPDATA_SETGROUPNAME);
413 typedef HRESULT (WINAPI *LPSP_SETPLAYERDATA)(LPSPDATA_SETPLAYERDATA);
414 typedef HRESULT (WINAPI *LPSP_SETPLAYERNAME)(LPSPDATA_SETPLAYERNAME);
415 typedef HRESULT (WINAPI *LPSP_SHUTDOWN)(LPSPDATA_SHUTDOWN);
416 typedef HRESULT (WINAPI *LPSP_STARTSESSION)(LPSPDATA_STARTSESSION);
418 /* Callback table for dplay to call into service provider */
419 typedef struct SP_CALLBACKS
423 LPSP_ADDGROUPTOGROUP AddGroupToGroup;
424 LPSP_ADDPLAYERTOGROUP AddPlayerToGroup;
425 LPSP_BUILDPARENTALHEIRARCHY BuildParentalHeirarchy;
427 LPSP_CREATEGROUP CreateGroup;
428 LPSP_CREATEGROUPINGROUP CreateGroupInGroup;
429 LPSP_CREATEPLAYER CreatePlayer;
430 LPSP_DELETEGROUPFROMGROUP DeleteGroupFromGroup;
431 LPSP_DELETEPLAYERFROMGROUP DeletePlayerFromGroup;
432 LPSP_DESTROYGROUP DestroyGroup;
433 LPSP_DESTROYPLAYER DestroyPlayer;
434 LPSP_ENUMSESSIONS EnumSessions;
435 LPSP_GETCAPS GetCaps;
436 LPSP_GETGROUPCONNECTIONSETTINGS GetGroupConnectionSettings;
437 LPSP_GETGROUPDATA GetGroupData;
438 LPSP_GETPLAYERCAPS GetPlayerCaps;
439 LPSP_GETPLAYERDATA GetPlayerData;
442 LPSP_SENDCHATMESSAGE SendChatMessage;
443 LPSP_SETGROUPCONNECTIONSETTINGS SetGroupConnectionSettings;
444 LPSP_SETGROUPDATA SetGroupData;
445 LPSP_SETGROUPNAME SetGroupName;
446 LPSP_SETPLAYERDATA SetPlayerData;
447 LPSP_SETPLAYERNAME SetPlayerName;
448 LPSP_SHUTDOWN Shutdown;
449 LPSP_STARTSESSION StartSession;
450 } SP_CALLBACKS, *LPSP_CALLBACKS;
452 typedef struct SPDATA_INIT
457 LPDPADDRESS lpAddress;
458 } SPDATA_INIT, *LPSPDATA_INIT;
460 typedef HRESULT (WINAPI *LPSP_INIT)(LPSPDATA_INIT);
461 HRESULT WINAPI DPLSPInit(LPSPDATA_INIT);
463 /* Define the COM interface */
464 #define INTERFACE IDPLobbySP
465 DECLARE_INTERFACE_(IDPLobbySP,IUnknown)
467 /*** IUnknown methods ***/
468 STDMETHOD_(HRESULT,QueryInterface)(THIS_ REFIID riid, void** ppvObject) PURE;
469 STDMETHOD_(ULONG,AddRef)(THIS) PURE;
470 STDMETHOD_(ULONG,Release)(THIS) PURE;
471 /*** IDPLobbySP methods ***/
472 STDMETHOD(AddGroupToGroup)(THIS_ LPSPDATA_ADDREMOTEGROUPTOGROUP argtg ) PURE;
473 STDMETHOD(AddPlayerToGroup)(THIS_ LPSPDATA_ADDREMOTEPLAYERTOGROUP arptg ) PURE;
474 STDMETHOD(CreateGroup)(THIS_ LPSPDATA_CREATEREMOTEGROUP crg ) PURE;
475 STDMETHOD(CreateGroupInGroup)(THIS_ LPSPDATA_CREATEREMOTEGROUPINGROUP crgig ) PURE;
476 STDMETHOD(DeleteGroupFromGroup)(THIS_ LPSPDATA_DELETEREMOTEGROUPFROMGROUP drgfg ) PURE;
477 STDMETHOD(DeletePlayerFromGroup)(THIS_ LPSPDATA_DELETEREMOTEPLAYERFROMGROUP drpfg ) PURE;
478 STDMETHOD(DestroyGroup)(THIS_ LPSPDATA_DESTROYREMOTEGROUP drg ) PURE;
479 STDMETHOD(EnumSessionsResponse)(THIS_ LPSPDATA_ENUMSESSIONSRESPONSE er ) PURE;
480 STDMETHOD(GetSPDataPointer)(THIS_ LPVOID * lplpData ) PURE;
481 STDMETHOD(HandleMessage)(THIS_ LPSPDATA_HANDLEMESSAGE hm ) PURE;
482 STDMETHOD(SendChatMessage)(THIS_ LPSPDATA_CHATMESSAGE cm ) PURE;
483 STDMETHOD(SetGroupName)(THIS_ LPSPDATA_SETREMOTEGROUPNAME srgn ) PURE;
484 STDMETHOD(SetPlayerName)(THIS_ LPSPDATA_SETREMOTEPLAYERNAME srpn ) PURE;
485 STDMETHOD(SetSessionDesc)(THIS_ LPSPDATA_SETSESSIONDESC ssd ) PURE;
486 STDMETHOD(SetSPDataPointer)(THIS_ LPVOID lpData ) PURE;
487 STDMETHOD(StartSession)(THIS_ LPSPDATA_STARTSESSIONCOMMAND ssc ) PURE;
491 #if !defined (__cplusplus) || defined(CINTERFACE)
492 /*** IUnknown methods ***/
493 #define IDPLobbySP_QueryInterface(p,a,b) (p)->lpVtbl->QueryInterface(p,a,b)
494 #define IDPLobbySP_AddRef(p) (p)->lpVtbl->AddRef(p)
495 #define IDPLobbySP_Release(p) (p)->lpVtbl->Release(p)
497 /*** IDPLobbySP methods ***/
498 #define IDPLobbySP_AddGroupToGroup(p,a) (p)->lpVtbl->AddGroupToGroup(p,a)
499 #define IDPLobbySP_AddPlayerToGroup(p,a) (p)->lpVtbl->AddPlayerToGroup(p,a)
500 #define IDPLobbySP_CreateGroup(p,a) (p)->lpVtbl->CreateGroup(p,a)
501 #define IDPLobbySP_CreateGroupInGroup(p,a) (p)->lpVtbl->CreateGroupInGroup(p,a)
502 #define IDPLobbySP_DeleteGroupFromGroup(p,a) (p)->lpVtbl->DeleteGroupFromGroup(p,a)
503 #define IDPLobbySP_DeletePlayerFromGroup(p,a) (p)->lpVtbl->DeletePlayerFromGroup(p,a)
504 #define IDPLobbySP_DestroyGroup(p,a) (p)->lpVtbl->DestroyGroup(p,a)
505 #define IDPLobbySP_EnumSessionsResponse(p,a) (p)->lpVtbl->EnumSessionsResponse(p,a)
506 #define IDPLobbySP_GetSPDataPointer(p,a) (p)->lpVtbl->GetSPDataPointer(p,a)
507 #define IDPLobbySP_HandleMessage(p,a) (p)->lpVtbl->HandleMessage(p,a)
508 #define IDPLobbySP_SetGroupName(p,a) (p)->lpVtbl->SetGroupName(p,a)
509 #define IDPLobbySP_SetPlayerName(p,a) (p)->lpVtbl->SetPlayerName(p,a)
510 #define IDPLobbySP_SetSessionDesc(p,a) (p)->lpVtbl->SetSessionDesc(p,a)
511 #define IDPLobbySP_StartSession(p,a) (p)->lpVtbl->StartSession(p,a)
512 #define IDPLobbySP_SetSPDataPointer(p,a) (p)->lpVtbl->SetSPDataPointer(p,a)
515 /* This variable is exported from the DLL at ordinal 6 to be accessed by the
516 * SP directly. This is the same variable that the DP SP will use.
518 extern DWORD gdwDPlaySPRefCount;