ReactOS  0.4.14-dev-614-gbfd8a84
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 
29 typedef struct IDPLobbySPImpl
30 {
31  IDPLobbySP IDPLobbySP_iface;
35 
36 static 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 
58 static ULONG WINAPI IDPLobbySPImpl_AddRef( IDPLobbySP *iface )
59 {
62 
63  TRACE( "(%p) ref=%d\n", This, ref );
64 
65  return ref;
66 }
67 
68 static ULONG WINAPI IDPLobbySPImpl_Release( IDPLobbySP *iface )
69 {
72 
73  TRACE( "(%p) ref=%d\n", This, ref );
74 
75  if( !ref )
76  HeapFree( GetProcessHeap(), 0, This );
77 
78  return ref;
79 }
80 
81 static HRESULT WINAPI IDPLobbySPImpl_AddGroupToGroup( IDPLobbySP *iface,
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 
97 static 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 
129 static HRESULT WINAPI IDPLobbySPImpl_DestroyGroup( IDPLobbySP *iface,
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 
145 static 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 
160  SPDATA_CHATMESSAGE *cm )
161 {
163  FIXME( "(%p)->(%p):stub\n", This, cm );
164  return DP_OK;
165 }
166 
167 static HRESULT WINAPI IDPLobbySPImpl_SetGroupName( IDPLobbySP *iface,
169 {
171  FIXME( "(%p)->(%p):stub\n", This, srgn );
172  return DP_OK;
173 }
174 
175 static HRESULT WINAPI IDPLobbySPImpl_SetPlayerName( IDPLobbySP *iface,
177 {
179  FIXME( "(%p)->(%p):stub\n", This, srpn );
180  return DP_OK;
181 }
182 
183 static HRESULT WINAPI IDPLobbySPImpl_SetSessionDesc( IDPLobbySP *iface,
184  SPDATA_SETSESSIONDESC *ssd )
185 {
187  FIXME( "(%p)->(%p):stub\n", This, ssd );
188  return DP_OK;
189 }
190 
191 static HRESULT WINAPI IDPLobbySPImpl_SetSPDataPointer( IDPLobbySP *iface, void *lpData )
192 {
194  FIXME( "(%p)->(%p):stub\n", This, lpData );
195  return DP_OK;
196 }
197 
198 static HRESULT WINAPI IDPLobbySPImpl_StartSession( IDPLobbySP *iface,
200 {
202  FIXME( "(%p)->(%p):stub\n", This, ssc );
203  return DP_OK;
204 }
205 
206 
207 static 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 }
static HRESULT WINAPI IDPLobbySPImpl_AddPlayerToGroup(IDPLobbySP *iface, SPDATA_ADDREMOTEPLAYERTOGROUP *arptg)
Definition: lobbysp.c:89
static HRESULT WINAPI IDPLobbySPImpl_DestroyGroup(IDPLobbySP *iface, SPDATA_DESTROYREMOTEGROUP *drg)
Definition: lobbysp.c:129
#define REFIID
Definition: guiddef.h:118
#define E_NOINTERFACE
Definition: winerror.h:2364
HRESULT hr
Definition: shlfolder.c:183
static HRESULT WINAPI IDPLobbySPImpl_HandleMessage(IDPLobbySP *iface, SPDATA_HANDLEMESSAGE *hm)
Definition: lobbysp.c:152
static HRESULT WINAPI IDPLobbySPImpl_AddGroupToGroup(IDPLobbySP *iface, SPDATA_ADDREMOTEGROUPTOGROUP *argtg)
Definition: lobbysp.c:81
REFIID riid
Definition: precomp.h:44
struct IDPLobbySPImpl IDPLobbySPImpl
REFIID LPVOID * ppv
Definition: atlbase.h:39
static HRESULT WINAPI IDPLobbySPImpl_CreateGroup(IDPLobbySP *iface, SPDATA_CREATEREMOTEGROUP *crg)
Definition: lobbysp.c:97
#define IDPLobbySP_AddRef(p)
Definition: lobbysp.h:493
#define DPERR_OUTOFMEMORY
Definition: dplay.h:109
HRESULT dplobbysp_create(REFIID riid, void **ppv, IDirectPlayImpl *dp)
Definition: lobbysp.c:230
Definition: send.c:47
WINE_DEFAULT_DEBUG_CHANNEL(dplay)
static HRESULT WINAPI IDPLobbySPImpl_DeletePlayerFromGroup(IDPLobbySP *iface, SPDATA_DELETEREMOTEPLAYERFROMGROUP *drpfg)
Definition: lobbysp.c:121
GLsizei GLsizei GLuint * obj
Definition: glext.h:6042
static HRESULT WINAPI IDPLobbySPImpl_SetSessionDesc(IDPLobbySP *iface, SPDATA_SETSESSIONDESC *ssd)
Definition: lobbysp.c:183
#define DP_OK
Definition: dplay.h:88
static HRESULT WINAPI IDPLobbySPImpl_CreateGroupInGroup(IDPLobbySP *iface, SPDATA_CREATEREMOTEGROUPINGROUP *crgig)
Definition: lobbysp.c:105
static HRESULT WINAPI IDPLobbySPImpl_GetSPDataPointer(IDPLobbySP *iface, LPVOID *lplpData)
Definition: lobbysp.c:145
long LONG
Definition: pedump.c:60
GLenum GLint ref
Definition: glext.h:6028
#define FIXME(fmt,...)
Definition: debug.h:110
smooth NULL
Definition: ftsmooth.c:416
#define debugstr_guid
Definition: kernel32.h:35
static HRESULT WINAPI IDPLobbySPImpl_EnumSessionsResponse(IDPLobbySP *iface, SPDATA_ENUMSESSIONSRESPONSE *er)
Definition: lobbysp.c:137
PFLT_MESSAGE_WAITER_QUEUE CONTAINING_RECORD(Csq, DEVICE_EXTENSION, IrpQueue)) -> WaiterQ.mLock) _IRQL_raises_(DISPATCH_LEVEL) VOID NTAPI FltpAcquireMessageWaiterLock(_In_ PIO_CSQ Csq, _Out_ PKIRQL Irql)
Definition: Messaging.c:560
static HRESULT WINAPI IDPLobbySPImpl_DeleteGroupFromGroup(IDPLobbySP *iface, SPDATA_DELETEREMOTEGROUPFROMGROUP *drgfg)
Definition: lobbysp.c:113
#define TRACE(s)
Definition: solgame.cpp:4
static HRESULT WINAPI IDPLobbySPImpl_QueryInterface(IDPLobbySP *iface, REFIID riid, void **ppv)
Definition: lobbysp.c:41
#define GetProcessHeap()
Definition: compat.h:403
PVOID WINAPI HeapAlloc(HANDLE, DWORD, SIZE_T)
LONG HRESULT
Definition: typedefs.h:77
const GUID IID_IUnknown
#define WINAPI
Definition: msvc.h:6
#define InterlockedDecrement
Definition: armddk.h:52
static ULONG WINAPI IDPLobbySPImpl_AddRef(IDPLobbySP *iface)
Definition: lobbysp.c:58
static HRESULT WINAPI IDPLobbySPImpl_SetPlayerName(IDPLobbySP *iface, SPDATA_SETREMOTEPLAYERNAME *srpn)
Definition: lobbysp.c:175
static HRESULT WINAPI IDPLobbySPImpl_SetSPDataPointer(IDPLobbySP *iface, void *lpData)
Definition: lobbysp.c:191
static HRESULT WINAPI IDPLobbySPImpl_SetGroupName(IDPLobbySP *iface, SPDATA_SETREMOTEGROUPNAME *srgn)
Definition: lobbysp.c:167
#define S_OK
Definition: intsafe.h:59
#define InterlockedIncrement
Definition: armddk.h:53
IDPLobbySP IDPLobbySP_iface
Definition: lobbysp.c:31
BOOL WINAPI IsEqualGUID(REFGUID rguid1, REFGUID rguid2)
Definition: compobj.c:4112
static IDPLobbySPImpl * impl_from_IDPLobbySP(IDPLobbySP *iface)
Definition: lobbysp.c:36
static HRESULT WINAPI IDPLobbySPImpl_StartSession(IDPLobbySP *iface, SPDATA_STARTSESSIONCOMMAND *ssc)
Definition: lobbysp.c:198
#define IDPLobbySP_QueryInterface(p, a, b)
Definition: lobbysp.h:492
static const IDPLobbySPVtbl dpLobbySPVT
Definition: lobbysp.c:207
unsigned int ULONG
Definition: retypes.h:1
static ULONG WINAPI IDPLobbySPImpl_Release(IDPLobbySP *iface)
Definition: lobbysp.c:68
#define IDPLobbySP_Release(p)
Definition: lobbysp.h:494
static HRESULT WINAPI IDPLobbySPImpl_SendChatMessage(IDPLobbySP *iface, SPDATA_CHATMESSAGE *cm)
Definition: lobbysp.c:159
#define HeapFree(x, y, z)
Definition: compat.h:402
IDirectPlayImpl * dplay
Definition: lobbysp.c:33