ReactOS 0.4.16-dev-257-g6aa11ac
lobbysp.c
Go to the documentation of this file.
1/* This contains the implementation of the Lobby Service
2 * Providers interface required to communicate with Direct Play
3 *
4 * Copyright 2001 Peter Hunnisett
5 *
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.
10 *
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.
15 *
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
19 */
20
21#include "winerror.h"
22#include "wine/debug.h"
23
24#include "lobbysp.h"
25#include "dplay_global.h"
26
28
29typedef struct IDPLobbySPImpl
30{
31 IDPLobbySP IDPLobbySP_iface;
35
36static inline IDPLobbySPImpl *impl_from_IDPLobbySP(IDPLobbySP *iface)
37{
38 return CONTAINING_RECORD(iface, IDPLobbySPImpl, IDPLobbySP_iface);
39}
40
42 void **ppv )
43{
44 TRACE("(%p)->(%s,%p)\n", iface, debugstr_guid( riid ), ppv );
45
46 if ( IsEqualGUID( &IID_IUnknown, riid ) || IsEqualGUID( &IID_IDPLobbySP, riid ) )
47 {
48 *ppv = iface;
49 IDPLobbySP_AddRef(iface);
50 return S_OK;
51 }
52
53 FIXME("Unsupported interface %s\n", debugstr_guid(riid));
54 *ppv = NULL;
55 return E_NOINTERFACE;
56}
57
58static ULONG WINAPI IDPLobbySPImpl_AddRef( IDPLobbySP *iface )
59{
62
63 TRACE( "(%p) ref=%d\n", This, ref );
64
65 return ref;
66}
67
68static ULONG WINAPI IDPLobbySPImpl_Release( IDPLobbySP *iface )
69{
72
73 TRACE( "(%p) ref=%d\n", This, ref );
74
75 if( !ref )
77
78 return ref;
79}
80
83{
85 FIXME( "(%p)->(%p):stub\n", This, argtg );
86 return DP_OK;
87}
88
91{
93 FIXME( "(%p)->(%p):stub\n", This, arptg );
94 return DP_OK;
95}
96
97static HRESULT WINAPI IDPLobbySPImpl_CreateGroup( IDPLobbySP *iface,
99{
101 FIXME( "(%p)->(%p):stub\n", This, crg );
102 return DP_OK;
103}
104
107{
109 FIXME( "(%p)->(%p):stub\n", This, crgig );
110 return DP_OK;
111}
112
115{
117 FIXME( "(%p)->(%p):stub\n", This, drgfg );
118 return DP_OK;
119}
120
123{
125 FIXME( "(%p)->(%p):stub\n", This, drpfg );
126 return DP_OK;
127}
128
131{
133 FIXME( "(%p)->(%p):stub\n", This, drg );
134 return DP_OK;
135}
136
139{
141 FIXME( "(%p)->(%p):stub\n", This, er );
142 return DP_OK;
143}
144
145static HRESULT WINAPI IDPLobbySPImpl_GetSPDataPointer( IDPLobbySP *iface, LPVOID* lplpData )
146{
148 FIXME( "(%p)->(%p):stub\n", This, lplpData );
149 return DP_OK;
150}
151
153{
155 FIXME( "(%p)->(%p):stub\n", This, hm );
156 return DP_OK;
157}
158
161{
163 FIXME( "(%p)->(%p):stub\n", This, cm );
164 return DP_OK;
165}
166
169{
171 FIXME( "(%p)->(%p):stub\n", This, srgn );
172 return DP_OK;
173}
174
177{
179 FIXME( "(%p)->(%p):stub\n", This, srpn );
180 return DP_OK;
181}
182
185{
187 FIXME( "(%p)->(%p):stub\n", This, ssd );
188 return DP_OK;
189}
190
191static HRESULT WINAPI IDPLobbySPImpl_SetSPDataPointer( IDPLobbySP *iface, void *lpData )
192{
194 FIXME( "(%p)->(%p):stub\n", This, lpData );
195 return DP_OK;
196}
197
200{
202 FIXME( "(%p)->(%p):stub\n", This, ssc );
203 return DP_OK;
204}
205
206
207static const IDPLobbySPVtbl dpLobbySPVT =
208{
228};
229
231{
233 HRESULT hr;
234
235 TRACE( "(%s, %p)\n", debugstr_guid( riid ), ppv );
236
237 *ppv = NULL;
238 obj = HeapAlloc( GetProcessHeap(), 0, sizeof( *obj ) );
239 if ( !obj )
240 return DPERR_OUTOFMEMORY;
241
242 obj->IDPLobbySP_iface.lpVtbl = &dpLobbySPVT;
243 obj->ref = 1;
244 obj->dplay = dp;
245
246 hr = IDPLobbySP_QueryInterface( &obj->IDPLobbySP_iface, riid, ppv );
247 IDPLobbySP_Release( &obj->IDPLobbySP_iface );
248
249 return hr;
250}
#define InterlockedIncrement
Definition: armddk.h:53
#define InterlockedDecrement
Definition: armddk.h:52
#define WINE_DEFAULT_DEBUG_CHANNEL(t)
Definition: precomp.h:23
#define FIXME(fmt,...)
Definition: precomp.h:53
const GUID IID_IUnknown
#define NULL
Definition: types.h:112
#define GetProcessHeap()
Definition: compat.h:736
#define HeapAlloc
Definition: compat.h:733
#define HeapFree(x, y, z)
Definition: compat.h:735
#define DP_OK
Definition: dplay.h:88
#define DPERR_OUTOFMEMORY
Definition: dplay.h:109
REFIID riid
Definition: atlbase.h:39
REFIID LPVOID * ppv
Definition: atlbase.h:39
#define S_OK
Definition: intsafe.h:52
#define debugstr_guid
Definition: kernel32.h:35
static HRESULT WINAPI IDPLobbySPImpl_CreateGroup(IDPLobbySP *iface, SPDATA_CREATEREMOTEGROUP *crg)
Definition: lobbysp.c:97
static HRESULT WINAPI IDPLobbySPImpl_DestroyGroup(IDPLobbySP *iface, SPDATA_DESTROYREMOTEGROUP *drg)
Definition: lobbysp.c:129
static HRESULT WINAPI IDPLobbySPImpl_EnumSessionsResponse(IDPLobbySP *iface, SPDATA_ENUMSESSIONSRESPONSE *er)
Definition: lobbysp.c:137
static HRESULT WINAPI IDPLobbySPImpl_QueryInterface(IDPLobbySP *iface, REFIID riid, void **ppv)
Definition: lobbysp.c:41
static HRESULT WINAPI IDPLobbySPImpl_StartSession(IDPLobbySP *iface, SPDATA_STARTSESSIONCOMMAND *ssc)
Definition: lobbysp.c:198
static ULONG WINAPI IDPLobbySPImpl_AddRef(IDPLobbySP *iface)
Definition: lobbysp.c:58
static IDPLobbySPImpl * impl_from_IDPLobbySP(IDPLobbySP *iface)
Definition: lobbysp.c:36
static HRESULT WINAPI IDPLobbySPImpl_SetPlayerName(IDPLobbySP *iface, SPDATA_SETREMOTEPLAYERNAME *srpn)
Definition: lobbysp.c:175
static HRESULT WINAPI IDPLobbySPImpl_CreateGroupInGroup(IDPLobbySP *iface, SPDATA_CREATEREMOTEGROUPINGROUP *crgig)
Definition: lobbysp.c:105
static HRESULT WINAPI IDPLobbySPImpl_SetGroupName(IDPLobbySP *iface, SPDATA_SETREMOTEGROUPNAME *srgn)
Definition: lobbysp.c:167
static HRESULT WINAPI IDPLobbySPImpl_SetSPDataPointer(IDPLobbySP *iface, void *lpData)
Definition: lobbysp.c:191
static HRESULT WINAPI IDPLobbySPImpl_DeletePlayerFromGroup(IDPLobbySP *iface, SPDATA_DELETEREMOTEPLAYERFROMGROUP *drpfg)
Definition: lobbysp.c:121
static HRESULT WINAPI IDPLobbySPImpl_HandleMessage(IDPLobbySP *iface, SPDATA_HANDLEMESSAGE *hm)
Definition: lobbysp.c:152
static HRESULT WINAPI IDPLobbySPImpl_AddPlayerToGroup(IDPLobbySP *iface, SPDATA_ADDREMOTEPLAYERTOGROUP *arptg)
Definition: lobbysp.c:89
static HRESULT WINAPI IDPLobbySPImpl_AddGroupToGroup(IDPLobbySP *iface, SPDATA_ADDREMOTEGROUPTOGROUP *argtg)
Definition: lobbysp.c:81
HRESULT dplobbysp_create(REFIID riid, void **ppv, IDirectPlayImpl *dp)
Definition: lobbysp.c:230
static HRESULT WINAPI IDPLobbySPImpl_GetSPDataPointer(IDPLobbySP *iface, LPVOID *lplpData)
Definition: lobbysp.c:145
static HRESULT WINAPI IDPLobbySPImpl_SetSessionDesc(IDPLobbySP *iface, SPDATA_SETSESSIONDESC *ssd)
Definition: lobbysp.c:183
static HRESULT WINAPI IDPLobbySPImpl_SendChatMessage(IDPLobbySP *iface, SPDATA_CHATMESSAGE *cm)
Definition: lobbysp.c:159
static ULONG WINAPI IDPLobbySPImpl_Release(IDPLobbySP *iface)
Definition: lobbysp.c:68
static HRESULT WINAPI IDPLobbySPImpl_DeleteGroupFromGroup(IDPLobbySP *iface, SPDATA_DELETEREMOTEGROUPFROMGROUP *drgfg)
Definition: lobbysp.c:113
static const IDPLobbySPVtbl dpLobbySPVT
Definition: lobbysp.c:207
#define IDPLobbySP_QueryInterface(p, a, b)
Definition: lobbysp.h:492
#define IDPLobbySP_Release(p)
Definition: lobbysp.h:494
#define IDPLobbySP_AddRef(p)
Definition: lobbysp.h:493
long LONG
Definition: pedump.c:60
#define IsEqualGUID(rguid1, rguid2)
Definition: guiddef.h:147
#define REFIID
Definition: guiddef.h:118
HRESULT hr
Definition: shlfolder.c:183
#define TRACE(s)
Definition: solgame.cpp:4
IDirectPlayImpl * dplay
Definition: lobbysp.c:33
IDPLobbySP IDPLobbySP_iface
Definition: lobbysp.c:31
Definition: send.c:48
#define CONTAINING_RECORD(address, type, field)
Definition: typedefs.h:260
uint32_t ULONG
Definition: typedefs.h:59
#define WINAPI
Definition: msvc.h:6
#define E_NOINTERFACE
Definition: winerror.h:2364