1 /* This contains the implementation of the Lobby Service
2 * Providers interface required to communicate with Direct Play
4 * Copyright 2001 Peter Hunnisett
6 * This library is free software; you can redistribute it and/or
7 * modify it under the terms of the GNU Lesser General Public
8 * License as published by the Free Software Foundation; either
9 * version 2.1 of the License, or (at your option) any later version.
11 * This library is distributed in the hope that it will be useful,
12 * but WITHOUT ANY WARRANTY; without even the implied warranty of
13 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
14 * Lesser General Public License for more details.
16 * You should have received a copy of the GNU Lesser General Public
17 * License along with this library; if not, write to the Free Software
18 * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA
22 #include "wine/debug.h"
25 #include "dplay_global.h"
27 WINE_DEFAULT_DEBUG_CHANNEL(dplay
);
29 typedef struct IDPLobbySPImpl
31 IDPLobbySP IDPLobbySP_iface
;
33 IDirectPlayImpl
*dplay
;
36 static inline IDPLobbySPImpl
*impl_from_IDPLobbySP(IDPLobbySP
*iface
)
38 return CONTAINING_RECORD(iface
, IDPLobbySPImpl
, IDPLobbySP_iface
);
41 static HRESULT WINAPI
IDPLobbySPImpl_QueryInterface( IDPLobbySP
*iface
, REFIID riid
,
44 TRACE("(%p)->(%s,%p)\n", iface
, debugstr_guid( riid
), ppv
);
46 if ( IsEqualGUID( &IID_IUnknown
, riid
) || IsEqualGUID( &IID_IDPLobbySP
, riid
) )
49 IDPLobbySP_AddRef(iface
);
53 FIXME("Unsupported interface %s\n", debugstr_guid(riid
));
58 static ULONG WINAPI
IDPLobbySPImpl_AddRef( IDPLobbySP
*iface
)
60 IDPLobbySPImpl
*This
= impl_from_IDPLobbySP( iface
);
61 ULONG ref
= InterlockedIncrement( &This
->ref
);
63 TRACE( "(%p) ref=%d\n", This
, ref
);
68 static ULONG WINAPI
IDPLobbySPImpl_Release( IDPLobbySP
*iface
)
70 IDPLobbySPImpl
*This
= impl_from_IDPLobbySP( iface
);
71 ULONG ref
= InterlockedDecrement( &This
->ref
);
73 TRACE( "(%p) ref=%d\n", This
, ref
);
76 HeapFree( GetProcessHeap(), 0, This
);
81 static HRESULT WINAPI
IDPLobbySPImpl_AddGroupToGroup( IDPLobbySP
*iface
,
82 SPDATA_ADDREMOTEGROUPTOGROUP
*argtg
)
84 IDPLobbySPImpl
*This
= impl_from_IDPLobbySP( iface
);
85 FIXME( "(%p)->(%p):stub\n", This
, argtg
);
89 static HRESULT WINAPI
IDPLobbySPImpl_AddPlayerToGroup( IDPLobbySP
*iface
,
90 SPDATA_ADDREMOTEPLAYERTOGROUP
*arptg
)
92 IDPLobbySPImpl
*This
= impl_from_IDPLobbySP( iface
);
93 FIXME( "(%p)->(%p):stub\n", This
, arptg
);
97 static HRESULT WINAPI
IDPLobbySPImpl_CreateGroup( IDPLobbySP
*iface
,
98 SPDATA_CREATEREMOTEGROUP
*crg
)
100 IDPLobbySPImpl
*This
= impl_from_IDPLobbySP( iface
);
101 FIXME( "(%p)->(%p):stub\n", This
, crg
);
105 static HRESULT WINAPI
IDPLobbySPImpl_CreateGroupInGroup( IDPLobbySP
*iface
,
106 SPDATA_CREATEREMOTEGROUPINGROUP
*crgig
)
108 IDPLobbySPImpl
*This
= impl_from_IDPLobbySP( iface
);
109 FIXME( "(%p)->(%p):stub\n", This
, crgig
);
113 static HRESULT WINAPI
IDPLobbySPImpl_DeleteGroupFromGroup( IDPLobbySP
*iface
,
114 SPDATA_DELETEREMOTEGROUPFROMGROUP
*drgfg
)
116 IDPLobbySPImpl
*This
= impl_from_IDPLobbySP( iface
);
117 FIXME( "(%p)->(%p):stub\n", This
, drgfg
);
121 static HRESULT WINAPI
IDPLobbySPImpl_DeletePlayerFromGroup( IDPLobbySP
*iface
,
122 SPDATA_DELETEREMOTEPLAYERFROMGROUP
*drpfg
)
124 IDPLobbySPImpl
*This
= impl_from_IDPLobbySP( iface
);
125 FIXME( "(%p)->(%p):stub\n", This
, drpfg
);
129 static HRESULT WINAPI
IDPLobbySPImpl_DestroyGroup( IDPLobbySP
*iface
,
130 SPDATA_DESTROYREMOTEGROUP
*drg
)
132 IDPLobbySPImpl
*This
= impl_from_IDPLobbySP( iface
);
133 FIXME( "(%p)->(%p):stub\n", This
, drg
);
137 static HRESULT WINAPI
IDPLobbySPImpl_EnumSessionsResponse( IDPLobbySP
*iface
,
138 SPDATA_ENUMSESSIONSRESPONSE
*er
)
140 IDPLobbySPImpl
*This
= impl_from_IDPLobbySP( iface
);
141 FIXME( "(%p)->(%p):stub\n", This
, er
);
145 static HRESULT WINAPI
IDPLobbySPImpl_GetSPDataPointer( IDPLobbySP
*iface
, LPVOID
* lplpData
)
147 IDPLobbySPImpl
*This
= impl_from_IDPLobbySP( iface
);
148 FIXME( "(%p)->(%p):stub\n", This
, lplpData
);
152 static HRESULT WINAPI
IDPLobbySPImpl_HandleMessage( IDPLobbySP
*iface
, SPDATA_HANDLEMESSAGE
*hm
)
154 IDPLobbySPImpl
*This
= impl_from_IDPLobbySP( iface
);
155 FIXME( "(%p)->(%p):stub\n", This
, hm
);
159 static HRESULT WINAPI
IDPLobbySPImpl_SendChatMessage( IDPLobbySP
*iface
,
160 SPDATA_CHATMESSAGE
*cm
)
162 IDPLobbySPImpl
*This
= impl_from_IDPLobbySP( iface
);
163 FIXME( "(%p)->(%p):stub\n", This
, cm
);
167 static HRESULT WINAPI
IDPLobbySPImpl_SetGroupName( IDPLobbySP
*iface
,
168 SPDATA_SETREMOTEGROUPNAME
*srgn
)
170 IDPLobbySPImpl
*This
= impl_from_IDPLobbySP( iface
);
171 FIXME( "(%p)->(%p):stub\n", This
, srgn
);
175 static HRESULT WINAPI
IDPLobbySPImpl_SetPlayerName( IDPLobbySP
*iface
,
176 SPDATA_SETREMOTEPLAYERNAME
*srpn
)
178 IDPLobbySPImpl
*This
= impl_from_IDPLobbySP( iface
);
179 FIXME( "(%p)->(%p):stub\n", This
, srpn
);
183 static HRESULT WINAPI
IDPLobbySPImpl_SetSessionDesc( IDPLobbySP
*iface
,
184 SPDATA_SETSESSIONDESC
*ssd
)
186 IDPLobbySPImpl
*This
= impl_from_IDPLobbySP( iface
);
187 FIXME( "(%p)->(%p):stub\n", This
, ssd
);
191 static HRESULT WINAPI
IDPLobbySPImpl_SetSPDataPointer( IDPLobbySP
*iface
, void *lpData
)
193 IDPLobbySPImpl
*This
= impl_from_IDPLobbySP( iface
);
194 FIXME( "(%p)->(%p):stub\n", This
, lpData
);
198 static HRESULT WINAPI
IDPLobbySPImpl_StartSession( IDPLobbySP
*iface
,
199 SPDATA_STARTSESSIONCOMMAND
*ssc
)
201 IDPLobbySPImpl
*This
= impl_from_IDPLobbySP( iface
);
202 FIXME( "(%p)->(%p):stub\n", This
, ssc
);
207 static const IDPLobbySPVtbl dpLobbySPVT
=
209 IDPLobbySPImpl_QueryInterface
,
210 IDPLobbySPImpl_AddRef
,
211 IDPLobbySPImpl_Release
,
212 IDPLobbySPImpl_AddGroupToGroup
,
213 IDPLobbySPImpl_AddPlayerToGroup
,
214 IDPLobbySPImpl_CreateGroup
,
215 IDPLobbySPImpl_CreateGroupInGroup
,
216 IDPLobbySPImpl_DeleteGroupFromGroup
,
217 IDPLobbySPImpl_DeletePlayerFromGroup
,
218 IDPLobbySPImpl_DestroyGroup
,
219 IDPLobbySPImpl_EnumSessionsResponse
,
220 IDPLobbySPImpl_GetSPDataPointer
,
221 IDPLobbySPImpl_HandleMessage
,
222 IDPLobbySPImpl_SendChatMessage
,
223 IDPLobbySPImpl_SetGroupName
,
224 IDPLobbySPImpl_SetPlayerName
,
225 IDPLobbySPImpl_SetSessionDesc
,
226 IDPLobbySPImpl_SetSPDataPointer
,
227 IDPLobbySPImpl_StartSession
230 HRESULT
dplobbysp_create( REFIID riid
, void **ppv
, IDirectPlayImpl
*dp
)
235 TRACE( "(%s, %p)\n", debugstr_guid( riid
), ppv
);
238 obj
= HeapAlloc( GetProcessHeap(), 0, sizeof( *obj
) );
240 return DPERR_OUTOFMEMORY
;
242 obj
->IDPLobbySP_iface
.lpVtbl
= &dpLobbySPVT
;
246 hr
= IDPLobbySP_QueryInterface( &obj
->IDPLobbySP_iface
, riid
, ppv
);
247 IDPLobbySP_Release( &obj
->IDPLobbySP_iface
);