~ [ source navigation ] ~ [ diff markup ] ~ [ identifier search ] ~ [ freetext search ] ~ [ file search ] ~

Wine Cross Reference
wine/dlls/dpnet/peer.c

Version: ~ [ wine-1.5.31 ] ~ [ wine-1.5.30 ] ~ [ wine-1.5.29 ] ~ [ wine-1.5.28 ] ~ [ wine-1.5.27 ] ~ [ wine-1.5.26 ] ~ [ wine-1.5.25 ] ~ [ wine-1.5.24 ] ~ [ wine-1.5.23 ] ~ [ wine-1.5.22 ] ~ [ wine-1.5.21 ] ~ [ wine-1.5.20 ] ~ [ wine-1.5.19 ] ~ [ wine-1.5.18 ] ~ [ wine-1.5.17 ] ~ [ wine-1.5.16 ] ~ [ wine-1.5.15 ] ~ [ wine-1.5.14 ] ~ [ wine-1.5.13 ] ~ [ wine-1.5.12 ] ~ [ wine-1.5.11 ] ~ [ wine-1.5.10 ] ~ [ wine-1.5.9 ] ~ [ wine-1.5.8 ] ~ [ wine-1.5.7 ] ~ [ wine-1.4.1 ] ~ [ wine-1.5.6 ] ~ [ wine-1.5.5 ] ~ [ wine-1.5.4 ] ~ [ wine-1.5.3 ] ~ [ wine-1.5.2 ] ~ [ wine-1.5.1 ] ~ [ wine-1.5.0 ] ~ [ wine-1.4 ] ~ [ wine-1.4-rc6 ] ~ [ wine-1.4-rc5 ] ~ [ wine-1.4-rc4 ] ~ [ wine-1.4-rc3 ] ~ [ wine-1.4-rc2 ] ~ [ wine-1.4-rc1 ] ~ [ wine-1.3.37 ] ~ [ wine-1.3.36 ] ~ [ wine-1.3.35 ] ~ [ wine-1.3.34 ] ~ [ wine-1.3.33 ] ~ [ wine-1.3.32 ] ~ [ wine-1.3.31 ] ~ [ wine-1.3.30 ] ~ [ wine-1.3.29 ] ~ [ wine-1.3.28 ] ~ [ wine-1.3.27 ] ~ [ wine-1.3.26 ] ~ [ wine-1.3.25 ] ~ [ wine-1.3.24 ] ~ [ wine-1.3.23 ] ~ [ wine-1.3.22 ] ~ [ wine-1.3.21 ] ~ [ wine-1.3.20 ] ~ [ wine-1.3.19 ] ~ [ wine-1.3.18 ] ~ [ wine-1.2.3 ] ~ [ wine-1.3.17 ] ~ [ wine-1.3.16 ] ~ [ wine-1.3.15 ] ~ [ wine-1.3.14 ] ~ [ wine-1.3.13 ] ~ [ wine-1.3.12 ] ~ [ wine-1.3.11 ] ~ [ wine-1.3.10 ] ~ [ wine-1.3.9 ] ~ [ wine-1.2.2 ] ~ [ wine-1.3.8 ] ~ [ wine-1.3.7 ] ~ [ wine-1.3.6 ] ~ [ wine-1.3.5 ] ~ [ wine-1.2.1 ] ~ [ wine-1.3.4 ] ~ [ wine-1.3.3 ] ~ [ wine-1.3.2 ] ~ [ wine-1.3.1 ] ~ [ wine-1.3.0 ] ~ [ wine-1.2 ] ~ [ wine-1.2-rc7 ] ~ [ wine-1.2-rc6 ] ~ [ wine-1.2-rc5 ] ~ [ wine-1.2-rc4 ] ~ [ wine-1.2-rc3 ] ~ [ wine-1.2-rc2 ] ~ [ wine-1.2-rc1 ] ~ [ wine-1.1.44 ] ~ [ wine-1.1.43 ] ~ [ wine-1.1.42 ] ~ [ wine-1.1.41 ] ~ [ wine-1.1.40 ] ~ [ wine-1.1.39 ] ~ [ wine-1.1.38 ] ~ [ wine-1.1.37 ] ~ [ wine-1.1.36 ] ~ [ wine-1.1.35 ] ~ [ wine-1.1.34 ] ~ [ wine-1.1.33 ] ~ [ wine-1.1.32 ] ~ [ wine-1.1.31 ] ~ [ wine-1.1.30 ] ~ [ wine-1.1.29 ] ~ [ wine-1.1.28 ] ~ [ wine-1.1.27 ] ~ [ wine-1.1.26 ] ~ [ wine-1.1.25 ] ~ [ wine-1.1.24 ] ~ [ wine-1.1.23 ] ~ [ wine-1.1.22 ] ~ [ wine-1.1.21 ] ~ [ wine-1.1.20 ] ~ [ wine-1.1.19 ] ~ [ wine-1.1.18 ] ~ [ wine-1.1.17 ] ~ [ wine-1.1.16 ] ~ [ wine-1.1.15 ] ~ [ wine-1.1.14 ] ~ [ wine-1.1.13 ] ~ [ wine-1.1.12 ] ~ [ wine-1.1.11 ] ~ [ wine-1.1.10 ] ~ [ wine-1.1.9 ] ~ [ wine-1.1.8 ] ~ [ wine-1.1.7 ] ~ [ wine-1.0.1 ] ~ [ wine-1.1.6 ] ~ [ wine-1.1.5 ] ~ [ wine-1.1.4 ] ~ [ wine-1.1.3 ] ~ [ wine-1.1.2 ] ~ [ wine-1.1.1 ] ~ [ wine-1.1.0 ] ~ [ wine-1.0 ] ~

  1 /* 
  2  * DirectPlay8 Peer
  3  * 
  4  * Copyright 2004 Raphael Junqueira
  5  * Copyright 2008 Alexander N. Sørnes <alex@thehandofagony.com>
  6  *
  7  * This library is free software; you can redistribute it and/or
  8  * modify it under the terms of the GNU Lesser General Public
  9  * License as published by the Free Software Foundation; either
 10  * version 2.1 of the License, or (at your option) any later version.
 11  *
 12  * This library is distributed in the hope that it will be useful,
 13  * but WITHOUT ANY WARRANTY; without even the implied warranty of
 14  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
 15  * Lesser General Public License for more details.
 16  *
 17  * You should have received a copy of the GNU Lesser General Public
 18  * License along with this library; if not, write to the Free Software
 19  * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA
 20  *
 21  */
 22 
 23 #include "config.h"
 24 
 25 #include <stdarg.h>
 26 
 27 #define COBJMACROS
 28 #include "windef.h"
 29 #include "winbase.h"
 30 #include "wingdi.h"
 31 #include "winuser.h"
 32 #include "objbase.h"
 33 #include "wine/debug.h"
 34 
 35 #include "dplay8.h"
 36 #include "dpnet_private.h"
 37 
 38 WINE_DEFAULT_DEBUG_CHANNEL(dpnet);
 39 
 40 static inline IDirectPlay8PeerImpl *impl_from_IDirectPlay8Peer(IDirectPlay8Peer *iface)
 41 {
 42     return CONTAINING_RECORD(iface, IDirectPlay8PeerImpl, IDirectPlay8Peer_iface);
 43 }
 44 
 45 /* IUnknown interface follows */
 46 static HRESULT WINAPI IDirectPlay8PeerImpl_QueryInterface(IDirectPlay8Peer *iface, REFIID riid,
 47         void **ppobj)
 48 {
 49     IDirectPlay8PeerImpl* This = impl_from_IDirectPlay8Peer(iface);
 50 
 51     if(IsEqualGUID(riid, &IID_IUnknown) ||
 52        IsEqualGUID(riid, &IID_IDirectPlay8Peer))
 53     {
 54         IUnknown_AddRef(iface);
 55         *ppobj = This;
 56         return DPN_OK;
 57     }
 58 
 59     WARN("(%p)->(%s,%p): not found\n", This, debugstr_guid(riid), ppobj);
 60     return E_NOINTERFACE;
 61 }
 62 
 63 static ULONG WINAPI IDirectPlay8PeerImpl_AddRef(IDirectPlay8Peer *iface)
 64 {
 65     IDirectPlay8PeerImpl* This = impl_from_IDirectPlay8Peer(iface);
 66     ULONG RefCount = InterlockedIncrement(&This->ref);
 67 
 68     return RefCount;
 69 }
 70 
 71 static ULONG WINAPI IDirectPlay8PeerImpl_Release(IDirectPlay8Peer *iface)
 72 {
 73     IDirectPlay8PeerImpl* This = impl_from_IDirectPlay8Peer(iface);
 74     ULONG RefCount = InterlockedDecrement(&This->ref);
 75 
 76     if(!RefCount)
 77         HeapFree(GetProcessHeap(), 0, This);
 78 
 79     return RefCount;
 80 }
 81 
 82 /* IDirectPlay8Peer interface follows */
 83 
 84 static HRESULT WINAPI IDirectPlay8PeerImpl_Initialize(IDirectPlay8Peer *iface,
 85         void * const pvUserContext, const PFNDPNMESSAGEHANDLER pfn, const DWORD dwFlags)
 86 {
 87     FIXME("(%p)->(%p,%p,%x): stub\n", iface, pvUserContext, pfn, dwFlags);
 88 
 89     return DPNERR_GENERIC;
 90 }
 91 
 92 static HRESULT WINAPI IDirectPlay8PeerImpl_EnumServiceProviders(IDirectPlay8Peer *iface,
 93         const GUID * const pguidServiceProvider, const GUID * const pguidApplication,
 94         DPN_SERVICE_PROVIDER_INFO * const pSPInfoBuffer, DWORD * const pcbEnumData,
 95         DWORD * const pcReturned, const DWORD dwFlags)
 96 {
 97     FIXME("(%p)->(%p,%p,%p,%p,%p,%x): stub\n", iface, pguidServiceProvider, pguidApplication, pSPInfoBuffer, pcbEnumData, pcReturned, dwFlags);
 98     return DPNERR_GENERIC;
 99 }
100 
101 static HRESULT WINAPI IDirectPlay8PeerImpl_CancelAsyncOperation(IDirectPlay8Peer *iface,
102         const DPNHANDLE hAsyncHandle, const DWORD dwFlags)
103 {
104     FIXME("(%p)->(%x,%x): stub\n", iface, hAsyncHandle, dwFlags);
105 
106     return DPNERR_GENERIC;
107 }
108 
109 static HRESULT WINAPI IDirectPlay8PeerImpl_Connect(IDirectPlay8Peer *iface,
110         const DPN_APPLICATION_DESC * const pdnAppDesc, IDirectPlay8Address * const pHostAddr,
111         IDirectPlay8Address * const pDeviceInfo, const DPN_SECURITY_DESC * const pdnSecurity,
112         const DPN_SECURITY_CREDENTIALS * const pdnCredentials, const void * const pvUserConnectData,
113         const DWORD dwUserConnectDataSize, void * const pvPlayerContext,
114         void * const pvAsyncContext, DPNHANDLE * const phAsyncHandle, const DWORD dwFlags)
115 {
116     FIXME("(%p)->(%p,%p,%p,%p,%p,%p,%x,%p,%p,%p,%x): stub\n", iface, pdnAppDesc, pHostAddr, pDeviceInfo, pdnSecurity, pdnCredentials, pvUserConnectData, dwUserConnectDataSize, pvPlayerContext, pvAsyncContext, phAsyncHandle, dwFlags);
117 
118     return DPNERR_GENERIC;
119 }
120 
121 static HRESULT WINAPI IDirectPlay8PeerImpl_SendTo(IDirectPlay8Peer *iface, const DPNID dpnId,
122         const DPN_BUFFER_DESC *pBufferDesc, const DWORD cBufferDesc, const DWORD dwTimeOut,
123         void * const pvAsyncContext, DPNHANDLE * const phAsyncHandle, const DWORD dwFlags)
124 {
125     FIXME("(%p)->(%x,%p,%x,%x,%p,%p,%x): stub\n", iface, dpnId, pBufferDesc, cBufferDesc, dwTimeOut, pvAsyncContext, phAsyncHandle, dwFlags);
126 
127     return DPNERR_GENERIC;
128 }
129 
130 static HRESULT WINAPI IDirectPlay8PeerImpl_GetSendQueueInfo(IDirectPlay8Peer *iface,
131         const DPNID dpnid, DWORD * const pdwNumMsgs, DWORD * const pdwNumBytes, const DWORD dwFlags)
132 {
133     FIXME("(%p)->(%x,%p,%p,%x): stub\n", iface, dpnid, pdwNumMsgs, pdwNumBytes, dwFlags);
134 
135     return DPNERR_GENERIC;
136 }
137 
138 static HRESULT WINAPI IDirectPlay8PeerImpl_Host(IDirectPlay8Peer *iface,
139         const DPN_APPLICATION_DESC * const pdnAppDesc, IDirectPlay8Address ** const prgpDeviceInfo,
140         const DWORD cDeviceInfo, const DPN_SECURITY_DESC * const pdpSecurity,
141         const DPN_SECURITY_CREDENTIALS * const pdpCredentials, void * const pvPlayerContext,
142         const DWORD dwFlags)
143 {
144     FIXME("(%p)->(%p,%p,%x,%p,%p,%p,%x): stub\n", iface, pdnAppDesc, prgpDeviceInfo, cDeviceInfo, pdpSecurity, pdpCredentials, pvPlayerContext, dwFlags);
145 
146     return DPNERR_GENERIC;
147 }
148 
149 static HRESULT WINAPI IDirectPlay8PeerImpl_GetApplicationDesc(IDirectPlay8Peer *iface,
150         DPN_APPLICATION_DESC * const pAppDescBuffer, DWORD * const pcbDataSize, const DWORD dwFlags)
151 {
152     FIXME("(%p)->(%p,%p,%x): stub\n", iface, pAppDescBuffer, pcbDataSize, dwFlags);
153 
154     return DPNERR_GENERIC;
155 }
156 
157 static HRESULT WINAPI IDirectPlay8PeerImpl_SetApplicationDesc(IDirectPlay8Peer *iface,
158         const DPN_APPLICATION_DESC * const pad, const DWORD dwFlags)
159 {
160     FIXME("(%p)->(%p,%x): stub\n", iface, pad, dwFlags);
161 
162     return DPNERR_GENERIC;
163 }
164 
165 static HRESULT WINAPI IDirectPlay8PeerImpl_CreateGroup(IDirectPlay8Peer *iface,
166         const DPN_GROUP_INFO * const pdpnGroupInfo, void * const pvGroupContext,
167         void * const pvAsyncContext, DPNHANDLE * const phAsyncHandle, const DWORD dwFlags)
168 {
169     FIXME("(%p)->(%p,%p,%p,%p,%x): stub\n", iface, pdpnGroupInfo, pvGroupContext, pvAsyncContext, phAsyncHandle, dwFlags);
170 
171     return DPNERR_GENERIC;
172 }
173 
174 static HRESULT WINAPI IDirectPlay8PeerImpl_DestroyGroup(IDirectPlay8Peer *iface,
175         const DPNID idGroup, void * const pvAsyncContext, DPNHANDLE * const phAsyncHandle,
176         const DWORD dwFlags)
177 {
178     FIXME("(%p)->(%x,%p,%p,%x): stub\n", iface, idGroup, pvAsyncContext, phAsyncHandle, dwFlags);
179 
180     return DPNERR_GENERIC;
181 }
182 
183 static HRESULT WINAPI IDirectPlay8PeerImpl_AddPlayerToGroup(IDirectPlay8Peer *iface,
184         const DPNID idGroup, const DPNID idClient, void * const pvAsyncContext,
185         DPNHANDLE * const phAsyncHandle, const DWORD dwFlags)
186 {
187     FIXME("(%p)->(%x,%x,%p,%p,%x): stub\n", iface, idGroup, idClient, pvAsyncContext, phAsyncHandle, dwFlags);
188 
189     return DPNERR_GENERIC;
190 }
191 
192 static HRESULT WINAPI IDirectPlay8PeerImpl_RemovePlayerFromGroup(IDirectPlay8Peer *iface,
193         const DPNID idGroup, const DPNID idClient, void * const pvAsyncContext,
194         DPNHANDLE * const phAsyncHandle, const DWORD dwFlags)
195 {
196     FIXME("(%p)->(%x,%x,%p,%p,%x): stub\n", iface, idGroup, idClient, pvAsyncContext, phAsyncHandle, dwFlags);
197 
198     return DPNERR_GENERIC;
199 }
200 
201 static HRESULT WINAPI IDirectPlay8PeerImpl_SetGroupInfo(IDirectPlay8Peer *iface, const DPNID dpnid,
202         DPN_GROUP_INFO * const pdpnGroupInfo, void * const pvAsyncContext,
203         DPNHANDLE * const phAsyncHandle, const DWORD dwFlags)
204 {
205     FIXME("(%p)->(%x,%p,%p,%p,%x): stub\n", iface, dpnid, pdpnGroupInfo, pvAsyncContext, phAsyncHandle, dwFlags);
206 
207     return DPNERR_GENERIC;
208 }
209 
210 static HRESULT WINAPI IDirectPlay8PeerImpl_GetGroupInfo(IDirectPlay8Peer *iface, const DPNID dpnid,
211         DPN_GROUP_INFO * const pdpnGroupInfo, DWORD * const pdwSize, const DWORD dwFlags)
212 {
213     FIXME("(%p)->(%x,%p,%p,%x): stub\n", iface, dpnid, pdpnGroupInfo, pdwSize, dwFlags);
214 
215     return DPNERR_GENERIC;
216 }
217 
218 static HRESULT WINAPI IDirectPlay8PeerImpl_EnumPlayersAndGroups(IDirectPlay8Peer *iface,
219         DPNID * const prgdpnid, DWORD * const pcdpnid, const DWORD dwFlags)
220 {
221     FIXME("(%p)->(%p,%p,%x): stub\n", iface, prgdpnid, pcdpnid, dwFlags);
222 
223     return DPNERR_GENERIC;
224 }
225 
226 static HRESULT WINAPI IDirectPlay8PeerImpl_EnumGroupMembers(IDirectPlay8Peer *iface,
227         const DPNID dpnid, DPNID * const prgdpnid, DWORD * const pcdpnid, const DWORD dwFlags)
228 {
229     FIXME("(%p)->(%x,%p,%p,%x): stub\n", iface, dpnid, prgdpnid, pcdpnid, dwFlags);
230 
231     return DPNERR_GENERIC;
232 }
233 
234 static HRESULT WINAPI IDirectPlay8PeerImpl_SetPeerInfo(IDirectPlay8Peer *iface,
235         const DPN_PLAYER_INFO * const pdpnPlayerInfo, void * const pvAsyncContext,
236         DPNHANDLE * const phAsyncHandle, const DWORD dwFlags)
237 {
238     FIXME("(%p)->(%p,%p,%p,%x): stub\n", iface, pdpnPlayerInfo, pvAsyncContext, phAsyncHandle, dwFlags);
239 
240     return DPNERR_GENERIC;
241 }
242 
243 static HRESULT WINAPI IDirectPlay8PeerImpl_GetPeerInfo(IDirectPlay8Peer *iface, const DPNID dpnid,
244         DPN_PLAYER_INFO * const pdpnPlayerInfo, DWORD * const pdwSize, const DWORD dwFlags)
245 {
246     FIXME("(%p)->(%x,%p,%p,%x): stub\n", iface, dpnid, pdpnPlayerInfo, pdwSize, dwFlags);
247 
248     return DPNERR_GENERIC;
249 }
250 
251 static HRESULT WINAPI IDirectPlay8PeerImpl_GetPeerAddress(IDirectPlay8Peer *iface,
252         const DPNID dpnid, IDirectPlay8Address ** const pAddress, const DWORD dwFlags)
253 {
254     FIXME("(%p)->(%x,%p,%x): stub\n", iface, dpnid, pAddress, dwFlags);
255 
256     return DPNERR_GENERIC;
257 }
258 
259 static HRESULT WINAPI IDirectPlay8PeerImpl_GetLocalHostAddresses(IDirectPlay8Peer *iface,
260         IDirectPlay8Address ** const prgpAddress, DWORD * const pcAddress, const DWORD dwFlags)
261 {
262     FIXME("(%p)->(%p,%p,%x): stub\n", iface, prgpAddress, pcAddress, dwFlags);
263 
264     return DPNERR_GENERIC;
265 }
266 
267 static HRESULT WINAPI IDirectPlay8PeerImpl_Close(IDirectPlay8Peer *iface, const DWORD dwFlags)
268 {
269     FIXME("(%p)->(%x): stub\n", iface, dwFlags);
270 
271     return DPN_OK;
272 }
273 
274 static const IDirectPlay8PeerVtbl DirectPlay8Peer_Vtbl =
275 {
276     IDirectPlay8PeerImpl_QueryInterface,
277     IDirectPlay8PeerImpl_AddRef,
278     IDirectPlay8PeerImpl_Release,
279     IDirectPlay8PeerImpl_Initialize,
280     IDirectPlay8PeerImpl_EnumServiceProviders,
281     IDirectPlay8PeerImpl_CancelAsyncOperation,
282     IDirectPlay8PeerImpl_Connect,
283     IDirectPlay8PeerImpl_SendTo,
284     IDirectPlay8PeerImpl_GetSendQueueInfo,
285     IDirectPlay8PeerImpl_Host,
286     IDirectPlay8PeerImpl_GetApplicationDesc,
287     IDirectPlay8PeerImpl_SetApplicationDesc,
288     IDirectPlay8PeerImpl_CreateGroup,
289     IDirectPlay8PeerImpl_DestroyGroup,
290     IDirectPlay8PeerImpl_AddPlayerToGroup,
291     IDirectPlay8PeerImpl_RemovePlayerFromGroup,
292     IDirectPlay8PeerImpl_SetGroupInfo,
293     IDirectPlay8PeerImpl_GetGroupInfo,
294     IDirectPlay8PeerImpl_EnumPlayersAndGroups,
295     IDirectPlay8PeerImpl_EnumGroupMembers,
296     IDirectPlay8PeerImpl_SetPeerInfo,
297     IDirectPlay8PeerImpl_GetPeerInfo,
298     IDirectPlay8PeerImpl_GetPeerAddress,
299     IDirectPlay8PeerImpl_GetLocalHostAddresses,
300     IDirectPlay8PeerImpl_Close
301 };
302 
303 HRESULT DPNET_CreateDirectPlay8Peer(LPCLASSFACTORY iface, LPUNKNOWN punkOuter, REFIID riid, LPVOID *ppobj) {
304     IDirectPlay8PeerImpl* Client;
305     HRESULT ret;
306 
307     Client = HeapAlloc(GetProcessHeap(), HEAP_ZERO_MEMORY, sizeof(IDirectPlay8PeerImpl));
308 
309     if(Client == NULL)
310     {
311         *ppobj = NULL;
312         WARN("Not enough memory\n");
313         return E_OUTOFMEMORY;
314     }
315 
316     Client->IDirectPlay8Peer_iface.lpVtbl = &DirectPlay8Peer_Vtbl;
317     ret = IDirectPlay8PeerImpl_QueryInterface(&Client->IDirectPlay8Peer_iface, riid, ppobj);
318     if(ret != DPN_OK)
319         HeapFree(GetProcessHeap(), 0, Client);
320 
321     return ret;
322 }
323 

~ [ source navigation ] ~ [ diff markup ] ~ [ identifier search ] ~ [ freetext search ] ~ [ file search ] ~

This page was automatically generated by the LXR engine.
Visit the LXR main site for more information.