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
24 /* GUID for IDPLobbySP {5A4E5A20-2CED-11d0-A889-00A0C905433C} */
25 DEFINE_GUID(IID_IDPLobbySP
, 0x5a4e5a20, 0x2ced, 0x11d0, 0xa8, 0x89, 0x0, 0xa0, 0xc9, 0x5, 0x43, 0x3c);
26 typedef struct IDPLobbySP IDPLobbySP
, *LPDPLOBBYSP
;
28 /* For SP. Top 16 bits is dplay, bottom 16 is SP */
29 #define DPLSP_MAJORVERSION 0x00050000
31 typedef struct SPDATA_ADDGROUPTOGROUP
37 } SPDATA_ADDGROUPTOGROUP
, *LPSPDATA_ADDGROUPTOGROUP
;
39 typedef struct SPDATA_ADDPLAYERTOGROUP
45 } SPDATA_ADDPLAYERTOGROUP
, *LPSPDATA_ADDPLAYERTOGROUP
;
47 typedef struct SPDATA_ADDREMOTEGROUPTOGROUP
56 } SPDATA_ADDREMOTEGROUPTOGROUP
, *LPSPDATA_ADDREMOTEGROUPTOGROUP
;
58 typedef struct SPDATA_ADDREMOTEPLAYERTOGROUP
66 } SPDATA_ADDREMOTEPLAYERTOGROUP
, *LPSPDATA_ADDREMOTEPLAYERTOGROUP
;
68 typedef struct SPDATA_BUILDPARENTALHEIRARCHY
75 } SPDATA_BUILDPARENTALHEIRARCHY
, *LPSPDATA_BUILDPARENTALHEIRARCHY
;
77 typedef struct SPDATA_CLOSE
81 } SPDATA_CLOSE
, *LPSPDATA_CLOSE
;
83 typedef struct SPDATA_CREATEGROUP
92 } SPDATA_CREATEGROUP
, *LPSPDATA_CREATEGROUP
;
94 typedef struct SPDATA_CREATEGROUPINGROUP
104 } SPDATA_CREATEGROUPINGROUP
, *LPSPDATA_CREATEGROUPINGROUP
;
106 typedef struct SPDATA_CREATEREMOTEGROUP
115 } SPDATA_CREATEREMOTEGROUP
, *LPSPDATA_CREATEREMOTEGROUP
;
117 typedef struct SPDATA_CREATEREMOTEGROUPINGROUP
125 } SPDATA_CREATEREMOTEGROUPINGROUP
, *LPSPDATA_CREATEREMOTEGROUPINGROUP
;
127 typedef struct SPDATA_CREATEPLAYER
136 } SPDATA_CREATEPLAYER
, *LPSPDATA_CREATEPLAYER
;
138 typedef struct SPDATA_DELETEGROUPFROMGROUP
144 } SPDATA_DELETEGROUPFROMGROUP
, *LPSPDATA_DELETEGROUPFROMGROUP
;
146 typedef struct SPDATA_DELETEPLAYERFROMGROUP
152 } SPDATA_DELETEPLAYERFROMGROUP
, *LPSPDATA_DELETEPLAYERFROMGROUP
;
154 typedef struct SPDATA_DELETEREMOTEGROUPFROMGROUP
160 } SPDATA_DELETEREMOTEGROUPFROMGROUP
, *LPSPDATA_DELETEREMOTEGROUPFROMGROUP
;
162 typedef struct SPDATA_DELETEREMOTEPLAYERFROMGROUP
168 } SPDATA_DELETEREMOTEPLAYERFROMGROUP
, *LPSPDATA_DELETEREMOTEPLAYERFROMGROUP
;
170 typedef struct SPDATA_DESTROYGROUP
175 } SPDATA_DESTROYGROUP
, *LPSPDATA_DESTROYGROUP
;
177 typedef struct SPDATA_DESTROYREMOTEGROUP
182 } SPDATA_DESTROYREMOTEGROUP
, *LPSPDATA_DESTROYREMOTEGROUP
;
184 typedef struct SPDATA_DESTROYPLAYER
189 } SPDATA_DESTROYPLAYER
, *LPSPDATA_DESTROYPLAYER
;
191 typedef struct SPDATA_ENUMSESSIONS
195 LPDPSESSIONDESC2 lpsd
;
198 } SPDATA_ENUMSESSIONS
, *LPSPDATA_ENUMSESSIONS
;
200 typedef struct SPDATA_ENUMSESSIONSRESPONSE
203 LPDPSESSIONDESC2 lpsd
;
204 } SPDATA_ENUMSESSIONSRESPONSE
, *LPSPDATA_ENUMSESSIONSRESPONSE
;
206 typedef struct SPDATA_GETCAPS
212 } SPDATA_GETCAPS
, *LPSPDATA_GETCAPS
;
214 typedef struct SPDATA_GETGROUPCONNECTIONSETTINGS
220 LPDWORD lpdwBufferSize
;
222 } SPDATA_GETGROUPCONNECTIONSETTINGS
, *LPSPDATA_GETGROUPCONNECTIONSETTINGS
;
224 typedef struct SPDATA_GETGROUPDATA
229 LPDWORD lpdwDataSize
;
231 } SPDATA_GETGROUPDATA
, *LPSPDATA_GETGROUPDATA
;
233 typedef struct SPDATA_GETPLAYERCAPS
240 } SPDATA_GETPLAYERCAPS
, *LPSPDATA_GETPLAYERCAPS
;
242 typedef struct SPDATA_GETPLAYERDATA
247 LPDWORD lpdwDataSize
;
249 } SPDATA_GETPLAYERDATA
, *LPSPDATA_GETPLAYERDATA
;
251 typedef struct SPDATA_HANDLEMESSAGE
258 } SPDATA_HANDLEMESSAGE
, *LPSPDATA_HANDLEMESSAGE
;
260 typedef struct SPDATA_OPEN
264 LPDPSESSIONDESC2 lpsd
;
266 LPCDPCREDENTIALS lpCredentials
;
267 } SPDATA_OPEN
, *LPSPDATA_OPEN
;
269 typedef struct SPDATA_SEND
278 } SPDATA_SEND
, *LPSPDATA_SEND
;
280 typedef struct SPDATA_CHATMESSAGE
288 } SPDATA_CHATMESSAGE
, *LPSPDATA_CHATMESSAGE
;
290 typedef struct SPDATA_SETGROUPCONNECTIONSETTINGS
296 LPDPLCONNECTION lpConn
;
297 } SPDATA_SETGROUPCONNECTIONSETTINGS
, *LPSPDATA_SETGROUPCONNECTIONSETTINGS
;
299 typedef struct SPDATA_SETGROUPDATA
307 } SPDATA_SETGROUPDATA
, *LPSPDATA_SETGROUPDATA
;
309 typedef struct SPDATA_SETGROUPNAME
316 } SPDATA_SETGROUPNAME
, *LPSPDATA_SETGROUPNAME
;
318 typedef struct SPDATA_SETREMOTEGROUPNAME
325 } SPDATA_SETREMOTEGROUPNAME
, *LPSPDATA_SETREMOTEGROUPNAME
;
327 typedef struct SPDATA_SETPLAYERDATA
335 } SPDATA_SETPLAYERDATA
, *LPSPDATA_SETPLAYERDATA
;
337 typedef struct SPDATA_SETPLAYERNAME
344 } SPDATA_SETPLAYERNAME
, *LPSPDATA_SETPLAYERNAME
;
346 typedef struct SPDATA_SETREMOTEPLAYERNAME
353 } SPDATA_SETREMOTEPLAYERNAME
, *LPSPDATA_SETREMOTEPLAYERNAME
;
355 typedef struct SPDATA_SETSESSIONDESC
358 LPDPSESSIONDESC2 lpsd
;
359 } SPDATA_SETSESSIONDESC
, *LPSPDATA_SETSESSIONDESC
;
361 typedef struct SPDATA_SHUTDOWN
365 } SPDATA_SHUTDOWN
, *LPSPDATA_SHUTDOWN
;
367 typedef struct SPDATA_STARTSESSION
373 } SPDATA_STARTSESSION
, *LPSPDATA_STARTSESSION
;
375 typedef struct SPDATA_STARTSESSIONCOMMAND
380 LPDPLCONNECTION lpConn
;
381 } SPDATA_STARTSESSIONCOMMAND
, *LPSPDATA_STARTSESSIONCOMMAND
;
383 /* Prototypes for callbacks returned by DPLSPInit */
384 typedef HRESULT (WINAPI
*LPSP_ADDGROUPTOGROUP
)(LPSPDATA_ADDGROUPTOGROUP
);
385 typedef HRESULT (WINAPI
*LPSP_ADDPLAYERTOGROUP
)(LPSPDATA_ADDPLAYERTOGROUP
);
386 typedef HRESULT (WINAPI
*LPSP_BUILDPARENTALHEIRARCHY
)(LPSPDATA_BUILDPARENTALHEIRARCHY
);
387 typedef HRESULT (WINAPI
*LPSP_CLOSE
)(LPSPDATA_CLOSE
);
388 typedef HRESULT (WINAPI
*LPSP_CREATEGROUP
)(LPSPDATA_CREATEGROUP
);
389 typedef HRESULT (WINAPI
*LPSP_CREATEGROUPINGROUP
)(LPSPDATA_CREATEGROUPINGROUP
);
390 typedef HRESULT (WINAPI
*LPSP_CREATEPLAYER
)(LPSPDATA_CREATEPLAYER
);
391 typedef HRESULT (WINAPI
*LPSP_DELETEGROUPFROMGROUP
)(LPSPDATA_DELETEGROUPFROMGROUP
);
392 typedef HRESULT (WINAPI
*LPSP_DELETEPLAYERFROMGROUP
)(LPSPDATA_DELETEPLAYERFROMGROUP
);
393 typedef HRESULT (WINAPI
*LPSP_DESTROYGROUP
)(LPSPDATA_DESTROYGROUP
);
394 typedef HRESULT (WINAPI
*LPSP_DESTROYPLAYER
)(LPSPDATA_DESTROYPLAYER
);
395 typedef HRESULT (WINAPI
*LPSP_ENUMSESSIONS
)(LPSPDATA_ENUMSESSIONS
);
396 typedef HRESULT (WINAPI
*LPSP_GETCAPS
)(LPSPDATA_GETCAPS
);
397 typedef HRESULT (WINAPI
*LPSP_GETGROUPCONNECTIONSETTINGS
)(LPSPDATA_GETGROUPCONNECTIONSETTINGS
);
398 typedef HRESULT (WINAPI
*LPSP_GETGROUPDATA
)(LPSPDATA_GETGROUPDATA
);
399 typedef HRESULT (WINAPI
*LPSP_GETPLAYERCAPS
)(LPSPDATA_GETPLAYERCAPS
);
400 typedef HRESULT (WINAPI
*LPSP_GETPLAYERDATA
)(LPSPDATA_GETPLAYERDATA
);
401 typedef HRESULT (WINAPI
*LPSP_HANDLEMESSAGE
)(LPSPDATA_HANDLEMESSAGE
);
402 typedef HRESULT (WINAPI
*LPSP_OPEN
)(LPSPDATA_OPEN
);
403 typedef HRESULT (WINAPI
*LPSP_SEND
)(LPSPDATA_SEND
);
404 typedef HRESULT (WINAPI
*LPSP_SENDCHATMESSAGE
)(LPSPDATA_CHATMESSAGE
);
405 typedef HRESULT (WINAPI
*LPSP_SETGROUPCONNECTIONSETTINGS
)(LPSPDATA_SETGROUPCONNECTIONSETTINGS
);
406 typedef HRESULT (WINAPI
*LPSP_SETGROUPDATA
)(LPSPDATA_SETGROUPDATA
);
407 typedef HRESULT (WINAPI
*LPSP_SETGROUPNAME
)(LPSPDATA_SETGROUPNAME
);
408 typedef HRESULT (WINAPI
*LPSP_SETPLAYERDATA
)(LPSPDATA_SETPLAYERDATA
);
409 typedef HRESULT (WINAPI
*LPSP_SETPLAYERNAME
)(LPSPDATA_SETPLAYERNAME
);
410 typedef HRESULT (WINAPI
*LPSP_SHUTDOWN
)(LPSPDATA_SHUTDOWN
);
411 typedef HRESULT (WINAPI
*LPSP_STARTSESSION
)(LPSPDATA_STARTSESSION
);
413 /* Callback table for dplay to call into service provider */
414 typedef struct SP_CALLBACKS
418 LPSP_ADDGROUPTOGROUP AddGroupToGroup
;
419 LPSP_ADDPLAYERTOGROUP AddPlayerToGroup
;
420 LPSP_BUILDPARENTALHEIRARCHY BuildParentalHeirarchy
;
422 LPSP_CREATEGROUP CreateGroup
;
423 LPSP_CREATEGROUPINGROUP CreateGroupInGroup
;
424 LPSP_CREATEPLAYER CreatePlayer
;
425 LPSP_DELETEGROUPFROMGROUP DeleteGroupFromGroup
;
426 LPSP_DELETEPLAYERFROMGROUP DeletePlayerFromGroup
;
427 LPSP_DESTROYGROUP DestroyGroup
;
428 LPSP_DESTROYPLAYER DestroyPlayer
;
429 LPSP_ENUMSESSIONS EnumSessions
;
430 LPSP_GETCAPS GetCaps
;
431 LPSP_GETGROUPCONNECTIONSETTINGS GetGroupConnectionSettings
;
432 LPSP_GETGROUPDATA GetGroupData
;
433 LPSP_GETPLAYERCAPS GetPlayerCaps
;
434 LPSP_GETPLAYERDATA GetPlayerData
;
437 LPSP_SENDCHATMESSAGE SendChatMessage
;
438 LPSP_SETGROUPCONNECTIONSETTINGS SetGroupConnectionSettings
;
439 LPSP_SETGROUPDATA SetGroupData
;
440 LPSP_SETGROUPNAME SetGroupName
;
441 LPSP_SETPLAYERDATA SetPlayerData
;
442 LPSP_SETPLAYERNAME SetPlayerName
;
443 LPSP_SHUTDOWN Shutdown
;
444 LPSP_STARTSESSION StartSession
;
445 } SP_CALLBACKS
, *LPSP_CALLBACKS
;
447 typedef struct SPDATA_INIT
452 LPDPADDRESS lpAddress
;
453 } SPDATA_INIT
, *LPSPDATA_INIT
;
455 typedef HRESULT (WINAPI
*LPSP_INIT
)(LPSPDATA_INIT
);
456 HRESULT WINAPI
DPLSPInit(LPSPDATA_INIT
);
458 /* Define the COM interface */
459 #define ICOM_INTERFACE IDPLobbySP
460 #define IDPLobbySP_METHODS \
461 ICOM_METHOD1(HRESULT, AddGroupToGroup, LPSPDATA_ADDREMOTEGROUPTOGROUP, argtg ) \
462 ICOM_METHOD1(HRESULT, AddPlayerToGroup, LPSPDATA_ADDREMOTEPLAYERTOGROUP, arptg ) \
463 ICOM_METHOD1(HRESULT, CreateGroup, LPSPDATA_CREATEREMOTEGROUP, crg ) \
464 ICOM_METHOD1(HRESULT, CreateGroupInGroup, LPSPDATA_CREATEREMOTEGROUPINGROUP, crgig ) \
465 ICOM_METHOD1(HRESULT, DeleteGroupFromGroup, LPSPDATA_DELETEREMOTEGROUPFROMGROUP, drgfg ) \
466 ICOM_METHOD1(HRESULT, DeletePlayerFromGroup, LPSPDATA_DELETEREMOTEPLAYERFROMGROUP, drpfg ) \
467 ICOM_METHOD1(HRESULT, DestroyGroup, LPSPDATA_DESTROYREMOTEGROUP, drg ) \
468 ICOM_METHOD1(HRESULT, EnumSessionsResponse, LPSPDATA_ENUMSESSIONSRESPONSE, er ) \
469 ICOM_METHOD1(HRESULT, GetSPDataPointer, LPVOID*, lplpData ) \
470 ICOM_METHOD1(HRESULT, HandleMessage, LPSPDATA_HANDLEMESSAGE, hm ) \
471 ICOM_METHOD1(HRESULT, SendChatMessage, LPSPDATA_CHATMESSAGE, cm ) \
472 ICOM_METHOD1(HRESULT, SetGroupName, LPSPDATA_SETREMOTEGROUPNAME, srgn ) \
473 ICOM_METHOD1(HRESULT, SetPlayerName, LPSPDATA_SETREMOTEPLAYERNAME, srpn ) \
474 ICOM_METHOD1(HRESULT, SetSessionDesc, LPSPDATA_SETSESSIONDESC, ssd ) \
475 ICOM_METHOD1(HRESULT, SetSPDataPointer, LPVOID, lpData ) \
476 ICOM_METHOD1(HRESULT, StartSession, LPSPDATA_STARTSESSIONCOMMAND, ssc )
478 #define IDPLobbySP_IMETHODS \
482 ICOM_DEFINE(IDPLobbySP
,IUnknown
)
483 #undef ICOM_INTERFACE
485 /*** IUnknown methods ***/
486 #define IDPLobbySP_QueryInterface(p,a,b) ICOM_CALL2(QueryInterface,p,a,b)
487 #define IDPLobbySP_AddRef(p) ICOM_CALL (AddRef,p)
488 #define IDPLobbySP_Release(p) ICOM_CALL (Release,p)
490 /*** IDPLobbySP methods ***/
491 #define IDPLobbySP_AddGroupToGroup(p,a) ICOM_CALL1(AddGroupToGroup,p,a)
492 #define IDPLobbySP_AddPlayerToGroup(p,a) ICOM_CALL1(AddPlayerToGroup,p,a)
493 #define IDPLobbySP_CreateGroup(p,a) ICOM_CALL1(CreateGroup,p,a)
494 #define IDPLobbySP_CreateGroupInGroup(p,a) ICOM_CALL1(CreateGroupInGroup,p,a)
495 #define IDPLobbySP_DeleteGroupFromGroup(p,a) ICOM_CALL1(DeleteGroupFromGroup,p,a)
496 #define IDPLobbySP_DeletePlayerFromGroup(p,a) ICOM_CALL1(DeletePlayerFromGroup,p,a)
497 #define IDPLobbySP_DestroyGroup(p,a) ICOM_CALL1(DestroyGroup,p,a)
498 #define IDPLobbySP_EnumSessionsResponse(p,a) ICOM_CALL1(EnumSessionsResponse,p,a)
499 #define IDPLobbySP_GetSPDataPointer(p,a) ICOM_CALL1(GetSPDataPointer,p,a)
500 #define IDPLobbySP_HandleMessage(p,a) ICOM_CALL1(HandleMessage,p,a)
501 #define IDPLobbySP_SetGroupName(p,a) ICOM_CALL1(SetGroupName,p,a)
502 #define IDPLobbySP_SetPlayerName(p,a) ICOM_CALL1(SetPlayerName,p,a)
503 #define IDPLobbySP_SetSessionDesc(p,a) ICOM_CALL1(SetSessionDesc,p,a)
504 #define IDPLobbySP_StartSession(p,a) ICOM_CALL1(StartSession,p,a)
505 #define IDPLobbySP_SetSPDataPointer(p,a) ICOM_CALL1(SetSPDataPointer,p,a)
507 /* This variable is exported from the DLL at ordinal 6 to be accessed by the
508 * SP directly. This is the same variable that the DP SP will use.
510 extern DWORD gdwDPlaySPRefCount
;