Release 990225.
[wine/multimedia.git] / multimedia / dplay.c
blobad14fab2236fbf7743df612478a15a71ef6dc8c0
1 /* Direct Play 3 and Direct Play Lobby 2 Implementation
3 * Copyright 1998,1999 - Peter Hunnisett
5 * <presently under construction - contact hunnise@nortelnetworks.com>
7 */
8 #include "winerror.h"
9 #include "winnt.h"
10 #include "winreg.h"
11 #include "dplay.h"
12 #include "heap.h"
13 #include "debug.h"
15 struct IDirectPlayLobby {
16 LPDIRECTPLAYLOBBY_VTABLE lpVtbl;
17 ULONG ref;
18 DWORD dwConnFlags;
19 DPSESSIONDESC2 sessionDesc;
20 DPNAME playerName;
21 GUID guidSP;
22 LPVOID lpAddress;
23 DWORD dwAddressSize;
26 struct IDirectPlayLobby2 {
27 LPDIRECTPLAYLOBBY2_VTABLE lpVtbl;
28 ULONG ref;
29 DWORD dwConnFlags;
30 DPSESSIONDESC2 lpSessionDesc;
31 DPNAME lpPlayerName;
32 GUID guidSP;
33 LPVOID lpAddress;
34 DWORD dwAddressSize;
38 /* Forward declarations of virtual tables */
39 static DIRECTPLAYLOBBY_VTABLE directPlayLobbyAVT;
40 static DIRECTPLAYLOBBY_VTABLE directPlayLobbyWVT;
41 static DIRECTPLAYLOBBY2_VTABLE directPlayLobby2AVT;
42 static DIRECTPLAYLOBBY2_VTABLE directPlayLobby2WVT;
45 static DIRECTPLAY2_VTABLE directPlay2WVT;
46 static DIRECTPLAY2_VTABLE directPlay2AVT;
47 static DIRECTPLAY3_VTABLE directPlay3WVT;
48 static DIRECTPLAY3_VTABLE directPlay3AVT;
53 struct IDirectPlay2 {
54 LPDIRECTPLAY2_VTABLE lpVtbl;
55 ULONG ref;
58 struct IDirectPlay3 {
59 LPDIRECTPLAY3_VTABLE lpVtbl;
60 ULONG ref;
63 /* Routine called when starting up the server thread */
64 DWORD DPLobby_Spawn_Server( LPVOID startData )
66 DPSESSIONDESC2* lpSession = (DPSESSIONDESC2*) startData;
67 DWORD sessionDwFlags = lpSession->dwFlags;
69 TRACE( dplay, "spawing thread for lpConn=%p dwFlags=%08lx\n", lpSession, sessionDwFlags );
70 FIXME( dplay, "thread needs something to do\n" );
72 /*for(;;)*/
75 /* Check out the connection flags to determine what to do. Ensure we have
76 no leftover bits in this structure */
77 if( sessionDwFlags & DPSESSION_CLIENTSERVER )
79 /* This indicates that the application which is requesting the creation
80 * of this session is going to be the server (application/player)
81 */
82 if( sessionDwFlags & DPSESSION_SECURESERVER )
84 sessionDwFlags &= ~DPSESSION_SECURESERVER;
86 sessionDwFlags &= ~DPSESSION_CLIENTSERVER;
89 if( sessionDwFlags & DPSESSION_JOINDISABLED )
91 sessionDwFlags &= ~DPSESSION_JOINDISABLED;
94 if( sessionDwFlags & DPSESSION_KEEPALIVE )
96 sessionDwFlags &= ~DPSESSION_KEEPALIVE;
99 if( sessionDwFlags & DPSESSION_MIGRATEHOST )
101 sessionDwFlags &= ~DPSESSION_MIGRATEHOST;
104 if( sessionDwFlags & DPSESSION_MULTICASTSERVER )
106 sessionDwFlags &= ~DPSESSION_MULTICASTSERVER;
109 if( sessionDwFlags & DPSESSION_NEWPLAYERSDISABLED )
111 sessionDwFlags &= ~DPSESSION_NEWPLAYERSDISABLED;
114 if( sessionDwFlags & DPSESSION_NODATAMESSAGES )
116 sessionDwFlags &= ~DPSESSION_NODATAMESSAGES;
119 if( sessionDwFlags & DPSESSION_NOMESSAGEID )
121 sessionDwFlags &= ~DPSESSION_NOMESSAGEID;
124 if( sessionDwFlags & DPSESSION_PASSWORDREQUIRED )
126 sessionDwFlags &= ~DPSESSION_PASSWORDREQUIRED;
131 ExitThread(0);
132 return 0;
136 /*********************************************************
138 * Direct Play and Direct Play Lobby Interface Implementation
140 *********************************************************/
142 /* The COM interface for upversioning an interface
143 * We've been given a GUID (riid) and we need to replace the present
144 * interface with that of the requested interface.
146 * Snip from some Microsoft document:
147 * There are four requirements for implementations of QueryInterface (In these
148 * cases, "must succeed" means "must succeed barring catastrophic failure."):
150 * * The set of interfaces accessible on an object through
151 * IUnknown::QueryInterface must be static, not dynamic. This means that
152 * if a call to QueryInterface for a pointer to a specified interface
153 * succeeds the first time, it must succeed again, and if it fails the
154 * first time, it must fail on all subsequent queries.
155 * * It must be symmetric ~W if a client holds a pointer to an interface on
156 * an object, and queries for that interface, the call must succeed.
157 * * It must be reflexive ~W if a client holding a pointer to one interface
158 * queries successfully for another, a query through the obtained pointer
159 * for the first interface must succeed.
160 * * It must be transitive ~W if a client holding a pointer to one interface
161 * queries successfully for a second, and through that pointer queries
162 * successfully for a third interface, a query for the first interface
163 * through the pointer for the third interface must succeed.
165 * As you can see, this interface doesn't qualify but will most likely
166 * be good enough for the time being.
169 /* Helper function for DirectPlayLobby QueryInterface */
170 static HRESULT directPlayLobby_QueryInterface
171 ( REFIID riid, LPVOID* ppvObj )
174 if( IsEqualGUID( &IID_IDirectPlayLobby, riid ) )
176 LPDIRECTPLAYLOBBY lpDpL = (LPDIRECTPLAYLOBBY)(*ppvObj);
178 lpDpL = (LPDIRECTPLAYLOBBY)HeapAlloc( GetProcessHeap(), HEAP_ZERO_MEMORY,
179 sizeof( *lpDpL ) );
181 if( !lpDpL )
183 return E_NOINTERFACE;
186 lpDpL->lpVtbl = &directPlayLobbyWVT;
187 lpDpL->ref = 1;
189 return S_OK;
191 else if( IsEqualGUID( &IID_IDirectPlayLobbyA, riid ) )
193 LPDIRECTPLAYLOBBYA lpDpL = (LPDIRECTPLAYLOBBYA)(*ppvObj);
195 lpDpL = (LPDIRECTPLAYLOBBYA)HeapAlloc( GetProcessHeap(), HEAP_ZERO_MEMORY,
196 sizeof( *lpDpL ) );
198 if( !lpDpL )
200 return E_NOINTERFACE;
203 lpDpL->lpVtbl = &directPlayLobbyAVT;
204 lpDpL->ref = 1;
206 return S_OK;
208 else if( IsEqualGUID( &IID_IDirectPlayLobby2, riid ) )
210 LPDIRECTPLAYLOBBY2 lpDpL = (LPDIRECTPLAYLOBBY2)(*ppvObj);
212 lpDpL = (LPDIRECTPLAYLOBBY2)HeapAlloc( GetProcessHeap(), HEAP_ZERO_MEMORY,
213 sizeof( *lpDpL ) );
215 if( !lpDpL )
217 return E_NOINTERFACE;
220 lpDpL->lpVtbl = &directPlayLobby2WVT;
221 lpDpL->ref = 1;
223 return S_OK;
225 else if( IsEqualGUID( &IID_IDirectPlayLobby2A, riid ) )
227 LPDIRECTPLAYLOBBY2A lpDpL = (LPDIRECTPLAYLOBBY2A)(*ppvObj);
229 lpDpL = (LPDIRECTPLAYLOBBY2)HeapAlloc( GetProcessHeap(), HEAP_ZERO_MEMORY,
230 sizeof( *lpDpL ) );
232 if( !lpDpL )
234 return E_NOINTERFACE;
237 lpDpL->lpVtbl = &directPlayLobby2AVT;
238 lpDpL->ref = 1;
240 return S_OK;
243 /* Unknown interface */
244 *ppvObj = NULL;
245 return E_NOINTERFACE;
247 static HRESULT WINAPI IDirectPlayLobbyA_QueryInterface
248 ( LPDIRECTPLAYLOBBYA this,
249 REFIID riid,
250 LPVOID* ppvObj )
252 TRACE( dplay, "(%p)->(%p,%p)\n", this, riid, ppvObj );
254 if( IsEqualGUID( &IID_IUnknown, riid ) ||
255 IsEqualGUID( &IID_IDirectPlayLobbyA, riid )
258 this->lpVtbl->fnAddRef( this );
259 *ppvObj = this;
260 return S_OK;
263 return directPlayLobby_QueryInterface( riid, ppvObj );
267 static HRESULT WINAPI IDirectPlayLobbyW_QueryInterface
268 ( LPDIRECTPLAYLOBBY this,
269 REFIID riid,
270 LPVOID* ppvObj )
272 TRACE( dplay, "(%p)->(%p,%p)\n", this, riid, ppvObj );
274 if( IsEqualGUID( &IID_IUnknown, riid ) ||
275 IsEqualGUID( &IID_IDirectPlayLobby, riid )
278 this->lpVtbl->fnAddRef( this );
279 *ppvObj = this;
280 return S_OK;
283 return directPlayLobby_QueryInterface( riid, ppvObj );
287 static HRESULT WINAPI IDirectPlayLobby2A_QueryInterface
288 ( LPDIRECTPLAYLOBBY2A this,
289 REFIID riid,
290 LPVOID* ppvObj )
292 TRACE( dplay, "(%p)->(%p,%p)\n", this, riid, ppvObj );
294 /* Compare riids. We know this object is a direct play lobby 2A object.
295 If we are asking about the same type of interface we're fine.
297 if( IsEqualGUID( &IID_IUnknown, riid ) ||
298 IsEqualGUID( &IID_IDirectPlayLobby2A, riid )
301 this->lpVtbl->fnAddRef( this );
302 *ppvObj = this;
303 return S_OK;
305 return directPlayLobby_QueryInterface( riid, ppvObj );
308 static HRESULT WINAPI IDirectPlayLobby2W_QueryInterface
309 ( LPDIRECTPLAYLOBBY2 this,
310 REFIID riid,
311 LPVOID* ppvObj )
314 /* Compare riids. We know this object is a direct play lobby 2 object.
315 If we are asking about the same type of interface we're fine.
317 if( IsEqualGUID( &IID_IUnknown, riid ) ||
318 IsEqualGUID( &IID_IDirectPlayLobby2, riid )
321 this->lpVtbl->fnAddRef( this );
322 *ppvObj = this;
323 return S_OK;
326 return directPlayLobby_QueryInterface( riid, ppvObj );
331 * Simple procedure. Just increment the reference count to this
332 * structure and return the new reference count.
334 static ULONG WINAPI IDirectPlayLobby2A_AddRef
335 ( LPDIRECTPLAYLOBBY2A this )
337 ++(this->ref);
338 TRACE( dplay,"ref count now %lu\n", this->ref );
339 return (this->ref);
342 static ULONG WINAPI IDirectPlayLobby2W_AddRef
343 ( LPDIRECTPLAYLOBBY2 this )
345 return IDirectPlayLobby2A_AddRef( (LPDIRECTPLAYLOBBY2) this );
350 * Simple COM procedure. Decrease the reference count to this object.
351 * If the object no longer has any reference counts, free up the associated
352 * memory.
354 static ULONG WINAPI IDirectPlayLobby2A_Release
355 ( LPDIRECTPLAYLOBBY2A this )
357 TRACE( dplay, "ref count decremeneted from %lu\n", this->ref );
359 this->ref--;
361 /* Deallocate if this is the last reference to the object */
362 if( !(this->ref) )
364 FIXME( dplay, "memory leak\n" );
365 /* Implement memory deallocation */
367 HeapFree( GetProcessHeap(), 0, this );
369 return 0;
372 return this->ref;
375 static ULONG WINAPI IDirectPlayLobby2W_Release
376 ( LPDIRECTPLAYLOBBY2 this )
378 return IDirectPlayLobby2A_Release( (LPDIRECTPLAYLOBBY2A) this );
382 /********************************************************************
384 * Connects an application to the session specified by the DPLCONNECTION
385 * structure currently stored with the DirectPlayLobby object.
387 * Returns a IDirectPlay interface.
390 static HRESULT WINAPI IDirectPlayLobby2A_Connect
391 ( LPDIRECTPLAYLOBBY2A this,
392 DWORD dwFlags,
393 LPDIRECTPLAY2* lplpDP,
394 IUnknown* pUnk)
396 FIXME( dplay, ": dwFlags=%08lx %p %p stub\n", dwFlags, lplpDP, pUnk );
397 return DPERR_OUTOFMEMORY;
400 static HRESULT WINAPI IDirectPlayLobby2W_Connect
401 ( LPDIRECTPLAYLOBBY2 this,
402 DWORD dwFlags,
403 LPDIRECTPLAY2* lplpDP,
404 IUnknown* pUnk)
406 LPDIRECTPLAY2* directPlay2W;
407 HRESULT createRC;
409 FIXME( dplay, "(%p)->(%08lx,%p,%p): stub\n", this, dwFlags, lplpDP, pUnk );
411 if( dwFlags )
413 return DPERR_INVALIDPARAMS;
416 if( ( createRC = DirectPlayCreate( (LPGUID)&IID_IDirectPlayLobby2, lplpDP, pUnk ) ) != DP_OK )
418 ERR( dplay, "error creating Direct Play 2W interface. Return Code = %ld.\n", createRC );
419 return createRC;
422 /* This should invoke IDirectPlay3::InitializeConnection IDirectPlay3::Open */
423 directPlay2W = lplpDP;
428 #if 0
429 /* All the stuff below this is WRONG! */
430 if( this->lpSession->dwFlags == DPLCONNECTION_CREATESESSION )
432 DWORD threadIdSink;
434 /* Spawn a thread to deal with all of this and to handle the incomming requests */
435 threadIdSink = CreateThread( NULL, 0, &DPLobby_Spawn_Server,
436 (LPVOID)this->lpSession->lpConn->lpSessionDesc, 0, &threadIdSink );
439 else if ( this->lpSession->dwFlags == DPLCONNECTION_JOINSESSION )
441 /* Let's search for a matching session */
442 FIXME( dplay, "joining session not yet supported.\n");
443 return DPERR_OUTOFMEMORY;
445 else /* Unknown type of connection request */
447 ERR( dplay, ": Unknown connection request lpConn->dwFlags=%08lx\n",
448 lpConn->dwFlags );
450 return DPERR_OUTOFMEMORY;
453 /* This does the work of the following methods...
454 IDirectPlay3::InitializeConnection,
455 IDirectPlay3::EnumSessions,
456 IDirectPlay3::Open
460 #endif
462 return DP_OK;
466 /********************************************************************
468 * Creates a DirectPlay Address, given a service provider-specific network
469 * address.
470 * Returns an address contains the globally unique identifier
471 * (GUID) of the service provider and data that the service provider can
472 * interpret as a network address.
475 static HRESULT WINAPI IDirectPlayLobby2A_CreateAddress
476 ( LPDIRECTPLAYLOBBY2A this,
477 REFGUID guidSP,
478 REFGUID guidDataType,
479 LPCVOID lpData,
480 DWORD dwDataSize,
481 LPVOID lpAddress,
482 LPDWORD lpdwAddressSize )
484 FIXME( dplay, ":stub\n");
485 return DPERR_OUTOFMEMORY;
488 static HRESULT WINAPI IDirectPlayLobby2W_CreateAddress
489 ( LPDIRECTPLAYLOBBY2 this,
490 REFGUID guidSP,
491 REFGUID guidDataType,
492 LPCVOID lpData,
493 DWORD dwDataSize,
494 LPVOID lpAddress,
495 LPDWORD lpdwAddressSize )
497 FIXME( dplay, ":stub\n");
498 return DPERR_OUTOFMEMORY;
502 /********************************************************************
504 * Parses out chunks from the DirectPlay Address buffer by calling the
505 * given callback function, with lpContext, for each of the chunks.
508 static HRESULT WINAPI IDirectPlayLobby2A_EnumAddress
509 ( LPDIRECTPLAYLOBBY2A this,
510 LPDPENUMADDRESSCALLBACK lpEnumAddressCallback,
511 LPCVOID lpAddress,
512 DWORD dwAddressSize,
513 LPVOID lpContext )
515 FIXME( dplay, ":stub\n");
516 return DPERR_OUTOFMEMORY;
519 static HRESULT WINAPI IDirectPlayLobby2W_EnumAddress
520 ( LPDIRECTPLAYLOBBY2 this,
521 LPDPENUMADDRESSCALLBACK lpEnumAddressCallback,
522 LPCVOID lpAddress,
523 DWORD dwAddressSize,
524 LPVOID lpContext )
526 FIXME( dplay, ":stub\n");
527 return DPERR_OUTOFMEMORY;
530 /********************************************************************
532 * Enumerates all the address types that a given service provider needs to
533 * build the DirectPlay Address.
536 static HRESULT WINAPI IDirectPlayLobbyA_EnumAddressTypes
537 ( LPDIRECTPLAYLOBBYA this,
538 LPDPLENUMADDRESSTYPESCALLBACK lpEnumAddressTypeCallback,
539 REFGUID guidSP,
540 LPVOID lpContext,
541 DWORD dwFlags )
543 FIXME( dplay, ":stub\n");
544 return DPERR_OUTOFMEMORY;
547 static HRESULT WINAPI IDirectPlayLobby2A_EnumAddressTypes
548 ( LPDIRECTPLAYLOBBY2A this,
549 LPDPLENUMADDRESSTYPESCALLBACK lpEnumAddressTypeCallback,
550 REFGUID guidSP,
551 LPVOID lpContext,
552 DWORD dwFlags )
554 return IDirectPlayLobbyA_EnumAddressTypes( (LPDIRECTPLAYLOBBYA)this, lpEnumAddressTypeCallback,
555 guidSP, lpContext, dwFlags );
558 static HRESULT WINAPI IDirectPlayLobby2W_EnumAddressTypes
559 ( LPDIRECTPLAYLOBBY2 this,
560 LPDPLENUMADDRESSTYPESCALLBACK lpEnumAddressTypeCallback,
561 REFGUID guidSP,
562 LPVOID lpContext,
563 DWORD dwFlags )
565 FIXME( dplay, ":stub\n");
566 return DPERR_OUTOFMEMORY;
569 /********************************************************************
571 * Enumerates what applications are registered with DirectPlay by
572 * invoking the callback function with lpContext.
575 static HRESULT WINAPI IDirectPlayLobbyW_EnumLocalApplications
576 ( LPDIRECTPLAYLOBBY this,
577 LPDPLENUMLOCALAPPLICATIONSCALLBACK a,
578 LPVOID lpContext,
579 DWORD dwFlags )
581 FIXME( dplay, ":stub\n");
582 return DPERR_OUTOFMEMORY;
585 static HRESULT WINAPI IDirectPlayLobby2W_EnumLocalApplications
586 ( LPDIRECTPLAYLOBBY2 this,
587 LPDPLENUMLOCALAPPLICATIONSCALLBACK a,
588 LPVOID lpContext,
589 DWORD dwFlags )
591 return IDirectPlayLobbyW_EnumLocalApplications( (LPDIRECTPLAYLOBBY)this, a,
592 lpContext, dwFlags );
595 static HRESULT WINAPI IDirectPlayLobbyA_EnumLocalApplications
596 ( LPDIRECTPLAYLOBBYA this,
597 LPDPLENUMLOCALAPPLICATIONSCALLBACK a,
598 LPVOID lpContext,
599 DWORD dwFlags )
601 FIXME( dplay, ":stub\n");
602 return DPERR_OUTOFMEMORY;
605 static HRESULT WINAPI IDirectPlayLobby2A_EnumLocalApplications
606 ( LPDIRECTPLAYLOBBY2A this,
607 LPDPLENUMLOCALAPPLICATIONSCALLBACK a,
608 LPVOID lpContext,
609 DWORD dwFlags )
611 return IDirectPlayLobbyA_EnumLocalApplications( (LPDIRECTPLAYLOBBYA)this, a,
612 lpContext, dwFlags );
616 /********************************************************************
618 * Retrieves the DPLCONNECTION structure that contains all the information
619 * needed to start and connect an application. This was generated using
620 * either the RunApplication or SetConnectionSettings methods.
622 * NOTES: If lpData is NULL then just return lpdwDataSize. This allows
623 * the data structure to be allocated by our caller which can then
624 * call this procedure/method again with a valid data pointer.
626 static HRESULT WINAPI IDirectPlayLobbyA_GetConnectionSettings
627 ( LPDIRECTPLAYLOBBYA this,
628 DWORD dwAppID,
629 LPVOID lpData,
630 LPDWORD lpdwDataSize )
632 LPDPLCONNECTION lpDplConnection;
634 FIXME( dplay, ": semi stub (%p)->(0x%08lx,%p,%p)\n", this, dwAppID, lpData, lpdwDataSize );
636 /* Application is requesting us to give the required size */
637 if ( !lpData )
639 /* Let's check the size of the buffer that the application has allocated */
640 if( *lpdwDataSize >= sizeof( DPLCONNECTION ) )
642 return DP_OK;
644 else
646 *lpdwDataSize = sizeof( DPLCONNECTION );
647 return DPERR_BUFFERTOOSMALL;
651 /* Fill in the fields - let them just use the ptrs */
652 lpDplConnection = (LPDPLCONNECTION)lpData;
654 /* Make sure we were given the right size */
655 if( lpDplConnection->dwSize < sizeof( DPLCONNECTION ) )
657 ERR( dplay, "bad passed size 0x%08lx.\n", lpDplConnection->dwSize );
658 return DPERR_INVALIDPARAMS;
661 /* Copy everything we've got into here */
662 /* Need to actually store the stuff here. Check if we've already allocated each field first. */
663 lpDplConnection->dwFlags = this->dwConnFlags;
665 /* Copy LPDPSESSIONDESC2 struct */
666 lpDplConnection->lpSessionDesc = HeapAlloc( GetProcessHeap(), HEAP_ZERO_MEMORY, sizeof( this->sessionDesc ) );
667 memcpy( lpDplConnection->lpSessionDesc, &(this->sessionDesc), sizeof( this->sessionDesc ) );
669 if( this->sessionDesc.sess.lpszSessionName )
671 lpDplConnection->lpSessionDesc->sess.lpszSessionName =
672 HEAP_strdupW( GetProcessHeap(), HEAP_ZERO_MEMORY, this->sessionDesc.sess.lpszSessionName );
675 if( this->sessionDesc.pass.lpszPassword )
677 lpDplConnection->lpSessionDesc->pass.lpszPassword =
678 HEAP_strdupW( GetProcessHeap(), HEAP_ZERO_MEMORY, this->sessionDesc.pass.lpszPassword );
681 /* I don't know what to use the reserved for. We'll set it to 0 just for fun */
682 this->sessionDesc.dwReserved1 = this->sessionDesc.dwReserved2 = 0;
684 /* Copy DPNAME struct - seems to be optional - check for existance first */
685 lpDplConnection->lpPlayerName = HeapAlloc( GetProcessHeap(), HEAP_ZERO_MEMORY, sizeof( this->playerName ) );
686 memcpy( lpDplConnection->lpPlayerName, &(this->playerName), sizeof( this->playerName ) );
688 if( this->playerName.psn.lpszShortName )
690 lpDplConnection->lpPlayerName->psn.lpszShortName =
691 HEAP_strdupW( GetProcessHeap(), HEAP_ZERO_MEMORY, this->playerName.psn.lpszShortName );
694 if( this->playerName.pln.lpszLongName )
696 lpDplConnection->lpPlayerName->pln.lpszLongName =
697 HEAP_strdupW( GetProcessHeap(), HEAP_ZERO_MEMORY, this->playerName.pln.lpszLongName );
702 memcpy( &(lpDplConnection->guidSP), &(this->guidSP), sizeof( this->guidSP ) );
704 lpDplConnection->lpAddress = HeapAlloc( GetProcessHeap(), HEAP_ZERO_MEMORY, this->dwAddressSize );
705 memcpy( lpDplConnection->lpAddress, this->lpAddress, this->dwAddressSize );
707 lpDplConnection->dwAddressSize = this->dwAddressSize;
709 return DP_OK;
712 static HRESULT WINAPI IDirectPlayLobby2A_GetConnectionSettings
713 ( LPDIRECTPLAYLOBBY2A this,
714 DWORD dwAppID,
715 LPVOID lpData,
716 LPDWORD lpdwDataSize )
718 return IDirectPlayLobbyA_GetConnectionSettings( (LPDIRECTPLAYLOBBYA)this,
719 dwAppID, lpData, lpdwDataSize );
722 static HRESULT WINAPI IDirectPlayLobbyW_GetConnectionSettings
723 ( LPDIRECTPLAYLOBBY this,
724 DWORD dwAppID,
725 LPVOID lpData,
726 LPDWORD lpdwDataSize )
728 FIXME( dplay, ":semi stub %p %08lx %p %p \n", this, dwAppID, lpData, lpdwDataSize );
730 /* Application is requesting us to give the required size */
731 if ( !lpData )
733 /* Let's check the size of the buffer that the application has allocated */
734 if( *lpdwDataSize >= sizeof( DPLCONNECTION ) )
736 return DP_OK;
738 else
740 *lpdwDataSize = sizeof( DPLCONNECTION );
741 return DPERR_BUFFERTOOSMALL;
745 /* Fill in the fields - let them just use the ptrs */
746 FIXME( dplay, "stub\n" );
748 return DP_OK;
751 static HRESULT WINAPI IDirectPlayLobby2W_GetConnectionSettings
752 ( LPDIRECTPLAYLOBBY2 this,
753 DWORD dwAppID,
754 LPVOID lpData,
755 LPDWORD lpdwDataSize )
757 return IDirectPlayLobbyW_GetConnectionSettings( (LPDIRECTPLAYLOBBY)this,
758 dwAppID, lpData, lpdwDataSize );
761 /********************************************************************
763 * Retrieves the message sent between a lobby client and a DirectPlay
764 * application. All messages are queued until received.
767 static HRESULT WINAPI IDirectPlayLobbyA_ReceiveLobbyMessage
768 ( LPDIRECTPLAYLOBBYA this,
769 DWORD dwFlags,
770 DWORD dwAppID,
771 LPDWORD lpdwMessageFlags,
772 LPVOID lpData,
773 LPDWORD lpdwDataSize )
775 FIXME( dplay, ":stub %p %08lx %08lx %p %p %p\n", this, dwFlags, dwAppID, lpdwMessageFlags, lpData,
776 lpdwDataSize );
777 return DPERR_OUTOFMEMORY;
780 static HRESULT WINAPI IDirectPlayLobby2A_ReceiveLobbyMessage
781 ( LPDIRECTPLAYLOBBY2A this,
782 DWORD dwFlags,
783 DWORD dwAppID,
784 LPDWORD lpdwMessageFlags,
785 LPVOID lpData,
786 LPDWORD lpdwDataSize )
788 return IDirectPlayLobbyA_ReceiveLobbyMessage( (LPDIRECTPLAYLOBBYA)this, dwFlags, dwAppID,
789 lpdwMessageFlags, lpData, lpdwDataSize );
793 static HRESULT WINAPI IDirectPlayLobbyW_ReceiveLobbyMessage
794 ( LPDIRECTPLAYLOBBY this,
795 DWORD dwFlags,
796 DWORD dwAppID,
797 LPDWORD lpdwMessageFlags,
798 LPVOID lpData,
799 LPDWORD lpdwDataSize )
801 FIXME( dplay, ":stub %p %08lx %08lx %p %p %p\n", this, dwFlags, dwAppID, lpdwMessageFlags, lpData,
802 lpdwDataSize );
803 return DPERR_OUTOFMEMORY;
806 static HRESULT WINAPI IDirectPlayLobby2W_ReceiveLobbyMessage
807 ( LPDIRECTPLAYLOBBY2 this,
808 DWORD dwFlags,
809 DWORD dwAppID,
810 LPDWORD lpdwMessageFlags,
811 LPVOID lpData,
812 LPDWORD lpdwDataSize )
814 return IDirectPlayLobbyW_ReceiveLobbyMessage( (LPDIRECTPLAYLOBBY)this, dwFlags, dwAppID,
815 lpdwMessageFlags, lpData, lpdwDataSize );
818 /********************************************************************
820 * Starts an application and passes to it all the information to
821 * connect to a session.
824 static HRESULT WINAPI IDirectPlayLobbyA_RunApplication
825 ( LPDIRECTPLAYLOBBYA this,
826 DWORD dwFlags,
827 LPDWORD lpdwAppID,
828 LPDPLCONNECTION lpConn,
829 HANDLE32 hReceiveEvent )
831 FIXME( dplay, ":stub\n");
832 return DPERR_OUTOFMEMORY;
835 static HRESULT WINAPI IDirectPlayLobby2A_RunApplication
836 ( LPDIRECTPLAYLOBBY2A this,
837 DWORD dwFlags,
838 LPDWORD lpdwAppID,
839 LPDPLCONNECTION lpConn,
840 HANDLE32 hReceiveEvent )
842 return IDirectPlayLobbyA_RunApplication( (LPDIRECTPLAYLOBBYA)this, dwFlags,
843 lpdwAppID, lpConn, hReceiveEvent );
846 static HRESULT WINAPI IDirectPlayLobbyW_RunApplication
847 ( LPDIRECTPLAYLOBBY this,
848 DWORD dwFlags,
849 LPDWORD lpdwAppID,
850 LPDPLCONNECTION lpConn,
851 HANDLE32 hReceiveEvent )
853 FIXME( dplay, ":stub\n");
854 return DPERR_OUTOFMEMORY;
857 static HRESULT WINAPI IDirectPlayLobby2W_RunApplication
858 ( LPDIRECTPLAYLOBBY2 this,
859 DWORD dwFlags,
860 LPDWORD lpdwAppID,
861 LPDPLCONNECTION lpConn,
862 HANDLE32 hReceiveEvent )
864 return IDirectPlayLobbyW_RunApplication( (LPDIRECTPLAYLOBBY)this, dwFlags,
865 lpdwAppID, lpConn, hReceiveEvent );
869 /********************************************************************
871 * Sends a message between the application and the lobby client.
872 * All messages are queued until received.
875 static HRESULT WINAPI IDirectPlayLobbyA_SendLobbyMessage
876 ( LPDIRECTPLAYLOBBYA this,
877 DWORD dwFlags,
878 DWORD dwAppID,
879 LPVOID lpData,
880 DWORD dwDataSize )
882 FIXME( dplay, ":stub\n");
883 return DPERR_OUTOFMEMORY;
886 static HRESULT WINAPI IDirectPlayLobby2A_SendLobbyMessage
887 ( LPDIRECTPLAYLOBBY2A this,
888 DWORD dwFlags,
889 DWORD dwAppID,
890 LPVOID lpData,
891 DWORD dwDataSize )
893 return IDirectPlayLobbyA_SendLobbyMessage( (LPDIRECTPLAYLOBBYA)this, dwFlags,
894 dwAppID, lpData, dwDataSize );
898 static HRESULT WINAPI IDirectPlayLobbyW_SendLobbyMessage
899 ( LPDIRECTPLAYLOBBY this,
900 DWORD dwFlags,
901 DWORD dwAppID,
902 LPVOID lpData,
903 DWORD dwDataSize )
905 FIXME( dplay, ":stub\n");
906 return DPERR_OUTOFMEMORY;
909 static HRESULT WINAPI IDirectPlayLobby2W_SendLobbyMessage
910 ( LPDIRECTPLAYLOBBY2 this,
911 DWORD dwFlags,
912 DWORD dwAppID,
913 LPVOID lpData,
914 DWORD dwDataSize )
916 return IDirectPlayLobbyW_SendLobbyMessage( (LPDIRECTPLAYLOBBY)this, dwFlags,
917 dwAppID, lpData, dwDataSize );
920 /********************************************************************
922 * Modifies the DPLCONNECTION structure to contain all information
923 * needed to start and connect an application.
926 static HRESULT WINAPI IDirectPlayLobbyW_SetConnectionSettings
927 ( LPDIRECTPLAYLOBBY this,
928 DWORD dwFlags,
929 DWORD dwAppID,
930 LPDPLCONNECTION lpConn )
932 TRACE( dplay, ": this=%p, dwFlags=%08lx, dwAppId=%08lx, lpConn=%p\n",
933 this, dwFlags, dwAppID, lpConn );
935 /* Paramater check */
936 if( dwFlags || !this || !lpConn )
938 ERR( dplay, "invalid parameters.\n");
939 return DPERR_INVALIDPARAMS;
942 /* See if there is a connection associated with this request.
943 * dwAppID == 0 indicates that this request isn't associated with a connection.
945 if( dwAppID )
947 FIXME( dplay, ": Connection dwAppID=%08lx given. Not implemented yet.\n",
948 dwAppID );
950 /* Need to add a check for this application Id...*/
951 return DPERR_NOTLOBBIED;
954 if( lpConn->dwSize != sizeof(DPLCONNECTION) )
956 ERR( dplay, ": old/new DPLCONNECTION type? Size=%08lx vs. expected=%ul bytes\n",
957 lpConn->dwSize, sizeof( DPLCONNECTION ) );
958 return DPERR_INVALIDPARAMS;
961 /* Need to investigate the lpConn->lpSessionDesc to figure out
962 * what type of session we need to join/create.
964 if( (!lpConn->lpSessionDesc ) ||
965 ( lpConn->lpSessionDesc->dwSize != sizeof( DPSESSIONDESC2 ) )
968 ERR( dplay, "DPSESSIONDESC passed in? Size=%08lx vs. expected=%ul bytes\n",
969 lpConn->lpSessionDesc->dwSize, sizeof( DPSESSIONDESC2 ) );
970 return DPERR_INVALIDPARAMS;
973 /* Need to actually store the stuff here. Check if we've already allocated each field first. */
974 this->dwConnFlags = lpConn->dwFlags;
976 /* Copy LPDPSESSIONDESC2 struct - this is required */
977 memcpy( &(this->sessionDesc), lpConn->lpSessionDesc, sizeof( *(lpConn->lpSessionDesc) ) );
979 if( lpConn->lpSessionDesc->sess.lpszSessionName )
980 this->sessionDesc.sess.lpszSessionName = HEAP_strdupW( GetProcessHeap(), HEAP_ZERO_MEMORY, lpConn->lpSessionDesc->sess.lpszSessionName );
981 else
982 this->sessionDesc.sess.lpszSessionName = NULL;
984 if( lpConn->lpSessionDesc->pass.lpszPassword )
985 this->sessionDesc.pass.lpszPassword = HEAP_strdupW( GetProcessHeap(), HEAP_ZERO_MEMORY, lpConn->lpSessionDesc->pass.lpszPassword );
986 else
987 this->sessionDesc.pass.lpszPassword = NULL;
989 /* I don't know what to use the reserved for ... */
990 this->sessionDesc.dwReserved1 = this->sessionDesc.dwReserved2 = 0;
992 /* Copy DPNAME struct - seems to be optional - check for existance first */
993 if( lpConn->lpPlayerName )
995 memcpy( &(this->playerName), lpConn->lpPlayerName, sizeof( *lpConn->lpPlayerName ) );
997 if( lpConn->lpPlayerName->psn.lpszShortName )
998 this->playerName.psn.lpszShortName = HEAP_strdupW( GetProcessHeap(), HEAP_ZERO_MEMORY, lpConn->lpPlayerName->psn.lpszShortName );
1000 if( lpConn->lpPlayerName->pln.lpszLongName )
1001 this->playerName.pln.lpszLongName = HEAP_strdupW( GetProcessHeap(), HEAP_ZERO_MEMORY, lpConn->lpPlayerName->pln.lpszLongName );
1005 memcpy( &(this->guidSP), &(lpConn->guidSP), sizeof( lpConn->guidSP ) );
1007 this->lpAddress = HeapAlloc( GetProcessHeap(), HEAP_ZERO_MEMORY, lpConn->dwAddressSize );
1008 memcpy( this->lpAddress, lpConn->lpAddress, lpConn->dwAddressSize );
1010 this->dwAddressSize = lpConn->dwAddressSize;
1012 return DP_OK;
1015 static HRESULT WINAPI IDirectPlayLobby2W_SetConnectionSettings
1016 ( LPDIRECTPLAYLOBBY2 this,
1017 DWORD dwFlags,
1018 DWORD dwAppID,
1019 LPDPLCONNECTION lpConn )
1021 return IDirectPlayLobbyW_SetConnectionSettings( (LPDIRECTPLAYLOBBY)this,
1022 dwFlags, dwAppID, lpConn );
1025 static HRESULT WINAPI IDirectPlayLobbyA_SetConnectionSettings
1026 ( LPDIRECTPLAYLOBBYA this,
1027 DWORD dwFlags,
1028 DWORD dwAppID,
1029 LPDPLCONNECTION lpConn )
1031 FIXME( dplay, ": this=%p, dwFlags=%08lx, dwAppId=%08lx, lpConn=%p: stub\n",
1032 this, dwFlags, dwAppID, lpConn );
1033 return DPERR_OUTOFMEMORY;
1036 static HRESULT WINAPI IDirectPlayLobby2A_SetConnectionSettings
1037 ( LPDIRECTPLAYLOBBY2A this,
1038 DWORD dwFlags,
1039 DWORD dwAppID,
1040 LPDPLCONNECTION lpConn )
1042 return IDirectPlayLobbyA_SetConnectionSettings( (LPDIRECTPLAYLOBBYA)this,
1043 dwFlags, dwAppID, lpConn );
1046 /********************************************************************
1048 * Registers an event that will be set when a lobby message is received.
1051 static HRESULT WINAPI IDirectPlayLobbyA_SetLobbyMessageEvent
1052 ( LPDIRECTPLAYLOBBYA this,
1053 DWORD dwFlags,
1054 DWORD dwAppID,
1055 HANDLE32 hReceiveEvent )
1057 FIXME( dplay, ":stub\n");
1058 return DPERR_OUTOFMEMORY;
1061 static HRESULT WINAPI IDirectPlayLobby2A_SetLobbyMessageEvent
1062 ( LPDIRECTPLAYLOBBY2A this,
1063 DWORD dwFlags,
1064 DWORD dwAppID,
1065 HANDLE32 hReceiveEvent )
1067 return IDirectPlayLobbyA_SetLobbyMessageEvent( (LPDIRECTPLAYLOBBYA)this, dwFlags,
1068 dwAppID, hReceiveEvent );
1071 static HRESULT WINAPI IDirectPlayLobbyW_SetLobbyMessageEvent
1072 ( LPDIRECTPLAYLOBBY this,
1073 DWORD dwFlags,
1074 DWORD dwAppID,
1075 HANDLE32 hReceiveEvent )
1077 FIXME( dplay, ":stub\n");
1078 return DPERR_OUTOFMEMORY;
1081 static HRESULT WINAPI IDirectPlayLobby2W_SetLobbyMessageEvent
1082 ( LPDIRECTPLAYLOBBY2 this,
1083 DWORD dwFlags,
1084 DWORD dwAppID,
1085 HANDLE32 hReceiveEvent )
1087 return IDirectPlayLobbyW_SetLobbyMessageEvent( (LPDIRECTPLAYLOBBY)this, dwFlags,
1088 dwAppID, hReceiveEvent );
1092 /********************************************************************
1094 * Registers an event that will be set when a lobby message is received.
1097 static HRESULT WINAPI IDirectPlayLobby2W_CreateCompoundAddress
1098 ( LPDIRECTPLAYLOBBY2 this,
1099 LPCDPCOMPOUNDADDRESSELEMENT lpElements,
1100 DWORD dwElementCount,
1101 LPVOID lpAddress,
1102 LPDWORD lpdwAddressSize )
1104 FIXME( dplay, ":stub\n");
1105 return DPERR_OUTOFMEMORY;
1108 static HRESULT WINAPI IDirectPlayLobby2A_CreateCompoundAddress
1109 ( LPDIRECTPLAYLOBBY2A this,
1110 LPCDPCOMPOUNDADDRESSELEMENT lpElements,
1111 DWORD dwElementCount,
1112 LPVOID lpAddress,
1113 LPDWORD lpdwAddressSize )
1115 FIXME( dplay, ":stub\n");
1116 return DPERR_OUTOFMEMORY;
1120 /* Direct Play Lobby 1 (ascii) Virtual Table for methods */
1121 /* All lobby 1 methods are exactly the same except QueryInterface */
1122 static struct tagLPDIRECTPLAYLOBBY_VTABLE directPlayLobbyAVT = {
1123 IDirectPlayLobbyA_QueryInterface,
1124 (void*)IDirectPlayLobby2A_AddRef,
1125 (void*)IDirectPlayLobby2A_Release,
1126 (void*)IDirectPlayLobby2A_Connect,
1127 (void*)IDirectPlayLobby2A_CreateAddress,
1128 (void*)IDirectPlayLobby2A_EnumAddress,
1129 (void*)IDirectPlayLobby2A_EnumAddressTypes,
1130 (void*)IDirectPlayLobby2A_EnumLocalApplications,
1131 (void*)IDirectPlayLobby2A_GetConnectionSettings,
1132 (void*)IDirectPlayLobby2A_ReceiveLobbyMessage,
1133 (void*)IDirectPlayLobby2A_RunApplication,
1134 (void*)IDirectPlayLobby2A_SendLobbyMessage,
1135 (void*)IDirectPlayLobby2A_SetConnectionSettings,
1136 (void*)IDirectPlayLobby2A_SetLobbyMessageEvent
1139 /* Direct Play Lobby 1 (unicode) Virtual Table for methods */
1140 static struct tagLPDIRECTPLAYLOBBY_VTABLE directPlayLobbyWVT = {
1141 IDirectPlayLobbyW_QueryInterface,
1142 (void*)IDirectPlayLobby2W_AddRef,
1143 (void*)IDirectPlayLobby2W_Release,
1144 (void*)IDirectPlayLobby2W_Connect,
1145 (void*)IDirectPlayLobby2W_CreateAddress,
1146 (void*)IDirectPlayLobby2W_EnumAddress,
1147 (void*)IDirectPlayLobby2W_EnumAddressTypes,
1148 (void*)IDirectPlayLobby2W_EnumLocalApplications,
1149 (void*)IDirectPlayLobby2W_GetConnectionSettings,
1150 (void*)IDirectPlayLobby2W_ReceiveLobbyMessage,
1151 (void*)IDirectPlayLobby2W_RunApplication,
1152 (void*)IDirectPlayLobby2W_SendLobbyMessage,
1153 (void*)IDirectPlayLobby2W_SetConnectionSettings,
1154 (void*)IDirectPlayLobby2W_SetLobbyMessageEvent
1158 /* Direct Play Lobby 2 (ascii) Virtual Table for methods */
1159 static struct tagLPDIRECTPLAYLOBBY2_VTABLE directPlayLobby2AVT = {
1160 IDirectPlayLobby2A_QueryInterface,
1161 IDirectPlayLobby2A_AddRef,
1162 IDirectPlayLobby2A_Release,
1163 IDirectPlayLobby2A_Connect,
1164 IDirectPlayLobby2A_CreateAddress,
1165 IDirectPlayLobby2A_EnumAddress,
1166 IDirectPlayLobby2A_EnumAddressTypes,
1167 IDirectPlayLobby2A_EnumLocalApplications,
1168 IDirectPlayLobby2A_GetConnectionSettings,
1169 IDirectPlayLobby2A_ReceiveLobbyMessage,
1170 IDirectPlayLobby2A_RunApplication,
1171 IDirectPlayLobby2A_SendLobbyMessage,
1172 IDirectPlayLobby2A_SetConnectionSettings,
1173 IDirectPlayLobby2A_SetLobbyMessageEvent,
1174 IDirectPlayLobby2A_CreateCompoundAddress
1177 /* Direct Play Lobby 2 (unicode) Virtual Table for methods */
1178 static struct tagLPDIRECTPLAYLOBBY2_VTABLE directPlayLobby2WVT = {
1179 IDirectPlayLobby2W_QueryInterface,
1180 IDirectPlayLobby2W_AddRef,
1181 IDirectPlayLobby2W_Release,
1182 IDirectPlayLobby2W_Connect,
1183 IDirectPlayLobby2W_CreateAddress,
1184 IDirectPlayLobby2W_EnumAddress,
1185 IDirectPlayLobby2W_EnumAddressTypes,
1186 IDirectPlayLobby2W_EnumLocalApplications,
1187 IDirectPlayLobby2W_GetConnectionSettings,
1188 IDirectPlayLobby2W_ReceiveLobbyMessage,
1189 IDirectPlayLobby2W_RunApplication,
1190 IDirectPlayLobby2W_SendLobbyMessage,
1191 IDirectPlayLobby2W_SetConnectionSettings,
1192 IDirectPlayLobby2W_SetLobbyMessageEvent,
1193 IDirectPlayLobby2W_CreateCompoundAddress
1196 /***************************************************************************
1197 * DirectPlayLobbyCreateA (DPLAYX.4)
1200 HRESULT WINAPI DirectPlayLobbyCreateA( LPGUID lpGUIDDSP,
1201 LPDIRECTPLAYLOBBYA *lplpDPL,
1202 IUnknown *lpUnk,
1203 LPVOID lpData,
1204 DWORD dwDataSize )
1206 TRACE(dplay,"lpGUIDDSP=%p lplpDPL=%p lpUnk=%p lpData=%p dwDataSize=%08lx\n",
1207 lpGUIDDSP,lplpDPL,lpUnk,lpData,dwDataSize);
1209 /* Parameter Check: lpGUIDSP, lpUnk & lpData must be NULL. dwDataSize must
1210 * equal 0. These fields are mostly for future expansion.
1212 if ( lpGUIDDSP || lpUnk || lpData || dwDataSize )
1214 *lplpDPL = NULL;
1215 return DPERR_INVALIDPARAMS;
1218 /* Yes...really we should be returning a lobby 1 object */
1219 *lplpDPL = (LPDIRECTPLAYLOBBYA)HeapAlloc( GetProcessHeap(), HEAP_ZERO_MEMORY,
1220 sizeof( IDirectPlayLobbyA ) );
1222 if( ! (*lplpDPL) )
1224 return DPERR_OUTOFMEMORY;
1227 (*lplpDPL)->lpVtbl = &directPlayLobbyAVT;
1228 (*lplpDPL)->ref = 1;
1230 /* All fields were nulled out by the allocation */
1232 return DP_OK;
1235 /***************************************************************************
1236 * DirectPlayLobbyCreateW (DPLAYX.5)
1239 HRESULT WINAPI DirectPlayLobbyCreateW( LPGUID lpGUIDDSP,
1240 LPDIRECTPLAYLOBBY *lplpDPL,
1241 IUnknown *lpUnk,
1242 LPVOID lpData,
1243 DWORD dwDataSize )
1245 TRACE(dplay,"lpGUIDDSP=%p lplpDPL=%p lpUnk=%p lpData=%p dwDataSize=%08lx\n",
1246 lpGUIDDSP,lplpDPL,lpUnk,lpData,dwDataSize);
1248 /* Parameter Check: lpGUIDSP, lpUnk & lpData must be NULL. dwDataSize must
1249 * equal 0. These fields are mostly for future expansion.
1251 if ( lpGUIDDSP || lpUnk || lpData || dwDataSize )
1253 *lplpDPL = NULL;
1254 ERR( dplay, "Bad parameters!\n" );
1255 return DPERR_INVALIDPARAMS;
1258 /* Yes...really we should bre returning a lobby 1 object */
1259 *lplpDPL = (LPDIRECTPLAYLOBBY)HeapAlloc( GetProcessHeap(), HEAP_ZERO_MEMORY,
1260 sizeof( IDirectPlayLobby ) );
1262 if( !*lplpDPL)
1264 return DPERR_OUTOFMEMORY;
1267 (*lplpDPL)->lpVtbl = &directPlayLobbyWVT;
1268 (*lplpDPL)->ref = 1;
1270 /* All fields were nulled out by the allocation */
1272 return DP_OK;
1276 /***************************************************************************
1277 * DirectPlayEnumerateA (DPLAYX.2)
1279 * The pointer to the structure lpContext will be filled with the
1280 * appropriate data for each service offered by the OS. These services are
1281 * not necessarily available on this particular machine but are defined
1282 * as simple service providers under the "Service Providers" registry key.
1283 * This structure is then passed to lpEnumCallback for each of the different
1284 * services.
1286 * This API is useful only for applications written using DirectX3 or
1287 * worse. It is superceeded by IDirectPlay3::EnumConnections which also
1288 * gives information on the actual connections.
1290 * defn of a service provider:
1291 * A dynamic-link library used by DirectPlay to communicate over a network.
1292 * The service provider contains all the network-specific code required
1293 * to send and receive messages. Online services and network operators can
1294 * supply service providers to use specialized hardware, protocols, communications
1295 * media, and network resources.
1297 * TODO: Allocate string buffer space from the heap (length from reg)
1298 * Pass real device driver numbers...
1299 * Get the GUID properly...
1301 HRESULT WINAPI DirectPlayEnumerateA( LPDPENUMDPCALLBACKA lpEnumCallback,
1302 LPVOID lpContext )
1305 HKEY hkResult;
1306 LPCSTR searchSubKey = "SOFTWARE\\Microsoft\\DirectPlay\\Service Providers";
1307 LPSTR guidDataSubKey = "Guid";
1308 LPSTR majVerDataSubKey = "dwReserved1";
1309 DWORD dwIndex, sizeOfSubKeyName=50;
1310 char subKeyName[51];
1312 TRACE( dplay, ": lpEnumCallback=%p lpContext=%p\n", lpEnumCallback, lpContext );
1314 if( !lpEnumCallback || !*lpEnumCallback )
1316 return DPERR_INVALIDPARAMS;
1319 /* Need to loop over the service providers in the registry */
1320 if( RegOpenKeyEx32A( HKEY_LOCAL_MACHINE, searchSubKey,
1321 0, KEY_ENUMERATE_SUB_KEYS, &hkResult ) != ERROR_SUCCESS )
1323 /* Hmmm. Does this mean that there are no service providers? */
1324 ERR(dplay, ": no service providers?\n");
1325 return DP_OK;
1328 /* Traverse all the service providers we have available */
1329 for( dwIndex=0;
1330 RegEnumKey32A( hkResult, dwIndex, subKeyName, sizeOfSubKeyName ) !=
1331 ERROR_NO_MORE_ITEMS;
1332 ++dwIndex )
1334 HKEY hkServiceProvider;
1335 GUID serviceProviderGUID;
1336 DWORD returnTypeGUID, returnTypeReserved1, sizeOfReturnBuffer=50;
1337 char returnBuffer[51];
1338 DWORD majVersionNum /*, minVersionNum */;
1339 LPWSTR lpWGUIDString;
1341 TRACE( dplay, " this time through: %s\n", subKeyName );
1343 /* Get a handle for this particular service provider */
1344 if( RegOpenKeyEx32A( hkResult, subKeyName, 0, KEY_QUERY_VALUE,
1345 &hkServiceProvider ) != ERROR_SUCCESS )
1347 ERR( dplay, ": what the heck is going on?\n" );
1348 continue;
1351 /* Get the GUID, Device major number and device minor number
1352 * from the registry.
1354 if( RegQueryValueEx32A( hkServiceProvider, guidDataSubKey,
1355 NULL, &returnTypeGUID, returnBuffer,
1356 &sizeOfReturnBuffer ) != ERROR_SUCCESS )
1358 ERR( dplay, ": missing GUID registry data members\n" );
1359 continue;
1362 /* FIXME: Check return types to ensure we're interpreting data right */
1363 lpWGUIDString = HEAP_strdupAtoW( GetProcessHeap(), 0, returnBuffer );
1364 CLSIDFromString32( (LPCOLESTR32)lpWGUIDString, &serviceProviderGUID );
1365 HeapFree( GetProcessHeap(), 0, lpWGUIDString );
1367 sizeOfReturnBuffer = 50;
1369 if( RegQueryValueEx32A( hkServiceProvider, majVerDataSubKey,
1370 NULL, &returnTypeReserved1, returnBuffer,
1371 &sizeOfReturnBuffer ) != ERROR_SUCCESS )
1373 ERR( dplay, ": missing dwReserved1 registry data members\n") ;
1374 continue;
1376 /* FIXME: This couldn't possibly be right...*/
1377 majVersionNum = GET_DWORD( returnBuffer );
1379 /* The enumeration will return FALSE if we are not to continue */
1380 if( !lpEnumCallback( &serviceProviderGUID , subKeyName,
1381 majVersionNum, (DWORD)0, lpContext ) )
1383 WARN( dplay, "lpEnumCallback returning FALSE\n" );
1384 break;
1388 return DP_OK;
1392 /***************************************************************************
1393 * DirectPlayEnumerateW (DPLAYX.3)
1396 HRESULT WINAPI DirectPlayEnumerateW( LPDPENUMDPCALLBACKW lpEnumCallback, LPVOID lpContext )
1399 FIXME( dplay, ":stub\n");
1401 return DPERR_OUTOFMEMORY;
1405 /***************************************************************************
1406 * DirectPlayCreate (DPLAYX.1) (DPLAY.1)
1409 HRESULT WINAPI DirectPlayCreate
1410 ( LPGUID lpGUID, LPDIRECTPLAY2 *lplpDP, IUnknown *pUnk)
1413 TRACE(dplay,"lpGUID=%p lplpDP=%p pUnk=%p\n", lpGUID,lplpDP,pUnk);
1415 if( pUnk != NULL )
1417 /* Hmmm...wonder what this means! */
1418 ERR(dplay, "What does a NULL here mean?\n" );
1419 return DPERR_OUTOFMEMORY;
1422 if( IsEqualGUID( &IID_IDirectPlay2A, lpGUID ) )
1424 *lplpDP = (LPDIRECTPLAY2A)HeapAlloc( GetProcessHeap(), HEAP_ZERO_MEMORY,
1425 sizeof( **lplpDP ) );
1427 if( !*lplpDP )
1429 return DPERR_OUTOFMEMORY;
1432 (*lplpDP)->lpVtbl = &directPlay2AVT;
1433 (*lplpDP)->ref = 1;
1435 return DP_OK;
1437 else if( IsEqualGUID( &IID_IDirectPlay2, lpGUID ) )
1439 *lplpDP = (LPDIRECTPLAY2)HeapAlloc( GetProcessHeap(), HEAP_ZERO_MEMORY,
1440 sizeof( **lplpDP ) );
1442 if( !*lplpDP )
1444 return DPERR_OUTOFMEMORY;
1447 (*lplpDP)->lpVtbl = &directPlay2WVT;
1448 (*lplpDP)->ref = 1;
1450 return DP_OK;
1453 /* Unknown interface type */
1454 return DPERR_NOINTERFACE;
1458 /* Direct Play helper methods */
1460 /* Get a new interface. To be used by QueryInterface. */
1461 static HRESULT directPlay_QueryInterface
1462 ( REFIID riid, LPVOID* ppvObj )
1465 if( IsEqualGUID( &IID_IDirectPlay2, riid ) )
1467 LPDIRECTPLAY2 lpDP = (LPDIRECTPLAY2)*ppvObj;
1469 lpDP = (LPDIRECTPLAY2)HeapAlloc( GetProcessHeap(), HEAP_ZERO_MEMORY,
1470 sizeof( *lpDP ) );
1472 if( !lpDP )
1474 return DPERR_OUTOFMEMORY;
1477 lpDP->lpVtbl = &directPlay2WVT;
1478 lpDP->ref = 1;
1480 return S_OK;
1482 else if( IsEqualGUID( &IID_IDirectPlay2A, riid ) )
1484 LPDIRECTPLAY2A lpDP = (LPDIRECTPLAY2A)*ppvObj;
1486 lpDP = (LPDIRECTPLAY2A)HeapAlloc( GetProcessHeap(), HEAP_ZERO_MEMORY,
1487 sizeof( *lpDP ) );
1489 if( !lpDP )
1491 return DPERR_OUTOFMEMORY;
1494 lpDP->lpVtbl = &directPlay2AVT;
1495 lpDP->ref = 1;
1497 return S_OK;
1499 else if( IsEqualGUID( &IID_IDirectPlay3, riid ) )
1501 LPDIRECTPLAY3 lpDP = (LPDIRECTPLAY3)*ppvObj;
1503 lpDP = (LPDIRECTPLAY3)HeapAlloc( GetProcessHeap(), HEAP_ZERO_MEMORY,
1504 sizeof( *lpDP ) );
1506 if( !lpDP )
1508 return DPERR_OUTOFMEMORY;
1511 lpDP->lpVtbl = &directPlay3WVT;
1512 lpDP->ref = 1;
1514 return S_OK;
1516 else if( IsEqualGUID( &IID_IDirectPlay3A, riid ) )
1518 LPDIRECTPLAY3A lpDP = (LPDIRECTPLAY3A)*ppvObj;
1520 lpDP = (LPDIRECTPLAY3A)HeapAlloc( GetProcessHeap(), HEAP_ZERO_MEMORY,
1521 sizeof( *lpDP ) );
1523 if( !lpDP )
1525 return DPERR_OUTOFMEMORY;
1528 lpDP->lpVtbl = &directPlay3AVT;
1529 lpDP->ref = 1;
1531 return S_OK;
1535 *ppvObj = NULL;
1536 return E_NOINTERFACE;
1540 /* Direct Play methods */
1541 static HRESULT WINAPI DirectPlay2W_QueryInterface
1542 ( LPDIRECTPLAY2 this, REFIID riid, LPVOID* ppvObj )
1544 TRACE( dplay, "(%p)->(%p,%p)\n", this, riid, ppvObj );
1546 if( IsEqualGUID( &IID_IUnknown, riid ) ||
1547 IsEqualGUID( &IID_IDirectPlay2, riid )
1550 this->lpVtbl->fnAddRef( this );
1551 *ppvObj = this;
1552 return S_OK;
1554 return directPlay_QueryInterface( riid, ppvObj );
1557 static HRESULT WINAPI DirectPlay2A_QueryInterface
1558 ( LPDIRECTPLAY2A this, REFIID riid, LPVOID* ppvObj )
1560 TRACE( dplay, "(%p)->(%p,%p)\n", this, riid, ppvObj );
1562 if( IsEqualGUID( &IID_IUnknown, riid ) ||
1563 IsEqualGUID( &IID_IDirectPlay2A, riid )
1566 this->lpVtbl->fnAddRef( this );
1567 *ppvObj = this;
1568 return S_OK;
1571 return directPlay_QueryInterface( riid, ppvObj );
1574 static HRESULT WINAPI DirectPlay3W_QueryInterface
1575 ( LPDIRECTPLAY3 this, REFIID riid, LPVOID* ppvObj )
1577 TRACE( dplay, "(%p)->(%p,%p)\n", this, riid, ppvObj );
1579 if( IsEqualGUID( &IID_IUnknown, riid ) ||
1580 IsEqualGUID( &IID_IDirectPlay3, riid )
1583 this->lpVtbl->fnAddRef( this );
1584 *ppvObj = this;
1585 return S_OK;
1588 return directPlay_QueryInterface( riid, ppvObj );
1591 static HRESULT WINAPI DirectPlay3A_QueryInterface
1592 ( LPDIRECTPLAY3A this, REFIID riid, LPVOID* ppvObj )
1594 TRACE( dplay, "(%p)->(%p,%p)\n", this, riid, ppvObj );
1596 if( IsEqualGUID( &IID_IUnknown, riid ) ||
1597 IsEqualGUID( &IID_IDirectPlay3A, riid )
1600 this->lpVtbl->fnAddRef( this );
1601 *ppvObj = this;
1602 return S_OK;
1605 return directPlay_QueryInterface( riid, ppvObj );
1609 /* Shared between all dplay types */
1610 static ULONG WINAPI DirectPlay3W_AddRef
1611 ( LPDIRECTPLAY3 this )
1613 ++(this->ref);
1614 TRACE( dplay,"ref count now %lu\n", this->ref );
1615 return (this->ref);
1618 static ULONG WINAPI DirectPlay3W_Release
1619 ( LPDIRECTPLAY3 this )
1621 TRACE( dplay, "ref count decremeneted from %lu\n", this->ref );
1623 this->ref--;
1625 /* Deallocate if this is the last reference to the object */
1626 if( !(this->ref) )
1628 FIXME( dplay, "memory leak\n" );
1629 /* Implement memory deallocation */
1631 HeapFree( GetProcessHeap(), 0, this );
1633 return 0;
1636 return this->ref;
1639 static ULONG WINAPI DirectPlay3A_Release
1640 ( LPDIRECTPLAY3A this )
1642 TRACE( dplay, "ref count decremeneted from %lu\n", this->ref );
1644 this->ref--;
1646 /* Deallocate if this is the last reference to the object */
1647 if( !(this->ref) )
1649 FIXME( dplay, "memory leak\n" );
1650 /* Implement memory deallocation */
1652 HeapFree( GetProcessHeap(), 0, this );
1654 return 0;
1657 return this->ref;
1660 HRESULT WINAPI DirectPlay3A_AddPlayerToGroup
1661 ( LPDIRECTPLAY3A this, DPID a, DPID b )
1663 FIXME( dplay,"(%p)->(0x%08lx,0x%08lx): stub", this, a, b );
1664 return DP_OK;
1667 HRESULT WINAPI DirectPlay3W_AddPlayerToGroup
1668 ( LPDIRECTPLAY3 this, DPID a, DPID b )
1670 FIXME( dplay,"(%p)->(0x%08lx,0x%08lx): stub", this, a, b );
1671 return DP_OK;
1675 HRESULT WINAPI DirectPlay3A_Close
1676 ( LPDIRECTPLAY3A this )
1678 FIXME( dplay,"(%p)->(): stub", this );
1679 return DP_OK;
1682 HRESULT WINAPI DirectPlay3W_Close
1683 ( LPDIRECTPLAY3 this )
1685 FIXME( dplay,"(%p)->(): stub", this );
1686 return DP_OK;
1689 HRESULT WINAPI DirectPlay3A_CreateGroup
1690 ( LPDIRECTPLAY3A this, LPDPID a, LPDPNAME b, LPVOID c, DWORD d, DWORD e )
1692 FIXME( dplay,"(%p)->(%p,%p,%p,0x%08lx,0x%08lx): stub", this, a, b, c, d, e );
1693 return DP_OK;
1696 HRESULT WINAPI DirectPlay3W_CreateGroup
1697 ( LPDIRECTPLAY3 this, LPDPID a, LPDPNAME b, LPVOID c, DWORD d, DWORD e )
1699 FIXME( dplay,"(%p)->(%p,%p,%p,0x%08lx,0x%08lx): stub", this, a, b, c, d, e );
1700 return DP_OK;
1703 HRESULT WINAPI DirectPlay3A_CreatePlayer
1704 ( LPDIRECTPLAY3A this, LPDPID a, LPDPNAME b, HANDLE32 c, LPVOID d, DWORD e, DWORD f )
1706 FIXME( dplay,"(%p)->(%p,%p,%d,%p,0x%08lx,0x%08lx): stub", this, a, b, c, d, e, f );
1707 return DP_OK;
1710 HRESULT WINAPI DirectPlay3W_CreatePlayer
1711 ( LPDIRECTPLAY3 this, LPDPID a, LPDPNAME b, HANDLE32 c, LPVOID d, DWORD e, DWORD f )
1713 FIXME( dplay,"(%p)->(%p,%p,%d,%p,0x%08lx,0x%08lx): stub", this, a, b, c, d, e, f );
1714 return DP_OK;
1717 HRESULT WINAPI DirectPlay3A_DeletePlayerFromGroup
1718 ( LPDIRECTPLAY3A this, DPID a, DPID b )
1720 FIXME( dplay,"(%p)->(0x%08lx,0x%08lx): stub", this, a, b );
1721 return DP_OK;
1724 HRESULT WINAPI DirectPlay3W_DeletePlayerFromGroup
1725 ( LPDIRECTPLAY3 this, DPID a, DPID b )
1727 FIXME( dplay,"(%p)->(0x%08lx,0x%08lx): stub", this, a, b );
1728 return DP_OK;
1731 HRESULT WINAPI DirectPlay3A_DestroyGroup
1732 ( LPDIRECTPLAY3A this, DPID a )
1734 FIXME( dplay,"(%p)->(0x%08lx): stub", this, a );
1735 return DP_OK;
1738 HRESULT WINAPI DirectPlay3W_DestroyGroup
1739 ( LPDIRECTPLAY3 this, DPID a )
1741 FIXME( dplay,"(%p)->(0x%08lx): stub", this, a );
1742 return DP_OK;
1745 HRESULT WINAPI DirectPlay3A_DestroyPlayer
1746 ( LPDIRECTPLAY3A this, DPID a )
1748 FIXME( dplay,"(%p)->(0x%08lx): stub", this, a );
1749 return DP_OK;
1752 HRESULT WINAPI DirectPlay3W_DestroyPlayer
1753 ( LPDIRECTPLAY3 this, DPID a )
1755 FIXME( dplay,"(%p)->(0x%08lx): stub", this, a );
1756 return DP_OK;
1759 HRESULT WINAPI DirectPlay3A_EnumGroupPlayers
1760 ( LPDIRECTPLAY3A this, DPID a, LPGUID b, LPDPENUMPLAYERSCALLBACK2 c,
1761 LPVOID d, DWORD e )
1763 FIXME( dplay,"(%p)->(0x%08lx,%p,%p,%p,0x%08lx): stub", this, a, b, c, d, e );
1764 return DP_OK;
1767 HRESULT WINAPI DirectPlay3W_EnumGroupPlayers
1768 ( LPDIRECTPLAY3 this, DPID a, LPGUID b, LPDPENUMPLAYERSCALLBACK2 c,
1769 LPVOID d, DWORD e )
1771 FIXME( dplay,"(%p)->(0x%08lx,%p,%p,%p,0x%08lx): stub", this, a, b, c, d, e );
1772 return DP_OK;
1775 HRESULT WINAPI DirectPlay3A_EnumGroups
1776 ( LPDIRECTPLAY3A this, LPGUID a, LPDPENUMPLAYERSCALLBACK2 b, LPVOID c, DWORD d )
1778 FIXME( dplay,"(%p)->(%p,%p,%p,0x%08lx): stub", this, a, b, c, d );
1779 return DP_OK;
1782 HRESULT WINAPI DirectPlay3W_EnumGroups
1783 ( LPDIRECTPLAY3 this, LPGUID a, LPDPENUMPLAYERSCALLBACK2 b, LPVOID c, DWORD d )
1785 FIXME( dplay,"(%p)->(%p,%p,%p,0x%08lx): stub", this, a, b, c, d );
1786 return DP_OK;
1789 HRESULT WINAPI DirectPlay3A_EnumPlayers
1790 ( LPDIRECTPLAY3A this, LPGUID a, LPDPENUMPLAYERSCALLBACK2 b, LPVOID c, DWORD d )
1792 FIXME( dplay,"(%p)->(%p,%p,%p,0x%08lx): stub", this, a, b, c, d );
1793 return DP_OK;
1796 HRESULT WINAPI DirectPlay3W_EnumPlayers
1797 ( LPDIRECTPLAY3 this, LPGUID a, LPDPENUMPLAYERSCALLBACK2 b, LPVOID c, DWORD d )
1799 FIXME( dplay,"(%p)->(%p,%p,%p,0x%08lx): stub", this, a, b, c, d );
1800 return DP_OK;
1803 HRESULT WINAPI DirectPlay3A_EnumSessions
1804 ( LPDIRECTPLAY3A this, LPDPSESSIONDESC2 a, DWORD b, LPDPENUMSESSIONSCALLBACK2 c,
1805 LPVOID d, DWORD e )
1807 FIXME( dplay,"(%p)->(%p,0x%08lx,%p,%p,0x%08lx): stub", this, a, b, c, d, e );
1808 return DP_OK;
1811 HRESULT WINAPI DirectPlay3W_EnumSessions
1812 ( LPDIRECTPLAY3 this, LPDPSESSIONDESC2 a, DWORD b, LPDPENUMSESSIONSCALLBACK2 c,
1813 LPVOID d, DWORD e )
1815 FIXME( dplay,"(%p)->(%p,0x%08lx,%p,%p,0x%08lx): stub", this, a, b, c, d, e );
1816 return DP_OK;
1819 HRESULT WINAPI DirectPlay3A_GetCaps
1820 ( LPDIRECTPLAY3A this, LPDPCAPS a, DWORD b )
1822 FIXME( dplay,"(%p)->(%p,0x%08lx): stub", this, a, b );
1823 return DP_OK;
1826 HRESULT WINAPI DirectPlay3W_GetCaps
1827 ( LPDIRECTPLAY3 this, LPDPCAPS a, DWORD b )
1829 FIXME( dplay,"(%p)->(%p,0x%08lx): stub", this, a, b );
1830 return DP_OK;
1833 HRESULT WINAPI DirectPlay3A_GetGroupData
1834 ( LPDIRECTPLAY3 this, DPID a, LPVOID b, LPDWORD c, DWORD d )
1836 FIXME( dplay,"(%p)->(0x%08lx,%p,%p,0x%08lx): stub", this, a, b, c, d );
1837 return DP_OK;
1840 HRESULT WINAPI DirectPlay3W_GetGroupData
1841 ( LPDIRECTPLAY3 this, DPID a, LPVOID b, LPDWORD c, DWORD d )
1843 FIXME( dplay,"(%p)->(0x%08lx,%p,%p,0x%08lx): stub", this, a, b, c, d );
1844 return DP_OK;
1847 HRESULT WINAPI DirectPlay3A_GetGroupName
1848 ( LPDIRECTPLAY3A this, DPID a, LPVOID b, LPDWORD c )
1850 FIXME( dplay,"(%p)->(0x%08lx,%p,%p): stub", this, a, b, c );
1851 return DP_OK;
1854 HRESULT WINAPI DirectPlay3W_GetGroupName
1855 ( LPDIRECTPLAY3 this, DPID a, LPVOID b, LPDWORD c )
1857 FIXME( dplay,"(%p)->(0x%08lx,%p,%p): stub", this, a, b, c );
1858 return DP_OK;
1861 HRESULT WINAPI DirectPlay3A_GetMessageCount
1862 ( LPDIRECTPLAY3A this, DPID a, LPDWORD b )
1864 FIXME( dplay,"(%p)->(0x%08lx,%p): stub", this, a, b );
1865 return DP_OK;
1868 HRESULT WINAPI DirectPlay3W_GetMessageCount
1869 ( LPDIRECTPLAY3 this, DPID a, LPDWORD b )
1871 FIXME( dplay,"(%p)->(0x%08lx,%p): stub", this, a, b );
1872 return DP_OK;
1875 HRESULT WINAPI DirectPlay3A_GetPlayerAddress
1876 ( LPDIRECTPLAY3A this, DPID a, LPVOID b, LPDWORD c )
1878 FIXME( dplay,"(%p)->(0x%08lx,%p,%p): stub", this, a, b, c );
1879 return DP_OK;
1882 HRESULT WINAPI DirectPlay3W_GetPlayerAddress
1883 ( LPDIRECTPLAY3 this, DPID a, LPVOID b, LPDWORD c )
1885 FIXME( dplay,"(%p)->(0x%08lx,%p,%p): stub", this, a, b, c );
1886 return DP_OK;
1889 HRESULT WINAPI DirectPlay3A_GetPlayerCaps
1890 ( LPDIRECTPLAY3A this, DPID a, LPDPCAPS b, DWORD c )
1892 FIXME( dplay,"(%p)->(0x%08lx,%p,0x%08lx): stub", this, a, b, c );
1893 return DP_OK;
1896 HRESULT WINAPI DirectPlay3W_GetPlayerCaps
1897 ( LPDIRECTPLAY3 this, DPID a, LPDPCAPS b, DWORD c )
1899 FIXME( dplay,"(%p)->(0x%08lx,%p,0x%08lx): stub", this, a, b, c );
1900 return DP_OK;
1903 HRESULT WINAPI DirectPlay3A_GetPlayerData
1904 ( LPDIRECTPLAY3A this, DPID a, LPVOID b, LPDWORD c, DWORD d )
1906 FIXME( dplay,"(%p)->(0x%08lx,%p,%p,0x%08lx): stub", this, a, b, c, d );
1907 return DP_OK;
1910 HRESULT WINAPI DirectPlay3W_GetPlayerData
1911 ( LPDIRECTPLAY3 this, DPID a, LPVOID b, LPDWORD c, DWORD d )
1913 FIXME( dplay,"(%p)->(0x%08lx,%p,%p,0x%08lx): stub", this, a, b, c, d );
1914 return DP_OK;
1917 HRESULT WINAPI DirectPlay3A_GetPlayerName
1918 ( LPDIRECTPLAY3 this, DPID a, LPVOID b, LPDWORD c )
1920 FIXME( dplay,"(%p)->(0x%08lx,%p,%p): stub", this, a, b, c );
1921 return DP_OK;
1924 HRESULT WINAPI DirectPlay3W_GetPlayerName
1925 ( LPDIRECTPLAY3 this, DPID a, LPVOID b, LPDWORD c )
1927 FIXME( dplay,"(%p)->(0x%08lx,%p,%p): stub", this, a, b, c );
1928 return DP_OK;
1931 HRESULT WINAPI DirectPlay3A_GetSessionDesc
1932 ( LPDIRECTPLAY3A this, LPVOID a, LPDWORD b )
1934 FIXME( dplay,"(%p)->(%p,%p): stub", this, a, b );
1935 return DP_OK;
1938 HRESULT WINAPI DirectPlay3W_GetSessionDesc
1939 ( LPDIRECTPLAY3 this, LPVOID a, LPDWORD b )
1941 FIXME( dplay,"(%p)->(%p,%p): stub", this, a, b );
1942 return DP_OK;
1945 HRESULT WINAPI DirectPlay3A_Initialize
1946 ( LPDIRECTPLAY3A this, LPGUID a )
1948 FIXME( dplay,"(%p)->(%p): stub", this, a );
1949 return DP_OK;
1952 HRESULT WINAPI DirectPlay3W_Initialize
1953 ( LPDIRECTPLAY3 this, LPGUID a )
1955 FIXME( dplay,"(%p)->(%p): stub", this, a );
1956 return DP_OK;
1960 HRESULT WINAPI DirectPlay3A_Open
1961 ( LPDIRECTPLAY3A this, LPDPSESSIONDESC2 a, DWORD b )
1963 FIXME( dplay,"(%p)->(%p,0x%08lx): stub", this, a, b );
1964 return DP_OK;
1967 HRESULT WINAPI DirectPlay3W_Open
1968 ( LPDIRECTPLAY3 this, LPDPSESSIONDESC2 a, DWORD b )
1970 FIXME( dplay,"(%p)->(%p,0x%08lx): stub", this, a, b );
1971 return DP_OK;
1974 HRESULT WINAPI DirectPlay3A_Receive
1975 ( LPDIRECTPLAY3A this, LPDPID a, LPDPID b, DWORD c, LPVOID d, LPDWORD e )
1977 FIXME( dplay,"(%p)->(%p,%p,0x%08lx,%p,%p): stub", this, a, b, c, d, e );
1978 return DP_OK;
1981 HRESULT WINAPI DirectPlay3W_Receive
1982 ( LPDIRECTPLAY3 this, LPDPID a, LPDPID b, DWORD c, LPVOID d, LPDWORD e )
1984 FIXME( dplay,"(%p)->(%p,%p,0x%08lx,%p,%p): stub", this, a, b, c, d, e );
1985 return DP_OK;
1988 HRESULT WINAPI DirectPlay3A_Send
1989 ( LPDIRECTPLAY3A this, DPID a, DPID b, DWORD c, LPVOID d, DWORD e )
1991 FIXME( dplay,"(%p)->(0x%08lx,0x%08lx,0x%08lx,%p,0x%08lx): stub", this, a, b, c, d, e );
1992 return DP_OK;
1995 HRESULT WINAPI DirectPlay3W_Send
1996 ( LPDIRECTPLAY3 this, DPID a, DPID b, DWORD c, LPVOID d, DWORD e )
1998 FIXME( dplay,"(%p)->(0x%08lx,0x%08lx,0x%08lx,%p,0x%08lx): stub", this, a, b, c, d, e );
1999 return DP_OK;
2002 HRESULT WINAPI DirectPlay3A_SetGroupData
2003 ( LPDIRECTPLAY3A this, DPID a, LPVOID b, DWORD c, DWORD d )
2005 FIXME( dplay,"(%p)->(0x%08lx,%p,0x%08lx,0x%08lx): stub", this, a, b, c, d );
2006 return DP_OK;
2009 HRESULT WINAPI DirectPlay3W_SetGroupData
2010 ( LPDIRECTPLAY3 this, DPID a, LPVOID b, DWORD c, DWORD d )
2012 FIXME( dplay,"(%p)->(0x%08lx,%p,0x%08lx,0x%08lx): stub", this, a, b, c, d );
2013 return DP_OK;
2016 HRESULT WINAPI DirectPlay3A_SetGroupName
2017 ( LPDIRECTPLAY3A this, DPID a, LPDPNAME b, DWORD c )
2019 FIXME( dplay,"(%p)->(0x%08lx,%p,0x%08lx): stub", this, a, b, c );
2020 return DP_OK;
2023 HRESULT WINAPI DirectPlay3W_SetGroupName
2024 ( LPDIRECTPLAY3 this, DPID a, LPDPNAME b, DWORD c )
2026 FIXME( dplay,"(%p)->(0x%08lx,%p,0x%08lx): stub", this, a, b, c );
2027 return DP_OK;
2030 HRESULT WINAPI DirectPlay3A_SetPlayerData
2031 ( LPDIRECTPLAY3A this, DPID a, LPVOID b, DWORD c, DWORD d )
2033 FIXME( dplay,"(%p)->(0x%08lx,%p,0x%08lx,0x%08lx): stub", this, a, b, c, d );
2034 return DP_OK;
2037 HRESULT WINAPI DirectPlay3W_SetPlayerData
2038 ( LPDIRECTPLAY3 this, DPID a, LPVOID b, DWORD c, DWORD d )
2040 FIXME( dplay,"(%p)->(0x%08lx,%p,0x%08lx,0x%08lx): stub", this, a, b, c, d );
2041 return DP_OK;
2044 HRESULT WINAPI DirectPlay3A_SetPlayerName
2045 ( LPDIRECTPLAY3A this, DPID a, LPDPNAME b, DWORD c )
2047 FIXME( dplay,"(%p)->(0x%08lx,%p,0x%08lx): stub", this, a, b, c );
2048 return DP_OK;
2051 HRESULT WINAPI DirectPlay3W_SetPlayerName
2052 ( LPDIRECTPLAY3 this, DPID a, LPDPNAME b, DWORD c )
2054 FIXME( dplay,"(%p)->(0x%08lx,%p,0x%08lx): stub", this, a, b, c );
2055 return DP_OK;
2058 HRESULT WINAPI DirectPlay3A_SetSessionDesc
2059 ( LPDIRECTPLAY3A this, LPDPSESSIONDESC2 a, DWORD b )
2061 FIXME( dplay,"(%p)->(%p,0x%08lx): stub", this, a, b );
2062 return DP_OK;
2065 HRESULT WINAPI DirectPlay3W_SetSessionDesc
2066 ( LPDIRECTPLAY3 this, LPDPSESSIONDESC2 a, DWORD b )
2068 FIXME( dplay,"(%p)->(%p,0x%08lx): stub", this, a, b );
2069 return DP_OK;
2072 HRESULT WINAPI DirectPlay3A_AddGroupToGroup
2073 ( LPDIRECTPLAY3A this, DPID a, DPID b )
2075 FIXME( dplay,"(%p)->(0x%08lx,0x%08lx): stub", this, a, b );
2076 return DP_OK;
2079 HRESULT WINAPI DirectPlay3W_AddGroupToGroup
2080 ( LPDIRECTPLAY3 this, DPID a, DPID b )
2082 FIXME( dplay,"(%p)->(0x%08lx,0x%08lx): stub", this, a, b );
2083 return DP_OK;
2086 HRESULT WINAPI DirectPlay3A_CreateGroupInGroup
2087 ( LPDIRECTPLAY3A this, DPID a, LPDPID b, LPDPNAME c, LPVOID d, DWORD e, DWORD f )
2089 FIXME( dplay,"(%p)->(0x%08lx,%p,%p,%p,0x%08lx,0x%08lx): stub", this, a, b, c, d, e, f );
2090 return DP_OK;
2093 HRESULT WINAPI DirectPlay3W_CreateGroupInGroup
2094 ( LPDIRECTPLAY3 this, DPID a, LPDPID b, LPDPNAME c, LPVOID d, DWORD e, DWORD f )
2096 FIXME( dplay,"(%p)->(0x%08lx,%p,%p,%p,0x%08lx,0x%08lx): stub", this, a, b, c, d, e, f );
2097 return DP_OK;
2100 HRESULT WINAPI DirectPlay3A_DeleteGroupFromGroup
2101 ( LPDIRECTPLAY3A this, DPID a, DPID b )
2103 FIXME( dplay,"(%p)->(0x%08lx,0x%08lx): stub", this, a, b );
2104 return DP_OK;
2107 HRESULT WINAPI DirectPlay3W_DeleteGroupFromGroup
2108 ( LPDIRECTPLAY3 this, DPID a, DPID b )
2110 FIXME( dplay,"(%p)->(0x%08lx,0x%08lx): stub", this, a, b );
2111 return DP_OK;
2114 HRESULT WINAPI DirectPlay3A_EnumConnections
2115 ( LPDIRECTPLAY3A this, LPCGUID a, LPDPENUMCONNECTIONSCALLBACK b, LPVOID c, DWORD d )
2117 FIXME( dplay,"(%p)->(%p,%p,%p,0x%08lx): stub", this, a, b, c, d );
2118 return DP_OK;
2121 HRESULT WINAPI DirectPlay3W_EnumConnections
2122 ( LPDIRECTPLAY3 this, LPCGUID a, LPDPENUMCONNECTIONSCALLBACK b, LPVOID c, DWORD d )
2124 FIXME( dplay,"(%p)->(%p,%p,%p,0x%08lx): stub", this, a, b, c, d );
2125 return DP_OK;
2128 HRESULT WINAPI DirectPlay3A_EnumGroupsInGroup
2129 ( LPDIRECTPLAY3A this, DPID a, LPGUID b, LPDPENUMPLAYERSCALLBACK2 c, LPVOID d, DWORD e )
2131 FIXME( dplay,"(%p)->(0x%08lx,%p,%p,%p,0x%08lx): stub", this, a, b, c, d, e );
2132 return DP_OK;
2135 HRESULT WINAPI DirectPlay3W_EnumGroupsInGroup
2136 ( LPDIRECTPLAY3 this, DPID a, LPGUID b, LPDPENUMPLAYERSCALLBACK2 c, LPVOID d, DWORD e )
2138 FIXME( dplay,"(%p)->(0x%08lx,%p,%p,%p,0x%08lx): stub", this, a, b, c, d, e );
2139 return DP_OK;
2142 HRESULT WINAPI DirectPlay3A_GetGroupConnectionSettings
2143 ( LPDIRECTPLAY3A this, DWORD a, DPID b, LPVOID c, LPDWORD d )
2145 FIXME( dplay,"(%p)->(0x%08lx,0x%08lx,%p,%p): stub", this, a, b, c, d );
2146 return DP_OK;
2149 HRESULT WINAPI DirectPlay3W_GetGroupConnectionSettings
2150 ( LPDIRECTPLAY3 this, DWORD a, DPID b, LPVOID c, LPDWORD d )
2152 FIXME( dplay,"(%p)->(0x%08lx,0x%08lx,%p,%p): stub", this, a, b, c, d );
2153 return DP_OK;
2156 HRESULT WINAPI DirectPlay3A_InitializeConnection
2157 ( LPDIRECTPLAY3A this, LPVOID a, DWORD b )
2159 FIXME( dplay,"(%p)->(%p,0x%08lx): stub", this, a, b );
2160 return DP_OK;
2163 HRESULT WINAPI DirectPlay3W_InitializeConnection
2164 ( LPDIRECTPLAY3 this, LPVOID a, DWORD b )
2166 FIXME( dplay,"(%p)->(%p,0x%08lx): stub", this, a, b );
2167 return DP_OK;
2170 HRESULT WINAPI DirectPlay3A_SecureOpen
2171 ( LPDIRECTPLAY3A this, LPCDPSESSIONDESC2 a, DWORD b, LPCDPSECURITYDESC c, LPCDPCREDENTIALS d )
2173 FIXME( dplay,"(%p)->(%p,0x%08lx,%p,%p): stub", this, a, b, c, d );
2174 return DP_OK;
2177 HRESULT WINAPI DirectPlay3W_SecureOpen
2178 ( LPDIRECTPLAY3 this, LPCDPSESSIONDESC2 a, DWORD b, LPCDPSECURITYDESC c, LPCDPCREDENTIALS d )
2180 FIXME( dplay,"(%p)->(%p,0x%08lx,%p,%p): stub", this, a, b, c, d );
2181 return DP_OK;
2184 HRESULT WINAPI DirectPlay3A_SendChatMessage
2185 ( LPDIRECTPLAY3A this, DPID a, DPID b, DWORD c, LPDPCHAT d )
2187 FIXME( dplay,"(%p)->(0x%08lx,0x%08lx,0x%08lx,%p): stub", this, a, b, c, d );
2188 return DP_OK;
2191 HRESULT WINAPI DirectPlay3W_SendChatMessage
2192 ( LPDIRECTPLAY3 this, DPID a, DPID b, DWORD c, LPDPCHAT d )
2194 FIXME( dplay,"(%p)->(0x%08lx,0x%08lx,0x%08lx,%p): stub", this, a, b, c, d );
2195 return DP_OK;
2198 HRESULT WINAPI DirectPlay3A_SetGroupConnectionSettings
2199 ( LPDIRECTPLAY3A this, DWORD a, DPID b, LPDPLCONNECTION c )
2201 FIXME( dplay,"(%p)->(0x%08lx,0x%08lx,%p): stub", this, a, b, c );
2202 return DP_OK;
2205 HRESULT WINAPI DirectPlay3W_SetGroupConnectionSettings
2206 ( LPDIRECTPLAY3 this, DWORD a, DPID b, LPDPLCONNECTION c )
2208 FIXME( dplay,"(%p)->(0x%08lx,0x%08lx,%p): stub", this, a, b, c );
2209 return DP_OK;
2212 HRESULT WINAPI DirectPlay3A_StartSession
2213 ( LPDIRECTPLAY3A this, DWORD a, DPID b )
2215 FIXME( dplay,"(%p)->(0x%08lx,0x%08lx): stub", this, a, b );
2216 return DP_OK;
2219 HRESULT WINAPI DirectPlay3W_StartSession
2220 ( LPDIRECTPLAY3 this, DWORD a, DPID b )
2222 FIXME( dplay,"(%p)->(0x%08lx,0x%08lx): stub", this, a, b );
2223 return DP_OK;
2226 HRESULT WINAPI DirectPlay3A_GetGroupFlags
2227 ( LPDIRECTPLAY3A this, DPID a, LPDWORD b )
2229 FIXME( dplay,"(%p)->(0x%08lx,%p): stub", this, a, b );
2230 return DP_OK;
2233 HRESULT WINAPI DirectPlay3W_GetGroupFlags
2234 ( LPDIRECTPLAY3 this, DPID a, LPDWORD b )
2236 FIXME( dplay,"(%p)->(0x%08lx,%p): stub", this, a, b );
2237 return DP_OK;
2240 HRESULT WINAPI DirectPlay3A_GetGroupParent
2241 ( LPDIRECTPLAY3A this, DPID a, LPDPID b )
2243 FIXME( dplay,"(%p)->(0x%08lx,%p): stub", this, a, b );
2244 return DP_OK;
2247 HRESULT WINAPI DirectPlay3W_GetGroupParent
2248 ( LPDIRECTPLAY3 this, DPID a, LPDPID b )
2250 FIXME( dplay,"(%p)->(0x%08lx,%p): stub", this, a, b );
2251 return DP_OK;
2254 HRESULT WINAPI DirectPlay3A_GetPlayerAccount
2255 ( LPDIRECTPLAY3A this, DPID a, DWORD b, LPVOID c, LPDWORD d )
2257 FIXME( dplay,"(%p)->(0x%08lx,0x%08lx,%p,%p): stub", this, a, b, c, d );
2258 return DP_OK;
2261 HRESULT WINAPI DirectPlay3W_GetPlayerAccount
2262 ( LPDIRECTPLAY3 this, DPID a, DWORD b, LPVOID c, LPDWORD d )
2264 FIXME( dplay,"(%p)->(0x%08lx,0x%08lx,%p,%p): stub", this, a, b, c, d );
2265 return DP_OK;
2268 HRESULT WINAPI DirectPlay3A_GetPlayerFlags
2269 ( LPDIRECTPLAY3A this, DPID a, LPDWORD b )
2271 FIXME( dplay,"(%p)->(0x%08lx,%p): stub", this, a, b );
2272 return DP_OK;
2275 HRESULT WINAPI DirectPlay3W_GetPlayerFlags
2276 ( LPDIRECTPLAY3 this, DPID a, LPDWORD b )
2278 FIXME( dplay,"(%p)->(0x%08lx,%p): stub", this, a, b );
2279 return DP_OK;
2282 static struct tagLPDIRECTPLAY2_VTABLE directPlay2WVT = {
2283 DirectPlay2W_QueryInterface,
2284 (void*)DirectPlay3W_AddRef,
2285 (void*)DirectPlay3W_Release,
2286 (void*)DirectPlay3W_AddPlayerToGroup,
2287 (void*)DirectPlay3W_Close,
2288 (void*)DirectPlay3W_CreateGroup,
2289 (void*)DirectPlay3W_CreatePlayer,
2290 (void*)DirectPlay3W_DeletePlayerFromGroup,
2291 (void*)DirectPlay3W_DestroyGroup,
2292 (void*)DirectPlay3W_DestroyPlayer,
2293 (void*)DirectPlay3W_EnumGroupPlayers,
2294 (void*)DirectPlay3W_EnumGroups,
2295 (void*)DirectPlay3W_EnumPlayers,
2296 (void*)DirectPlay3W_EnumSessions,
2297 (void*)DirectPlay3W_GetCaps,
2298 (void*)DirectPlay3W_GetGroupData,
2299 (void*)DirectPlay3W_GetGroupName,
2300 (void*)DirectPlay3W_GetMessageCount,
2301 (void*)DirectPlay3W_GetPlayerAddress,
2302 (void*)DirectPlay3W_GetPlayerCaps,
2303 (void*)DirectPlay3W_GetPlayerData,
2304 (void*)DirectPlay3W_GetPlayerName,
2305 (void*)DirectPlay3W_GetSessionDesc,
2306 (void*)DirectPlay3W_Initialize,
2307 (void*)DirectPlay3W_Open,
2308 (void*)DirectPlay3W_Receive,
2309 (void*)DirectPlay3W_Send,
2310 (void*)DirectPlay3W_SetGroupData,
2311 (void*)DirectPlay3W_SetGroupName,
2312 (void*)DirectPlay3W_SetPlayerData,
2313 (void*)DirectPlay3W_SetPlayerName,
2314 (void*)DirectPlay3W_SetSessionDesc
2317 static struct tagLPDIRECTPLAY2_VTABLE directPlay2AVT = {
2318 DirectPlay2A_QueryInterface,
2319 (void*)DirectPlay3W_AddRef,
2320 (void*)DirectPlay3A_Release,
2321 (void*)DirectPlay3A_AddPlayerToGroup,
2322 (void*)DirectPlay3A_Close,
2323 (void*)DirectPlay3A_CreateGroup,
2324 (void*)DirectPlay3A_CreatePlayer,
2325 (void*)DirectPlay3A_DeletePlayerFromGroup,
2326 (void*)DirectPlay3A_DestroyGroup,
2327 (void*)DirectPlay3A_DestroyPlayer,
2328 (void*)DirectPlay3A_EnumGroupPlayers,
2329 (void*)DirectPlay3A_EnumGroups,
2330 (void*)DirectPlay3A_EnumPlayers,
2331 (void*)DirectPlay3A_EnumSessions,
2332 (void*)DirectPlay3A_GetCaps,
2333 (void*)DirectPlay3A_GetGroupData,
2334 (void*)DirectPlay3A_GetGroupName,
2335 (void*)DirectPlay3A_GetMessageCount,
2336 (void*)DirectPlay3A_GetPlayerAddress,
2337 (void*)DirectPlay3A_GetPlayerCaps,
2338 (void*)DirectPlay3A_GetPlayerData,
2339 (void*)DirectPlay3A_GetPlayerName,
2340 (void*)DirectPlay3A_GetSessionDesc,
2341 (void*)DirectPlay3A_Initialize,
2342 (void*)DirectPlay3A_Open,
2343 (void*)DirectPlay3A_Receive,
2344 (void*)DirectPlay3A_Send,
2345 (void*)DirectPlay3A_SetGroupData,
2346 (void*)DirectPlay3A_SetGroupName,
2347 (void*)DirectPlay3A_SetPlayerData,
2348 (void*)DirectPlay3A_SetPlayerName,
2349 (void*)DirectPlay3A_SetSessionDesc
2352 static struct tagLPDIRECTPLAY3_VTABLE directPlay3AVT = {
2353 DirectPlay3A_QueryInterface,
2354 (void*)DirectPlay3W_AddRef,
2355 DirectPlay3A_Release,
2356 DirectPlay3A_AddPlayerToGroup,
2357 DirectPlay3A_Close,
2358 DirectPlay3A_CreateGroup,
2359 DirectPlay3A_CreatePlayer,
2360 DirectPlay3A_DeletePlayerFromGroup,
2361 DirectPlay3A_DestroyGroup,
2362 DirectPlay3A_DestroyPlayer,
2363 DirectPlay3A_EnumGroupPlayers,
2364 DirectPlay3A_EnumGroups,
2365 DirectPlay3A_EnumPlayers,
2366 DirectPlay3A_EnumSessions,
2367 DirectPlay3A_GetCaps,
2368 DirectPlay3A_GetGroupData,
2369 DirectPlay3A_GetGroupName,
2370 DirectPlay3A_GetMessageCount,
2371 DirectPlay3A_GetPlayerAddress,
2372 DirectPlay3A_GetPlayerCaps,
2373 DirectPlay3A_GetPlayerData,
2374 DirectPlay3A_GetPlayerName,
2375 DirectPlay3A_GetSessionDesc,
2376 DirectPlay3A_Initialize,
2377 DirectPlay3A_Open,
2378 DirectPlay3A_Receive,
2379 DirectPlay3A_Send,
2380 DirectPlay3A_SetGroupData,
2381 DirectPlay3A_SetGroupName,
2382 DirectPlay3A_SetPlayerData,
2383 DirectPlay3A_SetPlayerName,
2384 DirectPlay3A_SetSessionDesc,
2386 DirectPlay3A_AddGroupToGroup,
2387 DirectPlay3A_CreateGroupInGroup,
2388 DirectPlay3A_DeleteGroupFromGroup,
2389 DirectPlay3A_EnumConnections,
2390 DirectPlay3A_EnumGroupsInGroup,
2391 DirectPlay3A_GetGroupConnectionSettings,
2392 DirectPlay3A_InitializeConnection,
2393 DirectPlay3A_SecureOpen,
2394 DirectPlay3A_SendChatMessage,
2395 DirectPlay3A_SetGroupConnectionSettings,
2396 DirectPlay3A_StartSession,
2397 DirectPlay3A_GetGroupFlags,
2398 DirectPlay3A_GetGroupParent,
2399 DirectPlay3A_GetPlayerAccount,
2400 DirectPlay3A_GetPlayerFlags
2403 static struct tagLPDIRECTPLAY3_VTABLE directPlay3WVT = {
2404 DirectPlay3W_QueryInterface,
2405 DirectPlay3W_AddRef,
2406 DirectPlay3W_Release,
2407 DirectPlay3W_AddPlayerToGroup,
2408 DirectPlay3W_Close,
2409 DirectPlay3W_CreateGroup,
2410 DirectPlay3W_CreatePlayer,
2411 DirectPlay3W_DeletePlayerFromGroup,
2412 DirectPlay3W_DestroyGroup,
2413 DirectPlay3W_DestroyPlayer,
2414 DirectPlay3W_EnumGroupPlayers,
2415 DirectPlay3W_EnumGroups,
2416 DirectPlay3W_EnumPlayers,
2417 DirectPlay3W_EnumSessions,
2418 DirectPlay3W_GetCaps,
2419 DirectPlay3W_GetGroupData,
2420 DirectPlay3W_GetGroupName,
2421 DirectPlay3W_GetMessageCount,
2422 DirectPlay3W_GetPlayerAddress,
2423 DirectPlay3W_GetPlayerCaps,
2424 DirectPlay3W_GetPlayerData,
2425 DirectPlay3W_GetPlayerName,
2426 DirectPlay3W_GetSessionDesc,
2427 DirectPlay3W_Initialize,
2428 DirectPlay3W_Open,
2429 DirectPlay3W_Receive,
2430 DirectPlay3W_Send,
2431 DirectPlay3W_SetGroupData,
2432 DirectPlay3W_SetGroupName,
2433 DirectPlay3W_SetPlayerData,
2434 DirectPlay3W_SetPlayerName,
2435 DirectPlay3W_SetSessionDesc,
2437 DirectPlay3W_AddGroupToGroup,
2438 DirectPlay3W_CreateGroupInGroup,
2439 DirectPlay3W_DeleteGroupFromGroup,
2440 DirectPlay3W_EnumConnections,
2441 DirectPlay3W_EnumGroupsInGroup,
2442 DirectPlay3W_GetGroupConnectionSettings,
2443 DirectPlay3W_InitializeConnection,
2444 DirectPlay3W_SecureOpen,
2445 DirectPlay3W_SendChatMessage,
2446 DirectPlay3W_SetGroupConnectionSettings,
2447 DirectPlay3W_StartSession,
2448 DirectPlay3W_GetGroupFlags,
2449 DirectPlay3W_GetGroupParent,
2450 DirectPlay3W_GetPlayerAccount,
2451 DirectPlay3W_GetPlayerFlags