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
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 **ret_iface
)
47 if (IsEqualGUID(riid
, &IID_IUnknown
) || IsEqualGUID(riid
, &IID_IDirectPlay8LobbiedApplication
)) {
48 IDirectPlay8LobbiedApplication_AddRef(iface
);
53 WARN("(%p)->(%s,%p): not found\n", iface
, debugstr_guid(riid
), ret_iface
);
57 static ULONG WINAPI
IDirectPlay8LobbiedApplicationImpl_AddRef(IDirectPlay8LobbiedApplication
*iface
)
59 IDirectPlay8LobbiedApplicationImpl
*This
= impl_from_IDirectPlay8LobbiedApplication(iface
);
60 ULONG refCount
= InterlockedIncrement(&This
->ref
);
62 TRACE("(%p)->(ref before=%lu)\n", This
, refCount
- 1);
67 static ULONG WINAPI
IDirectPlay8LobbiedApplicationImpl_Release(IDirectPlay8LobbiedApplication
*iface
)
69 IDirectPlay8LobbiedApplicationImpl
*This
= impl_from_IDirectPlay8LobbiedApplication(iface
);
70 ULONG refCount
= InterlockedDecrement(&This
->ref
);
72 TRACE("(%p)->(ref before=%lu)\n", This
, refCount
+ 1);
75 HeapFree(GetProcessHeap(), 0, This
);
80 /* IDirectPlay8LobbiedApplication Interface follow: */
82 static HRESULT WINAPI
IDirectPlay8LobbiedApplicationImpl_Initialize(IDirectPlay8LobbiedApplication
*iface
,
83 void * const pvUserContext
, const PFNDPNMESSAGEHANDLER pfn
,
84 DPNHANDLE
* const pdpnhConnection
, const DWORD dwFlags
)
86 IDirectPlay8LobbiedApplicationImpl
*This
= impl_from_IDirectPlay8LobbiedApplication(iface
);
88 TRACE("(%p)->(%p %p %p %lx)\n", This
, pvUserContext
, pfn
, pdpnhConnection
, dwFlags
);
91 return DPNERR_INVALIDPOINTER
;
93 This
->msghandler
= pfn
;
94 This
->flags
= dwFlags
;
95 This
->usercontext
= pvUserContext
;
96 This
->connection
= pdpnhConnection
;
103 static HRESULT WINAPI
IDirectPlay8LobbiedApplicationImpl_RegisterProgram(IDirectPlay8LobbiedApplication
*iface
,
104 PDPL_PROGRAM_DESC pdplProgramDesc
, const DWORD dwFlags
)
106 IDirectPlay8LobbiedApplicationImpl
*This
= impl_from_IDirectPlay8LobbiedApplication(iface
);
107 FIXME("(%p): stub\n", This
);
111 static HRESULT WINAPI
IDirectPlay8LobbiedApplicationImpl_UnRegisterProgram(IDirectPlay8LobbiedApplication
*iface
,
112 GUID
*pguidApplication
, const DWORD dwFlags
)
114 IDirectPlay8LobbiedApplicationImpl
*This
= impl_from_IDirectPlay8LobbiedApplication(iface
);
115 FIXME("(%p): stub\n", This
);
119 static HRESULT WINAPI
IDirectPlay8LobbiedApplicationImpl_Send(IDirectPlay8LobbiedApplication
*iface
,
120 const DPNHANDLE hConnection
, BYTE
* const pBuffer
, const DWORD pBufferSize
,
123 IDirectPlay8LobbiedApplicationImpl
*This
= impl_from_IDirectPlay8LobbiedApplication(iface
);
124 FIXME("(%p): stub\n", This
);
128 static HRESULT WINAPI
IDirectPlay8LobbiedApplicationImpl_SetAppAvailable(IDirectPlay8LobbiedApplication
*iface
,
129 const BOOL fAvailable
, const DWORD dwFlags
)
131 IDirectPlay8LobbiedApplicationImpl
*This
= impl_from_IDirectPlay8LobbiedApplication(iface
);
132 FIXME("(%p): stub\n", This
);
136 static HRESULT WINAPI
IDirectPlay8LobbiedApplicationImpl_UpdateStatus(IDirectPlay8LobbiedApplication
*iface
,
137 const DPNHANDLE hConnection
, const DWORD dwStatus
, const DWORD dwFlags
)
139 IDirectPlay8LobbiedApplicationImpl
*This
= impl_from_IDirectPlay8LobbiedApplication(iface
);
140 FIXME("(%p): stub\n", This
);
144 static HRESULT WINAPI
IDirectPlay8LobbiedApplicationImpl_Close(IDirectPlay8LobbiedApplication
*iface
,
147 IDirectPlay8LobbiedApplicationImpl
*This
= impl_from_IDirectPlay8LobbiedApplication(iface
);
148 FIXME("(%p): stub\n", This
);
152 static HRESULT WINAPI
IDirectPlay8LobbiedApplicationImpl_GetConnectionSettings(IDirectPlay8LobbiedApplication
*iface
,
153 const DPNHANDLE hConnection
, DPL_CONNECTION_SETTINGS
* const pdplSessionInfo
,
154 DWORD
*pdwInfoSize
, const DWORD dwFlags
)
156 IDirectPlay8LobbiedApplicationImpl
*This
= impl_from_IDirectPlay8LobbiedApplication(iface
);
157 FIXME("(%p): stub\n", This
);
161 static HRESULT WINAPI
IDirectPlay8LobbiedApplicationImpl_SetConnectionSettings(IDirectPlay8LobbiedApplication
*iface
,
162 const DPNHANDLE hConnection
, const DPL_CONNECTION_SETTINGS
* const pdplSessionInfo
,
165 IDirectPlay8LobbiedApplicationImpl
*This
= impl_from_IDirectPlay8LobbiedApplication(iface
);
166 FIXME("(%p): stub\n", This
);
170 static const IDirectPlay8LobbiedApplicationVtbl DirectPlay8LobbiedApplication_Vtbl
=
172 IDirectPlay8LobbiedApplicationImpl_QueryInterface
,
173 IDirectPlay8LobbiedApplicationImpl_AddRef
,
174 IDirectPlay8LobbiedApplicationImpl_Release
,
175 IDirectPlay8LobbiedApplicationImpl_Initialize
,
176 IDirectPlay8LobbiedApplicationImpl_RegisterProgram
,
177 IDirectPlay8LobbiedApplicationImpl_UnRegisterProgram
,
178 IDirectPlay8LobbiedApplicationImpl_Send
,
179 IDirectPlay8LobbiedApplicationImpl_SetAppAvailable
,
180 IDirectPlay8LobbiedApplicationImpl_UpdateStatus
,
181 IDirectPlay8LobbiedApplicationImpl_Close
,
182 IDirectPlay8LobbiedApplicationImpl_GetConnectionSettings
,
183 IDirectPlay8LobbiedApplicationImpl_SetConnectionSettings
188 HRESULT
DPNET_CreateDirectPlay8LobbiedApp(LPCLASSFACTORY iface
, LPUNKNOWN punkOuter
, REFIID riid
, LPVOID
*ppobj
) {
189 IDirectPlay8LobbiedApplicationImpl
* app
;
191 TRACE("(%p, %s, %p)\n", punkOuter
, debugstr_guid(riid
), ppobj
);
193 app
= HeapAlloc(GetProcessHeap(), HEAP_ZERO_MEMORY
, sizeof(IDirectPlay8LobbiedApplicationImpl
));
196 return E_OUTOFMEMORY
;
198 app
->IDirectPlay8LobbiedApplication_iface
.lpVtbl
= &DirectPlay8LobbiedApplication_Vtbl
;
200 return IDirectPlay8LobbiedApplicationImpl_QueryInterface(&app
->IDirectPlay8LobbiedApplication_iface
,