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
33 #include "wine/debug.h"
36 #include "dpnet_private.h"
38 WINE_DEFAULT_DEBUG_CHANNEL(dpnet);
40 /* IDirectPlay8Client IUnknown parts follow: */
41 static HRESULT WINAPI IDirectPlay8ClientImpl_QueryInterface(PDIRECTPLAY8CLIENT iface, REFIID riid, LPVOID *ppobj)
43 IDirectPlay8ClientImpl *This = (IDirectPlay8ClientImpl *)iface;
45 if (IsEqualGUID(riid, &IID_IUnknown)
46 || IsEqualGUID(riid, &IID_IDirectPlay8Client)) {
47 IUnknown_AddRef(iface);
52 WARN("(%p)->(%s,%p),not found\n",This,debugstr_guid(riid),ppobj);
56 static ULONG WINAPI IDirectPlay8ClientImpl_AddRef(PDIRECTPLAY8CLIENT iface) {
57 IDirectPlay8ClientImpl *This = (IDirectPlay8ClientImpl *)iface;
58 ULONG refCount = InterlockedIncrement(&This->ref);
60 TRACE("(%p)->(ref before=%u)\n", This, refCount - 1);
65 static ULONG WINAPI IDirectPlay8ClientImpl_Release(PDIRECTPLAY8CLIENT iface) {
66 IDirectPlay8ClientImpl *This = (IDirectPlay8ClientImpl *)iface;
67 ULONG refCount = InterlockedDecrement(&This->ref);
69 TRACE("(%p)->(ref before=%u)\n", This, refCount + 1);
72 HeapFree(GetProcessHeap(), 0, This);
77 /* IDirectPlay8Client Interface follow: */
79 static HRESULT WINAPI IDirectPlay8ClientImpl_Initialize(PDIRECTPLAY8CLIENT iface, PVOID CONST pvUserContext, CONST PFNDPNMESSAGEHANDLER pfn, CONST DWORD dwFlags) {
80 IDirectPlay8ClientImpl *This = (IDirectPlay8ClientImpl *)iface;
81 FIXME("(%p):(%p,%p,%x): Stub\n", This, pvUserContext, pfn, dwFlags);
85 static HRESULT WINAPI IDirectPlay8ClientImpl_EnumServiceProviders(PDIRECTPLAY8CLIENT iface,
86 CONST GUID * CONST pguidServiceProvider,
87 CONST GUID * CONST pguidApplication,
88 DPN_SERVICE_PROVIDER_INFO * CONST pSPInfoBuffer,
89 PDWORD CONST pcbEnumData,
90 PDWORD CONST pcReturned,
91 CONST DWORD dwFlags) {
92 IDirectPlay8ClientImpl *This = (IDirectPlay8ClientImpl *)iface;
93 FIXME("(%p):(%x): Stub\n", This, dwFlags);
97 static HRESULT WINAPI IDirectPlay8ClientImpl_EnumHosts(PDIRECTPLAY8CLIENT iface,
98 PDPN_APPLICATION_DESC CONST pApplicationDesc,
99 IDirectPlay8Address * CONST pAddrHost,
100 IDirectPlay8Address * CONST pDeviceInfo,
101 PVOID CONST pUserEnumData, CONST DWORD dwUserEnumDataSize, CONST DWORD dwEnumCount,
102 CONST DWORD dwRetryInterval,
103 CONST DWORD dwTimeOut,
104 PVOID CONST pvUserContext,
105 DPNHANDLE * CONST pAsyncHandle,
106 CONST DWORD dwFlags) {
107 IDirectPlay8ClientImpl *This = (IDirectPlay8ClientImpl *)iface;
108 /*FIXME("(%p):(%p,%p,%p,%p,%lu,%lu,%lu,%lu): Stub\n", This, pApplicationDesc, pAddrHost, pDeviceInfo, pUserEnumData, dwUserEnumDataSize, dwEnumCount, dwRetryInterval, dwTimeOut);*/
109 FIXME("(%p):(%p,%p,%x): Stub\n", This, pvUserContext, pAsyncHandle, dwFlags);
113 static HRESULT WINAPI IDirectPlay8ClientImpl_CancelAsyncOperation(PDIRECTPLAY8CLIENT iface, CONST DPNHANDLE hAsyncHandle, CONST DWORD dwFlags) {
114 IDirectPlay8ClientImpl *This = (IDirectPlay8ClientImpl *)iface;
115 FIXME("(%p):(%u,%x): Stub\n", This, hAsyncHandle, dwFlags);
119 static HRESULT WINAPI IDirectPlay8ClientImpl_Connect(PDIRECTPLAY8CLIENT iface,
120 CONST DPN_APPLICATION_DESC * CONST pdnAppDesc,
121 IDirectPlay8Address * CONST pHostAddr,
122 IDirectPlay8Address * CONST pDeviceInfo,
123 CONST DPN_SECURITY_DESC * CONST pdnSecurity,
124 CONST DPN_SECURITY_CREDENTIALS * CONST pdnCredentials,
125 CONST void * CONST pvUserConnectData,
126 CONST DWORD dwUserConnectDataSize,
127 void * CONST pvAsyncContext,
128 DPNHANDLE * CONST phAsyncHandle,
129 CONST DWORD dwFlags) {
130 IDirectPlay8ClientImpl *This = (IDirectPlay8ClientImpl *)iface;
131 FIXME("(%p):(%p,%p,%x): Stub\n", This, pvAsyncContext, phAsyncHandle, dwFlags);
135 static HRESULT WINAPI IDirectPlay8ClientImpl_Send(PDIRECTPLAY8CLIENT iface,
136 CONST DPN_BUFFER_DESC * CONST prgBufferDesc,
137 CONST DWORD cBufferDesc,
138 CONST DWORD dwTimeOut,
139 void * CONST pvAsyncContext,
140 DPNHANDLE * CONST phAsyncHandle,
141 CONST DWORD dwFlags) {
142 IDirectPlay8ClientImpl *This = (IDirectPlay8ClientImpl *)iface;
143 FIXME("(%p):(%p,%p,%x): Stub\n", This, pvAsyncContext, phAsyncHandle, dwFlags);
147 static HRESULT WINAPI IDirectPlay8ClientImpl_GetSendQueueInfo(PDIRECTPLAY8CLIENT iface, DWORD * CONST pdwNumMsgs, DWORD * CONST pdwNumBytes, CONST DWORD dwFlags) {
148 IDirectPlay8ClientImpl *This = (IDirectPlay8ClientImpl *)iface;
149 FIXME("(%p):(%x): Stub\n", This, dwFlags);
153 static HRESULT WINAPI IDirectPlay8ClientImpl_GetApplicationDesc(PDIRECTPLAY8CLIENT iface, DPN_APPLICATION_DESC * CONST pAppDescBuffer, DWORD * CONST pcbDataSize, CONST DWORD dwFlags) {
154 IDirectPlay8ClientImpl *This = (IDirectPlay8ClientImpl *)iface;
155 FIXME("(%p):(%x): Stub\n", This, dwFlags);
159 static HRESULT WINAPI IDirectPlay8ClientImpl_SetClientInfo(PDIRECTPLAY8CLIENT iface,
160 CONST DPN_PLAYER_INFO * CONST pdpnPlayerInfo,
161 PVOID CONST pvAsyncContext,
162 DPNHANDLE * CONST phAsyncHandle,
163 CONST DWORD dwFlags) {
164 IDirectPlay8ClientImpl *This = (IDirectPlay8ClientImpl *)iface;
165 FIXME("(%p):(%p,%p,%x): Stub\n", This, pvAsyncContext, phAsyncHandle, dwFlags);
169 static HRESULT WINAPI IDirectPlay8ClientImpl_GetServerInfo(PDIRECTPLAY8CLIENT iface, DPN_PLAYER_INFO * CONST pdpnPlayerInfo, DWORD * CONST pdwSize, CONST DWORD dwFlags) {
170 IDirectPlay8ClientImpl *This = (IDirectPlay8ClientImpl *)iface;
171 FIXME("(%p):(%x): Stub\n", This, dwFlags);
175 static HRESULT WINAPI IDirectPlay8ClientImpl_GetServerAddress(PDIRECTPLAY8CLIENT iface, IDirectPlay8Address ** CONST pAddress, CONST DWORD dwFlags) {
176 IDirectPlay8ClientImpl *This = (IDirectPlay8ClientImpl *)iface;
177 FIXME("(%p):(%x): Stub\n", This, dwFlags);
181 static HRESULT WINAPI IDirectPlay8ClientImpl_Close(PDIRECTPLAY8CLIENT iface, CONST DWORD dwFlags) {
182 IDirectPlay8ClientImpl *This = (IDirectPlay8ClientImpl *)iface;
183 FIXME("(%p):(%x): Stub\n", This, dwFlags);
187 static HRESULT WINAPI IDirectPlay8ClientImpl_ReturnBuffer(PDIRECTPLAY8CLIENT iface, CONST DPNHANDLE hBufferHandle, CONST DWORD dwFlags) {
188 IDirectPlay8ClientImpl *This = (IDirectPlay8ClientImpl *)iface;
189 FIXME("(%p):(%x): Stub\n", This, dwFlags);
193 static HRESULT WINAPI IDirectPlay8ClientImpl_GetCaps(PDIRECTPLAY8CLIENT iface, DPN_CAPS * CONST pdpCaps, CONST DWORD dwFlags) {
194 IDirectPlay8ClientImpl *This = (IDirectPlay8ClientImpl *)iface;
195 FIXME("(%p):(%x): Stub\n", This, dwFlags);
199 static HRESULT WINAPI IDirectPlay8ClientImpl_SetCaps(PDIRECTPLAY8CLIENT iface, CONST DPN_CAPS * CONST pdpCaps, CONST DWORD dwFlags) {
200 IDirectPlay8ClientImpl *This = (IDirectPlay8ClientImpl *)iface;
201 FIXME("(%p):(%x): Stub\n", This, dwFlags);
205 static HRESULT WINAPI IDirectPlay8ClientImpl_SetSPCaps(PDIRECTPLAY8CLIENT iface, CONST GUID * CONST pguidSP, CONST DPN_SP_CAPS * CONST pdpspCaps, CONST DWORD dwFlags ) {
206 IDirectPlay8ClientImpl *This = (IDirectPlay8ClientImpl *)iface;
207 FIXME("(%p):(%x): Stub\n", This, dwFlags);
211 static HRESULT WINAPI IDirectPlay8ClientImpl_GetSPCaps(PDIRECTPLAY8CLIENT iface, CONST GUID * CONST pguidSP, DPN_SP_CAPS * CONST pdpspCaps, CONST DWORD dwFlags) {
212 IDirectPlay8ClientImpl *This = (IDirectPlay8ClientImpl *)iface;
213 FIXME("(%p):(%x): Stub\n", This, dwFlags);
217 static HRESULT WINAPI IDirectPlay8ClientImpl_GetConnectionInfo(PDIRECTPLAY8CLIENT iface, DPN_CONNECTION_INFO * CONST pdpConnectionInfo, CONST DWORD dwFlags) {
218 IDirectPlay8ClientImpl *This = (IDirectPlay8ClientImpl *)iface;
219 FIXME("(%p):(%x): Stub\n", This, dwFlags);
223 static HRESULT WINAPI IDirectPlay8ClientImpl_RegisterLobby(PDIRECTPLAY8CLIENT iface, CONST DPNHANDLE dpnHandle, struct IDirectPlay8LobbiedApplication * CONST pIDP8LobbiedApplication, CONST DWORD dwFlags) {
224 IDirectPlay8ClientImpl *This = (IDirectPlay8ClientImpl *)iface;
225 FIXME("(%p):(%x): Stub\n", This, dwFlags);
229 static const IDirectPlay8ClientVtbl DirectPlay8Client_Vtbl =
231 IDirectPlay8ClientImpl_QueryInterface,
232 IDirectPlay8ClientImpl_AddRef,
233 IDirectPlay8ClientImpl_Release,
234 IDirectPlay8ClientImpl_Initialize,
235 IDirectPlay8ClientImpl_EnumServiceProviders,
236 IDirectPlay8ClientImpl_EnumHosts,
237 IDirectPlay8ClientImpl_CancelAsyncOperation,
238 IDirectPlay8ClientImpl_Connect,
239 IDirectPlay8ClientImpl_Send,
240 IDirectPlay8ClientImpl_GetSendQueueInfo,
241 IDirectPlay8ClientImpl_GetApplicationDesc,
242 IDirectPlay8ClientImpl_SetClientInfo,
243 IDirectPlay8ClientImpl_GetServerInfo,
244 IDirectPlay8ClientImpl_GetServerAddress,
245 IDirectPlay8ClientImpl_Close,
246 IDirectPlay8ClientImpl_ReturnBuffer,
247 IDirectPlay8ClientImpl_GetCaps,
248 IDirectPlay8ClientImpl_SetCaps,
249 IDirectPlay8ClientImpl_SetSPCaps,
250 IDirectPlay8ClientImpl_GetSPCaps,
251 IDirectPlay8ClientImpl_GetConnectionInfo,
252 IDirectPlay8ClientImpl_RegisterLobby
255 HRESULT DPNET_CreateDirectPlay8Client(LPCLASSFACTORY iface, LPUNKNOWN punkOuter, REFIID riid, LPVOID *ppobj) {
256 IDirectPlay8ClientImpl* client;
258 TRACE("(%p, %s, %p)\n", punkOuter, debugstr_guid(riid), ppobj);
260 client = HeapAlloc(GetProcessHeap(), HEAP_ZERO_MEMORY, sizeof(IDirectPlay8ClientImpl));
261 if (NULL == client) {
263 return E_OUTOFMEMORY;
265 client->lpVtbl = &DirectPlay8Client_Vtbl;
266 client->ref = 0; /* will be inited with QueryInterface */
267 return IDirectPlay8ClientImpl_QueryInterface ((PDIRECTPLAY8CLIENT)client, riid, ppobj);