included mci init sequence (from obsoleted init.c)
[wine] / multimedia / dplay.c
1 /* Direct Play 3 and Direct Play Lobby 2 Implementation
2  *
3  * Copyright 1998,1999 - Peter Hunnisett
4  *
5  * <presently under construction - contact hunnise@nortelnetworks.com>
6  *
7  */
8 #include <string.h>
9 #include "winerror.h"
10 #include "winnt.h"
11 #include "winreg.h"
12 #include "dplay.h"
13 #include "dplobby.h"
14 #include "heap.h"
15 #include "debug.h"
16
17 DEFAULT_DEBUG_CHANNEL(dplay)
18
19 /*****************************************************************************
20  * Predeclare the interface implementation structures
21  */
22 typedef struct IDirectPlayLobbyImpl IDirectPlayLobbyImpl;
23 typedef struct IDirectPlayLobbyImpl IDirectPlayLobbyAImpl;
24 typedef struct IDirectPlayLobbyImpl IDirectPlayLobbyWImpl;
25 typedef struct IDirectPlayLobby2Impl IDirectPlayLobby2Impl;
26 typedef struct IDirectPlayLobby2Impl IDirectPlayLobby2AImpl;
27 typedef struct IDirectPlay2Impl IDirectPlay2Impl;
28 typedef struct IDirectPlay2Impl IDirectPlay2AImpl;
29 typedef struct IDirectPlay3Impl IDirectPlay3Impl;
30 typedef struct IDirectPlay3Impl IDirectPlay3AImpl;
31
32 /*****************************************************************************
33  * IDirectPlayLobby implementation structure
34  */
35 struct IDirectPlayLobbyImpl
36 {
37     /* IUnknown fields */
38     ICOM_VTABLE(IDirectPlayLobby)* lpvtbl;
39     DWORD                          ref;
40     /* IDirectPlayLobbyImpl fields */
41     DWORD                    dwConnFlags;
42     DPSESSIONDESC2           sessionDesc;
43     DPNAME                   playerName;
44     GUID                     guidSP;
45     LPVOID                   lpAddress;
46     DWORD                    dwAddressSize;
47 };
48
49 /*****************************************************************************
50  * IDirectPlayLobby2 implementation structure
51  */
52 struct IDirectPlayLobby2Impl
53 {
54     /* IUnknown fields */
55     ICOM_VTABLE(IDirectPlayLobby2)* lpvtbl;
56     DWORD                           ref;
57     /* IDirectPlayLobby2Impl fields */
58     DWORD                     dwConnFlags;
59     DPSESSIONDESC2            lpSessionDesc;
60     DPNAME                    lpPlayerName;
61     GUID                      guidSP;
62     LPVOID                    lpAddress;
63     DWORD                     dwAddressSize;
64 };
65
66 /*****************************************************************************
67  * IDirectPlay2 implementation structure
68  */
69 struct IDirectPlay2Impl
70 {
71     /* IUnknown fields */
72     ICOM_VTABLE(IDirectPlay2)* lpvtbl;
73     DWORD                      ref;
74     /* IDirectPlay2Impl fields */
75     /* none */
76 };
77
78 /*****************************************************************************
79  * IDirectPlay3 implementation structure
80  */
81 struct IDirectPlay3Impl
82 {
83     /* IUnknown fields */
84     ICOM_VTABLE(IDirectPlay3)* lpvtbl;
85     DWORD                      ref;
86     /* IDirectPlay3Impl fields */
87     /* none */
88 };
89
90 /* Forward declarations of virtual tables */
91 static ICOM_VTABLE(IDirectPlayLobby) directPlayLobbyAVT;
92 static ICOM_VTABLE(IDirectPlayLobby) directPlayLobbyWVT;
93 static ICOM_VTABLE(IDirectPlayLobby2) directPlayLobby2AVT;
94 static ICOM_VTABLE(IDirectPlayLobby2) directPlayLobby2WVT;
95 static ICOM_VTABLE(IDirectPlay2) directPlay2WVT;
96 static ICOM_VTABLE(IDirectPlay2) directPlay2AVT;
97 static ICOM_VTABLE(IDirectPlay3) directPlay3WVT;
98 static ICOM_VTABLE(IDirectPlay3) directPlay3AVT;
99
100
101
102
103 /* Routine called when starting up the server thread */
104 DWORD DPLobby_Spawn_Server( LPVOID startData )
105 {
106   DPSESSIONDESC2* lpSession = (DPSESSIONDESC2*) startData;
107   DWORD sessionDwFlags = lpSession->dwFlags;
108  
109   TRACE( dplay, "spawing thread for lpConn=%p dwFlags=%08lx\n", lpSession, sessionDwFlags );
110   FIXME( dplay, "thread needs something to do\n" ); 
111
112 /*for(;;)*/
113   {
114      
115     /* Check out the connection flags to determine what to do. Ensure we have 
116        no leftover bits in this structure */
117     if( sessionDwFlags & DPSESSION_CLIENTSERVER )
118     {
119        /* This indicates that the application which is requesting the creation
120         * of this session is going to be the server (application/player)
121         */ 
122        if( sessionDwFlags & DPSESSION_SECURESERVER )
123        {
124          sessionDwFlags &= ~DPSESSION_SECURESERVER; 
125        }
126        sessionDwFlags &= ~DPSESSION_CLIENTSERVER;  
127     }
128
129     if( sessionDwFlags & DPSESSION_JOINDISABLED )
130     {
131        sessionDwFlags &= ~DPSESSION_JOINDISABLED; 
132     } 
133
134     if( sessionDwFlags & DPSESSION_KEEPALIVE )
135     {
136        sessionDwFlags &= ~DPSESSION_KEEPALIVE;
137     }
138
139     if( sessionDwFlags & DPSESSION_MIGRATEHOST )
140     {
141        sessionDwFlags &= ~DPSESSION_MIGRATEHOST;
142     }
143
144     if( sessionDwFlags & DPSESSION_MULTICASTSERVER )
145     {
146        sessionDwFlags &= ~DPSESSION_MULTICASTSERVER;
147     }
148
149     if( sessionDwFlags & DPSESSION_NEWPLAYERSDISABLED )
150     {
151        sessionDwFlags &= ~DPSESSION_NEWPLAYERSDISABLED; 
152     }
153
154     if( sessionDwFlags & DPSESSION_NODATAMESSAGES )
155     {
156        sessionDwFlags &= ~DPSESSION_NODATAMESSAGES; 
157     } 
158
159     if( sessionDwFlags & DPSESSION_NOMESSAGEID )
160     {
161        sessionDwFlags &= ~DPSESSION_NOMESSAGEID;
162     }
163
164     if( sessionDwFlags & DPSESSION_PASSWORDREQUIRED )
165     {
166        sessionDwFlags &= ~DPSESSION_PASSWORDREQUIRED;
167     }
168
169   }
170
171   ExitThread(0);
172   return 0; 
173 }
174
175
176 /*********************************************************
177  *
178  * Direct Play and Direct Play Lobby Interface Implementation 
179  * 
180  *********************************************************/ 
181
182 /* The COM interface for upversioning an interface
183  * We've been given a GUID (riid) and we need to replace the present
184  * interface with that of the requested interface.
185  *
186  * Snip from some Microsoft document:
187  * There are four requirements for implementations of QueryInterface (In these
188  * cases, "must succeed" means "must succeed barring catastrophic failure."):
189  *
190  *  * The set of interfaces accessible on an object through
191  *    IUnknown::QueryInterface must be static, not dynamic. This means that
192  *    if a call to QueryInterface for a pointer to a specified interface
193  *    succeeds the first time, it must succeed again, and if it fails the
194  *    first time, it must fail on all subsequent queries.
195  *  * It must be symmetric ~W if a client holds a pointer to an interface on
196  *    an object, and queries for that interface, the call must succeed.
197  *  * It must be reflexive ~W if a client holding a pointer to one interface
198  *    queries successfully for another, a query through the obtained pointer
199  *    for the first interface must succeed.
200  *  * It must be transitive ~W if a client holding a pointer to one interface
201  *    queries successfully for a second, and through that pointer queries
202  *    successfully for a third interface, a query for the first interface
203  *    through the pointer for the third interface must succeed.
204  *
205  *  As you can see, this interface doesn't qualify but will most likely
206  *  be good enough for the time being.
207  */
208
209 /* Helper function for DirectPlayLobby  QueryInterface */ 
210 static HRESULT directPlayLobby_QueryInterface
211          ( REFIID riid, LPVOID* ppvObj )
212 {
213
214   if( IsEqualGUID( &IID_IDirectPlayLobby, riid ) )
215   {
216      IDirectPlayLobbyImpl* lpDpL = (IDirectPlayLobbyImpl*)(*ppvObj);
217
218      lpDpL = (IDirectPlayLobbyImpl*)HeapAlloc( GetProcessHeap(), HEAP_ZERO_MEMORY,
219                                            sizeof( *lpDpL ) );
220
221     if( !lpDpL )
222     {
223       return E_NOINTERFACE;
224     }
225
226     lpDpL->lpvtbl = &directPlayLobbyWVT;
227     lpDpL->ref    = 1;
228
229     return S_OK;
230   }
231   else if( IsEqualGUID( &IID_IDirectPlayLobbyA, riid ) )
232   {
233      IDirectPlayLobbyAImpl* lpDpL = (IDirectPlayLobbyAImpl*)(*ppvObj);
234
235      lpDpL = (IDirectPlayLobbyAImpl*)HeapAlloc( GetProcessHeap(), HEAP_ZERO_MEMORY,
236                                             sizeof( *lpDpL ) );
237
238     if( !lpDpL )
239     {
240       return E_NOINTERFACE;
241     }
242
243     lpDpL->lpvtbl = &directPlayLobbyAVT;
244     lpDpL->ref    = 1;
245
246     return S_OK;
247   }
248   else if( IsEqualGUID( &IID_IDirectPlayLobby2, riid ) )
249   {
250      IDirectPlayLobby2Impl* lpDpL = (IDirectPlayLobby2Impl*)(*ppvObj);
251
252      lpDpL = (IDirectPlayLobby2Impl*)HeapAlloc( GetProcessHeap(), HEAP_ZERO_MEMORY,
253                                              sizeof( *lpDpL ) );
254
255     if( !lpDpL )
256     {
257       return E_NOINTERFACE;
258     }
259
260     lpDpL->lpvtbl = &directPlayLobby2WVT;
261     lpDpL->ref    = 1;
262
263     return S_OK;
264   }
265   else if( IsEqualGUID( &IID_IDirectPlayLobby2A, riid ) )
266   {
267      IDirectPlayLobby2AImpl* lpDpL = (IDirectPlayLobby2AImpl*)(*ppvObj);
268
269      lpDpL = (IDirectPlayLobby2AImpl*)HeapAlloc( GetProcessHeap(), HEAP_ZERO_MEMORY,
270                                              sizeof( *lpDpL ) );
271
272     if( !lpDpL )
273     {
274       return E_NOINTERFACE;
275     }
276
277     lpDpL->lpvtbl = &directPlayLobby2AVT;
278     lpDpL->ref    = 1;
279
280     return S_OK;
281   }
282
283   /* Unknown interface */
284   *ppvObj = NULL;
285   return E_NOINTERFACE;
286 }
287 static HRESULT WINAPI IDirectPlayLobbyAImpl_QueryInterface
288 ( LPDIRECTPLAYLOBBYA iface,
289   REFIID riid,
290   LPVOID* ppvObj )
291 {
292   ICOM_THIS(IDirectPlayLobby2Impl,iface);
293   TRACE( dplay, "(%p)->(%p,%p)\n", This, riid, ppvObj );
294
295   if( IsEqualGUID( &IID_IUnknown, riid )  ||
296       IsEqualGUID( &IID_IDirectPlayLobbyA, riid )
297     )
298   {
299     IDirectPlayLobby_AddRef( iface );
300     *ppvObj = This;
301     return S_OK;
302   }
303
304   return directPlayLobby_QueryInterface( riid, ppvObj );
305
306 }
307
308 static HRESULT WINAPI IDirectPlayLobbyW_QueryInterface
309 ( LPDIRECTPLAYLOBBY iface,
310   REFIID riid,
311   LPVOID* ppvObj )
312 {
313   ICOM_THIS(IDirectPlayLobbyImpl,iface);
314   TRACE( dplay, "(%p)->(%p,%p)\n", This, riid, ppvObj );
315
316   if( IsEqualGUID( &IID_IUnknown, riid )  ||
317       IsEqualGUID( &IID_IDirectPlayLobby, riid )
318     )
319   {
320     IDirectPlayLobby_AddRef( iface );
321     *ppvObj = This;
322     return S_OK;
323   }
324
325   return directPlayLobby_QueryInterface( riid, ppvObj );
326 }
327
328
329 static HRESULT WINAPI IDirectPlayLobby2AImpl_QueryInterface
330 ( LPDIRECTPLAYLOBBY2A iface,
331   REFIID riid,
332   LPVOID* ppvObj )
333 {
334   ICOM_THIS(IDirectPlayLobby2Impl,iface);
335   TRACE( dplay, "(%p)->(%p,%p)\n", This, riid, ppvObj );
336
337   /* Compare riids. We know this object is a direct play lobby 2A object.
338      If we are asking about the same type of interface we're fine.
339    */
340   if( IsEqualGUID( &IID_IUnknown, riid )  ||
341       IsEqualGUID( &IID_IDirectPlayLobby2A, riid )
342     )
343   {
344     IDirectPlayLobby2_AddRef( iface );
345     *ppvObj = This;
346     return S_OK;
347   }
348   return directPlayLobby_QueryInterface( riid, ppvObj ); 
349 }
350
351 static HRESULT WINAPI IDirectPlayLobby2WImpl_QueryInterface
352 ( LPDIRECTPLAYLOBBY2 iface,
353   REFIID riid,
354   LPVOID* ppvObj )
355 {
356   ICOM_THIS(IDirectPlayLobby2Impl,iface);
357
358   /* Compare riids. We know this object is a direct play lobby 2 object.
359      If we are asking about the same type of interface we're fine.
360    */
361   if( IsEqualGUID( &IID_IUnknown, riid ) ||
362       IsEqualGUID( &IID_IDirectPlayLobby2, riid ) 
363     )
364   {
365     IDirectPlayLobby2_AddRef( iface );
366     *ppvObj = This;
367     return S_OK;
368   }
369
370   return directPlayLobby_QueryInterface( riid, ppvObj ); 
371
372 }
373
374 /* 
375  * Simple procedure. Just increment the reference count to this
376  * structure and return the new reference count.
377  */
378 static ULONG WINAPI IDirectPlayLobby2AImpl_AddRef
379 ( LPDIRECTPLAYLOBBY2A iface )
380 {
381   ICOM_THIS(IDirectPlayLobby2Impl,iface);
382   ++(This->ref);
383   TRACE( dplay,"ref count now %lu\n", This->ref );
384   return (This->ref);
385 }
386
387 static ULONG WINAPI IDirectPlayLobby2WImpl_AddRef
388 ( LPDIRECTPLAYLOBBY2 iface )
389 {
390   ICOM_THIS(IDirectPlayLobby2Impl,iface);
391   return IDirectPlayLobby2AImpl_AddRef( (LPDIRECTPLAYLOBBY2) This );
392 }
393
394
395 /*
396  * Simple COM procedure. Decrease the reference count to this object.
397  * If the object no longer has any reference counts, free up the associated
398  * memory.
399  */
400 static ULONG WINAPI IDirectPlayLobby2AImpl_Release
401 ( LPDIRECTPLAYLOBBY2A iface )
402 {
403   ICOM_THIS(IDirectPlayLobby2Impl,iface);
404   TRACE( dplay, "ref count decremeneted from %lu\n", This->ref );
405
406   This->ref--;
407
408   /* Deallocate if this is the last reference to the object */
409   if( !(This->ref) )
410   {
411     FIXME( dplay, "memory leak\n" );
412     /* Implement memory deallocation */
413
414     HeapFree( GetProcessHeap(), 0, This );
415
416     return 0;
417   }
418
419   return This->ref;
420 }
421
422 static ULONG WINAPI IDirectPlayLobby2WImpl_Release
423 ( LPDIRECTPLAYLOBBY2 iface )
424 {
425   ICOM_THIS(IDirectPlayLobby2Impl,iface);
426   return IDirectPlayLobby2AImpl_Release( (LPDIRECTPLAYLOBBY2A) This );
427 }
428
429
430 /********************************************************************
431  * 
432  * Connects an application to the session specified by the DPLCONNECTION
433  * structure currently stored with the DirectPlayLobby object.
434  *
435  * Returns a IDirectPlay interface.
436  *
437  */
438 static HRESULT WINAPI IDirectPlayLobby2AImpl_Connect
439 ( LPDIRECTPLAYLOBBY2A iface,
440   DWORD dwFlags,
441   LPDIRECTPLAY2* lplpDP,
442   IUnknown* pUnk)
443 {
444   FIXME( dplay, ": dwFlags=%08lx %p %p stub\n", dwFlags, lplpDP, pUnk );
445   return DPERR_OUTOFMEMORY;
446 }
447
448 static HRESULT WINAPI IDirectPlayLobby2WImpl_Connect
449 ( LPDIRECTPLAYLOBBY2 iface,
450   DWORD dwFlags,
451   LPDIRECTPLAY2* lplpDP,
452   IUnknown* pUnk)
453 {
454   ICOM_THIS(IDirectPlayLobby2Impl,iface);
455   LPDIRECTPLAY2* directPlay2W;
456   HRESULT        createRC;
457
458   FIXME( dplay, "(%p)->(%08lx,%p,%p): stub\n", This, dwFlags, lplpDP, pUnk );
459
460   if( dwFlags )
461   {
462      return DPERR_INVALIDPARAMS;
463   }
464
465   if( ( createRC = DirectPlayCreate( (LPGUID)&IID_IDirectPlayLobby2, lplpDP, pUnk ) ) != DP_OK )
466   {
467      ERR( dplay, "error creating Direct Play 2W interface. Return Code = %ld.\n", createRC );
468      return createRC;
469   } 
470
471   /* This should invoke IDirectPlay3::InitializeConnection IDirectPlay3::Open */  
472   directPlay2W = lplpDP; 
473  
474     
475
476
477 #if 0
478   /* All the stuff below this is WRONG! */
479   if( This->lpSession->dwFlags == DPLCONNECTION_CREATESESSION )
480   {
481     DWORD threadIdSink;
482
483     /* Spawn a thread to deal with all of this and to handle the incomming requests */
484     threadIdSink = CreateThread( NULL, 0, &DPLobby_Spawn_Server,
485                                 (LPVOID)This->lpSession->lpConn->lpSessionDesc, 0, &threadIdSink );  
486
487   }
488   else if ( This->lpSession->dwFlags == DPLCONNECTION_JOINSESSION ) 
489   {
490     /* Let's search for a matching session */
491     FIXME( dplay, "joining session not yet supported.\n");
492     return DPERR_OUTOFMEMORY;
493   }
494   else /* Unknown type of connection request */
495   {
496      ERR( dplay, ": Unknown connection request lpConn->dwFlags=%08lx\n",
497           lpConn->dwFlags ); 
498
499      return DPERR_OUTOFMEMORY;
500   }
501
502   /* This does the work of the following methods...
503      IDirectPlay3::InitializeConnection,
504      IDirectPlay3::EnumSessions,
505      IDirectPlay3::Open
506    */
507   
508
509 #endif
510
511   return DP_OK;
512
513 }
514
515 /********************************************************************
516  *
517  * Creates a DirectPlay Address, given a service provider-specific network
518  * address. 
519  * Returns an address contains the globally unique identifier
520  * (GUID) of the service provider and data that the service provider can
521  * interpret as a network address.
522  *
523  */
524 static HRESULT WINAPI IDirectPlayLobby2AImpl_CreateAddress
525 ( LPDIRECTPLAYLOBBY2A iface,
526   REFGUID guidSP,
527   REFGUID guidDataType,
528   LPCVOID lpData, 
529   DWORD dwDataSize,
530   LPVOID lpAddress, 
531   LPDWORD lpdwAddressSize )
532 {
533   FIXME( dplay, ":stub\n");
534   return DPERR_OUTOFMEMORY;
535 }
536
537 static HRESULT WINAPI IDirectPlayLobby2WImpl_CreateAddress
538 ( LPDIRECTPLAYLOBBY2 iface,
539   REFGUID guidSP,
540   REFGUID guidDataType,
541   LPCVOID lpData,
542   DWORD dwDataSize,
543   LPVOID lpAddress,
544   LPDWORD lpdwAddressSize )
545 {
546   FIXME( dplay, ":stub\n");
547   return DPERR_OUTOFMEMORY;
548 }
549
550
551 /********************************************************************
552  *
553  * Parses out chunks from the DirectPlay Address buffer by calling the
554  * given callback function, with lpContext, for each of the chunks.
555  *
556  */
557 static HRESULT WINAPI IDirectPlayLobby2AImpl_EnumAddress
558 ( LPDIRECTPLAYLOBBY2A iface,
559   LPDPENUMADDRESSCALLBACK lpEnumAddressCallback,
560   LPCVOID lpAddress,
561   DWORD dwAddressSize,
562   LPVOID lpContext )
563 {
564   FIXME( dplay, ":stub\n");
565   return DPERR_OUTOFMEMORY;
566 }
567
568 static HRESULT WINAPI IDirectPlayLobby2WImpl_EnumAddress
569 ( LPDIRECTPLAYLOBBY2 iface,
570   LPDPENUMADDRESSCALLBACK lpEnumAddressCallback,
571   LPCVOID lpAddress,
572   DWORD dwAddressSize,
573   LPVOID lpContext )
574 {
575   FIXME( dplay, ":stub\n");
576   return DPERR_OUTOFMEMORY;
577 }
578
579 /********************************************************************
580  *
581  * Enumerates all the address types that a given service provider needs to
582  * build the DirectPlay Address.
583  *
584  */
585 static HRESULT WINAPI IDirectPlayLobbyAImpl_EnumAddressTypes
586 ( LPDIRECTPLAYLOBBYA iface,
587   LPDPLENUMADDRESSTYPESCALLBACK lpEnumAddressTypeCallback,
588   REFGUID guidSP,
589   LPVOID lpContext,
590   DWORD dwFlags )
591 {
592   FIXME( dplay, ":stub\n");
593   return DPERR_OUTOFMEMORY;
594 }
595
596 static HRESULT WINAPI IDirectPlayLobby2AImpl_EnumAddressTypes
597 ( LPDIRECTPLAYLOBBY2A iface,
598   LPDPLENUMADDRESSTYPESCALLBACK lpEnumAddressTypeCallback,
599   REFGUID guidSP, 
600   LPVOID lpContext,
601   DWORD dwFlags )
602 {
603   ICOM_THIS(IDirectPlayLobby2Impl,iface);
604   return IDirectPlayLobbyAImpl_EnumAddressTypes( (LPDIRECTPLAYLOBBYA)This, lpEnumAddressTypeCallback,
605                                              guidSP, lpContext, dwFlags );
606 }
607
608 static HRESULT WINAPI IDirectPlayLobby2WImpl_EnumAddressTypes
609 ( LPDIRECTPLAYLOBBY2 iface,
610   LPDPLENUMADDRESSTYPESCALLBACK lpEnumAddressTypeCallback,
611   REFGUID guidSP,
612   LPVOID lpContext,
613   DWORD dwFlags )
614 {
615   FIXME( dplay, ":stub\n");
616   return DPERR_OUTOFMEMORY;
617 }
618
619 /********************************************************************
620  *
621  * Enumerates what applications are registered with DirectPlay by
622  * invoking the callback function with lpContext.
623  *
624  */
625 static HRESULT WINAPI IDirectPlayLobbyW_EnumLocalApplications
626 ( LPDIRECTPLAYLOBBY iface,
627   LPDPLENUMLOCALAPPLICATIONSCALLBACK a,
628   LPVOID lpContext,
629   DWORD dwFlags )
630 {
631   FIXME( dplay, ":stub\n");
632   return DPERR_OUTOFMEMORY;
633 }
634
635 static HRESULT WINAPI IDirectPlayLobby2WImpl_EnumLocalApplications
636 ( LPDIRECTPLAYLOBBY2 iface,
637   LPDPLENUMLOCALAPPLICATIONSCALLBACK a,
638   LPVOID lpContext,
639   DWORD dwFlags )
640 {
641   ICOM_THIS(IDirectPlayLobby2Impl,iface);
642   return IDirectPlayLobbyW_EnumLocalApplications( (LPDIRECTPLAYLOBBY)This, a,
643                                                   lpContext, dwFlags ); 
644 }
645
646 static HRESULT WINAPI IDirectPlayLobbyAImpl_EnumLocalApplications
647 ( LPDIRECTPLAYLOBBYA iface,
648   LPDPLENUMLOCALAPPLICATIONSCALLBACK a,
649   LPVOID lpContext,
650   DWORD dwFlags )
651 {
652   FIXME( dplay, ":stub\n");
653   return DPERR_OUTOFMEMORY;
654 }
655
656 static HRESULT WINAPI IDirectPlayLobby2AImpl_EnumLocalApplications
657 ( LPDIRECTPLAYLOBBY2A iface,
658   LPDPLENUMLOCALAPPLICATIONSCALLBACK a,
659   LPVOID lpContext,
660   DWORD dwFlags )
661 {
662   ICOM_THIS(IDirectPlayLobby2Impl,iface);
663   return IDirectPlayLobbyAImpl_EnumLocalApplications( (LPDIRECTPLAYLOBBYA)This, a,
664                                                   lpContext, dwFlags ); 
665 }
666
667
668 /********************************************************************
669  *
670  * Retrieves the DPLCONNECTION structure that contains all the information
671  * needed to start and connect an application. This was generated using
672  * either the RunApplication or SetConnectionSettings methods.
673  *
674  * NOTES: If lpData is NULL then just return lpdwDataSize. This allows
675  *        the data structure to be allocated by our caller which can then
676  *        call this procedure/method again with a valid data pointer.
677  */
678 static HRESULT WINAPI IDirectPlayLobbyAImpl_GetConnectionSettings
679 ( LPDIRECTPLAYLOBBYA iface,
680   DWORD dwAppID,
681   LPVOID lpData,
682   LPDWORD lpdwDataSize )
683 {
684   ICOM_THIS(IDirectPlayLobbyImpl,iface);
685   LPDPLCONNECTION lpDplConnection;
686
687   FIXME( dplay, ": semi stub (%p)->(0x%08lx,%p,%p)\n", This, dwAppID, lpData, lpdwDataSize );
688  
689   /* Application is requesting us to give the required size */
690   if ( !lpData )
691   {
692     /* Let's check the size of the buffer that the application has allocated */
693     if( *lpdwDataSize >= sizeof( DPLCONNECTION ) )
694     {
695       return DP_OK;
696     }
697     else
698     {
699       *lpdwDataSize = sizeof( DPLCONNECTION );
700       return DPERR_BUFFERTOOSMALL;
701     }
702   }
703
704   /* Fill in the fields - let them just use the ptrs */
705   lpDplConnection = (LPDPLCONNECTION)lpData;
706
707   /* Make sure we were given the right size */
708   if( lpDplConnection->dwSize < sizeof( DPLCONNECTION ) )
709   {
710      ERR( dplay, "bad passed size 0x%08lx.\n", lpDplConnection->dwSize );
711      return DPERR_INVALIDPARAMS;
712   }
713
714   /* Copy everything we've got into here */
715   /* Need to actually store the stuff here. Check if we've already allocated each field first. */
716   lpDplConnection->dwFlags = This->dwConnFlags;
717
718   /* Copy LPDPSESSIONDESC2 struct */
719   lpDplConnection->lpSessionDesc = HeapAlloc( GetProcessHeap(), HEAP_ZERO_MEMORY, sizeof( This->sessionDesc ) );
720   memcpy( lpDplConnection->lpSessionDesc, &(This->sessionDesc), sizeof( This->sessionDesc ) );
721
722   if( This->sessionDesc.sess.lpszSessionName )
723   {
724     lpDplConnection->lpSessionDesc->sess.lpszSessionName = 
725       HEAP_strdupW( GetProcessHeap(), HEAP_ZERO_MEMORY, This->sessionDesc.sess.lpszSessionName );
726   }
727
728   if( This->sessionDesc.pass.lpszPassword )
729   {
730     lpDplConnection->lpSessionDesc->pass.lpszPassword = 
731       HEAP_strdupW( GetProcessHeap(), HEAP_ZERO_MEMORY, This->sessionDesc.pass.lpszPassword );
732   }
733      
734   /* I don't know what to use the reserved for. We'll set it to 0 just for fun */
735   This->sessionDesc.dwReserved1 = This->sessionDesc.dwReserved2 = 0;
736
737   /* Copy DPNAME struct - seems to be optional - check for existance first */
738   lpDplConnection->lpPlayerName = HeapAlloc( GetProcessHeap(), HEAP_ZERO_MEMORY, sizeof( This->playerName ) );
739   memcpy( lpDplConnection->lpPlayerName, &(This->playerName), sizeof( This->playerName ) );
740
741   if( This->playerName.psn.lpszShortName )
742   {
743     lpDplConnection->lpPlayerName->psn.lpszShortName =
744       HEAP_strdupW( GetProcessHeap(), HEAP_ZERO_MEMORY, This->playerName.psn.lpszShortName );  
745   }
746
747   if( This->playerName.pln.lpszLongName )
748   {
749     lpDplConnection->lpPlayerName->pln.lpszLongName =
750       HEAP_strdupW( GetProcessHeap(), HEAP_ZERO_MEMORY, This->playerName.pln.lpszLongName );
751   }
752
753
754
755   memcpy( &(lpDplConnection->guidSP), &(This->guidSP), sizeof( This->guidSP ) );
756
757   lpDplConnection->lpAddress = HeapAlloc( GetProcessHeap(), HEAP_ZERO_MEMORY, This->dwAddressSize );
758   memcpy( lpDplConnection->lpAddress, This->lpAddress, This->dwAddressSize );
759
760   lpDplConnection->dwAddressSize = This->dwAddressSize;
761
762   return DP_OK;
763 }
764
765 static HRESULT WINAPI IDirectPlayLobby2AImpl_GetConnectionSettings
766 ( LPDIRECTPLAYLOBBY2A iface,
767   DWORD dwAppID,
768   LPVOID lpData,
769   LPDWORD lpdwDataSize )
770 {
771   ICOM_THIS(IDirectPlayLobby2Impl,iface);
772   return IDirectPlayLobbyAImpl_GetConnectionSettings( (LPDIRECTPLAYLOBBYA)This,
773                                                   dwAppID, lpData, lpdwDataSize ); 
774 }
775
776 static HRESULT WINAPI IDirectPlayLobbyWImpl_GetConnectionSettings
777 ( LPDIRECTPLAYLOBBY iface,
778   DWORD dwAppID,
779   LPVOID lpData,
780   LPDWORD lpdwDataSize )
781 {
782   ICOM_THIS(IDirectPlayLobbyImpl,iface);
783   FIXME( dplay, ":semi stub %p %08lx %p %p \n", This, dwAppID, lpData, lpdwDataSize );
784
785   /* Application is requesting us to give the required size */ 
786   if ( !lpData )
787   {
788     /* Let's check the size of the buffer that the application has allocated */
789     if( *lpdwDataSize >= sizeof( DPLCONNECTION ) )
790     {
791       return DP_OK;  
792     }
793     else
794     {
795       *lpdwDataSize = sizeof( DPLCONNECTION );
796       return DPERR_BUFFERTOOSMALL;
797     }
798   }
799
800   /* Fill in the fields - let them just use the ptrs */
801   FIXME( dplay, "stub\n" );
802
803   return DP_OK;
804 }
805
806 static HRESULT WINAPI IDirectPlayLobby2WImpl_GetConnectionSettings
807 ( LPDIRECTPLAYLOBBY2 iface,
808   DWORD dwAppID,
809   LPVOID lpData,
810   LPDWORD lpdwDataSize )
811 {
812   ICOM_THIS(IDirectPlayLobby2Impl,iface);
813   return IDirectPlayLobbyWImpl_GetConnectionSettings( (LPDIRECTPLAYLOBBY)This,
814                                                   dwAppID, lpData, lpdwDataSize );
815 }
816
817 /********************************************************************
818  *
819  * Retrieves the message sent between a lobby client and a DirectPlay 
820  * application. All messages are queued until received.
821  *
822  */
823 static HRESULT WINAPI IDirectPlayLobbyAImpl_ReceiveLobbyMessage
824 ( LPDIRECTPLAYLOBBYA iface,
825   DWORD dwFlags,
826   DWORD dwAppID,
827   LPDWORD lpdwMessageFlags,
828   LPVOID lpData,
829   LPDWORD lpdwDataSize )
830 {
831   ICOM_THIS(IDirectPlayLobbyImpl,iface);
832   FIXME( dplay, ":stub %p %08lx %08lx %p %p %p\n", This, dwFlags, dwAppID, lpdwMessageFlags, lpData,
833          lpdwDataSize );
834   return DPERR_OUTOFMEMORY;
835 }
836
837 static HRESULT WINAPI IDirectPlayLobby2AImpl_ReceiveLobbyMessage
838 ( LPDIRECTPLAYLOBBY2A iface,
839   DWORD dwFlags,
840   DWORD dwAppID,
841   LPDWORD lpdwMessageFlags,
842   LPVOID lpData,
843   LPDWORD lpdwDataSize )
844 {
845   ICOM_THIS(IDirectPlayLobby2Impl,iface);
846   return IDirectPlayLobbyAImpl_ReceiveLobbyMessage( (LPDIRECTPLAYLOBBYA)This, dwFlags, dwAppID,
847                                                  lpdwMessageFlags, lpData, lpdwDataSize );
848 }
849
850
851 static HRESULT WINAPI IDirectPlayLobbyW_ReceiveLobbyMessage
852 ( LPDIRECTPLAYLOBBY iface,
853   DWORD dwFlags,
854   DWORD dwAppID,
855   LPDWORD lpdwMessageFlags,
856   LPVOID lpData,
857   LPDWORD lpdwDataSize )
858 {
859   ICOM_THIS(IDirectPlayLobbyImpl,iface);
860   FIXME( dplay, ":stub %p %08lx %08lx %p %p %p\n", This, dwFlags, dwAppID, lpdwMessageFlags, lpData,
861          lpdwDataSize );
862   return DPERR_OUTOFMEMORY;
863 }
864
865 static HRESULT WINAPI IDirectPlayLobby2WImpl_ReceiveLobbyMessage
866 ( LPDIRECTPLAYLOBBY2 iface,
867   DWORD dwFlags,
868   DWORD dwAppID,
869   LPDWORD lpdwMessageFlags,
870   LPVOID lpData,
871   LPDWORD lpdwDataSize )
872 {
873   ICOM_THIS(IDirectPlayLobby2Impl,iface);
874   return IDirectPlayLobbyW_ReceiveLobbyMessage( (LPDIRECTPLAYLOBBY)This, dwFlags, dwAppID,
875                                                  lpdwMessageFlags, lpData, lpdwDataSize );
876 }
877
878 /********************************************************************
879  *
880  * Starts an application and passes to it all the information to
881  * connect to a session.
882  *
883  */
884 static HRESULT WINAPI IDirectPlayLobbyAImpl_RunApplication
885 ( LPDIRECTPLAYLOBBYA iface,
886   DWORD dwFlags,
887   LPDWORD lpdwAppID,
888   LPDPLCONNECTION lpConn,
889   HANDLE hReceiveEvent )
890 {
891   FIXME( dplay, ":stub\n");
892   return DPERR_OUTOFMEMORY;
893 }
894
895 static HRESULT WINAPI IDirectPlayLobby2AImpl_RunApplication
896 ( LPDIRECTPLAYLOBBY2A iface,
897   DWORD dwFlags,
898   LPDWORD lpdwAppID,
899   LPDPLCONNECTION lpConn,
900   HANDLE hReceiveEvent )
901 {
902   ICOM_THIS(IDirectPlayLobby2Impl,iface);
903   return IDirectPlayLobbyAImpl_RunApplication( (LPDIRECTPLAYLOBBYA)This, dwFlags,
904                                            lpdwAppID, lpConn, hReceiveEvent );
905 }
906
907 static HRESULT WINAPI IDirectPlayLobbyW_RunApplication
908 ( LPDIRECTPLAYLOBBY iface,
909   DWORD dwFlags,
910   LPDWORD lpdwAppID,
911   LPDPLCONNECTION lpConn,
912   HANDLE hReceiveEvent )
913 {
914   FIXME( dplay, ":stub\n");
915   return DPERR_OUTOFMEMORY;
916 }
917
918 static HRESULT WINAPI IDirectPlayLobby2WImpl_RunApplication
919 ( LPDIRECTPLAYLOBBY2 iface,
920   DWORD dwFlags,
921   LPDWORD lpdwAppID,
922   LPDPLCONNECTION lpConn,
923   HANDLE hReceiveEvent )
924 {
925   ICOM_THIS(IDirectPlayLobby2Impl,iface);
926   return IDirectPlayLobbyW_RunApplication( (LPDIRECTPLAYLOBBY)This, dwFlags,
927                                            lpdwAppID, lpConn, hReceiveEvent );
928 }
929
930
931 /********************************************************************
932  *
933  * Sends a message between the application and the lobby client.
934  * All messages are queued until received.
935  *
936  */
937 static HRESULT WINAPI IDirectPlayLobbyAImpl_SendLobbyMessage
938 ( LPDIRECTPLAYLOBBYA iface,
939   DWORD dwFlags,
940   DWORD dwAppID,
941   LPVOID lpData,
942   DWORD dwDataSize )
943 {
944   FIXME( dplay, ":stub\n");
945   return DPERR_OUTOFMEMORY;
946 }
947
948 static HRESULT WINAPI IDirectPlayLobby2AImpl_SendLobbyMessage
949 ( LPDIRECTPLAYLOBBY2A iface,
950   DWORD dwFlags,
951   DWORD dwAppID,
952   LPVOID lpData,
953   DWORD dwDataSize )
954 {
955   ICOM_THIS(IDirectPlayLobby2Impl,iface);
956   return IDirectPlayLobbyAImpl_SendLobbyMessage( (LPDIRECTPLAYLOBBYA)This, dwFlags, 
957                                              dwAppID, lpData, dwDataSize ); 
958 }
959
960
961 static HRESULT WINAPI IDirectPlayLobbyW_SendLobbyMessage
962 ( LPDIRECTPLAYLOBBY iface,
963   DWORD dwFlags,
964   DWORD dwAppID,
965   LPVOID lpData,
966   DWORD dwDataSize )
967 {
968   FIXME( dplay, ":stub\n");
969   return DPERR_OUTOFMEMORY;
970 }
971
972 static HRESULT WINAPI IDirectPlayLobby2WImpl_SendLobbyMessage
973 ( LPDIRECTPLAYLOBBY2 iface,
974   DWORD dwFlags,
975   DWORD dwAppID,
976   LPVOID lpData,
977   DWORD dwDataSize )
978 {
979   ICOM_THIS(IDirectPlayLobby2Impl,iface);
980   return IDirectPlayLobbyW_SendLobbyMessage( (LPDIRECTPLAYLOBBY)This, dwFlags,
981                                               dwAppID, lpData, dwDataSize );
982 }
983
984 /********************************************************************
985  *
986  * Modifies the DPLCONNECTION structure to contain all information
987  * needed to start and connect an application.
988  *
989  */
990 static HRESULT WINAPI IDirectPlayLobbyW_SetConnectionSettings
991 ( LPDIRECTPLAYLOBBY iface,
992   DWORD dwFlags,
993   DWORD dwAppID,
994   LPDPLCONNECTION lpConn )
995 {
996   ICOM_THIS(IDirectPlayLobbyImpl,iface);
997   TRACE( dplay, ": This=%p, dwFlags=%08lx, dwAppId=%08lx, lpConn=%p\n",
998          This, dwFlags, dwAppID, lpConn );
999
1000   /* Paramater check */
1001   if( dwFlags || !This || !lpConn )
1002   {
1003     ERR( dplay, "invalid parameters.\n");
1004     return DPERR_INVALIDPARAMS;
1005   }
1006
1007   /* See if there is a connection associated with this request.
1008    * dwAppID == 0 indicates that this request isn't associated with a connection.
1009    */
1010   if( dwAppID )
1011   {
1012      FIXME( dplay, ": Connection dwAppID=%08lx given. Not implemented yet.\n",
1013             dwAppID );
1014
1015      /* Need to add a check for this application Id...*/
1016      return DPERR_NOTLOBBIED;
1017   }
1018
1019   if(  lpConn->dwSize != sizeof(DPLCONNECTION) )
1020   {
1021     ERR( dplay, ": old/new DPLCONNECTION type? Size=%08lx vs. expected=%ul bytes\n", 
1022          lpConn->dwSize, sizeof( DPLCONNECTION ) );
1023     return DPERR_INVALIDPARAMS;
1024   }
1025
1026   /* Need to investigate the lpConn->lpSessionDesc to figure out
1027    * what type of session we need to join/create.
1028    */
1029   if(  (!lpConn->lpSessionDesc ) || 
1030        ( lpConn->lpSessionDesc->dwSize != sizeof( DPSESSIONDESC2 ) )
1031     )
1032   {
1033     ERR( dplay, "DPSESSIONDESC passed in? Size=%08lx vs. expected=%ul bytes\n",
1034          lpConn->lpSessionDesc->dwSize, sizeof( DPSESSIONDESC2 ) );
1035     return DPERR_INVALIDPARAMS;
1036   }
1037
1038   /* Need to actually store the stuff here. Check if we've already allocated each field first. */
1039   This->dwConnFlags = lpConn->dwFlags;
1040
1041   /* Copy LPDPSESSIONDESC2 struct - this is required */
1042   memcpy( &(This->sessionDesc), lpConn->lpSessionDesc, sizeof( *(lpConn->lpSessionDesc) ) );
1043
1044   if( lpConn->lpSessionDesc->sess.lpszSessionName )
1045     This->sessionDesc.sess.lpszSessionName = HEAP_strdupW( GetProcessHeap(), HEAP_ZERO_MEMORY, lpConn->lpSessionDesc->sess.lpszSessionName );
1046   else
1047     This->sessionDesc.sess.lpszSessionName = NULL;
1048  
1049   if( lpConn->lpSessionDesc->pass.lpszPassword )
1050     This->sessionDesc.pass.lpszPassword = HEAP_strdupW( GetProcessHeap(), HEAP_ZERO_MEMORY, lpConn->lpSessionDesc->pass.lpszPassword );
1051   else
1052     This->sessionDesc.pass.lpszPassword = NULL;
1053
1054   /* I don't know what to use the reserved for ... */
1055   This->sessionDesc.dwReserved1 = This->sessionDesc.dwReserved2 = 0;
1056
1057   /* Copy DPNAME struct - seems to be optional - check for existance first */
1058   if( lpConn->lpPlayerName )
1059   {
1060      memcpy( &(This->playerName), lpConn->lpPlayerName, sizeof( *lpConn->lpPlayerName ) ); 
1061
1062      if( lpConn->lpPlayerName->psn.lpszShortName )
1063        This->playerName.psn.lpszShortName = HEAP_strdupW( GetProcessHeap(), HEAP_ZERO_MEMORY, lpConn->lpPlayerName->psn.lpszShortName ); 
1064
1065      if( lpConn->lpPlayerName->pln.lpszLongName )
1066        This->playerName.pln.lpszLongName = HEAP_strdupW( GetProcessHeap(), HEAP_ZERO_MEMORY, lpConn->lpPlayerName->pln.lpszLongName );
1067
1068   }
1069
1070   memcpy( &(This->guidSP), &(lpConn->guidSP), sizeof( lpConn->guidSP ) );  
1071   
1072   This->lpAddress = HeapAlloc( GetProcessHeap(), HEAP_ZERO_MEMORY, lpConn->dwAddressSize ); 
1073   memcpy( This->lpAddress, lpConn->lpAddress, lpConn->dwAddressSize );
1074
1075   This->dwAddressSize = lpConn->dwAddressSize;
1076
1077   return DP_OK;
1078 }
1079
1080 static HRESULT WINAPI IDirectPlayLobby2WImpl_SetConnectionSettings
1081 ( LPDIRECTPLAYLOBBY2 iface,
1082   DWORD dwFlags,
1083   DWORD dwAppID,
1084   LPDPLCONNECTION lpConn )
1085 {
1086   ICOM_THIS(IDirectPlayLobby2Impl,iface);
1087   return IDirectPlayLobbyW_SetConnectionSettings( (LPDIRECTPLAYLOBBY)This, 
1088                                                   dwFlags, dwAppID, lpConn );
1089 }
1090
1091 static HRESULT WINAPI IDirectPlayLobbyAImpl_SetConnectionSettings
1092 ( LPDIRECTPLAYLOBBYA iface,
1093   DWORD dwFlags,
1094   DWORD dwAppID,
1095   LPDPLCONNECTION lpConn )
1096 {
1097   ICOM_THIS(IDirectPlayLobbyImpl,iface);
1098   FIXME( dplay, ": This=%p, dwFlags=%08lx, dwAppId=%08lx, lpConn=%p: stub\n",
1099          This, dwFlags, dwAppID, lpConn );
1100   return DPERR_OUTOFMEMORY;
1101 }
1102
1103 static HRESULT WINAPI IDirectPlayLobby2AImpl_SetConnectionSettings
1104 ( LPDIRECTPLAYLOBBY2A iface,
1105   DWORD dwFlags,
1106   DWORD dwAppID,
1107   LPDPLCONNECTION lpConn )
1108 {
1109   ICOM_THIS(IDirectPlayLobby2Impl,iface);
1110   return IDirectPlayLobbyAImpl_SetConnectionSettings( (LPDIRECTPLAYLOBBYA)This,
1111                                                   dwFlags, dwAppID, lpConn );
1112 }
1113
1114 /********************************************************************
1115  *
1116  * Registers an event that will be set when a lobby message is received.
1117  *
1118  */
1119 static HRESULT WINAPI IDirectPlayLobbyAImpl_SetLobbyMessageEvent
1120 ( LPDIRECTPLAYLOBBYA iface,
1121   DWORD dwFlags,
1122   DWORD dwAppID,
1123   HANDLE hReceiveEvent )
1124 {
1125   FIXME( dplay, ":stub\n");
1126   return DPERR_OUTOFMEMORY;
1127 }
1128
1129 static HRESULT WINAPI IDirectPlayLobby2AImpl_SetLobbyMessageEvent
1130 ( LPDIRECTPLAYLOBBY2A iface,
1131   DWORD dwFlags,
1132   DWORD dwAppID,
1133   HANDLE hReceiveEvent )
1134 {
1135   ICOM_THIS(IDirectPlayLobby2Impl,iface);
1136   return IDirectPlayLobbyAImpl_SetLobbyMessageEvent( (LPDIRECTPLAYLOBBYA)This, dwFlags,
1137                                                  dwAppID, hReceiveEvent ); 
1138 }
1139
1140 static HRESULT WINAPI IDirectPlayLobbyW_SetLobbyMessageEvent
1141 ( LPDIRECTPLAYLOBBY iface,
1142   DWORD dwFlags,
1143   DWORD dwAppID,
1144   HANDLE hReceiveEvent )
1145 {
1146   FIXME( dplay, ":stub\n");
1147   return DPERR_OUTOFMEMORY;
1148 }
1149
1150 static HRESULT WINAPI IDirectPlayLobby2WImpl_SetLobbyMessageEvent
1151 ( LPDIRECTPLAYLOBBY2 iface,
1152   DWORD dwFlags,
1153   DWORD dwAppID,
1154   HANDLE hReceiveEvent )
1155 {
1156   ICOM_THIS(IDirectPlayLobby2Impl,iface);
1157   return IDirectPlayLobbyW_SetLobbyMessageEvent( (LPDIRECTPLAYLOBBY)This, dwFlags,
1158                                                  dwAppID, hReceiveEvent ); 
1159 }
1160
1161
1162 /********************************************************************
1163  *
1164  * Registers an event that will be set when a lobby message is received.
1165  *
1166  */
1167 static HRESULT WINAPI IDirectPlayLobby2WImpl_CreateCompoundAddress
1168 ( LPDIRECTPLAYLOBBY2 iface,
1169   LPCDPCOMPOUNDADDRESSELEMENT lpElements,
1170   DWORD dwElementCount,
1171   LPVOID lpAddress,
1172   LPDWORD lpdwAddressSize )
1173 {
1174   FIXME( dplay, ":stub\n");
1175   return DPERR_OUTOFMEMORY;
1176 }
1177
1178 static HRESULT WINAPI IDirectPlayLobby2AImpl_CreateCompoundAddress
1179 ( LPDIRECTPLAYLOBBY2A iface,
1180   LPCDPCOMPOUNDADDRESSELEMENT lpElements,
1181   DWORD dwElementCount,
1182   LPVOID lpAddress,
1183   LPDWORD lpdwAddressSize )
1184 {
1185   FIXME( dplay, ":stub\n");
1186   return DPERR_OUTOFMEMORY;
1187 }
1188
1189
1190 /* Note: Hack so we can reuse the old functions without compiler warnings */
1191 #if !defined(__STRICT_ANSI__) && defined(__GNUC__)
1192 # define XCAST(fun)     (typeof(directPlayLobbyAVT.fn##fun))
1193 #else
1194 # define XCAST(fun)     (void*)
1195 #endif
1196
1197 /* Direct Play Lobby 1 (ascii) Virtual Table for methods */
1198 /* All lobby 1 methods are exactly the same except QueryInterface */
1199 static struct ICOM_VTABLE(IDirectPlayLobby) directPlayLobbyAVT = 
1200 {
1201   ICOM_MSVTABLE_COMPAT_DummyRTTIVALUE
1202   IDirectPlayLobbyAImpl_QueryInterface,
1203   XCAST(AddRef)IDirectPlayLobby2AImpl_AddRef,
1204   XCAST(Release)IDirectPlayLobby2AImpl_Release,
1205   XCAST(Connect)IDirectPlayLobby2AImpl_Connect,
1206   XCAST(CreateAddress)IDirectPlayLobby2AImpl_CreateAddress,
1207   XCAST(EnumAddress)IDirectPlayLobby2AImpl_EnumAddress,
1208   XCAST(EnumAddressTypes)IDirectPlayLobby2AImpl_EnumAddressTypes,
1209   XCAST(EnumLocalApplications)IDirectPlayLobby2AImpl_EnumLocalApplications,
1210   XCAST(GetConnectionSettings)IDirectPlayLobby2AImpl_GetConnectionSettings,
1211   XCAST(ReceiveLobbyMessage)IDirectPlayLobby2AImpl_ReceiveLobbyMessage,
1212   XCAST(RunApplication)IDirectPlayLobby2AImpl_RunApplication,
1213   XCAST(SendLobbyMessage)IDirectPlayLobby2AImpl_SendLobbyMessage,
1214   XCAST(SetConnectionSettings)IDirectPlayLobby2AImpl_SetConnectionSettings,
1215   XCAST(SetLobbyMessageEvent)IDirectPlayLobby2AImpl_SetLobbyMessageEvent
1216 };
1217 #undef XCAST
1218
1219
1220 /* Note: Hack so we can reuse the old functions without compiler warnings */
1221 #if !defined(__STRICT_ANSI__) && defined(__GNUC__)
1222 # define XCAST(fun)     (typeof(directPlayLobbyWVT.fn##fun))
1223 #else
1224 # define XCAST(fun)     (void*)
1225 #endif
1226
1227 /* Direct Play Lobby 1 (unicode) Virtual Table for methods */
1228 static ICOM_VTABLE(IDirectPlayLobby) directPlayLobbyWVT = 
1229 {
1230   ICOM_MSVTABLE_COMPAT_DummyRTTIVALUE
1231   IDirectPlayLobbyW_QueryInterface,
1232   XCAST(AddRef)IDirectPlayLobby2WImpl_AddRef,
1233   XCAST(Release)IDirectPlayLobby2WImpl_Release,
1234   XCAST(Connect)IDirectPlayLobby2WImpl_Connect,
1235   XCAST(CreateAddress)IDirectPlayLobby2WImpl_CreateAddress, 
1236   XCAST(EnumAddress)IDirectPlayLobby2WImpl_EnumAddress,
1237   XCAST(EnumAddressTypes)IDirectPlayLobby2WImpl_EnumAddressTypes,
1238   XCAST(EnumLocalApplications)IDirectPlayLobby2WImpl_EnumLocalApplications,
1239   XCAST(GetConnectionSettings)IDirectPlayLobby2WImpl_GetConnectionSettings,
1240   XCAST(ReceiveLobbyMessage)IDirectPlayLobby2WImpl_ReceiveLobbyMessage,
1241   XCAST(RunApplication)IDirectPlayLobby2WImpl_RunApplication,
1242   XCAST(SendLobbyMessage)IDirectPlayLobby2WImpl_SendLobbyMessage,
1243   XCAST(SetConnectionSettings)IDirectPlayLobby2WImpl_SetConnectionSettings,
1244   XCAST(SetLobbyMessageEvent)IDirectPlayLobby2WImpl_SetLobbyMessageEvent
1245 };
1246 #undef XCAST
1247
1248
1249 /* Direct Play Lobby 2 (ascii) Virtual Table for methods */
1250 static ICOM_VTABLE(IDirectPlayLobby2) directPlayLobby2AVT = 
1251 {
1252   ICOM_MSVTABLE_COMPAT_DummyRTTIVALUE
1253   IDirectPlayLobby2AImpl_QueryInterface,
1254   IDirectPlayLobby2AImpl_AddRef,
1255   IDirectPlayLobby2AImpl_Release,
1256   IDirectPlayLobby2AImpl_Connect,
1257   IDirectPlayLobby2AImpl_CreateAddress,
1258   IDirectPlayLobby2AImpl_EnumAddress,
1259   IDirectPlayLobby2AImpl_EnumAddressTypes,
1260   IDirectPlayLobby2AImpl_EnumLocalApplications,
1261   IDirectPlayLobby2AImpl_GetConnectionSettings,
1262   IDirectPlayLobby2AImpl_ReceiveLobbyMessage,
1263   IDirectPlayLobby2AImpl_RunApplication,
1264   IDirectPlayLobby2AImpl_SendLobbyMessage,
1265   IDirectPlayLobby2AImpl_SetConnectionSettings,
1266   IDirectPlayLobby2AImpl_SetLobbyMessageEvent,
1267   IDirectPlayLobby2AImpl_CreateCompoundAddress 
1268 };
1269
1270 /* Direct Play Lobby 2 (unicode) Virtual Table for methods */
1271 static ICOM_VTABLE(IDirectPlayLobby2) directPlayLobby2WVT = 
1272 {
1273   ICOM_MSVTABLE_COMPAT_DummyRTTIVALUE
1274   IDirectPlayLobby2WImpl_QueryInterface,
1275   IDirectPlayLobby2WImpl_AddRef, 
1276   IDirectPlayLobby2WImpl_Release,
1277   IDirectPlayLobby2WImpl_Connect,
1278   IDirectPlayLobby2WImpl_CreateAddress,
1279   IDirectPlayLobby2WImpl_EnumAddress,
1280   IDirectPlayLobby2WImpl_EnumAddressTypes,
1281   IDirectPlayLobby2WImpl_EnumLocalApplications,
1282   IDirectPlayLobby2WImpl_GetConnectionSettings,
1283   IDirectPlayLobby2WImpl_ReceiveLobbyMessage,
1284   IDirectPlayLobby2WImpl_RunApplication,
1285   IDirectPlayLobby2WImpl_SendLobbyMessage,
1286   IDirectPlayLobby2WImpl_SetConnectionSettings,
1287   IDirectPlayLobby2WImpl_SetLobbyMessageEvent,
1288   IDirectPlayLobby2WImpl_CreateCompoundAddress
1289 };
1290
1291 /***************************************************************************
1292  *  DirectPlayLobbyCreateA   (DPLAYX.4)
1293  *
1294  */
1295 HRESULT WINAPI DirectPlayLobbyCreateA( LPGUID lpGUIDDSP,
1296                                        LPDIRECTPLAYLOBBYA *lplpDPL,
1297                                        IUnknown *lpUnk, 
1298                                        LPVOID lpData,
1299                                        DWORD dwDataSize )
1300 {
1301   IDirectPlayLobbyAImpl** ilplpDPL=(IDirectPlayLobbyAImpl**)lplpDPL;
1302   TRACE(dplay,"lpGUIDDSP=%p lplpDPL=%p lpUnk=%p lpData=%p dwDataSize=%08lx\n",
1303         lpGUIDDSP,ilplpDPL,lpUnk,lpData,dwDataSize);
1304
1305   /* Parameter Check: lpGUIDSP, lpUnk & lpData must be NULL. dwDataSize must
1306    * equal 0. These fields are mostly for future expansion.
1307    */
1308   if ( lpGUIDDSP || lpUnk || lpData || dwDataSize )
1309   {
1310      *ilplpDPL = NULL;
1311      return DPERR_INVALIDPARAMS;
1312   }
1313
1314   /* Yes...really we should be returning a lobby 1 object */
1315   *ilplpDPL = (IDirectPlayLobbyAImpl*)HeapAlloc( GetProcessHeap(), HEAP_ZERO_MEMORY,
1316                                             sizeof( IDirectPlayLobbyAImpl ) );
1317
1318   if( ! (*ilplpDPL) )
1319   {
1320      return DPERR_OUTOFMEMORY;
1321   }
1322
1323   (*ilplpDPL)->lpvtbl = &directPlayLobbyAVT;
1324   (*ilplpDPL)->ref    = 1;
1325
1326   /* All fields were nulled out by the allocation */
1327
1328   return DP_OK;
1329 }
1330
1331 /***************************************************************************
1332  *  DirectPlayLobbyCreateW   (DPLAYX.5)
1333  *
1334  */
1335 HRESULT WINAPI DirectPlayLobbyCreateW( LPGUID lpGUIDDSP, 
1336                                        LPDIRECTPLAYLOBBY *lplpDPL,
1337                                        IUnknown *lpUnk,
1338                                        LPVOID lpData, 
1339                                        DWORD dwDataSize )
1340 {
1341   IDirectPlayLobbyImpl** ilplpDPL=(IDirectPlayLobbyImpl**)lplpDPL;
1342   TRACE(dplay,"lpGUIDDSP=%p lplpDPL=%p lpUnk=%p lpData=%p dwDataSize=%08lx\n",
1343         lpGUIDDSP,ilplpDPL,lpUnk,lpData,dwDataSize);
1344
1345   /* Parameter Check: lpGUIDSP, lpUnk & lpData must be NULL. dwDataSize must 
1346    * equal 0. These fields are mostly for future expansion.
1347    */
1348   if ( lpGUIDDSP || lpUnk || lpData || dwDataSize )
1349   {
1350      *ilplpDPL = NULL;
1351      ERR( dplay, "Bad parameters!\n" );
1352      return DPERR_INVALIDPARAMS;
1353   }
1354
1355   /* Yes...really we should bre returning a lobby 1 object */
1356   *ilplpDPL = (IDirectPlayLobbyImpl*)HeapAlloc( GetProcessHeap(), HEAP_ZERO_MEMORY,
1357                                            sizeof( IDirectPlayLobbyImpl ) );
1358
1359   if( !*ilplpDPL)
1360   {
1361      return DPERR_OUTOFMEMORY;
1362   }
1363
1364   (*ilplpDPL)->lpvtbl = &directPlayLobbyWVT;
1365   (*ilplpDPL)->ref    = 1;
1366
1367   /* All fields were nulled out by the allocation */
1368
1369   return DP_OK;
1370
1371 }
1372
1373 /***************************************************************************
1374  *  DirectPlayEnumerateA (DPLAYX.2) 
1375  *
1376  *  The pointer to the structure lpContext will be filled with the 
1377  *  appropriate data for each service offered by the OS. These services are
1378  *  not necessarily available on this particular machine but are defined
1379  *  as simple service providers under the "Service Providers" registry key.
1380  *  This structure is then passed to lpEnumCallback for each of the different 
1381  *  services. 
1382  *
1383  *  This API is useful only for applications written using DirectX3 or
1384  *  worse. It is superceeded by IDirectPlay3::EnumConnections which also
1385  *  gives information on the actual connections.
1386  *
1387  * defn of a service provider:
1388  * A dynamic-link library used by DirectPlay to communicate over a network. 
1389  * The service provider contains all the network-specific code required
1390  * to send and receive messages. Online services and network operators can
1391  * supply service providers to use specialized hardware, protocols, communications
1392  * media, and network resources. 
1393  *
1394  * TODO: Allocate string buffer space from the heap (length from reg)
1395  *       Pass real device driver numbers...
1396  *       Get the GUID properly...
1397  */
1398 HRESULT WINAPI DirectPlayEnumerateA( LPDPENUMDPCALLBACKA lpEnumCallback,
1399                                      LPVOID lpContext )
1400 {
1401
1402   HKEY hkResult; 
1403   LPCSTR searchSubKey    = "SOFTWARE\\Microsoft\\DirectPlay\\Service Providers";
1404   LPSTR guidDataSubKey   = "Guid";
1405   LPSTR majVerDataSubKey = "dwReserved1";
1406   DWORD dwIndex, sizeOfSubKeyName=50;
1407   char subKeyName[51]; 
1408
1409   TRACE( dplay, ": lpEnumCallback=%p lpContext=%p\n", lpEnumCallback, lpContext );
1410
1411   if( !lpEnumCallback || !*lpEnumCallback )
1412   {
1413      return DPERR_INVALIDPARAMS;
1414   }
1415
1416   /* Need to loop over the service providers in the registry */
1417   if( RegOpenKeyExA( HKEY_LOCAL_MACHINE, searchSubKey,
1418                        0, KEY_ENUMERATE_SUB_KEYS, &hkResult ) != ERROR_SUCCESS )
1419   {
1420     /* Hmmm. Does this mean that there are no service providers? */ 
1421     ERR(dplay, ": no service providers?\n");
1422     return DP_OK; 
1423   }
1424
1425   /* Traverse all the service providers we have available */
1426   for( dwIndex=0;
1427        RegEnumKeyA( hkResult, dwIndex, subKeyName, sizeOfSubKeyName ) !=
1428          ERROR_NO_MORE_ITEMS;
1429        ++dwIndex )
1430   {
1431     HKEY     hkServiceProvider;
1432     GUID     serviceProviderGUID;
1433     DWORD    returnTypeGUID, returnTypeReserved1, sizeOfReturnBuffer=50;
1434     char     returnBuffer[51];
1435     DWORD    majVersionNum /*, minVersionNum */;
1436     LPWSTR   lpWGUIDString; 
1437
1438     TRACE( dplay, " this time through: %s\n", subKeyName );
1439
1440     /* Get a handle for this particular service provider */
1441     if( RegOpenKeyExA( hkResult, subKeyName, 0, KEY_QUERY_VALUE,
1442                          &hkServiceProvider ) != ERROR_SUCCESS )
1443     {
1444       ERR( dplay, ": what the heck is going on?\n" );
1445       continue;
1446     }
1447
1448     /* Get the GUID, Device major number and device minor number 
1449      * from the registry. 
1450      */
1451     if( RegQueryValueExA( hkServiceProvider, guidDataSubKey,
1452                             NULL, &returnTypeGUID, returnBuffer,
1453                             &sizeOfReturnBuffer ) != ERROR_SUCCESS )
1454     {
1455       ERR( dplay, ": missing GUID registry data members\n" );
1456       continue; 
1457     }
1458
1459     /* FIXME: Check return types to ensure we're interpreting data right */
1460     lpWGUIDString = HEAP_strdupAtoW( GetProcessHeap(), 0, returnBuffer );
1461     CLSIDFromString( (LPCOLESTR)lpWGUIDString, &serviceProviderGUID ); 
1462     HeapFree( GetProcessHeap(), 0, lpWGUIDString );
1463
1464     sizeOfReturnBuffer = 50;
1465  
1466     if( RegQueryValueExA( hkServiceProvider, majVerDataSubKey,
1467                             NULL, &returnTypeReserved1, returnBuffer,
1468                             &sizeOfReturnBuffer ) != ERROR_SUCCESS )
1469     {
1470       ERR( dplay, ": missing dwReserved1 registry data members\n") ;
1471       continue; 
1472     }
1473     /* FIXME: This couldn't possibly be right...*/
1474     majVersionNum = GET_DWORD( returnBuffer );
1475
1476     /* The enumeration will return FALSE if we are not to continue */
1477     if( !lpEnumCallback( &serviceProviderGUID , subKeyName,
1478                          majVersionNum, (DWORD)0, lpContext ) )
1479     {
1480       WARN( dplay, "lpEnumCallback returning FALSE\n" );
1481       break;
1482     }
1483   }
1484
1485   return DP_OK;
1486
1487 }
1488
1489 /***************************************************************************
1490  *  DirectPlayEnumerateW (DPLAYX.3)
1491  *
1492  */
1493 HRESULT WINAPI DirectPlayEnumerateW( LPDPENUMDPCALLBACKW lpEnumCallback, LPVOID lpContext )
1494 {
1495
1496   FIXME( dplay, ":stub\n");
1497
1498   return DPERR_OUTOFMEMORY; 
1499
1500 }
1501
1502 /***************************************************************************
1503  *  DirectPlayCreate (DPLAYX.1) (DPLAY.1)
1504  *
1505  */
1506 HRESULT WINAPI DirectPlayCreate
1507 ( LPGUID lpGUID, LPDIRECTPLAY2 *lplpDP, IUnknown *pUnk)
1508 {
1509
1510   TRACE(dplay,"lpGUID=%p lplpDP=%p pUnk=%p\n", lpGUID,lplpDP,pUnk);
1511
1512   if( pUnk != NULL )
1513   {
1514     /* Hmmm...wonder what this means! */
1515     ERR(dplay, "What does a NULL here mean?\n" ); 
1516     return DPERR_OUTOFMEMORY;
1517   }
1518
1519   if( IsEqualGUID( &IID_IDirectPlay2A, lpGUID ) )
1520   {
1521     IDirectPlay2AImpl** ilplpDP=(IDirectPlay2AImpl**)lplpDP;
1522     *ilplpDP = (IDirectPlay2AImpl*)HeapAlloc( GetProcessHeap(), HEAP_ZERO_MEMORY,
1523                                          sizeof( **ilplpDP ) );
1524
1525     if( !*ilplpDP )
1526     {
1527        return DPERR_OUTOFMEMORY;
1528     }
1529
1530     (*ilplpDP)->lpvtbl = &directPlay2AVT;
1531     (*ilplpDP)->ref    = 1;
1532   
1533     return DP_OK;
1534   }
1535   else if( IsEqualGUID( &IID_IDirectPlay2, lpGUID ) )
1536   {
1537     IDirectPlay2Impl** ilplpDP=(IDirectPlay2Impl**)lplpDP;
1538     *ilplpDP = (IDirectPlay2Impl*)HeapAlloc( GetProcessHeap(), HEAP_ZERO_MEMORY,
1539                                         sizeof( **ilplpDP ) );
1540
1541     if( !*ilplpDP )
1542     {
1543        return DPERR_OUTOFMEMORY;
1544     }
1545
1546     (*ilplpDP)->lpvtbl = &directPlay2WVT;
1547     (*ilplpDP)->ref    = 1;
1548
1549     return DP_OK;
1550   }
1551
1552   /* Unknown interface type */
1553   return DPERR_NOINTERFACE;
1554
1555 }
1556
1557 /* Direct Play helper methods */
1558
1559 /* Get a new interface. To be used by QueryInterface. */ 
1560 static HRESULT directPlay_QueryInterface 
1561          ( REFIID riid, LPVOID* ppvObj )
1562 {
1563
1564   if( IsEqualGUID( &IID_IDirectPlay2, riid ) )
1565   {
1566     IDirectPlay2Impl* lpDP = (IDirectPlay2Impl*)*ppvObj;
1567
1568     lpDP = (IDirectPlay2Impl*)HeapAlloc( GetProcessHeap(), HEAP_ZERO_MEMORY,
1569                                       sizeof( *lpDP ) );
1570
1571     if( !lpDP ) 
1572     {
1573        return DPERR_OUTOFMEMORY;
1574     }
1575
1576     lpDP->lpvtbl = &directPlay2WVT;
1577     lpDP->ref    = 1;
1578
1579     return S_OK;
1580   } 
1581   else if( IsEqualGUID( &IID_IDirectPlay2A, riid ) )
1582   {
1583     IDirectPlay2AImpl* lpDP = (IDirectPlay2AImpl*)*ppvObj;
1584
1585     lpDP = (IDirectPlay2AImpl*)HeapAlloc( GetProcessHeap(), HEAP_ZERO_MEMORY,
1586                                       sizeof( *lpDP ) );
1587
1588     if( !lpDP )
1589     {
1590        return DPERR_OUTOFMEMORY;
1591     }
1592
1593     lpDP->lpvtbl = &directPlay2AVT;
1594     lpDP->ref    = 1;
1595
1596     return S_OK;
1597   }
1598   else if( IsEqualGUID( &IID_IDirectPlay3, riid ) )
1599   {
1600     IDirectPlay3Impl* lpDP = (IDirectPlay3Impl*)*ppvObj;
1601
1602     lpDP = (IDirectPlay3Impl*)HeapAlloc( GetProcessHeap(), HEAP_ZERO_MEMORY,
1603                                       sizeof( *lpDP ) );
1604
1605     if( !lpDP )
1606     {
1607        return DPERR_OUTOFMEMORY;
1608     }
1609
1610     lpDP->lpvtbl = &directPlay3WVT;
1611     lpDP->ref    = 1;
1612
1613     return S_OK;
1614   }
1615   else if( IsEqualGUID( &IID_IDirectPlay3A, riid ) )
1616   {
1617     IDirectPlay3AImpl* lpDP = (IDirectPlay3AImpl*)*ppvObj;
1618
1619     lpDP = (IDirectPlay3AImpl*)HeapAlloc( GetProcessHeap(), HEAP_ZERO_MEMORY,
1620                                       sizeof( *lpDP ) );
1621
1622     if( !lpDP )
1623     {
1624        return DPERR_OUTOFMEMORY;
1625     }
1626
1627     lpDP->lpvtbl = &directPlay3AVT;
1628     lpDP->ref    = 1;
1629
1630     return S_OK;
1631
1632   }
1633
1634   *ppvObj = NULL;
1635   return E_NOINTERFACE;
1636 }
1637
1638
1639 /* Direct Play methods */
1640 static HRESULT WINAPI DirectPlay2W_QueryInterface
1641          ( LPDIRECTPLAY2 iface, REFIID riid, LPVOID* ppvObj )
1642 {
1643   ICOM_THIS(IDirectPlay2Impl,iface);
1644   TRACE( dplay, "(%p)->(%p,%p)\n", This, riid, ppvObj );
1645
1646   if( IsEqualGUID( &IID_IUnknown, riid ) ||
1647       IsEqualGUID( &IID_IDirectPlay2, riid )
1648     )
1649   {
1650     IDirectPlay2_AddRef( iface );
1651     *ppvObj = This;
1652     return S_OK;
1653   }
1654   return directPlay_QueryInterface( riid, ppvObj );
1655 }
1656
1657 static HRESULT WINAPI DirectPlay2A_QueryInterface
1658          ( LPDIRECTPLAY2A iface, REFIID riid, LPVOID* ppvObj )
1659 {
1660   ICOM_THIS(IDirectPlay2Impl,iface);
1661   TRACE( dplay, "(%p)->(%p,%p)\n", This, riid, ppvObj );
1662
1663   if( IsEqualGUID( &IID_IUnknown, riid ) ||
1664       IsEqualGUID( &IID_IDirectPlay2A, riid )
1665     )
1666   {
1667     IDirectPlay2_AddRef( iface );
1668     *ppvObj = This;
1669     return S_OK;
1670   }
1671
1672   return directPlay_QueryInterface( riid, ppvObj );
1673 }
1674
1675 static HRESULT WINAPI DirectPlay3WImpl_QueryInterface
1676          ( LPDIRECTPLAY3 iface, REFIID riid, LPVOID* ppvObj )
1677 {
1678   ICOM_THIS(IDirectPlay3Impl,iface);
1679   TRACE( dplay, "(%p)->(%p,%p)\n", This, riid, ppvObj );
1680
1681   if( IsEqualGUID( &IID_IUnknown, riid ) ||
1682       IsEqualGUID( &IID_IDirectPlay3, riid )
1683     )
1684   {
1685     IDirectPlay3_AddRef( iface );
1686     *ppvObj = This;
1687     return S_OK;
1688   }
1689
1690   return directPlay_QueryInterface( riid, ppvObj );
1691 }
1692
1693 static HRESULT WINAPI DirectPlay3A_QueryInterface
1694          ( LPDIRECTPLAY3A iface, REFIID riid, LPVOID* ppvObj )
1695 {
1696   ICOM_THIS(IDirectPlay3Impl,iface);
1697   TRACE( dplay, "(%p)->(%p,%p)\n", This, riid, ppvObj );
1698
1699   if( IsEqualGUID( &IID_IUnknown, riid ) ||
1700       IsEqualGUID( &IID_IDirectPlay3A, riid )
1701     )
1702   {
1703     IDirectPlay3_AddRef( iface );
1704     *ppvObj = This;
1705     return S_OK;
1706   }
1707
1708   return directPlay_QueryInterface( riid, ppvObj );
1709 }
1710
1711
1712 /* Shared between all dplay types */
1713 static ULONG WINAPI DirectPlay3WImpl_AddRef
1714          ( LPDIRECTPLAY3 iface )
1715 {
1716   ICOM_THIS(IDirectPlay3Impl,iface);
1717   ++(This->ref);
1718   TRACE( dplay,"ref count now %lu\n", This->ref );
1719   return (This->ref);
1720 }
1721
1722 static ULONG WINAPI DirectPlay3WImpl_Release
1723 ( LPDIRECTPLAY3 iface )
1724 {
1725   ICOM_THIS(IDirectPlay3Impl,iface);
1726   TRACE( dplay, "ref count decremeneted from %lu\n", This->ref );
1727
1728   This->ref--;
1729
1730   /* Deallocate if this is the last reference to the object */
1731   if( !(This->ref) )
1732   {
1733     FIXME( dplay, "memory leak\n" );
1734     /* Implement memory deallocation */
1735
1736     HeapFree( GetProcessHeap(), 0, This );
1737
1738     return 0;
1739   }
1740
1741   return This->ref;
1742 }
1743
1744 static ULONG WINAPI DirectPlay3A_Release
1745 ( LPDIRECTPLAY3A iface )
1746 {
1747   ICOM_THIS(IDirectPlay3Impl,iface);
1748   TRACE( dplay, "ref count decremeneted from %lu\n", This->ref );
1749
1750   This->ref--;
1751
1752   /* Deallocate if this is the last reference to the object */
1753   if( !(This->ref) )
1754   {
1755     FIXME( dplay, "memory leak\n" );
1756     /* Implement memory deallocation */
1757
1758     HeapFree( GetProcessHeap(), 0, This );
1759
1760     return 0;
1761   }
1762
1763   return This->ref;
1764 }
1765
1766 HRESULT WINAPI DirectPlay3A_AddPlayerToGroup
1767           ( LPDIRECTPLAY3A iface, DPID a, DPID b )
1768 {
1769   ICOM_THIS(IDirectPlay3Impl,iface);
1770   FIXME( dplay,"(%p)->(0x%08lx,0x%08lx): stub", This, a, b );
1771   return DP_OK;
1772 }
1773
1774 HRESULT WINAPI DirectPlay3WImpl_AddPlayerToGroup
1775           ( LPDIRECTPLAY3 iface, DPID a, DPID b )
1776 {
1777   ICOM_THIS(IDirectPlay3Impl,iface);
1778   FIXME( dplay,"(%p)->(0x%08lx,0x%08lx): stub", This, a, b );
1779   return DP_OK;
1780 }
1781
1782
1783 HRESULT WINAPI DirectPlay3A_Close
1784           ( LPDIRECTPLAY3A iface )
1785 {
1786   ICOM_THIS(IDirectPlay3Impl,iface);
1787   FIXME( dplay,"(%p)->(): stub", This );
1788   return DP_OK;
1789 }
1790
1791 HRESULT WINAPI DirectPlay3WImpl_Close
1792           ( LPDIRECTPLAY3 iface )
1793 {
1794   ICOM_THIS(IDirectPlay3Impl,iface);
1795   FIXME( dplay,"(%p)->(): stub", This );
1796   return DP_OK;
1797 }
1798
1799 HRESULT WINAPI DirectPlay3A_CreateGroup
1800           ( LPDIRECTPLAY3A iface, LPDPID a, LPDPNAME b, LPVOID c, DWORD d, DWORD e )
1801 {
1802   ICOM_THIS(IDirectPlay3Impl,iface);
1803   FIXME( dplay,"(%p)->(%p,%p,%p,0x%08lx,0x%08lx): stub", This, a, b, c, d, e );
1804   return DP_OK;
1805 }
1806
1807 HRESULT WINAPI DirectPlay3WImpl_CreateGroup
1808           ( LPDIRECTPLAY3 iface, LPDPID a, LPDPNAME b, LPVOID c, DWORD d, DWORD e )
1809 {
1810   ICOM_THIS(IDirectPlay3Impl,iface);
1811   FIXME( dplay,"(%p)->(%p,%p,%p,0x%08lx,0x%08lx): stub", This, a, b, c, d, e );
1812   return DP_OK;
1813 }
1814
1815 HRESULT WINAPI DirectPlay3A_CreatePlayer
1816           ( LPDIRECTPLAY3A iface, LPDPID a, LPDPNAME b, HANDLE c, LPVOID d, DWORD e, DWORD f )
1817 {
1818   ICOM_THIS(IDirectPlay3Impl,iface);
1819   FIXME( dplay,"(%p)->(%p,%p,%d,%p,0x%08lx,0x%08lx): stub", This, a, b, c, d, e, f );
1820   return DP_OK;
1821 }
1822
1823 HRESULT WINAPI DirectPlay3WImpl_CreatePlayer
1824           ( LPDIRECTPLAY3 iface, LPDPID a, LPDPNAME b, HANDLE c, LPVOID d, DWORD e, DWORD f )
1825 {
1826   ICOM_THIS(IDirectPlay3Impl,iface);
1827   FIXME( dplay,"(%p)->(%p,%p,%d,%p,0x%08lx,0x%08lx): stub", This, a, b, c, d, e, f );
1828   return DP_OK;
1829 }
1830
1831 HRESULT WINAPI DirectPlay3A_DeletePlayerFromGroup
1832           ( LPDIRECTPLAY3A iface, DPID a, DPID b )
1833 {
1834   ICOM_THIS(IDirectPlay3Impl,iface);
1835   FIXME( dplay,"(%p)->(0x%08lx,0x%08lx): stub", This, a, b );
1836   return DP_OK;
1837 }
1838
1839 HRESULT WINAPI DirectPlay3WImpl_DeletePlayerFromGroup
1840           ( LPDIRECTPLAY3 iface, DPID a, DPID b )
1841 {
1842   ICOM_THIS(IDirectPlay3Impl,iface);
1843   FIXME( dplay,"(%p)->(0x%08lx,0x%08lx): stub", This, a, b );
1844   return DP_OK;
1845 }
1846
1847 HRESULT WINAPI DirectPlay3A_DestroyGroup
1848           ( LPDIRECTPLAY3A iface, DPID a )
1849 {
1850   ICOM_THIS(IDirectPlay3Impl,iface);
1851   FIXME( dplay,"(%p)->(0x%08lx): stub", This, a );
1852   return DP_OK;
1853 }
1854
1855 HRESULT WINAPI DirectPlay3WImpl_DestroyGroup
1856           ( LPDIRECTPLAY3 iface, DPID a )
1857 {
1858   ICOM_THIS(IDirectPlay3Impl,iface);
1859   FIXME( dplay,"(%p)->(0x%08lx): stub", This, a );
1860   return DP_OK;
1861 }
1862
1863 HRESULT WINAPI DirectPlay3A_DestroyPlayer
1864           ( LPDIRECTPLAY3A iface, DPID a )
1865 {
1866   ICOM_THIS(IDirectPlay3Impl,iface);
1867   FIXME( dplay,"(%p)->(0x%08lx): stub", This, a );
1868   return DP_OK;
1869 }
1870
1871 HRESULT WINAPI DirectPlay3WImpl_DestroyPlayer
1872           ( LPDIRECTPLAY3 iface, DPID a )
1873 {
1874   ICOM_THIS(IDirectPlay3Impl,iface);
1875   FIXME( dplay,"(%p)->(0x%08lx): stub", This, a );
1876   return DP_OK;
1877 }
1878
1879 HRESULT WINAPI DirectPlay3A_EnumGroupPlayers
1880           ( LPDIRECTPLAY3A iface, DPID a, LPGUID b, LPDPENUMPLAYERSCALLBACK2 c,
1881             LPVOID d, DWORD e )
1882 {
1883   ICOM_THIS(IDirectPlay3Impl,iface);
1884   FIXME( dplay,"(%p)->(0x%08lx,%p,%p,%p,0x%08lx): stub", This, a, b, c, d, e );
1885   return DP_OK;
1886 }
1887
1888 HRESULT WINAPI DirectPlay3WImpl_EnumGroupPlayers
1889           ( LPDIRECTPLAY3 iface, DPID a, LPGUID b, LPDPENUMPLAYERSCALLBACK2 c,
1890             LPVOID d, DWORD e )
1891 {
1892   ICOM_THIS(IDirectPlay3Impl,iface);
1893   FIXME( dplay,"(%p)->(0x%08lx,%p,%p,%p,0x%08lx): stub", This, a, b, c, d, e );
1894   return DP_OK;
1895 }
1896
1897 HRESULT WINAPI DirectPlay3A_EnumGroups
1898           ( LPDIRECTPLAY3A iface, LPGUID a, LPDPENUMPLAYERSCALLBACK2 b, LPVOID c, DWORD d )
1899 {
1900   ICOM_THIS(IDirectPlay3Impl,iface);
1901   FIXME( dplay,"(%p)->(%p,%p,%p,0x%08lx): stub", This, a, b, c, d );
1902   return DP_OK;
1903 }
1904
1905 HRESULT WINAPI DirectPlay3WImpl_EnumGroups
1906           ( LPDIRECTPLAY3 iface, LPGUID a, LPDPENUMPLAYERSCALLBACK2 b, LPVOID c, DWORD d )
1907 {
1908   ICOM_THIS(IDirectPlay3Impl,iface);
1909   FIXME( dplay,"(%p)->(%p,%p,%p,0x%08lx): stub", This, a, b, c, d );
1910   return DP_OK;
1911 }
1912
1913 HRESULT WINAPI DirectPlay3A_EnumPlayers
1914           ( LPDIRECTPLAY3A iface, LPGUID a, LPDPENUMPLAYERSCALLBACK2 b, LPVOID c, DWORD d )
1915 {
1916   ICOM_THIS(IDirectPlay3Impl,iface);
1917   FIXME( dplay,"(%p)->(%p,%p,%p,0x%08lx): stub", This, a, b, c, d );
1918   return DP_OK;
1919 }
1920
1921 HRESULT WINAPI DirectPlay3WImpl_EnumPlayers
1922           ( LPDIRECTPLAY3 iface, LPGUID a, LPDPENUMPLAYERSCALLBACK2 b, LPVOID c, DWORD d )
1923 {
1924   ICOM_THIS(IDirectPlay3Impl,iface);
1925   FIXME( dplay,"(%p)->(%p,%p,%p,0x%08lx): stub", This, a, b, c, d );
1926   return DP_OK;
1927 }
1928
1929 HRESULT WINAPI DirectPlay3A_EnumSessions
1930           ( LPDIRECTPLAY3A iface, LPDPSESSIONDESC2 a, DWORD b, LPDPENUMSESSIONSCALLBACK2 c,
1931             LPVOID d, DWORD e )
1932 {
1933   ICOM_THIS(IDirectPlay3Impl,iface);
1934   FIXME( dplay,"(%p)->(%p,0x%08lx,%p,%p,0x%08lx): stub", This, a, b, c, d, e );
1935   return DP_OK;
1936 }
1937
1938 HRESULT WINAPI DirectPlay3WImpl_EnumSessions
1939           ( LPDIRECTPLAY3 iface, LPDPSESSIONDESC2 a, DWORD b, LPDPENUMSESSIONSCALLBACK2 c,
1940             LPVOID d, DWORD e )
1941 {
1942   ICOM_THIS(IDirectPlay3Impl,iface);
1943   FIXME( dplay,"(%p)->(%p,0x%08lx,%p,%p,0x%08lx): stub", This, a, b, c, d, e );
1944   return DP_OK;
1945 }
1946
1947 HRESULT WINAPI DirectPlay3A_GetCaps
1948           ( LPDIRECTPLAY3A iface, LPDPCAPS a, DWORD b )
1949 {
1950   ICOM_THIS(IDirectPlay3Impl,iface);
1951   FIXME( dplay,"(%p)->(%p,0x%08lx): stub", This, a, b );
1952   return DP_OK;
1953 }
1954
1955 HRESULT WINAPI DirectPlay3WImpl_GetCaps
1956           ( LPDIRECTPLAY3 iface, LPDPCAPS a, DWORD b )
1957 {
1958   ICOM_THIS(IDirectPlay3Impl,iface);
1959   FIXME( dplay,"(%p)->(%p,0x%08lx): stub", This, a, b );
1960   return DP_OK;
1961 }
1962
1963 HRESULT WINAPI DirectPlay3A_GetGroupData
1964           ( LPDIRECTPLAY3 iface, DPID a, LPVOID b, LPDWORD c, DWORD d )
1965 {
1966   ICOM_THIS(IDirectPlay3Impl,iface);
1967   FIXME( dplay,"(%p)->(0x%08lx,%p,%p,0x%08lx): stub", This, a, b, c, d );
1968   return DP_OK;
1969 }
1970
1971 HRESULT WINAPI DirectPlay3WImpl_GetGroupData
1972           ( LPDIRECTPLAY3 iface, DPID a, LPVOID b, LPDWORD c, DWORD d )
1973 {
1974   ICOM_THIS(IDirectPlay3Impl,iface);
1975   FIXME( dplay,"(%p)->(0x%08lx,%p,%p,0x%08lx): stub", This, a, b, c, d );
1976   return DP_OK;
1977 }
1978
1979 HRESULT WINAPI DirectPlay3A_GetGroupName
1980           ( LPDIRECTPLAY3A iface, DPID a, LPVOID b, LPDWORD c )
1981 {
1982   ICOM_THIS(IDirectPlay3Impl,iface);
1983   FIXME( dplay,"(%p)->(0x%08lx,%p,%p): stub", This, a, b, c );
1984   return DP_OK;
1985 }
1986
1987 HRESULT WINAPI DirectPlay3WImpl_GetGroupName
1988           ( LPDIRECTPLAY3 iface, DPID a, LPVOID b, LPDWORD c )
1989 {
1990   ICOM_THIS(IDirectPlay3Impl,iface);
1991   FIXME( dplay,"(%p)->(0x%08lx,%p,%p): stub", This, a, b, c );
1992   return DP_OK;
1993 }
1994
1995 HRESULT WINAPI DirectPlay3A_GetMessageCount
1996           ( LPDIRECTPLAY3A iface, DPID a, LPDWORD b )
1997 {
1998   ICOM_THIS(IDirectPlay3Impl,iface);
1999   FIXME( dplay,"(%p)->(0x%08lx,%p): stub", This, a, b );
2000   return DP_OK;
2001 }
2002
2003 HRESULT WINAPI DirectPlay3WImpl_GetMessageCount
2004           ( LPDIRECTPLAY3 iface, DPID a, LPDWORD b )
2005 {
2006   ICOM_THIS(IDirectPlay3Impl,iface);
2007   FIXME( dplay,"(%p)->(0x%08lx,%p): stub", This, a, b );
2008   return DP_OK;
2009 }
2010
2011 HRESULT WINAPI DirectPlay3A_GetPlayerAddress
2012           ( LPDIRECTPLAY3A iface, DPID a, LPVOID b, LPDWORD c )
2013 {
2014   ICOM_THIS(IDirectPlay3Impl,iface);
2015   FIXME( dplay,"(%p)->(0x%08lx,%p,%p): stub", This, a, b, c );
2016   return DP_OK;
2017 }
2018
2019 HRESULT WINAPI DirectPlay3WImpl_GetPlayerAddress
2020           ( LPDIRECTPLAY3 iface, DPID a, LPVOID b, LPDWORD c )
2021 {
2022   ICOM_THIS(IDirectPlay3Impl,iface);
2023   FIXME( dplay,"(%p)->(0x%08lx,%p,%p): stub", This, a, b, c );
2024   return DP_OK;
2025 }
2026
2027 HRESULT WINAPI DirectPlay3A_GetPlayerCaps
2028           ( LPDIRECTPLAY3A iface, DPID a, LPDPCAPS b, DWORD c )
2029 {
2030   ICOM_THIS(IDirectPlay3Impl,iface);
2031   FIXME( dplay,"(%p)->(0x%08lx,%p,0x%08lx): stub", This, a, b, c );
2032   return DP_OK;
2033 }
2034
2035 HRESULT WINAPI DirectPlay3WImpl_GetPlayerCaps
2036           ( LPDIRECTPLAY3 iface, DPID a, LPDPCAPS b, DWORD c )
2037 {
2038   ICOM_THIS(IDirectPlay3Impl,iface);
2039   FIXME( dplay,"(%p)->(0x%08lx,%p,0x%08lx): stub", This, a, b, c );
2040   return DP_OK;
2041 }
2042
2043 HRESULT WINAPI DirectPlay3A_GetPlayerData
2044           ( LPDIRECTPLAY3A iface, DPID a, LPVOID b, LPDWORD c, DWORD d )
2045 {
2046   ICOM_THIS(IDirectPlay3Impl,iface);
2047   FIXME( dplay,"(%p)->(0x%08lx,%p,%p,0x%08lx): stub", This, a, b, c, d );
2048   return DP_OK;
2049 }
2050
2051 HRESULT WINAPI DirectPlay3WImpl_GetPlayerData
2052           ( LPDIRECTPLAY3 iface, DPID a, LPVOID b, LPDWORD c, DWORD d )
2053 {
2054   ICOM_THIS(IDirectPlay3Impl,iface);
2055   FIXME( dplay,"(%p)->(0x%08lx,%p,%p,0x%08lx): stub", This, a, b, c, d );
2056   return DP_OK;
2057 }
2058
2059 HRESULT WINAPI DirectPlay3A_GetPlayerName
2060           ( LPDIRECTPLAY3 iface, DPID a, LPVOID b, LPDWORD c )
2061 {
2062   ICOM_THIS(IDirectPlay3Impl,iface);
2063   FIXME( dplay,"(%p)->(0x%08lx,%p,%p): stub", This, a, b, c );
2064   return DP_OK;
2065 }
2066
2067 HRESULT WINAPI DirectPlay3WImpl_GetPlayerName
2068           ( LPDIRECTPLAY3 iface, DPID a, LPVOID b, LPDWORD c )
2069 {
2070   ICOM_THIS(IDirectPlay3Impl,iface);
2071   FIXME( dplay,"(%p)->(0x%08lx,%p,%p): stub", This, a, b, c );
2072   return DP_OK;
2073 }
2074
2075 HRESULT WINAPI DirectPlay3A_GetSessionDesc
2076           ( LPDIRECTPLAY3A iface, LPVOID a, LPDWORD b )
2077 {
2078   ICOM_THIS(IDirectPlay3Impl,iface);
2079   FIXME( dplay,"(%p)->(%p,%p): stub", This, a, b );
2080   return DP_OK;
2081 }
2082
2083 HRESULT WINAPI DirectPlay3WImpl_GetSessionDesc
2084           ( LPDIRECTPLAY3 iface, LPVOID a, LPDWORD b )
2085 {
2086   ICOM_THIS(IDirectPlay3Impl,iface);
2087   FIXME( dplay,"(%p)->(%p,%p): stub", This, a, b );
2088   return DP_OK;
2089 }
2090
2091 HRESULT WINAPI DirectPlay3A_Initialize
2092           ( LPDIRECTPLAY3A iface, LPGUID a )
2093 {
2094   ICOM_THIS(IDirectPlay3Impl,iface);
2095   FIXME( dplay,"(%p)->(%p): stub", This, a );
2096   return DP_OK;
2097 }
2098
2099 HRESULT WINAPI DirectPlay3WImpl_Initialize
2100           ( LPDIRECTPLAY3 iface, LPGUID a )
2101 {
2102   ICOM_THIS(IDirectPlay3Impl,iface);
2103   FIXME( dplay,"(%p)->(%p): stub", This, a );
2104   return DP_OK;
2105 }
2106
2107
2108 HRESULT WINAPI DirectPlay3A_Open
2109           ( LPDIRECTPLAY3A iface, LPDPSESSIONDESC2 a, DWORD b )
2110 {
2111   ICOM_THIS(IDirectPlay3Impl,iface);
2112   FIXME( dplay,"(%p)->(%p,0x%08lx): stub", This, a, b );
2113   return DP_OK;
2114 }
2115
2116 HRESULT WINAPI DirectPlay3WImpl_Open
2117           ( LPDIRECTPLAY3 iface, LPDPSESSIONDESC2 a, DWORD b )
2118 {
2119   ICOM_THIS(IDirectPlay3Impl,iface);
2120   FIXME( dplay,"(%p)->(%p,0x%08lx): stub", This, a, b );
2121   return DP_OK;
2122 }
2123
2124 HRESULT WINAPI DirectPlay3A_Receive
2125           ( LPDIRECTPLAY3A iface, LPDPID a, LPDPID b, DWORD c, LPVOID d, LPDWORD e )
2126 {
2127   ICOM_THIS(IDirectPlay3Impl,iface);
2128   FIXME( dplay,"(%p)->(%p,%p,0x%08lx,%p,%p): stub", This, a, b, c, d, e );
2129   return DP_OK;
2130 }
2131
2132 HRESULT WINAPI DirectPlay3WImpl_Receive
2133           ( LPDIRECTPLAY3 iface, LPDPID a, LPDPID b, DWORD c, LPVOID d, LPDWORD e )
2134 {
2135   ICOM_THIS(IDirectPlay3Impl,iface);
2136   FIXME( dplay,"(%p)->(%p,%p,0x%08lx,%p,%p): stub", This, a, b, c, d, e );
2137   return DP_OK;
2138 }
2139
2140 HRESULT WINAPI DirectPlay3A_Send
2141           ( LPDIRECTPLAY3A iface, DPID a, DPID b, DWORD c, LPVOID d, DWORD e )
2142 {
2143   ICOM_THIS(IDirectPlay3Impl,iface);
2144   FIXME( dplay,"(%p)->(0x%08lx,0x%08lx,0x%08lx,%p,0x%08lx): stub", This, a, b, c, d, e );
2145   return DP_OK;
2146 }
2147
2148 HRESULT WINAPI DirectPlay3WImpl_Send
2149           ( LPDIRECTPLAY3 iface, DPID a, DPID b, DWORD c, LPVOID d, DWORD e )
2150 {
2151   ICOM_THIS(IDirectPlay3Impl,iface);
2152   FIXME( dplay,"(%p)->(0x%08lx,0x%08lx,0x%08lx,%p,0x%08lx): stub", This, a, b, c, d, e );
2153   return DP_OK;
2154 }
2155
2156 HRESULT WINAPI DirectPlay3A_SetGroupData
2157           ( LPDIRECTPLAY3A iface, DPID a, LPVOID b, DWORD c, DWORD d )
2158 {
2159   ICOM_THIS(IDirectPlay3Impl,iface);
2160   FIXME( dplay,"(%p)->(0x%08lx,%p,0x%08lx,0x%08lx): stub", This, a, b, c, d );
2161   return DP_OK;
2162 }
2163
2164 HRESULT WINAPI DirectPlay3WImpl_SetGroupData
2165           ( LPDIRECTPLAY3 iface, DPID a, LPVOID b, DWORD c, DWORD d )
2166 {   
2167   ICOM_THIS(IDirectPlay3Impl,iface);
2168   FIXME( dplay,"(%p)->(0x%08lx,%p,0x%08lx,0x%08lx): stub", This, a, b, c, d );
2169   return DP_OK;
2170 }
2171
2172 HRESULT WINAPI DirectPlay3A_SetGroupName
2173           ( LPDIRECTPLAY3A iface, DPID a, LPDPNAME b, DWORD c )
2174 {
2175   ICOM_THIS(IDirectPlay3Impl,iface);
2176   FIXME( dplay,"(%p)->(0x%08lx,%p,0x%08lx): stub", This, a, b, c );
2177   return DP_OK;
2178 }
2179
2180 HRESULT WINAPI DirectPlay3WImpl_SetGroupName
2181           ( LPDIRECTPLAY3 iface, DPID a, LPDPNAME b, DWORD c )
2182 {
2183   ICOM_THIS(IDirectPlay3Impl,iface);
2184   FIXME( dplay,"(%p)->(0x%08lx,%p,0x%08lx): stub", This, a, b, c );
2185   return DP_OK;
2186 }
2187
2188 HRESULT WINAPI DirectPlay3A_SetPlayerData
2189           ( LPDIRECTPLAY3A iface, DPID a, LPVOID b, DWORD c, DWORD d )
2190 {
2191   ICOM_THIS(IDirectPlay3Impl,iface);
2192   FIXME( dplay,"(%p)->(0x%08lx,%p,0x%08lx,0x%08lx): stub", This, a, b, c, d );
2193   return DP_OK;
2194 }
2195
2196 HRESULT WINAPI DirectPlay3WImpl_SetPlayerData
2197           ( LPDIRECTPLAY3 iface, DPID a, LPVOID b, DWORD c, DWORD d )
2198 {
2199   ICOM_THIS(IDirectPlay3Impl,iface);
2200   FIXME( dplay,"(%p)->(0x%08lx,%p,0x%08lx,0x%08lx): stub", This, a, b, c, d );
2201   return DP_OK;
2202 }
2203
2204 HRESULT WINAPI DirectPlay3A_SetPlayerName
2205           ( LPDIRECTPLAY3A iface, DPID a, LPDPNAME b, DWORD c )
2206 {
2207   ICOM_THIS(IDirectPlay3Impl,iface);
2208   FIXME( dplay,"(%p)->(0x%08lx,%p,0x%08lx): stub", This, a, b, c );
2209   return DP_OK;
2210 }
2211
2212 HRESULT WINAPI DirectPlay3WImpl_SetPlayerName
2213           ( LPDIRECTPLAY3 iface, DPID a, LPDPNAME b, DWORD c )
2214 {
2215   ICOM_THIS(IDirectPlay3Impl,iface);
2216   FIXME( dplay,"(%p)->(0x%08lx,%p,0x%08lx): stub", This, a, b, c );
2217   return DP_OK;
2218 }
2219
2220 HRESULT WINAPI DirectPlay3A_SetSessionDesc
2221           ( LPDIRECTPLAY3A iface, LPDPSESSIONDESC2 a, DWORD b )
2222 {
2223   ICOM_THIS(IDirectPlay3Impl,iface);
2224   FIXME( dplay,"(%p)->(%p,0x%08lx): stub", This, a, b );
2225   return DP_OK;
2226 }
2227
2228 HRESULT WINAPI DirectPlay3WImpl_SetSessionDesc
2229           ( LPDIRECTPLAY3 iface, LPDPSESSIONDESC2 a, DWORD b )
2230 {
2231   ICOM_THIS(IDirectPlay3Impl,iface);
2232   FIXME( dplay,"(%p)->(%p,0x%08lx): stub", This, a, b );
2233   return DP_OK;
2234 }
2235
2236 HRESULT WINAPI DirectPlay3A_AddGroupToGroup
2237           ( LPDIRECTPLAY3A iface, DPID a, DPID b )
2238 {
2239   ICOM_THIS(IDirectPlay3Impl,iface);
2240   FIXME( dplay,"(%p)->(0x%08lx,0x%08lx): stub", This, a, b );
2241   return DP_OK;
2242 }
2243
2244 HRESULT WINAPI DirectPlay3WImpl_AddGroupToGroup
2245           ( LPDIRECTPLAY3 iface, DPID a, DPID b )
2246 {
2247   ICOM_THIS(IDirectPlay3Impl,iface);
2248   FIXME( dplay,"(%p)->(0x%08lx,0x%08lx): stub", This, a, b );
2249   return DP_OK;
2250 }
2251
2252 HRESULT WINAPI DirectPlay3A_CreateGroupInGroup
2253           ( LPDIRECTPLAY3A iface, DPID a, LPDPID b, LPDPNAME c, LPVOID d, DWORD e, DWORD f )
2254 {
2255   ICOM_THIS(IDirectPlay3Impl,iface);
2256   FIXME( dplay,"(%p)->(0x%08lx,%p,%p,%p,0x%08lx,0x%08lx): stub", This, a, b, c, d, e, f );
2257   return DP_OK;
2258 }
2259
2260 HRESULT WINAPI DirectPlay3WImpl_CreateGroupInGroup
2261           ( LPDIRECTPLAY3 iface, DPID a, LPDPID b, LPDPNAME c, LPVOID d, DWORD e, DWORD f )
2262 {
2263   ICOM_THIS(IDirectPlay3Impl,iface);
2264   FIXME( dplay,"(%p)->(0x%08lx,%p,%p,%p,0x%08lx,0x%08lx): stub", This, a, b, c, d, e, f );
2265   return DP_OK;
2266 }
2267
2268 HRESULT WINAPI DirectPlay3A_DeleteGroupFromGroup
2269           ( LPDIRECTPLAY3A iface, DPID a, DPID b )
2270 {
2271   ICOM_THIS(IDirectPlay3Impl,iface);
2272   FIXME( dplay,"(%p)->(0x%08lx,0x%08lx): stub", This, a, b );
2273   return DP_OK;
2274 }
2275
2276 HRESULT WINAPI DirectPlay3WImpl_DeleteGroupFromGroup
2277           ( LPDIRECTPLAY3 iface, DPID a, DPID b )
2278 {
2279   ICOM_THIS(IDirectPlay3Impl,iface);
2280   FIXME( dplay,"(%p)->(0x%08lx,0x%08lx): stub", This, a, b );
2281   return DP_OK;
2282 }
2283
2284 HRESULT WINAPI DirectPlay3A_EnumConnections
2285           ( LPDIRECTPLAY3A iface, LPCGUID a, LPDPENUMCONNECTIONSCALLBACK b, LPVOID c, DWORD d )
2286 {
2287   ICOM_THIS(IDirectPlay3Impl,iface);
2288   FIXME( dplay,"(%p)->(%p,%p,%p,0x%08lx): stub", This, a, b, c, d );
2289   return DP_OK;
2290 }
2291
2292 HRESULT WINAPI DirectPlay3WImpl_EnumConnections
2293           ( LPDIRECTPLAY3 iface, LPCGUID a, LPDPENUMCONNECTIONSCALLBACK b, LPVOID c, DWORD d )
2294
2295   ICOM_THIS(IDirectPlay3Impl,iface);
2296   FIXME( dplay,"(%p)->(%p,%p,%p,0x%08lx): stub", This, a, b, c, d );
2297   return DP_OK;
2298 }
2299
2300 HRESULT WINAPI DirectPlay3A_EnumGroupsInGroup
2301           ( LPDIRECTPLAY3A iface, DPID a, LPGUID b, LPDPENUMPLAYERSCALLBACK2 c, LPVOID d, DWORD e )
2302 {
2303   ICOM_THIS(IDirectPlay3Impl,iface);
2304   FIXME( dplay,"(%p)->(0x%08lx,%p,%p,%p,0x%08lx): stub", This, a, b, c, d, e );
2305   return DP_OK;
2306 }
2307
2308 HRESULT WINAPI DirectPlay3WImpl_EnumGroupsInGroup
2309           ( LPDIRECTPLAY3 iface, DPID a, LPGUID b, LPDPENUMPLAYERSCALLBACK2 c, LPVOID d, DWORD e )
2310 {
2311   ICOM_THIS(IDirectPlay3Impl,iface);
2312   FIXME( dplay,"(%p)->(0x%08lx,%p,%p,%p,0x%08lx): stub", This, a, b, c, d, e );
2313   return DP_OK;
2314 }
2315
2316 HRESULT WINAPI DirectPlay3A_GetGroupConnectionSettings
2317           ( LPDIRECTPLAY3A iface, DWORD a, DPID b, LPVOID c, LPDWORD d )
2318 {
2319   ICOM_THIS(IDirectPlay3Impl,iface);
2320   FIXME( dplay,"(%p)->(0x%08lx,0x%08lx,%p,%p): stub", This, a, b, c, d );
2321   return DP_OK;
2322 }
2323
2324 HRESULT WINAPI DirectPlay3WImpl_GetGroupConnectionSettings
2325           ( LPDIRECTPLAY3 iface, DWORD a, DPID b, LPVOID c, LPDWORD d )
2326 {
2327   ICOM_THIS(IDirectPlay3Impl,iface);
2328   FIXME( dplay,"(%p)->(0x%08lx,0x%08lx,%p,%p): stub", This, a, b, c, d );
2329   return DP_OK;
2330 }
2331
2332 HRESULT WINAPI DirectPlay3A_InitializeConnection
2333           ( LPDIRECTPLAY3A iface, LPVOID a, DWORD b )
2334 {
2335   ICOM_THIS(IDirectPlay3Impl,iface);
2336   FIXME( dplay,"(%p)->(%p,0x%08lx): stub", This, a, b );
2337   return DP_OK;
2338 }
2339
2340 HRESULT WINAPI DirectPlay3WImpl_InitializeConnection
2341           ( LPDIRECTPLAY3 iface, LPVOID a, DWORD b )
2342 {
2343   ICOM_THIS(IDirectPlay3Impl,iface);
2344   FIXME( dplay,"(%p)->(%p,0x%08lx): stub", This, a, b );
2345   return DP_OK;
2346 }
2347
2348 HRESULT WINAPI DirectPlay3A_SecureOpen
2349           ( LPDIRECTPLAY3A iface, LPCDPSESSIONDESC2 a, DWORD b, LPCDPSECURITYDESC c, LPCDPCREDENTIALS d )
2350 {
2351   ICOM_THIS(IDirectPlay3Impl,iface);
2352   FIXME( dplay,"(%p)->(%p,0x%08lx,%p,%p): stub", This, a, b, c, d );
2353   return DP_OK;
2354 }
2355
2356 HRESULT WINAPI DirectPlay3WImpl_SecureOpen
2357           ( LPDIRECTPLAY3 iface, LPCDPSESSIONDESC2 a, DWORD b, LPCDPSECURITYDESC c, LPCDPCREDENTIALS d )
2358 {   
2359   ICOM_THIS(IDirectPlay3Impl,iface);
2360   FIXME( dplay,"(%p)->(%p,0x%08lx,%p,%p): stub", This, a, b, c, d );
2361   return DP_OK;
2362 }
2363
2364 HRESULT WINAPI DirectPlay3A_SendChatMessage
2365           ( LPDIRECTPLAY3A iface, DPID a, DPID b, DWORD c, LPDPCHAT d )
2366 {
2367   ICOM_THIS(IDirectPlay3Impl,iface);
2368   FIXME( dplay,"(%p)->(0x%08lx,0x%08lx,0x%08lx,%p): stub", This, a, b, c, d );
2369   return DP_OK;
2370 }
2371
2372 HRESULT WINAPI DirectPlay3WImpl_SendChatMessage
2373           ( LPDIRECTPLAY3 iface, DPID a, DPID b, DWORD c, LPDPCHAT d )
2374 {
2375   ICOM_THIS(IDirectPlay3Impl,iface);
2376   FIXME( dplay,"(%p)->(0x%08lx,0x%08lx,0x%08lx,%p): stub", This, a, b, c, d );
2377   return DP_OK;
2378 }
2379
2380 HRESULT WINAPI DirectPlay3A_SetGroupConnectionSettings
2381           ( LPDIRECTPLAY3A iface, DWORD a, DPID b, LPDPLCONNECTION c )
2382 {
2383   ICOM_THIS(IDirectPlay3Impl,iface);
2384   FIXME( dplay,"(%p)->(0x%08lx,0x%08lx,%p): stub", This, a, b, c );
2385   return DP_OK;
2386 }
2387
2388 HRESULT WINAPI DirectPlay3WImpl_SetGroupConnectionSettings
2389           ( LPDIRECTPLAY3 iface, DWORD a, DPID b, LPDPLCONNECTION c )
2390 {
2391   ICOM_THIS(IDirectPlay3Impl,iface);
2392   FIXME( dplay,"(%p)->(0x%08lx,0x%08lx,%p): stub", This, a, b, c );
2393   return DP_OK;
2394 }
2395
2396 HRESULT WINAPI DirectPlay3A_StartSession
2397           ( LPDIRECTPLAY3A iface, DWORD a, DPID b )
2398 {
2399   ICOM_THIS(IDirectPlay3Impl,iface);
2400   FIXME( dplay,"(%p)->(0x%08lx,0x%08lx): stub", This, a, b );
2401   return DP_OK;
2402 }
2403
2404 HRESULT WINAPI DirectPlay3WImpl_StartSession
2405           ( LPDIRECTPLAY3 iface, DWORD a, DPID b )
2406 {
2407   ICOM_THIS(IDirectPlay3Impl,iface);
2408   FIXME( dplay,"(%p)->(0x%08lx,0x%08lx): stub", This, a, b );
2409   return DP_OK;
2410 }
2411  
2412 HRESULT WINAPI DirectPlay3A_GetGroupFlags
2413           ( LPDIRECTPLAY3A iface, DPID a, LPDWORD b )
2414 {
2415   ICOM_THIS(IDirectPlay3Impl,iface);
2416   FIXME( dplay,"(%p)->(0x%08lx,%p): stub", This, a, b );
2417   return DP_OK;
2418 }
2419
2420 HRESULT WINAPI DirectPlay3WImpl_GetGroupFlags
2421           ( LPDIRECTPLAY3 iface, DPID a, LPDWORD b )
2422 {
2423   ICOM_THIS(IDirectPlay3Impl,iface);
2424   FIXME( dplay,"(%p)->(0x%08lx,%p): stub", This, a, b );
2425   return DP_OK;
2426 }
2427
2428 HRESULT WINAPI DirectPlay3A_GetGroupParent
2429           ( LPDIRECTPLAY3A iface, DPID a, LPDPID b )
2430 {
2431   ICOM_THIS(IDirectPlay3Impl,iface);
2432   FIXME( dplay,"(%p)->(0x%08lx,%p): stub", This, a, b );
2433   return DP_OK;
2434 }
2435
2436 HRESULT WINAPI DirectPlay3WImpl_GetGroupParent
2437           ( LPDIRECTPLAY3 iface, DPID a, LPDPID b )
2438 {
2439   ICOM_THIS(IDirectPlay3Impl,iface);
2440   FIXME( dplay,"(%p)->(0x%08lx,%p): stub", This, a, b );
2441   return DP_OK;
2442 }
2443
2444 HRESULT WINAPI DirectPlay3A_GetPlayerAccount
2445           ( LPDIRECTPLAY3A iface, DPID a, DWORD b, LPVOID c, LPDWORD d )
2446 {
2447   ICOM_THIS(IDirectPlay3Impl,iface);
2448   FIXME( dplay,"(%p)->(0x%08lx,0x%08lx,%p,%p): stub", This, a, b, c, d );
2449   return DP_OK;
2450 }
2451
2452 HRESULT WINAPI DirectPlay3WImpl_GetPlayerAccount
2453           ( LPDIRECTPLAY3 iface, DPID a, DWORD b, LPVOID c, LPDWORD d )
2454 {
2455   ICOM_THIS(IDirectPlay3Impl,iface);
2456   FIXME( dplay,"(%p)->(0x%08lx,0x%08lx,%p,%p): stub", This, a, b, c, d );
2457   return DP_OK;
2458 }
2459
2460 HRESULT WINAPI DirectPlay3A_GetPlayerFlags
2461           ( LPDIRECTPLAY3A iface, DPID a, LPDWORD b )
2462 {
2463   ICOM_THIS(IDirectPlay3Impl,iface);
2464   FIXME( dplay,"(%p)->(0x%08lx,%p): stub", This, a, b );
2465   return DP_OK;
2466 }
2467
2468 HRESULT WINAPI DirectPlay3WImpl_GetPlayerFlags
2469           ( LPDIRECTPLAY3 iface, DPID a, LPDWORD b )
2470 {
2471   ICOM_THIS(IDirectPlay3Impl,iface);
2472   FIXME( dplay,"(%p)->(0x%08lx,%p): stub", This, a, b );
2473   return DP_OK;
2474 }
2475
2476
2477 /* Note: Hack so we can reuse the old functions without compiler warnings */
2478 #if !defined(__STRICT_ANSI__) && defined(__GNUC__)
2479 # define XCAST(fun)     (typeof(directPlay2WVT.fn##fun))
2480 #else
2481 # define XCAST(fun)     (void*)
2482 #endif
2483
2484 static ICOM_VTABLE(IDirectPlay2) directPlay2WVT = 
2485 {
2486   ICOM_MSVTABLE_COMPAT_DummyRTTIVALUE
2487   DirectPlay2W_QueryInterface,
2488   XCAST(AddRef)DirectPlay3WImpl_AddRef,
2489   XCAST(Release)DirectPlay3WImpl_Release,
2490   XCAST(AddPlayerToGroup)DirectPlay3WImpl_AddPlayerToGroup,
2491   XCAST(Close)DirectPlay3WImpl_Close,
2492   XCAST(CreateGroup)DirectPlay3WImpl_CreateGroup,
2493   XCAST(CreatePlayer)DirectPlay3WImpl_CreatePlayer,
2494   XCAST(DeletePlayerFromGroup)DirectPlay3WImpl_DeletePlayerFromGroup,
2495   XCAST(DestroyGroup)DirectPlay3WImpl_DestroyGroup,
2496   XCAST(DestroyPlayer)DirectPlay3WImpl_DestroyPlayer,
2497   XCAST(EnumGroupPlayers)DirectPlay3WImpl_EnumGroupPlayers,
2498   XCAST(EnumGroups)DirectPlay3WImpl_EnumGroups,
2499   XCAST(EnumPlayers)DirectPlay3WImpl_EnumPlayers,
2500   XCAST(EnumSessions)DirectPlay3WImpl_EnumSessions,
2501   XCAST(GetCaps)DirectPlay3WImpl_GetCaps,
2502   XCAST(GetGroupData)DirectPlay3WImpl_GetGroupData,
2503   XCAST(GetGroupName)DirectPlay3WImpl_GetGroupName,
2504   XCAST(GetMessageCount)DirectPlay3WImpl_GetMessageCount,
2505   XCAST(GetPlayerAddress)DirectPlay3WImpl_GetPlayerAddress,
2506   XCAST(GetPlayerCaps)DirectPlay3WImpl_GetPlayerCaps,
2507   XCAST(GetPlayerData)DirectPlay3WImpl_GetPlayerData,
2508   XCAST(GetPlayerName)DirectPlay3WImpl_GetPlayerName,
2509   XCAST(GetSessionDesc)DirectPlay3WImpl_GetSessionDesc,
2510   XCAST(Initialize)DirectPlay3WImpl_Initialize,
2511   XCAST(Open)DirectPlay3WImpl_Open,
2512   XCAST(Receive)DirectPlay3WImpl_Receive,
2513   XCAST(Send)DirectPlay3WImpl_Send,
2514   XCAST(SetGroupData)DirectPlay3WImpl_SetGroupData,
2515   XCAST(SetGroupName)DirectPlay3WImpl_SetGroupName,
2516   XCAST(SetPlayerData)DirectPlay3WImpl_SetPlayerData,
2517   XCAST(SetPlayerName)DirectPlay3WImpl_SetPlayerName,
2518   XCAST(SetSessionDesc)DirectPlay3WImpl_SetSessionDesc
2519 };
2520 #undef XCAST
2521
2522
2523 /* Note: Hack so we can reuse the old functions without compiler warnings */
2524 #if !defined(__STRICT_ANSI__) && defined(__GNUC__)
2525 # define XCAST(fun)     (typeof(directPlay2AVT.fn##fun))
2526 #else
2527 # define XCAST(fun)     (void*)
2528 #endif
2529
2530 static ICOM_VTABLE(IDirectPlay2) directPlay2AVT = 
2531 {
2532   ICOM_MSVTABLE_COMPAT_DummyRTTIVALUE
2533   DirectPlay2A_QueryInterface,
2534   XCAST(AddRef)DirectPlay3WImpl_AddRef,
2535   XCAST(Release)DirectPlay3A_Release,
2536   XCAST(AddPlayerToGroup)DirectPlay3A_AddPlayerToGroup,
2537   XCAST(Close)DirectPlay3A_Close,
2538   XCAST(CreateGroup)DirectPlay3A_CreateGroup,
2539   XCAST(CreatePlayer)DirectPlay3A_CreatePlayer,
2540   XCAST(DeletePlayerFromGroup)DirectPlay3A_DeletePlayerFromGroup,
2541   XCAST(DestroyGroup)DirectPlay3A_DestroyGroup,
2542   XCAST(DestroyPlayer)DirectPlay3A_DestroyPlayer,
2543   XCAST(EnumGroupPlayers)DirectPlay3A_EnumGroupPlayers,
2544   XCAST(EnumGroups)DirectPlay3A_EnumGroups,
2545   XCAST(EnumPlayers)DirectPlay3A_EnumPlayers,
2546   XCAST(EnumSessions)DirectPlay3A_EnumSessions,
2547   XCAST(GetCaps)DirectPlay3A_GetCaps,
2548   XCAST(GetGroupData)DirectPlay3A_GetGroupData,
2549   XCAST(GetGroupName)DirectPlay3A_GetGroupName,
2550   XCAST(GetMessageCount)DirectPlay3A_GetMessageCount,
2551   XCAST(GetPlayerAddress)DirectPlay3A_GetPlayerAddress,
2552   XCAST(GetPlayerCaps)DirectPlay3A_GetPlayerCaps,
2553   XCAST(GetPlayerData)DirectPlay3A_GetPlayerData,
2554   XCAST(GetPlayerName)DirectPlay3A_GetPlayerName,
2555   XCAST(GetSessionDesc)DirectPlay3A_GetSessionDesc,
2556   XCAST(Initialize)DirectPlay3A_Initialize,
2557   XCAST(Open)DirectPlay3A_Open,
2558   XCAST(Receive)DirectPlay3A_Receive,
2559   XCAST(Send)DirectPlay3A_Send,
2560   XCAST(SetGroupData)DirectPlay3A_SetGroupData,
2561   XCAST(SetGroupName)DirectPlay3A_SetGroupName,
2562   XCAST(SetPlayerData)DirectPlay3A_SetPlayerData,
2563   XCAST(SetPlayerName)DirectPlay3A_SetPlayerName,
2564   XCAST(SetSessionDesc)DirectPlay3A_SetSessionDesc
2565 };
2566 #undef XCAST
2567
2568
2569 static ICOM_VTABLE(IDirectPlay3) directPlay3AVT = 
2570 {
2571   ICOM_MSVTABLE_COMPAT_DummyRTTIVALUE
2572   DirectPlay3A_QueryInterface,
2573   DirectPlay3WImpl_AddRef,
2574   DirectPlay3A_Release,
2575   DirectPlay3A_AddPlayerToGroup,
2576   DirectPlay3A_Close,
2577   DirectPlay3A_CreateGroup,
2578   DirectPlay3A_CreatePlayer,
2579   DirectPlay3A_DeletePlayerFromGroup,
2580   DirectPlay3A_DestroyGroup,
2581   DirectPlay3A_DestroyPlayer,
2582   DirectPlay3A_EnumGroupPlayers,
2583   DirectPlay3A_EnumGroups,
2584   DirectPlay3A_EnumPlayers,
2585   DirectPlay3A_EnumSessions,
2586   DirectPlay3A_GetCaps,
2587   DirectPlay3A_GetGroupData,
2588   DirectPlay3A_GetGroupName,
2589   DirectPlay3A_GetMessageCount,
2590   DirectPlay3A_GetPlayerAddress,
2591   DirectPlay3A_GetPlayerCaps,
2592   DirectPlay3A_GetPlayerData,
2593   DirectPlay3A_GetPlayerName,
2594   DirectPlay3A_GetSessionDesc,
2595   DirectPlay3A_Initialize,
2596   DirectPlay3A_Open,
2597   DirectPlay3A_Receive,
2598   DirectPlay3A_Send,
2599   DirectPlay3A_SetGroupData,
2600   DirectPlay3A_SetGroupName,
2601   DirectPlay3A_SetPlayerData,
2602   DirectPlay3A_SetPlayerName,
2603   DirectPlay3A_SetSessionDesc,
2604
2605   DirectPlay3A_AddGroupToGroup,
2606   DirectPlay3A_CreateGroupInGroup,
2607   DirectPlay3A_DeleteGroupFromGroup,
2608   DirectPlay3A_EnumConnections,
2609   DirectPlay3A_EnumGroupsInGroup,
2610   DirectPlay3A_GetGroupConnectionSettings,
2611   DirectPlay3A_InitializeConnection,
2612   DirectPlay3A_SecureOpen,
2613   DirectPlay3A_SendChatMessage,
2614   DirectPlay3A_SetGroupConnectionSettings,
2615   DirectPlay3A_StartSession,
2616   DirectPlay3A_GetGroupFlags,
2617   DirectPlay3A_GetGroupParent,
2618   DirectPlay3A_GetPlayerAccount,
2619   DirectPlay3A_GetPlayerFlags
2620 };
2621
2622 static ICOM_VTABLE(IDirectPlay3) directPlay3WVT = 
2623 {
2624   ICOM_MSVTABLE_COMPAT_DummyRTTIVALUE
2625   DirectPlay3WImpl_QueryInterface,
2626   DirectPlay3WImpl_AddRef,
2627   DirectPlay3WImpl_Release,
2628   DirectPlay3WImpl_AddPlayerToGroup,
2629   DirectPlay3WImpl_Close,
2630   DirectPlay3WImpl_CreateGroup,
2631   DirectPlay3WImpl_CreatePlayer,
2632   DirectPlay3WImpl_DeletePlayerFromGroup,
2633   DirectPlay3WImpl_DestroyGroup,
2634   DirectPlay3WImpl_DestroyPlayer,
2635   DirectPlay3WImpl_EnumGroupPlayers,
2636   DirectPlay3WImpl_EnumGroups,
2637   DirectPlay3WImpl_EnumPlayers,
2638   DirectPlay3WImpl_EnumSessions,
2639   DirectPlay3WImpl_GetCaps,
2640   DirectPlay3WImpl_GetGroupData,
2641   DirectPlay3WImpl_GetGroupName,
2642   DirectPlay3WImpl_GetMessageCount,
2643   DirectPlay3WImpl_GetPlayerAddress,
2644   DirectPlay3WImpl_GetPlayerCaps,
2645   DirectPlay3WImpl_GetPlayerData,
2646   DirectPlay3WImpl_GetPlayerName,
2647   DirectPlay3WImpl_GetSessionDesc,
2648   DirectPlay3WImpl_Initialize,
2649   DirectPlay3WImpl_Open,
2650   DirectPlay3WImpl_Receive,
2651   DirectPlay3WImpl_Send,
2652   DirectPlay3WImpl_SetGroupData,
2653   DirectPlay3WImpl_SetGroupName,
2654   DirectPlay3WImpl_SetPlayerData,
2655   DirectPlay3WImpl_SetPlayerName,
2656   DirectPlay3WImpl_SetSessionDesc,
2657
2658   DirectPlay3WImpl_AddGroupToGroup,
2659   DirectPlay3WImpl_CreateGroupInGroup,
2660   DirectPlay3WImpl_DeleteGroupFromGroup,
2661   DirectPlay3WImpl_EnumConnections,
2662   DirectPlay3WImpl_EnumGroupsInGroup,
2663   DirectPlay3WImpl_GetGroupConnectionSettings,
2664   DirectPlay3WImpl_InitializeConnection,
2665   DirectPlay3WImpl_SecureOpen,
2666   DirectPlay3WImpl_SendChatMessage,
2667   DirectPlay3WImpl_SetGroupConnectionSettings,
2668   DirectPlay3WImpl_StartSession,
2669   DirectPlay3WImpl_GetGroupFlags,
2670   DirectPlay3WImpl_GetGroupParent,
2671   DirectPlay3WImpl_GetPlayerAccount,
2672   DirectPlay3WImpl_GetPlayerFlags
2673 };