gphoto2.ds: Set supported groups.
[wine.git] / dlls / dpnet / lobbiedapp.c
blobd041e63624fa9643d928a521714fd401ae50f2d2
1 /*
2 * DirectPlay8 LobbiedApplication
4 * Copyright 2007 Jason Edmeades
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 "config.h"
24 #include <stdarg.h>
26 #define COBJMACROS
27 #include "windef.h"
28 #include "winbase.h"
29 #include "wingdi.h"
30 #include "winuser.h"
31 #include "objbase.h"
32 #include "wine/debug.h"
34 #include "dpnet_private.h"
36 WINE_DEFAULT_DEBUG_CHANNEL(dpnet);
38 static inline IDirectPlay8LobbiedApplicationImpl *impl_from_IDirectPlay8LobbiedApplication(IDirectPlay8LobbiedApplication *iface)
40 return CONTAINING_RECORD(iface, IDirectPlay8LobbiedApplicationImpl,
41 IDirectPlay8LobbiedApplication_iface);
44 /* IDirectPlay8LobbiedApplication IUnknown parts follow: */
45 static HRESULT WINAPI IDirectPlay8LobbiedApplicationImpl_QueryInterface(IDirectPlay8LobbiedApplication *iface,
46 REFIID riid, void **ppobj)
48 IDirectPlay8LobbiedApplicationImpl *This = impl_from_IDirectPlay8LobbiedApplication(iface);
50 if (IsEqualGUID(riid, &IID_IUnknown)
51 || IsEqualGUID(riid, &IID_IDirectPlay8LobbiedApplication)) {
52 IUnknown_AddRef(iface);
53 *ppobj = This;
54 return DPN_OK;
57 WARN("(%p)->(%s,%p),not found\n",This,debugstr_guid(riid),ppobj);
58 return E_NOINTERFACE;
61 static ULONG WINAPI IDirectPlay8LobbiedApplicationImpl_AddRef(IDirectPlay8LobbiedApplication *iface)
63 IDirectPlay8LobbiedApplicationImpl *This = impl_from_IDirectPlay8LobbiedApplication(iface);
64 ULONG refCount = InterlockedIncrement(&This->ref);
66 TRACE("(%p)->(ref before=%u)\n", This, refCount - 1);
68 return refCount;
71 static ULONG WINAPI IDirectPlay8LobbiedApplicationImpl_Release(IDirectPlay8LobbiedApplication *iface)
73 IDirectPlay8LobbiedApplicationImpl *This = impl_from_IDirectPlay8LobbiedApplication(iface);
74 ULONG refCount = InterlockedDecrement(&This->ref);
76 TRACE("(%p)->(ref before=%u)\n", This, refCount + 1);
78 if (!refCount) {
79 HeapFree(GetProcessHeap(), 0, This);
81 return refCount;
84 /* IDirectPlay8LobbiedApplication Interface follow: */
86 static HRESULT WINAPI IDirectPlay8LobbiedApplicationImpl_Initialize(IDirectPlay8LobbiedApplication *iface,
87 void * const pvUserContext, const PFNDPNMESSAGEHANDLER pfn,
88 DPNHANDLE * const pdpnhConnection, const DWORD dwFlags)
90 IDirectPlay8LobbiedApplicationImpl *This = impl_from_IDirectPlay8LobbiedApplication(iface);
92 TRACE("(%p)->(%p %p %p %x)\n", This, pvUserContext, pfn, pdpnhConnection, dwFlags);
94 if(!pfn)
95 return DPNERR_INVALIDPOINTER;
97 This->msghandler = pfn;
98 This->flags = dwFlags;
99 This->usercontext = pvUserContext;
100 This->connection = pdpnhConnection;
102 init_winsock();
104 return DPN_OK;
107 static HRESULT WINAPI IDirectPlay8LobbiedApplicationImpl_RegisterProgram(IDirectPlay8LobbiedApplication *iface,
108 PDPL_PROGRAM_DESC pdplProgramDesc, const DWORD dwFlags)
110 IDirectPlay8LobbiedApplicationImpl *This = impl_from_IDirectPlay8LobbiedApplication(iface);
111 FIXME("(%p): stub\n", This);
112 return DPN_OK;
115 static HRESULT WINAPI IDirectPlay8LobbiedApplicationImpl_UnRegisterProgram(IDirectPlay8LobbiedApplication *iface,
116 GUID *pguidApplication, const DWORD dwFlags)
118 IDirectPlay8LobbiedApplicationImpl *This = impl_from_IDirectPlay8LobbiedApplication(iface);
119 FIXME("(%p): stub\n", This);
120 return DPN_OK;
123 static HRESULT WINAPI IDirectPlay8LobbiedApplicationImpl_Send(IDirectPlay8LobbiedApplication *iface,
124 const DPNHANDLE hConnection, BYTE * const pBuffer, const DWORD pBufferSize,
125 const DWORD dwFlags)
127 IDirectPlay8LobbiedApplicationImpl *This = impl_from_IDirectPlay8LobbiedApplication(iface);
128 FIXME("(%p): stub\n", This);
129 return DPN_OK;
132 static HRESULT WINAPI IDirectPlay8LobbiedApplicationImpl_SetAppAvailable(IDirectPlay8LobbiedApplication *iface,
133 const BOOL fAvailable, const DWORD dwFlags)
135 IDirectPlay8LobbiedApplicationImpl *This = impl_from_IDirectPlay8LobbiedApplication(iface);
136 FIXME("(%p): stub\n", This);
137 return DPN_OK;
140 static HRESULT WINAPI IDirectPlay8LobbiedApplicationImpl_UpdateStatus(IDirectPlay8LobbiedApplication *iface,
141 const DPNHANDLE hConnection, const DWORD dwStatus, const DWORD dwFlags)
143 IDirectPlay8LobbiedApplicationImpl *This = impl_from_IDirectPlay8LobbiedApplication(iface);
144 FIXME("(%p): stub\n", This);
145 return DPN_OK;
148 static HRESULT WINAPI IDirectPlay8LobbiedApplicationImpl_Close(IDirectPlay8LobbiedApplication *iface,
149 const DWORD dwFlags)
151 IDirectPlay8LobbiedApplicationImpl *This = impl_from_IDirectPlay8LobbiedApplication(iface);
152 FIXME("(%p): stub\n", This);
153 return DPN_OK;
156 static HRESULT WINAPI IDirectPlay8LobbiedApplicationImpl_GetConnectionSettings(IDirectPlay8LobbiedApplication *iface,
157 const DPNHANDLE hConnection, DPL_CONNECTION_SETTINGS * const pdplSessionInfo,
158 DWORD *pdwInfoSize, const DWORD dwFlags)
160 IDirectPlay8LobbiedApplicationImpl *This = impl_from_IDirectPlay8LobbiedApplication(iface);
161 FIXME("(%p): stub\n", This);
162 return DPN_OK;
165 static HRESULT WINAPI IDirectPlay8LobbiedApplicationImpl_SetConnectionSettings(IDirectPlay8LobbiedApplication *iface,
166 const DPNHANDLE hConnection, const DPL_CONNECTION_SETTINGS * const pdplSessionInfo,
167 const DWORD dwFlags)
169 IDirectPlay8LobbiedApplicationImpl *This = impl_from_IDirectPlay8LobbiedApplication(iface);
170 FIXME("(%p): stub\n", This);
171 return DPN_OK;
174 static const IDirectPlay8LobbiedApplicationVtbl DirectPlay8LobbiedApplication_Vtbl =
176 IDirectPlay8LobbiedApplicationImpl_QueryInterface,
177 IDirectPlay8LobbiedApplicationImpl_AddRef,
178 IDirectPlay8LobbiedApplicationImpl_Release,
179 IDirectPlay8LobbiedApplicationImpl_Initialize,
180 IDirectPlay8LobbiedApplicationImpl_RegisterProgram,
181 IDirectPlay8LobbiedApplicationImpl_UnRegisterProgram,
182 IDirectPlay8LobbiedApplicationImpl_Send,
183 IDirectPlay8LobbiedApplicationImpl_SetAppAvailable,
184 IDirectPlay8LobbiedApplicationImpl_UpdateStatus,
185 IDirectPlay8LobbiedApplicationImpl_Close,
186 IDirectPlay8LobbiedApplicationImpl_GetConnectionSettings,
187 IDirectPlay8LobbiedApplicationImpl_SetConnectionSettings
192 HRESULT DPNET_CreateDirectPlay8LobbiedApp(LPCLASSFACTORY iface, LPUNKNOWN punkOuter, REFIID riid, LPVOID *ppobj) {
193 IDirectPlay8LobbiedApplicationImpl* app;
195 TRACE("(%p, %s, %p)\n", punkOuter, debugstr_guid(riid), ppobj);
197 app = HeapAlloc(GetProcessHeap(), HEAP_ZERO_MEMORY, sizeof(IDirectPlay8LobbiedApplicationImpl));
198 if (NULL == app) {
199 *ppobj = NULL;
200 return E_OUTOFMEMORY;
202 app->IDirectPlay8LobbiedApplication_iface.lpVtbl = &DirectPlay8LobbiedApplication_Vtbl;
203 app->ref = 0;
204 return IDirectPlay8LobbiedApplicationImpl_QueryInterface(&app->IDirectPlay8LobbiedApplication_iface,
205 riid, ppobj);