winevulkan: Avoid zero-sized allocations.
[wine.git] / dlls / dpnet / client.c
blob4af8daf6d3e8bbbb562b3feec01d2cb2e66f71fe
1 /*
2 * DirectPlay8 Client
3 *
4 * Copyright 2004 Raphael Junqueira
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
23 #include <stdarg.h>
25 #define COBJMACROS
26 #include "windef.h"
27 #include "winbase.h"
28 #include "wingdi.h"
29 #include "winuser.h"
30 #include "objbase.h"
31 #include "wine/debug.h"
33 #include "dpnet_private.h"
35 WINE_DEFAULT_DEBUG_CHANNEL(dpnet);
37 typedef struct IDirectPlay8LobbyClientImpl
39 IDirectPlay8LobbyClient IDirectPlay8LobbyClient_iface;
40 LONG ref;
42 PFNDPNMESSAGEHANDLER msghandler;
43 DWORD flags;
44 void *usercontext;
45 } IDirectPlay8LobbyClientImpl;
47 static inline IDirectPlay8LobbyClientImpl *impl_from_IDirectPlay8LobbyClient(IDirectPlay8LobbyClient *iface)
49 return CONTAINING_RECORD(iface, IDirectPlay8LobbyClientImpl, IDirectPlay8LobbyClient_iface);
52 static inline IDirectPlay8ClientImpl *impl_from_IDirectPlay8Client(IDirectPlay8Client *iface)
54 return CONTAINING_RECORD(iface, IDirectPlay8ClientImpl, IDirectPlay8Client_iface);
57 /* IDirectPlay8Client IUnknown parts follow: */
58 static HRESULT WINAPI IDirectPlay8ClientImpl_QueryInterface(IDirectPlay8Client *iface, REFIID riid,
59 void **ret_iface)
61 if (IsEqualGUID(riid, &IID_IUnknown) || IsEqualGUID(riid, &IID_IDirectPlay8Client)) {
62 IDirectPlay8Client_AddRef(iface);
63 *ret_iface = iface;
64 return S_OK;
67 WARN("(%p)->(%s,%p): not found\n", iface, debugstr_guid(riid), ret_iface);
68 return E_NOINTERFACE;
71 static ULONG WINAPI IDirectPlay8ClientImpl_AddRef(IDirectPlay8Client *iface)
73 IDirectPlay8ClientImpl *This = impl_from_IDirectPlay8Client(iface);
74 ULONG ref = InterlockedIncrement(&This->ref);
76 TRACE("(%p) ref=%lu\n", This, ref);
78 return ref;
81 static ULONG WINAPI IDirectPlay8ClientImpl_Release(IDirectPlay8Client *iface)
83 IDirectPlay8ClientImpl *This = impl_from_IDirectPlay8Client(iface);
84 ULONG ref = InterlockedDecrement(&This->ref);
86 TRACE("(%p) ref=%lu\n", This, ref);
88 if (!ref)
90 heap_free(This->username);
91 heap_free(This->data);
92 heap_free(This);
94 return ref;
97 /* IDirectPlay8Client Interface follow: */
99 static HRESULT WINAPI IDirectPlay8ClientImpl_Initialize(IDirectPlay8Client *iface,
100 void * const pvUserContext, const PFNDPNMESSAGEHANDLER pfn, const DWORD dwFlags)
102 IDirectPlay8ClientImpl *This = impl_from_IDirectPlay8Client(iface);
104 TRACE("(%p):(%p,%p,%lx)\n", This, pvUserContext, pfn, dwFlags);
106 if(!pfn)
107 return DPNERR_INVALIDPARAM;
109 This->usercontext = pvUserContext;
110 This->msghandler = pfn;
111 This->flags = dwFlags;
113 init_winsock();
115 return DPN_OK;
118 static HRESULT WINAPI IDirectPlay8ClientImpl_EnumServiceProviders(IDirectPlay8Client *iface,
119 const GUID * const pguidServiceProvider, const GUID * const pguidApplication,
120 DPN_SERVICE_PROVIDER_INFO * const pSPInfoBuffer, PDWORD const pcbEnumData,
121 PDWORD const pcReturned, const DWORD dwFlags)
123 IDirectPlay8ClientImpl *This = impl_from_IDirectPlay8Client(iface);
124 TRACE("(%p)->(%s,%s,%p,%p,%p,%lx)\n", This, debugstr_guid(pguidServiceProvider), debugstr_guid(pguidApplication),
125 pSPInfoBuffer, pcbEnumData, pcReturned, dwFlags);
127 if(dwFlags)
128 FIXME("Unhandled flags %lx\n", dwFlags);
130 if(pguidApplication)
131 FIXME("Application guid %s is currently being ignored\n", debugstr_guid(pguidApplication));
133 return enum_services_providers(pguidServiceProvider, pSPInfoBuffer, pcbEnumData, pcReturned);
136 static HRESULT WINAPI IDirectPlay8ClientImpl_EnumHosts(IDirectPlay8Client *iface,
137 PDPN_APPLICATION_DESC const pApplicationDesc, IDirectPlay8Address * const pAddrHost,
138 IDirectPlay8Address * const pDeviceInfo, void * const pUserEnumData,
139 const DWORD dwUserEnumDataSize, const DWORD dwEnumCount, const DWORD dwRetryInterval,
140 const DWORD dwTimeOut, void * const pvUserContext, DPNHANDLE * const pAsyncHandle,
141 const DWORD dwFlags)
143 IDirectPlay8ClientImpl *This = impl_from_IDirectPlay8Client(iface);
145 FIXME("(%p):(%p,%p,%p,%p,%lu,%lu,%lu,%lu,%p,%p,%lx)\n", This, pApplicationDesc, pAddrHost, pDeviceInfo, pUserEnumData,
146 dwUserEnumDataSize, dwEnumCount, dwRetryInterval, dwTimeOut, pvUserContext, pAsyncHandle, dwFlags);
148 if(!This->msghandler)
149 return DPNERR_UNINITIALIZED;
151 if((dwFlags & DPNENUMHOSTS_SYNC) && pAsyncHandle)
152 return DPNERR_INVALIDPARAM;
154 if(dwUserEnumDataSize > This->spcaps.dwMaxEnumPayloadSize)
155 return DPNERR_ENUMQUERYTOOLARGE;
157 return (dwFlags & DPNENUMHOSTS_SYNC) ? DPN_OK : DPNSUCCESS_PENDING;
160 static HRESULT WINAPI IDirectPlay8ClientImpl_CancelAsyncOperation(IDirectPlay8Client *iface,
161 const DPNHANDLE hAsyncHandle, const DWORD dwFlags)
163 IDirectPlay8ClientImpl *This = impl_from_IDirectPlay8Client(iface);
164 FIXME("(%p):(%lu,%lx): Stub\n", This, hAsyncHandle, dwFlags);
165 return DPN_OK;
168 static HRESULT WINAPI IDirectPlay8ClientImpl_Connect(IDirectPlay8Client *iface,
169 const DPN_APPLICATION_DESC * const pdnAppDesc, IDirectPlay8Address * const pHostAddr,
170 IDirectPlay8Address * const pDeviceInfo, const DPN_SECURITY_DESC * const pdnSecurity,
171 const DPN_SECURITY_CREDENTIALS * const pdnCredentials, const void * const pvUserConnectData,
172 const DWORD dwUserConnectDataSize, void * const pvAsyncContext,
173 DPNHANDLE * const phAsyncHandle, const DWORD dwFlags)
175 IDirectPlay8ClientImpl *This = impl_from_IDirectPlay8Client(iface);
176 FIXME("(%p):(%p,%p,%lx): Stub\n", This, pvAsyncContext, phAsyncHandle, dwFlags);
177 return DPN_OK;
180 static HRESULT WINAPI IDirectPlay8ClientImpl_Send(IDirectPlay8Client *iface,
181 const DPN_BUFFER_DESC * const prgBufferDesc, const DWORD cBufferDesc, const DWORD dwTimeOut,
182 void * const pvAsyncContext, DPNHANDLE * const phAsyncHandle, const DWORD dwFlags)
184 IDirectPlay8ClientImpl *This = impl_from_IDirectPlay8Client(iface);
185 FIXME("(%p):(%p,%p,%lx): Stub\n", This, pvAsyncContext, phAsyncHandle, dwFlags);
186 return DPN_OK;
189 static HRESULT WINAPI IDirectPlay8ClientImpl_GetSendQueueInfo(IDirectPlay8Client *iface,
190 DWORD * const pdwNumMsgs, DWORD * const pdwNumBytes, const DWORD dwFlags)
192 IDirectPlay8ClientImpl *This = impl_from_IDirectPlay8Client(iface);
193 FIXME("(%p):(%lx): Stub\n", This, dwFlags);
194 return DPN_OK;
197 static HRESULT WINAPI IDirectPlay8ClientImpl_GetApplicationDesc(IDirectPlay8Client *iface,
198 DPN_APPLICATION_DESC * const pAppDescBuffer, DWORD * const pcbDataSize, const DWORD dwFlags)
200 IDirectPlay8ClientImpl *This = impl_from_IDirectPlay8Client(iface);
201 FIXME("(%p):(%lx): Stub\n", This, dwFlags);
202 return DPN_OK;
205 static HRESULT WINAPI IDirectPlay8ClientImpl_SetClientInfo(IDirectPlay8Client *iface,
206 const DPN_PLAYER_INFO * const pdpnPlayerInfo, void * const pvAsyncContext,
207 DPNHANDLE * const phAsyncHandle, const DWORD dwFlags)
209 IDirectPlay8ClientImpl *This = impl_from_IDirectPlay8Client(iface);
210 FIXME("(%p):(%p,%p,%lx): Semi-stub.\n", This, pvAsyncContext, phAsyncHandle, dwFlags);
212 if(!pdpnPlayerInfo)
213 return E_POINTER;
215 if(phAsyncHandle)
216 FIXME("Async handle currently not supported.\n");
218 if (pdpnPlayerInfo->dwInfoFlags & DPNINFO_NAME)
220 heap_free(This->username);
221 This->username = NULL;
223 if(pdpnPlayerInfo->pwszName)
225 This->username = heap_strdupW(pdpnPlayerInfo->pwszName);
226 if (!This->username)
227 return E_OUTOFMEMORY;
231 if (pdpnPlayerInfo->dwInfoFlags & DPNINFO_DATA)
233 heap_free(This->data);
234 This->data = NULL;
235 This->datasize = 0;
237 if(!pdpnPlayerInfo->pvData && pdpnPlayerInfo->dwDataSize)
238 return E_POINTER;
240 if(pdpnPlayerInfo->dwDataSize && pdpnPlayerInfo->pvData)
242 This->data = heap_alloc(pdpnPlayerInfo->dwDataSize);
243 if (!This->data)
244 return E_OUTOFMEMORY;
246 This->datasize = pdpnPlayerInfo->dwDataSize;
248 memcpy(This->data, pdpnPlayerInfo->pvData, pdpnPlayerInfo->dwDataSize);
252 return DPN_OK;
255 static HRESULT WINAPI IDirectPlay8ClientImpl_GetServerInfo(IDirectPlay8Client *iface,
256 DPN_PLAYER_INFO * const pdpnPlayerInfo, DWORD * const pdwSize, const DWORD dwFlags)
258 IDirectPlay8ClientImpl *This = impl_from_IDirectPlay8Client(iface);
259 FIXME("(%p):(%lx): Stub\n", This, dwFlags);
260 return DPN_OK;
263 static HRESULT WINAPI IDirectPlay8ClientImpl_GetServerAddress(IDirectPlay8Client *iface,
264 IDirectPlay8Address ** const pAddress, const DWORD dwFlags)
266 IDirectPlay8ClientImpl *This = impl_from_IDirectPlay8Client(iface);
267 FIXME("(%p):(%lx): Stub\n", This, dwFlags);
268 return DPN_OK;
271 static HRESULT WINAPI IDirectPlay8ClientImpl_Close(IDirectPlay8Client *iface, const DWORD dwFlags)
273 IDirectPlay8ClientImpl *This = impl_from_IDirectPlay8Client(iface);
274 FIXME("(%p):(%lx): Stub\n", This, dwFlags);
276 This->msghandler = NULL;
278 return DPN_OK;
281 static HRESULT WINAPI IDirectPlay8ClientImpl_ReturnBuffer(IDirectPlay8Client *iface,
282 const DPNHANDLE hBufferHandle, const DWORD dwFlags)
284 IDirectPlay8ClientImpl *This = impl_from_IDirectPlay8Client(iface);
285 FIXME("(%p):(%lx): Stub\n", This, dwFlags);
286 return DPN_OK;
289 static HRESULT WINAPI IDirectPlay8ClientImpl_GetCaps(IDirectPlay8Client *iface,
290 DPN_CAPS * const pdpCaps, const DWORD dwFlags)
292 IDirectPlay8ClientImpl *This = impl_from_IDirectPlay8Client(iface);
293 FIXME("(%p):(%lx): Stub\n", This, dwFlags);
294 return DPN_OK;
297 static HRESULT WINAPI IDirectPlay8ClientImpl_SetCaps(IDirectPlay8Client *iface,
298 const DPN_CAPS * const pdpCaps, const DWORD dwFlags)
300 IDirectPlay8ClientImpl *This = impl_from_IDirectPlay8Client(iface);
301 FIXME("(%p):(%lx): Stub\n", This, dwFlags);
302 return DPN_OK;
305 static HRESULT WINAPI IDirectPlay8ClientImpl_SetSPCaps(IDirectPlay8Client *iface,
306 const GUID * const pguidSP, const DPN_SP_CAPS * const pdpspCaps, const DWORD dwFlags)
308 IDirectPlay8ClientImpl *This = impl_from_IDirectPlay8Client(iface);
310 TRACE("(%p)->(%p,%p,%lx): stub\n", iface, pguidSP, pdpspCaps, dwFlags);
312 if(!This->msghandler || pdpspCaps->dwSize != sizeof(DPN_SP_CAPS))
313 return DPNERR_INVALIDPARAM;
315 /* Only dwSystemBufferSize is set by this call. */
316 This->spcaps.dwSystemBufferSize = pdpspCaps->dwSystemBufferSize;
318 return DPN_OK;
321 static HRESULT WINAPI IDirectPlay8ClientImpl_GetSPCaps(IDirectPlay8Client *iface,
322 const GUID * const pguidSP, DPN_SP_CAPS * const pdpspCaps, const DWORD dwFlags)
324 IDirectPlay8ClientImpl *This = impl_from_IDirectPlay8Client(iface);
326 TRACE("(%p)->(%p,%p,%lx)\n", This, pguidSP, pdpspCaps, dwFlags);
328 if(!This->msghandler)
329 return DPNERR_UNINITIALIZED;
331 if(pdpspCaps->dwSize != sizeof(DPN_SP_CAPS))
333 return DPNERR_INVALIDPARAM;
336 *pdpspCaps = This->spcaps;
338 return DPN_OK;
341 static HRESULT WINAPI IDirectPlay8ClientImpl_GetConnectionInfo(IDirectPlay8Client *iface,
342 DPN_CONNECTION_INFO * const pdpConnectionInfo, const DWORD dwFlags)
344 IDirectPlay8ClientImpl *This = impl_from_IDirectPlay8Client(iface);
345 FIXME("(%p):(%lx): Stub\n", This, dwFlags);
346 return DPN_OK;
349 static HRESULT WINAPI IDirectPlay8ClientImpl_RegisterLobby(IDirectPlay8Client *iface,
350 const DPNHANDLE dpnHandle,
351 struct IDirectPlay8LobbiedApplication * const pIDP8LobbiedApplication, const DWORD dwFlags)
353 IDirectPlay8ClientImpl *This = impl_from_IDirectPlay8Client(iface);
354 FIXME("(%p):(%lx): Stub\n", This, dwFlags);
355 return DPN_OK;
358 static const IDirectPlay8ClientVtbl DirectPlay8Client_Vtbl =
360 IDirectPlay8ClientImpl_QueryInterface,
361 IDirectPlay8ClientImpl_AddRef,
362 IDirectPlay8ClientImpl_Release,
363 IDirectPlay8ClientImpl_Initialize,
364 IDirectPlay8ClientImpl_EnumServiceProviders,
365 IDirectPlay8ClientImpl_EnumHosts,
366 IDirectPlay8ClientImpl_CancelAsyncOperation,
367 IDirectPlay8ClientImpl_Connect,
368 IDirectPlay8ClientImpl_Send,
369 IDirectPlay8ClientImpl_GetSendQueueInfo,
370 IDirectPlay8ClientImpl_GetApplicationDesc,
371 IDirectPlay8ClientImpl_SetClientInfo,
372 IDirectPlay8ClientImpl_GetServerInfo,
373 IDirectPlay8ClientImpl_GetServerAddress,
374 IDirectPlay8ClientImpl_Close,
375 IDirectPlay8ClientImpl_ReturnBuffer,
376 IDirectPlay8ClientImpl_GetCaps,
377 IDirectPlay8ClientImpl_SetCaps,
378 IDirectPlay8ClientImpl_SetSPCaps,
379 IDirectPlay8ClientImpl_GetSPCaps,
380 IDirectPlay8ClientImpl_GetConnectionInfo,
381 IDirectPlay8ClientImpl_RegisterLobby
384 HRESULT DPNET_CreateDirectPlay8Client(IClassFactory *iface, IUnknown *pUnkOuter, REFIID riid, void **ppv)
386 IDirectPlay8ClientImpl* client;
387 HRESULT hr;
389 TRACE("(%p, %s, %p)\n", pUnkOuter, debugstr_guid(riid), ppv);
391 *ppv = NULL;
393 if(pUnkOuter)
394 return CLASS_E_NOAGGREGATION;
396 client = HeapAlloc(GetProcessHeap(), HEAP_ZERO_MEMORY, sizeof(IDirectPlay8ClientImpl));
397 if (!client)
398 return E_OUTOFMEMORY;
400 client->IDirectPlay8Client_iface.lpVtbl = &DirectPlay8Client_Vtbl;
401 client->ref = 1;
403 init_dpn_sp_caps(&client->spcaps);
405 hr = IDirectPlay8ClientImpl_QueryInterface(&client->IDirectPlay8Client_iface, riid, ppv);
406 IDirectPlay8ClientImpl_Release(&client->IDirectPlay8Client_iface);
408 return hr;
411 static HRESULT WINAPI lobbyclient_QueryInterface(IDirectPlay8LobbyClient *iface, REFIID riid, void **obj)
413 IDirectPlay8LobbyClientImpl *This = impl_from_IDirectPlay8LobbyClient(iface);
415 TRACE("(%p)->(%s %p)\n", This, debugstr_guid(riid), obj);
417 *obj = NULL;
419 if (IsEqualGUID(riid, &IID_IUnknown) ||
420 IsEqualGUID(riid, &IID_IDirectPlay8LobbyClient))
422 *obj = &This->IDirectPlay8LobbyClient_iface;
423 IUnknown_AddRef( (IUnknown*)*obj);
425 return DPN_OK;
428 WARN("(%p)->(%s,%p),not found\n",This,debugstr_guid(riid),obj);
429 return E_NOINTERFACE;
432 static ULONG WINAPI lobbyclient_AddRef(IDirectPlay8LobbyClient *iface)
434 IDirectPlay8LobbyClientImpl *This = impl_from_IDirectPlay8LobbyClient(iface);
435 ULONG ref = InterlockedIncrement(&This->ref);
437 TRACE("(%p) ref=%lu\n", This, ref);
439 return ref;
442 static ULONG WINAPI lobbyclient_Release(IDirectPlay8LobbyClient *iface)
444 IDirectPlay8LobbyClientImpl *This = impl_from_IDirectPlay8LobbyClient(iface);
445 ULONG ref = InterlockedDecrement(&This->ref);
447 TRACE("(%p) ref=%lu\n", This, ref);
449 if (!ref)
451 HeapFree(GetProcessHeap(), 0, This);
454 return ref;
457 static HRESULT WINAPI lobbyclient_Initialize(IDirectPlay8LobbyClient *iface, void *context,
458 PFNDPNMESSAGEHANDLER msghandler, DWORD flags)
460 IDirectPlay8LobbyClientImpl *This = impl_from_IDirectPlay8LobbyClient(iface);
462 TRACE("(%p):(%p,%p,%lx)\n", This, context, msghandler, flags);
464 if(!msghandler)
465 return E_POINTER;
467 This->usercontext = context;
468 This->msghandler = msghandler;
469 This->flags = flags;
471 init_winsock();
473 return DPN_OK;
476 static HRESULT WINAPI lobbyclient_EnumLocalPrograms(IDirectPlay8LobbyClient *iface, GUID* guidapplication,
477 BYTE *enumdata, DWORD *enumDataSize, DWORD *items, DWORD flags)
479 IDirectPlay8LobbyClientImpl *This = impl_from_IDirectPlay8LobbyClient(iface);
481 FIXME("(%p)->(%p %p %p %p 0x%08lx)\n", This, guidapplication, enumdata, enumDataSize, items, flags);
483 if(enumDataSize)
484 *enumDataSize = 0;
486 return S_OK;
489 static HRESULT WINAPI lobbyclient_ConnectApplication(IDirectPlay8LobbyClient *iface, DPL_CONNECT_INFO *connectioninfo,
490 void *connectioncontext, DPNHANDLE *application, DWORD timeout,
491 DWORD flags)
493 IDirectPlay8LobbyClientImpl *This = impl_from_IDirectPlay8LobbyClient(iface);
495 FIXME("(%p)->(%p %p %p %lu 0x%08lx)\n", This, connectioninfo, connectioncontext, application, timeout, flags);
497 return E_NOTIMPL;
500 static HRESULT WINAPI lobbyclient_Send(IDirectPlay8LobbyClient *iface, DPNHANDLE connection, BYTE *buffer, DWORD buffersize, DWORD flags)
502 IDirectPlay8LobbyClientImpl *This = impl_from_IDirectPlay8LobbyClient(iface);
504 FIXME("(%p)->(%lu %p %lu 0x%08lx)\n", This, connection, buffer, buffersize, flags);
506 return E_NOTIMPL;
509 static HRESULT WINAPI lobbyclient_ReleaseApplication(IDirectPlay8LobbyClient *iface, DPNHANDLE connection, DWORD flags)
511 IDirectPlay8LobbyClientImpl *This = impl_from_IDirectPlay8LobbyClient(iface);
513 FIXME("(%p)->(%lu 0x%08lx)\n", This, connection, flags);
515 return E_NOTIMPL;
518 static HRESULT WINAPI lobbyclient_Close(IDirectPlay8LobbyClient *iface, DWORD flags)
520 IDirectPlay8LobbyClientImpl *This = impl_from_IDirectPlay8LobbyClient(iface);
522 FIXME("(%p)->(0x%08lx)\n", This, flags);
524 return E_NOTIMPL;
527 static HRESULT WINAPI lobbyclient_GetConnectionSettings(IDirectPlay8LobbyClient *iface, DPNHANDLE connection, DPL_CONNECTION_SETTINGS *sessioninfo, DWORD *infosize, DWORD flags)
529 IDirectPlay8LobbyClientImpl *This = impl_from_IDirectPlay8LobbyClient(iface);
531 FIXME("(%p)->(%lu %p %p 0x%08lx)\n", This, connection, sessioninfo, infosize, flags);
533 return E_NOTIMPL;
536 static HRESULT WINAPI lobbyclient_SetConnectionSettings(IDirectPlay8LobbyClient *iface, DPNHANDLE connection, const DPL_CONNECTION_SETTINGS *sessioninfo, DWORD flags)
538 IDirectPlay8LobbyClientImpl *This = impl_from_IDirectPlay8LobbyClient(iface);
540 FIXME("(%p)->(%lu %p 0x%08lx)\n", This, connection, sessioninfo, flags);
542 return E_NOTIMPL;
545 static const IDirectPlay8LobbyClientVtbl DirectPlay8LobbiedClient_Vtbl =
547 lobbyclient_QueryInterface,
548 lobbyclient_AddRef,
549 lobbyclient_Release,
550 lobbyclient_Initialize,
551 lobbyclient_EnumLocalPrograms,
552 lobbyclient_ConnectApplication,
553 lobbyclient_Send,
554 lobbyclient_ReleaseApplication,
555 lobbyclient_Close,
556 lobbyclient_GetConnectionSettings,
557 lobbyclient_SetConnectionSettings
560 HRESULT DPNET_CreateDirectPlay8LobbyClient(IClassFactory *iface, IUnknown *outer, REFIID riid, void **obj)
562 IDirectPlay8LobbyClientImpl *client;
563 HRESULT ret;
565 TRACE("%p (%p, %s, %p)\n", iface, outer, debugstr_guid(riid), obj);
567 client = HeapAlloc(GetProcessHeap(), HEAP_ZERO_MEMORY, sizeof(*client));
568 if (!client)
570 *obj = NULL;
571 return E_OUTOFMEMORY;
574 client->IDirectPlay8LobbyClient_iface.lpVtbl = &DirectPlay8LobbiedClient_Vtbl;
575 client->ref = 1;
577 ret = lobbyclient_QueryInterface(&client->IDirectPlay8LobbyClient_iface, riid, obj);
578 lobbyclient_Release(&client->IDirectPlay8LobbyClient_iface);
580 return ret;