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., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
32 #include "wine/debug.h"
35 #include "dpnet_private.h"
37 WINE_DEFAULT_DEBUG_CHANNEL(dpnet
);
39 /* IDirectPlay8Client IUnknown parts follow: */
40 HRESULT WINAPI
IDirectPlay8ClientImpl_QueryInterface(PDIRECTPLAY8CLIENT iface
, REFIID riid
, LPVOID
*ppobj
)
42 ICOM_THIS(IDirectPlay8ClientImpl
,iface
);
44 if (IsEqualGUID(riid
, &IID_IUnknown
)
45 || IsEqualGUID(riid
, &IID_IDirectPlay8Client
)) {
46 IDirectPlay8ClientImpl_AddRef(iface
);
51 WARN("(%p)->(%s,%p),not found\n",This
,debugstr_guid(riid
),ppobj
);
55 ULONG WINAPI
IDirectPlay8ClientImpl_AddRef(PDIRECTPLAY8CLIENT iface
) {
56 ICOM_THIS(IDirectPlay8ClientImpl
,iface
);
57 TRACE("(%p) : AddRef from %ld\n", This
, This
->ref
);
61 ULONG WINAPI
IDirectPlay8ClientImpl_Release(PDIRECTPLAY8CLIENT iface
) {
62 ICOM_THIS(IDirectPlay8ClientImpl
,iface
);
63 ULONG ref
= --This
->ref
;
64 TRACE("(%p) : ReleaseRef to %ld\n", This
, This
->ref
);
66 HeapFree(GetProcessHeap(), 0, This
);
71 /* IDirectPlay8Client Interface follow: */
73 HRESULT WINAPI
IDirectPlay8ClientImpl_Initialize(PDIRECTPLAY8CLIENT iface
, PVOID CONST pvUserContext
, CONST PFNDPNMESSAGEHANDLER pfn
, CONST DWORD dwFlags
) {
74 ICOM_THIS(IDirectPlay8ClientImpl
,iface
);
75 FIXME("(%p):(%p,%p,%lx): Stub\n", This
, pvUserContext
, pfn
, dwFlags
);
79 HRESULT WINAPI
IDirectPlay8ClientImpl_EnumServiceProviders(PDIRECTPLAY8CLIENT iface
,
80 CONST GUID
* CONST pguidServiceProvider
,
81 CONST GUID
* CONST pguidApplication
,
82 DPN_SERVICE_PROVIDER_INFO
* CONST pSPInfoBuffer
,
83 PDWORD CONST pcbEnumData
,
84 PDWORD CONST pcReturned
,
85 CONST DWORD dwFlags
) {
86 ICOM_THIS(IDirectPlay8ClientImpl
,iface
);
87 FIXME("(%p):(%lx): Stub\n", This
, dwFlags
);
91 HRESULT WINAPI
IDirectPlay8ClientImpl_EnumHosts(PDIRECTPLAY8CLIENT iface
,
92 PDPN_APPLICATION_DESC CONST pApplicationDesc
,
93 IDirectPlay8Address
* CONST pAddrHost
,
94 IDirectPlay8Address
* CONST pDeviceInfo
,
95 PVOID CONST pUserEnumData
, CONST DWORD dwUserEnumDataSize
, CONST DWORD dwEnumCount
,
96 CONST DWORD dwRetryInterval
,
97 CONST DWORD dwTimeOut
,
98 PVOID CONST pvUserContext
,
99 DPNHANDLE
* CONST pAsyncHandle
,
100 CONST DWORD dwFlags
) {
101 ICOM_THIS(IDirectPlay8ClientImpl
,iface
);
102 /*FIXME("(%p):(%p,%p,%p,%p,%lu,%lu,%lu,%lu): Stub\n", This, pApplicationDesc, pAddrHost, pDeviceInfo, pUserEnumData, dwUserEnumDataSize, dwEnumCount, dwRetryInterval, dwTimeOut);*/
103 FIXME("(%p):(%p,%p,%lx): Stub\n", This
, pvUserContext
, pAsyncHandle
, dwFlags
);
107 HRESULT WINAPI
IDirectPlay8ClientImpl_CancelAsyncOperation(PDIRECTPLAY8CLIENT iface
, CONST DPNHANDLE hAsyncHandle
, CONST DWORD dwFlags
) {
108 ICOM_THIS(IDirectPlay8ClientImpl
,iface
);
109 FIXME("(%p):(%lu,%lx): Stub\n", This
, hAsyncHandle
, dwFlags
);
113 HRESULT WINAPI
IDirectPlay8ClientImpl_Connect(PDIRECTPLAY8CLIENT iface
,
114 CONST DPN_APPLICATION_DESC
* CONST pdnAppDesc
,
115 IDirectPlay8Address
* CONST pHostAddr
,
116 IDirectPlay8Address
* CONST pDeviceInfo
,
117 CONST DPN_SECURITY_DESC
* CONST pdnSecurity
,
118 CONST DPN_SECURITY_CREDENTIALS
* CONST pdnCredentials
,
119 CONST
void * CONST pvUserConnectData
,
120 CONST DWORD dwUserConnectDataSize
,
121 void * CONST pvAsyncContext
,
122 DPNHANDLE
* CONST phAsyncHandle
,
123 CONST DWORD dwFlags
) {
124 ICOM_THIS(IDirectPlay8ClientImpl
,iface
);
125 FIXME("(%p):(%p,%p,%lx): Stub\n", This
, pvAsyncContext
, phAsyncHandle
, dwFlags
);
129 HRESULT WINAPI
IDirectPlay8ClientImpl_Send(PDIRECTPLAY8CLIENT iface
,
130 CONST DPN_BUFFER_DESC
* CONST prgBufferDesc
,
131 CONST DWORD cBufferDesc
,
132 CONST DWORD dwTimeOut
,
133 void * CONST pvAsyncContext
,
134 DPNHANDLE
* CONST phAsyncHandle
,
135 CONST DWORD dwFlags
) {
136 ICOM_THIS(IDirectPlay8ClientImpl
,iface
);
137 FIXME("(%p):(%p,%p,%lx): Stub\n", This
, pvAsyncContext
, phAsyncHandle
, dwFlags
);
141 HRESULT WINAPI
IDirectPlay8ClientImpl_GetSendQueueInfo(PDIRECTPLAY8CLIENT iface
, DWORD
* CONST pdwNumMsgs
, DWORD
* CONST pdwNumBytes
, CONST DWORD dwFlags
) {
142 ICOM_THIS(IDirectPlay8ClientImpl
,iface
);
143 FIXME("(%p):(%lx): Stub\n", This
, dwFlags
);
147 HRESULT WINAPI
IDirectPlay8ClientImpl_GetApplicationDesc(PDIRECTPLAY8CLIENT iface
, DPN_APPLICATION_DESC
* CONST pAppDescBuffer
, DWORD
* CONST pcbDataSize
, CONST DWORD dwFlags
) {
148 ICOM_THIS(IDirectPlay8ClientImpl
,iface
);
149 FIXME("(%p):(%lx): Stub\n", This
, dwFlags
);
153 HRESULT WINAPI
IDirectPlay8ClientImpl_SetClientInfo(PDIRECTPLAY8CLIENT iface
,
154 CONST DPN_PLAYER_INFO
* CONST pdpnPlayerInfo
,
155 PVOID CONST pvAsyncContext
,
156 DPNHANDLE
* CONST phAsyncHandle
,
157 CONST DWORD dwFlags
) {
158 ICOM_THIS(IDirectPlay8ClientImpl
,iface
);
159 FIXME("(%p):(%p,%p,%lx): Stub\n", This
, pvAsyncContext
, phAsyncHandle
, dwFlags
);
163 HRESULT WINAPI
IDirectPlay8ClientImpl_GetServerInfo(PDIRECTPLAY8CLIENT iface
, DPN_PLAYER_INFO
* CONST pdpnPlayerInfo
, DWORD
* CONST pdwSize
, CONST DWORD dwFlags
) {
164 ICOM_THIS(IDirectPlay8ClientImpl
,iface
);
165 FIXME("(%p):(%lx): Stub\n", This
, dwFlags
);
169 HRESULT WINAPI
IDirectPlay8ClientImpl_GetServerAddress(PDIRECTPLAY8CLIENT iface
, IDirectPlay8Address
** CONST pAddress
, CONST DWORD dwFlags
) {
170 ICOM_THIS(IDirectPlay8ClientImpl
,iface
);
171 FIXME("(%p):(%lx): Stub\n", This
, dwFlags
);
175 HRESULT WINAPI
IDirectPlay8ClientImpl_Close(PDIRECTPLAY8CLIENT iface
, CONST DWORD dwFlags
) {
176 ICOM_THIS(IDirectPlay8ClientImpl
,iface
);
177 FIXME("(%p):(%lx): Stub\n", This
, dwFlags
);
181 HRESULT WINAPI
IDirectPlay8ClientImpl_ReturnBuffer(PDIRECTPLAY8CLIENT iface
, CONST DPNHANDLE hBufferHandle
, CONST DWORD dwFlags
) {
182 ICOM_THIS(IDirectPlay8ClientImpl
,iface
);
183 FIXME("(%p):(%lx): Stub\n", This
, dwFlags
);
187 HRESULT WINAPI
IDirectPlay8ClientImpl_GetCaps(PDIRECTPLAY8CLIENT iface
, DPN_CAPS
* CONST pdpCaps
, CONST DWORD dwFlags
) {
188 ICOM_THIS(IDirectPlay8ClientImpl
,iface
);
189 FIXME("(%p):(%lx): Stub\n", This
, dwFlags
);
193 HRESULT WINAPI
IDirectPlay8ClientImpl_SetCaps(PDIRECTPLAY8CLIENT iface
, CONST DPN_CAPS
* CONST pdpCaps
, CONST DWORD dwFlags
) {
194 ICOM_THIS(IDirectPlay8ClientImpl
,iface
);
195 FIXME("(%p):(%lx): Stub\n", This
, dwFlags
);
199 HRESULT WINAPI
IDirectPlay8ClientImpl_SetSPCaps(PDIRECTPLAY8CLIENT iface
, CONST GUID
* CONST pguidSP
, CONST DPN_SP_CAPS
* CONST pdpspCaps
, CONST DWORD dwFlags
) {
200 ICOM_THIS(IDirectPlay8ClientImpl
,iface
);
201 FIXME("(%p):(%lx): Stub\n", This
, dwFlags
);
205 HRESULT WINAPI
IDirectPlay8ClientImpl_GetSPCaps(PDIRECTPLAY8CLIENT iface
, CONST GUID
* CONST pguidSP
, DPN_SP_CAPS
* CONST pdpspCaps
, CONST DWORD dwFlags
) {
206 ICOM_THIS(IDirectPlay8ClientImpl
,iface
);
207 FIXME("(%p):(%lx): Stub\n", This
, dwFlags
);
211 HRESULT WINAPI
IDirectPlay8ClientImpl_GetConnectionInfo(PDIRECTPLAY8CLIENT iface
, DPN_CONNECTION_INFO
* CONST pdpConnectionInfo
, CONST DWORD dwFlags
) {
212 ICOM_THIS(IDirectPlay8ClientImpl
,iface
);
213 FIXME("(%p):(%lx): Stub\n", This
, dwFlags
);
217 HRESULT WINAPI
IDirectPlay8ClientImpl_RegisterLobby(PDIRECTPLAY8CLIENT iface
, CONST DPNHANDLE dpnHandle
, struct IDirectPlay8LobbiedApplication
* CONST pIDP8LobbiedApplication
, CONST DWORD dwFlags
) {
218 ICOM_THIS(IDirectPlay8ClientImpl
,iface
);
219 FIXME("(%p):(%lx): Stub\n", This
, dwFlags
);
223 IDirectPlay8ClientVtbl DirectPlay8Client_Vtbl
=
225 IDirectPlay8ClientImpl_QueryInterface
,
226 IDirectPlay8ClientImpl_AddRef
,
227 IDirectPlay8ClientImpl_Release
,
228 IDirectPlay8ClientImpl_Initialize
,
229 IDirectPlay8ClientImpl_EnumServiceProviders
,
230 IDirectPlay8ClientImpl_EnumHosts
,
231 IDirectPlay8ClientImpl_CancelAsyncOperation
,
232 IDirectPlay8ClientImpl_Connect
,
233 IDirectPlay8ClientImpl_Send
,
234 IDirectPlay8ClientImpl_GetSendQueueInfo
,
235 IDirectPlay8ClientImpl_GetApplicationDesc
,
236 IDirectPlay8ClientImpl_SetClientInfo
,
237 IDirectPlay8ClientImpl_GetServerInfo
,
238 IDirectPlay8ClientImpl_GetServerAddress
,
239 IDirectPlay8ClientImpl_Close
,
240 IDirectPlay8ClientImpl_ReturnBuffer
,
241 IDirectPlay8ClientImpl_GetCaps
,
242 IDirectPlay8ClientImpl_SetCaps
,
243 IDirectPlay8ClientImpl_SetSPCaps
,
244 IDirectPlay8ClientImpl_GetSPCaps
,
245 IDirectPlay8ClientImpl_GetConnectionInfo
,
246 IDirectPlay8ClientImpl_RegisterLobby
249 HRESULT
DPNET_CreateDirectPlay8Client(LPCLASSFACTORY iface
, LPUNKNOWN punkOuter
, REFIID riid
, LPVOID
*ppobj
) {
250 IDirectPlay8ClientImpl
* client
;
252 TRACE("(%p, %s, %p)\n", punkOuter
, debugstr_guid(riid
), ppobj
);
254 client
= HeapAlloc(GetProcessHeap(), HEAP_ZERO_MEMORY
, sizeof(IDirectPlay8ClientImpl
));
255 if (NULL
== client
) {
257 return E_OUTOFMEMORY
;
259 client
->lpVtbl
= &DirectPlay8Client_Vtbl
;
260 client
->ref
= 0; /* will be inited with QueryInterface */
261 return IDirectPlay8ClientImpl_QueryInterface ((PDIRECTPLAY8CLIENT
)client
, riid
, ppobj
);