1c2c66affSColin Finck /* This contains the implementation of the Lobby Service
2c2c66affSColin Finck * Providers interface required to communicate with Direct Play
3c2c66affSColin Finck *
4c2c66affSColin Finck * Copyright 2001 Peter Hunnisett
5c2c66affSColin Finck *
6c2c66affSColin Finck * This library is free software; you can redistribute it and/or
7c2c66affSColin Finck * modify it under the terms of the GNU Lesser General Public
8c2c66affSColin Finck * License as published by the Free Software Foundation; either
9c2c66affSColin Finck * version 2.1 of the License, or (at your option) any later version.
10c2c66affSColin Finck *
11c2c66affSColin Finck * This library is distributed in the hope that it will be useful,
12c2c66affSColin Finck * but WITHOUT ANY WARRANTY; without even the implied warranty of
13c2c66affSColin Finck * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
14c2c66affSColin Finck * Lesser General Public License for more details.
15c2c66affSColin Finck *
16c2c66affSColin Finck * You should have received a copy of the GNU Lesser General Public
17c2c66affSColin Finck * License along with this library; if not, write to the Free Software
18c2c66affSColin Finck * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA
19c2c66affSColin Finck */
20c2c66affSColin Finck
21*a5313181SAmine Khaldi #include "winerror.h"
22*a5313181SAmine Khaldi #include "wine/debug.h"
23c2c66affSColin Finck
24*a5313181SAmine Khaldi #include "lobbysp.h"
25*a5313181SAmine Khaldi #include "dplay_global.h"
26*a5313181SAmine Khaldi
27*a5313181SAmine Khaldi WINE_DEFAULT_DEBUG_CHANNEL(dplay);
28c2c66affSColin Finck
29c2c66affSColin Finck typedef struct IDPLobbySPImpl
30c2c66affSColin Finck {
31c2c66affSColin Finck IDPLobbySP IDPLobbySP_iface;
32c2c66affSColin Finck LONG ref;
33c2c66affSColin Finck IDirectPlayImpl *dplay;
34c2c66affSColin Finck } IDPLobbySPImpl;
35c2c66affSColin Finck
impl_from_IDPLobbySP(IDPLobbySP * iface)36c2c66affSColin Finck static inline IDPLobbySPImpl *impl_from_IDPLobbySP(IDPLobbySP *iface)
37c2c66affSColin Finck {
38c2c66affSColin Finck return CONTAINING_RECORD(iface, IDPLobbySPImpl, IDPLobbySP_iface);
39c2c66affSColin Finck }
40c2c66affSColin Finck
IDPLobbySPImpl_QueryInterface(IDPLobbySP * iface,REFIID riid,void ** ppv)41c2c66affSColin Finck static HRESULT WINAPI IDPLobbySPImpl_QueryInterface( IDPLobbySP *iface, REFIID riid,
42c2c66affSColin Finck void **ppv )
43c2c66affSColin Finck {
44c2c66affSColin Finck TRACE("(%p)->(%s,%p)\n", iface, debugstr_guid( riid ), ppv );
45c2c66affSColin Finck
46c2c66affSColin Finck if ( IsEqualGUID( &IID_IUnknown, riid ) || IsEqualGUID( &IID_IDPLobbySP, riid ) )
47c2c66affSColin Finck {
48c2c66affSColin Finck *ppv = iface;
49c2c66affSColin Finck IDPLobbySP_AddRef(iface);
50c2c66affSColin Finck return S_OK;
51c2c66affSColin Finck }
52c2c66affSColin Finck
53c2c66affSColin Finck FIXME("Unsupported interface %s\n", debugstr_guid(riid));
54c2c66affSColin Finck *ppv = NULL;
55c2c66affSColin Finck return E_NOINTERFACE;
56c2c66affSColin Finck }
57c2c66affSColin Finck
IDPLobbySPImpl_AddRef(IDPLobbySP * iface)58c2c66affSColin Finck static ULONG WINAPI IDPLobbySPImpl_AddRef( IDPLobbySP *iface )
59c2c66affSColin Finck {
60c2c66affSColin Finck IDPLobbySPImpl *This = impl_from_IDPLobbySP( iface );
61c2c66affSColin Finck ULONG ref = InterlockedIncrement( &This->ref );
62c2c66affSColin Finck
63c2c66affSColin Finck TRACE( "(%p) ref=%d\n", This, ref );
64c2c66affSColin Finck
65c2c66affSColin Finck return ref;
66c2c66affSColin Finck }
67c2c66affSColin Finck
IDPLobbySPImpl_Release(IDPLobbySP * iface)68c2c66affSColin Finck static ULONG WINAPI IDPLobbySPImpl_Release( IDPLobbySP *iface )
69c2c66affSColin Finck {
70c2c66affSColin Finck IDPLobbySPImpl *This = impl_from_IDPLobbySP( iface );
71c2c66affSColin Finck ULONG ref = InterlockedDecrement( &This->ref );
72c2c66affSColin Finck
73c2c66affSColin Finck TRACE( "(%p) ref=%d\n", This, ref );
74c2c66affSColin Finck
75c2c66affSColin Finck if( !ref )
76c2c66affSColin Finck HeapFree( GetProcessHeap(), 0, This );
77c2c66affSColin Finck
78c2c66affSColin Finck return ref;
79c2c66affSColin Finck }
80c2c66affSColin Finck
IDPLobbySPImpl_AddGroupToGroup(IDPLobbySP * iface,SPDATA_ADDREMOTEGROUPTOGROUP * argtg)81c2c66affSColin Finck static HRESULT WINAPI IDPLobbySPImpl_AddGroupToGroup( IDPLobbySP *iface,
82c2c66affSColin Finck SPDATA_ADDREMOTEGROUPTOGROUP *argtg )
83c2c66affSColin Finck {
84c2c66affSColin Finck IDPLobbySPImpl *This = impl_from_IDPLobbySP( iface );
85c2c66affSColin Finck FIXME( "(%p)->(%p):stub\n", This, argtg );
86c2c66affSColin Finck return DP_OK;
87c2c66affSColin Finck }
88c2c66affSColin Finck
IDPLobbySPImpl_AddPlayerToGroup(IDPLobbySP * iface,SPDATA_ADDREMOTEPLAYERTOGROUP * arptg)89c2c66affSColin Finck static HRESULT WINAPI IDPLobbySPImpl_AddPlayerToGroup( IDPLobbySP *iface,
90c2c66affSColin Finck SPDATA_ADDREMOTEPLAYERTOGROUP *arptg )
91c2c66affSColin Finck {
92c2c66affSColin Finck IDPLobbySPImpl *This = impl_from_IDPLobbySP( iface );
93c2c66affSColin Finck FIXME( "(%p)->(%p):stub\n", This, arptg );
94c2c66affSColin Finck return DP_OK;
95c2c66affSColin Finck }
96c2c66affSColin Finck
IDPLobbySPImpl_CreateGroup(IDPLobbySP * iface,SPDATA_CREATEREMOTEGROUP * crg)97c2c66affSColin Finck static HRESULT WINAPI IDPLobbySPImpl_CreateGroup( IDPLobbySP *iface,
98c2c66affSColin Finck SPDATA_CREATEREMOTEGROUP *crg )
99c2c66affSColin Finck {
100c2c66affSColin Finck IDPLobbySPImpl *This = impl_from_IDPLobbySP( iface );
101c2c66affSColin Finck FIXME( "(%p)->(%p):stub\n", This, crg );
102c2c66affSColin Finck return DP_OK;
103c2c66affSColin Finck }
104c2c66affSColin Finck
IDPLobbySPImpl_CreateGroupInGroup(IDPLobbySP * iface,SPDATA_CREATEREMOTEGROUPINGROUP * crgig)105c2c66affSColin Finck static HRESULT WINAPI IDPLobbySPImpl_CreateGroupInGroup( IDPLobbySP *iface,
106c2c66affSColin Finck SPDATA_CREATEREMOTEGROUPINGROUP *crgig )
107c2c66affSColin Finck {
108c2c66affSColin Finck IDPLobbySPImpl *This = impl_from_IDPLobbySP( iface );
109c2c66affSColin Finck FIXME( "(%p)->(%p):stub\n", This, crgig );
110c2c66affSColin Finck return DP_OK;
111c2c66affSColin Finck }
112c2c66affSColin Finck
IDPLobbySPImpl_DeleteGroupFromGroup(IDPLobbySP * iface,SPDATA_DELETEREMOTEGROUPFROMGROUP * drgfg)113c2c66affSColin Finck static HRESULT WINAPI IDPLobbySPImpl_DeleteGroupFromGroup( IDPLobbySP *iface,
114c2c66affSColin Finck SPDATA_DELETEREMOTEGROUPFROMGROUP *drgfg )
115c2c66affSColin Finck {
116c2c66affSColin Finck IDPLobbySPImpl *This = impl_from_IDPLobbySP( iface );
117c2c66affSColin Finck FIXME( "(%p)->(%p):stub\n", This, drgfg );
118c2c66affSColin Finck return DP_OK;
119c2c66affSColin Finck }
120c2c66affSColin Finck
IDPLobbySPImpl_DeletePlayerFromGroup(IDPLobbySP * iface,SPDATA_DELETEREMOTEPLAYERFROMGROUP * drpfg)121c2c66affSColin Finck static HRESULT WINAPI IDPLobbySPImpl_DeletePlayerFromGroup( IDPLobbySP *iface,
122c2c66affSColin Finck SPDATA_DELETEREMOTEPLAYERFROMGROUP *drpfg )
123c2c66affSColin Finck {
124c2c66affSColin Finck IDPLobbySPImpl *This = impl_from_IDPLobbySP( iface );
125c2c66affSColin Finck FIXME( "(%p)->(%p):stub\n", This, drpfg );
126c2c66affSColin Finck return DP_OK;
127c2c66affSColin Finck }
128c2c66affSColin Finck
IDPLobbySPImpl_DestroyGroup(IDPLobbySP * iface,SPDATA_DESTROYREMOTEGROUP * drg)129c2c66affSColin Finck static HRESULT WINAPI IDPLobbySPImpl_DestroyGroup( IDPLobbySP *iface,
130c2c66affSColin Finck SPDATA_DESTROYREMOTEGROUP *drg )
131c2c66affSColin Finck {
132c2c66affSColin Finck IDPLobbySPImpl *This = impl_from_IDPLobbySP( iface );
133c2c66affSColin Finck FIXME( "(%p)->(%p):stub\n", This, drg );
134c2c66affSColin Finck return DP_OK;
135c2c66affSColin Finck }
136c2c66affSColin Finck
IDPLobbySPImpl_EnumSessionsResponse(IDPLobbySP * iface,SPDATA_ENUMSESSIONSRESPONSE * er)137c2c66affSColin Finck static HRESULT WINAPI IDPLobbySPImpl_EnumSessionsResponse( IDPLobbySP *iface,
138c2c66affSColin Finck SPDATA_ENUMSESSIONSRESPONSE *er )
139c2c66affSColin Finck {
140c2c66affSColin Finck IDPLobbySPImpl *This = impl_from_IDPLobbySP( iface );
141c2c66affSColin Finck FIXME( "(%p)->(%p):stub\n", This, er );
142c2c66affSColin Finck return DP_OK;
143c2c66affSColin Finck }
144c2c66affSColin Finck
IDPLobbySPImpl_GetSPDataPointer(IDPLobbySP * iface,LPVOID * lplpData)145c2c66affSColin Finck static HRESULT WINAPI IDPLobbySPImpl_GetSPDataPointer( IDPLobbySP *iface, LPVOID* lplpData )
146c2c66affSColin Finck {
147c2c66affSColin Finck IDPLobbySPImpl *This = impl_from_IDPLobbySP( iface );
148c2c66affSColin Finck FIXME( "(%p)->(%p):stub\n", This, lplpData );
149c2c66affSColin Finck return DP_OK;
150c2c66affSColin Finck }
151c2c66affSColin Finck
IDPLobbySPImpl_HandleMessage(IDPLobbySP * iface,SPDATA_HANDLEMESSAGE * hm)152c2c66affSColin Finck static HRESULT WINAPI IDPLobbySPImpl_HandleMessage( IDPLobbySP *iface, SPDATA_HANDLEMESSAGE *hm )
153c2c66affSColin Finck {
154c2c66affSColin Finck IDPLobbySPImpl *This = impl_from_IDPLobbySP( iface );
155c2c66affSColin Finck FIXME( "(%p)->(%p):stub\n", This, hm );
156c2c66affSColin Finck return DP_OK;
157c2c66affSColin Finck }
158c2c66affSColin Finck
IDPLobbySPImpl_SendChatMessage(IDPLobbySP * iface,SPDATA_CHATMESSAGE * cm)159c2c66affSColin Finck static HRESULT WINAPI IDPLobbySPImpl_SendChatMessage( IDPLobbySP *iface,
160c2c66affSColin Finck SPDATA_CHATMESSAGE *cm )
161c2c66affSColin Finck {
162c2c66affSColin Finck IDPLobbySPImpl *This = impl_from_IDPLobbySP( iface );
163c2c66affSColin Finck FIXME( "(%p)->(%p):stub\n", This, cm );
164c2c66affSColin Finck return DP_OK;
165c2c66affSColin Finck }
166c2c66affSColin Finck
IDPLobbySPImpl_SetGroupName(IDPLobbySP * iface,SPDATA_SETREMOTEGROUPNAME * srgn)167c2c66affSColin Finck static HRESULT WINAPI IDPLobbySPImpl_SetGroupName( IDPLobbySP *iface,
168c2c66affSColin Finck SPDATA_SETREMOTEGROUPNAME *srgn )
169c2c66affSColin Finck {
170c2c66affSColin Finck IDPLobbySPImpl *This = impl_from_IDPLobbySP( iface );
171c2c66affSColin Finck FIXME( "(%p)->(%p):stub\n", This, srgn );
172c2c66affSColin Finck return DP_OK;
173c2c66affSColin Finck }
174c2c66affSColin Finck
IDPLobbySPImpl_SetPlayerName(IDPLobbySP * iface,SPDATA_SETREMOTEPLAYERNAME * srpn)175c2c66affSColin Finck static HRESULT WINAPI IDPLobbySPImpl_SetPlayerName( IDPLobbySP *iface,
176c2c66affSColin Finck SPDATA_SETREMOTEPLAYERNAME *srpn )
177c2c66affSColin Finck {
178c2c66affSColin Finck IDPLobbySPImpl *This = impl_from_IDPLobbySP( iface );
179c2c66affSColin Finck FIXME( "(%p)->(%p):stub\n", This, srpn );
180c2c66affSColin Finck return DP_OK;
181c2c66affSColin Finck }
182c2c66affSColin Finck
IDPLobbySPImpl_SetSessionDesc(IDPLobbySP * iface,SPDATA_SETSESSIONDESC * ssd)183c2c66affSColin Finck static HRESULT WINAPI IDPLobbySPImpl_SetSessionDesc( IDPLobbySP *iface,
184c2c66affSColin Finck SPDATA_SETSESSIONDESC *ssd )
185c2c66affSColin Finck {
186c2c66affSColin Finck IDPLobbySPImpl *This = impl_from_IDPLobbySP( iface );
187c2c66affSColin Finck FIXME( "(%p)->(%p):stub\n", This, ssd );
188c2c66affSColin Finck return DP_OK;
189c2c66affSColin Finck }
190c2c66affSColin Finck
IDPLobbySPImpl_SetSPDataPointer(IDPLobbySP * iface,void * lpData)191c2c66affSColin Finck static HRESULT WINAPI IDPLobbySPImpl_SetSPDataPointer( IDPLobbySP *iface, void *lpData )
192c2c66affSColin Finck {
193c2c66affSColin Finck IDPLobbySPImpl *This = impl_from_IDPLobbySP( iface );
194c2c66affSColin Finck FIXME( "(%p)->(%p):stub\n", This, lpData );
195c2c66affSColin Finck return DP_OK;
196c2c66affSColin Finck }
197c2c66affSColin Finck
IDPLobbySPImpl_StartSession(IDPLobbySP * iface,SPDATA_STARTSESSIONCOMMAND * ssc)198c2c66affSColin Finck static HRESULT WINAPI IDPLobbySPImpl_StartSession( IDPLobbySP *iface,
199c2c66affSColin Finck SPDATA_STARTSESSIONCOMMAND *ssc )
200c2c66affSColin Finck {
201c2c66affSColin Finck IDPLobbySPImpl *This = impl_from_IDPLobbySP( iface );
202c2c66affSColin Finck FIXME( "(%p)->(%p):stub\n", This, ssc );
203c2c66affSColin Finck return DP_OK;
204c2c66affSColin Finck }
205c2c66affSColin Finck
206c2c66affSColin Finck
207c2c66affSColin Finck static const IDPLobbySPVtbl dpLobbySPVT =
208c2c66affSColin Finck {
209c2c66affSColin Finck IDPLobbySPImpl_QueryInterface,
210c2c66affSColin Finck IDPLobbySPImpl_AddRef,
211c2c66affSColin Finck IDPLobbySPImpl_Release,
212c2c66affSColin Finck IDPLobbySPImpl_AddGroupToGroup,
213c2c66affSColin Finck IDPLobbySPImpl_AddPlayerToGroup,
214c2c66affSColin Finck IDPLobbySPImpl_CreateGroup,
215c2c66affSColin Finck IDPLobbySPImpl_CreateGroupInGroup,
216c2c66affSColin Finck IDPLobbySPImpl_DeleteGroupFromGroup,
217c2c66affSColin Finck IDPLobbySPImpl_DeletePlayerFromGroup,
218c2c66affSColin Finck IDPLobbySPImpl_DestroyGroup,
219c2c66affSColin Finck IDPLobbySPImpl_EnumSessionsResponse,
220c2c66affSColin Finck IDPLobbySPImpl_GetSPDataPointer,
221c2c66affSColin Finck IDPLobbySPImpl_HandleMessage,
222c2c66affSColin Finck IDPLobbySPImpl_SendChatMessage,
223c2c66affSColin Finck IDPLobbySPImpl_SetGroupName,
224c2c66affSColin Finck IDPLobbySPImpl_SetPlayerName,
225c2c66affSColin Finck IDPLobbySPImpl_SetSessionDesc,
226c2c66affSColin Finck IDPLobbySPImpl_SetSPDataPointer,
227c2c66affSColin Finck IDPLobbySPImpl_StartSession
228c2c66affSColin Finck };
229c2c66affSColin Finck
dplobbysp_create(REFIID riid,void ** ppv,IDirectPlayImpl * dp)230c2c66affSColin Finck HRESULT dplobbysp_create( REFIID riid, void **ppv, IDirectPlayImpl *dp )
231c2c66affSColin Finck {
232c2c66affSColin Finck IDPLobbySPImpl *obj;
233c2c66affSColin Finck HRESULT hr;
234c2c66affSColin Finck
235c2c66affSColin Finck TRACE( "(%s, %p)\n", debugstr_guid( riid ), ppv );
236c2c66affSColin Finck
237c2c66affSColin Finck *ppv = NULL;
238c2c66affSColin Finck obj = HeapAlloc( GetProcessHeap(), 0, sizeof( *obj ) );
239c2c66affSColin Finck if ( !obj )
240c2c66affSColin Finck return DPERR_OUTOFMEMORY;
241c2c66affSColin Finck
242c2c66affSColin Finck obj->IDPLobbySP_iface.lpVtbl = &dpLobbySPVT;
243c2c66affSColin Finck obj->ref = 1;
244c2c66affSColin Finck obj->dplay = dp;
245c2c66affSColin Finck
246c2c66affSColin Finck hr = IDPLobbySP_QueryInterface( &obj->IDPLobbySP_iface, riid, ppv );
247c2c66affSColin Finck IDPLobbySP_Release( &obj->IDPLobbySP_iface );
248c2c66affSColin Finck
249c2c66affSColin Finck return hr;
250c2c66affSColin Finck }
251