crypt32: Fix adding trusted roots to store.
[wine/zf.git] / dlls / dpnet / lobbiedapp.c
blobd58571aca8748e5f4c8e4135cb7f93cf4b472daa
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
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 static inline IDirectPlay8LobbiedApplicationImpl *impl_from_IDirectPlay8LobbiedApplication(IDirectPlay8LobbiedApplication *iface)
39 return CONTAINING_RECORD(iface, IDirectPlay8LobbiedApplicationImpl,
40 IDirectPlay8LobbiedApplication_iface);
43 /* IDirectPlay8LobbiedApplication IUnknown parts follow: */
44 static HRESULT WINAPI IDirectPlay8LobbiedApplicationImpl_QueryInterface(IDirectPlay8LobbiedApplication *iface,
45 REFIID riid, void **ppobj)
47 IDirectPlay8LobbiedApplicationImpl *This = impl_from_IDirectPlay8LobbiedApplication(iface);
49 if (IsEqualGUID(riid, &IID_IUnknown)
50 || IsEqualGUID(riid, &IID_IDirectPlay8LobbiedApplication)) {
51 IUnknown_AddRef(iface);
52 *ppobj = This;
53 return DPN_OK;
56 WARN("(%p)->(%s,%p),not found\n",This,debugstr_guid(riid),ppobj);
57 return E_NOINTERFACE;
60 static ULONG WINAPI IDirectPlay8LobbiedApplicationImpl_AddRef(IDirectPlay8LobbiedApplication *iface)
62 IDirectPlay8LobbiedApplicationImpl *This = impl_from_IDirectPlay8LobbiedApplication(iface);
63 ULONG refCount = InterlockedIncrement(&This->ref);
65 TRACE("(%p)->(ref before=%u)\n", This, refCount - 1);
67 return refCount;
70 static ULONG WINAPI IDirectPlay8LobbiedApplicationImpl_Release(IDirectPlay8LobbiedApplication *iface)
72 IDirectPlay8LobbiedApplicationImpl *This = impl_from_IDirectPlay8LobbiedApplication(iface);
73 ULONG refCount = InterlockedDecrement(&This->ref);
75 TRACE("(%p)->(ref before=%u)\n", This, refCount + 1);
77 if (!refCount) {
78 HeapFree(GetProcessHeap(), 0, This);
80 return refCount;
83 /* IDirectPlay8LobbiedApplication Interface follow: */
85 static HRESULT WINAPI IDirectPlay8LobbiedApplicationImpl_Initialize(IDirectPlay8LobbiedApplication *iface,
86 void * const pvUserContext, const PFNDPNMESSAGEHANDLER pfn,
87 DPNHANDLE * const pdpnhConnection, const DWORD dwFlags)
89 IDirectPlay8LobbiedApplicationImpl *This = impl_from_IDirectPlay8LobbiedApplication(iface);
91 TRACE("(%p)->(%p %p %p %x)\n", This, pvUserContext, pfn, pdpnhConnection, dwFlags);
93 if(!pfn)
94 return DPNERR_INVALIDPOINTER;
96 This->msghandler = pfn;
97 This->flags = dwFlags;
98 This->usercontext = pvUserContext;
99 This->connection = pdpnhConnection;
101 init_winsock();
103 return DPN_OK;
106 static HRESULT WINAPI IDirectPlay8LobbiedApplicationImpl_RegisterProgram(IDirectPlay8LobbiedApplication *iface,
107 PDPL_PROGRAM_DESC pdplProgramDesc, const DWORD dwFlags)
109 IDirectPlay8LobbiedApplicationImpl *This = impl_from_IDirectPlay8LobbiedApplication(iface);
110 FIXME("(%p): stub\n", This);
111 return DPN_OK;
114 static HRESULT WINAPI IDirectPlay8LobbiedApplicationImpl_UnRegisterProgram(IDirectPlay8LobbiedApplication *iface,
115 GUID *pguidApplication, const DWORD dwFlags)
117 IDirectPlay8LobbiedApplicationImpl *This = impl_from_IDirectPlay8LobbiedApplication(iface);
118 FIXME("(%p): stub\n", This);
119 return DPN_OK;
122 static HRESULT WINAPI IDirectPlay8LobbiedApplicationImpl_Send(IDirectPlay8LobbiedApplication *iface,
123 const DPNHANDLE hConnection, BYTE * const pBuffer, const DWORD pBufferSize,
124 const DWORD dwFlags)
126 IDirectPlay8LobbiedApplicationImpl *This = impl_from_IDirectPlay8LobbiedApplication(iface);
127 FIXME("(%p): stub\n", This);
128 return DPN_OK;
131 static HRESULT WINAPI IDirectPlay8LobbiedApplicationImpl_SetAppAvailable(IDirectPlay8LobbiedApplication *iface,
132 const BOOL fAvailable, const DWORD dwFlags)
134 IDirectPlay8LobbiedApplicationImpl *This = impl_from_IDirectPlay8LobbiedApplication(iface);
135 FIXME("(%p): stub\n", This);
136 return DPN_OK;
139 static HRESULT WINAPI IDirectPlay8LobbiedApplicationImpl_UpdateStatus(IDirectPlay8LobbiedApplication *iface,
140 const DPNHANDLE hConnection, const DWORD dwStatus, const DWORD dwFlags)
142 IDirectPlay8LobbiedApplicationImpl *This = impl_from_IDirectPlay8LobbiedApplication(iface);
143 FIXME("(%p): stub\n", This);
144 return DPN_OK;
147 static HRESULT WINAPI IDirectPlay8LobbiedApplicationImpl_Close(IDirectPlay8LobbiedApplication *iface,
148 const DWORD dwFlags)
150 IDirectPlay8LobbiedApplicationImpl *This = impl_from_IDirectPlay8LobbiedApplication(iface);
151 FIXME("(%p): stub\n", This);
152 return DPN_OK;
155 static HRESULT WINAPI IDirectPlay8LobbiedApplicationImpl_GetConnectionSettings(IDirectPlay8LobbiedApplication *iface,
156 const DPNHANDLE hConnection, DPL_CONNECTION_SETTINGS * const pdplSessionInfo,
157 DWORD *pdwInfoSize, const DWORD dwFlags)
159 IDirectPlay8LobbiedApplicationImpl *This = impl_from_IDirectPlay8LobbiedApplication(iface);
160 FIXME("(%p): stub\n", This);
161 return DPN_OK;
164 static HRESULT WINAPI IDirectPlay8LobbiedApplicationImpl_SetConnectionSettings(IDirectPlay8LobbiedApplication *iface,
165 const DPNHANDLE hConnection, const DPL_CONNECTION_SETTINGS * const pdplSessionInfo,
166 const DWORD dwFlags)
168 IDirectPlay8LobbiedApplicationImpl *This = impl_from_IDirectPlay8LobbiedApplication(iface);
169 FIXME("(%p): stub\n", This);
170 return DPN_OK;
173 static const IDirectPlay8LobbiedApplicationVtbl DirectPlay8LobbiedApplication_Vtbl =
175 IDirectPlay8LobbiedApplicationImpl_QueryInterface,
176 IDirectPlay8LobbiedApplicationImpl_AddRef,
177 IDirectPlay8LobbiedApplicationImpl_Release,
178 IDirectPlay8LobbiedApplicationImpl_Initialize,
179 IDirectPlay8LobbiedApplicationImpl_RegisterProgram,
180 IDirectPlay8LobbiedApplicationImpl_UnRegisterProgram,
181 IDirectPlay8LobbiedApplicationImpl_Send,
182 IDirectPlay8LobbiedApplicationImpl_SetAppAvailable,
183 IDirectPlay8LobbiedApplicationImpl_UpdateStatus,
184 IDirectPlay8LobbiedApplicationImpl_Close,
185 IDirectPlay8LobbiedApplicationImpl_GetConnectionSettings,
186 IDirectPlay8LobbiedApplicationImpl_SetConnectionSettings
191 HRESULT DPNET_CreateDirectPlay8LobbiedApp(LPCLASSFACTORY iface, LPUNKNOWN punkOuter, REFIID riid, LPVOID *ppobj) {
192 IDirectPlay8LobbiedApplicationImpl* app;
194 TRACE("(%p, %s, %p)\n", punkOuter, debugstr_guid(riid), ppobj);
196 app = HeapAlloc(GetProcessHeap(), HEAP_ZERO_MEMORY, sizeof(IDirectPlay8LobbiedApplicationImpl));
197 if (NULL == app) {
198 *ppobj = NULL;
199 return E_OUTOFMEMORY;
201 app->IDirectPlay8LobbiedApplication_iface.lpVtbl = &DirectPlay8LobbiedApplication_Vtbl;
202 app->ref = 0;
203 return IDirectPlay8LobbiedApplicationImpl_QueryInterface(&app->IDirectPlay8LobbiedApplication_iface,
204 riid, ppobj);