1 /* Direct Play 3 and Direct Play Lobby 2 Implementation
3 * Copyright 1998 - Peter Hunnisett
5 * <presently under construction - contact hunnise@nortelnetworks.com>
17 #define IsEqualGUID(rguid1, rguid2) (!memcmp(rguid1, rguid2, sizeof(GUID)))
18 #define IsEqualIID(riid1, riid2) IsEqualGUID(riid1, riid2)
19 #define IsEqualCLSID(rclsid1, rclsid2) IsEqualGUID(rclsid1, rclsid2)
21 struct IDirectPlayLobby
{
22 LPDIRECTPLAYLOBBY_VTABLE lpVtbl
;
25 DPSESSIONDESC2 sessionDesc
;
32 struct IDirectPlayLobby2
{
33 LPDIRECTPLAYLOBBY2_VTABLE lpVtbl
;
36 DPSESSIONDESC2 lpSessionDesc
;
44 /* Forward declarations of virtual tables */
45 static DIRECTPLAYLOBBY_VTABLE directPlayLobbyAVT
;
46 static DIRECTPLAYLOBBY_VTABLE directPlayLobbyWVT
;
47 static DIRECTPLAYLOBBY2_VTABLE directPlayLobby2AVT
;
48 static DIRECTPLAYLOBBY2_VTABLE directPlayLobby2WVT
;
51 static DIRECTPLAY2_VTABLE directPlay2AVT
;
52 static DIRECTPLAY3_VTABLE directPlay3VT
;
58 LPDIRECTPLAY2_VTABLE lpVtbl
;
63 LPDIRECTPLAY3_VTABLE lpVtbl
;
67 /* Routine called when starting up the server thread */
68 DWORD
DPLobby_Spawn_Server( LPVOID startData
)
70 DPSESSIONDESC2
* lpSession
= (DPSESSIONDESC2
*) startData
;
71 DWORD sessionDwFlags
= lpSession
->dwFlags
;
73 TRACE( dplay
, "spawing thread for lpConn=%p dwFlags=%08lx\n", lpSession
, sessionDwFlags
);
74 FIXME( dplay
, "thread needs something to do\n" );
79 /* Check out the connection flags to determine what to do. Ensure we have
80 no leftover bits in this structure */
81 if( sessionDwFlags
& DPSESSION_CLIENTSERVER
)
83 /* This indicates that the application which is requesting the creation
84 * of this session is going to be the server (application/player)
86 if( sessionDwFlags
& DPSESSION_SECURESERVER
)
88 sessionDwFlags
&= ~DPSESSION_SECURESERVER
;
90 sessionDwFlags
&= ~DPSESSION_CLIENTSERVER
;
93 if( sessionDwFlags
& DPSESSION_JOINDISABLED
)
95 sessionDwFlags
&= ~DPSESSION_JOINDISABLED
;
98 if( sessionDwFlags
& DPSESSION_KEEPALIVE
)
100 sessionDwFlags
&= ~DPSESSION_KEEPALIVE
;
103 if( sessionDwFlags
& DPSESSION_MIGRATEHOST
)
105 sessionDwFlags
&= ~DPSESSION_MIGRATEHOST
;
108 if( sessionDwFlags
& DPSESSION_MULTICASTSERVER
)
110 sessionDwFlags
&= ~DPSESSION_MULTICASTSERVER
;
113 if( sessionDwFlags
& DPSESSION_NEWPLAYERSDISABLED
)
115 sessionDwFlags
&= ~DPSESSION_NEWPLAYERSDISABLED
;
118 if( sessionDwFlags
& DPSESSION_NODATAMESSAGES
)
120 sessionDwFlags
&= ~DPSESSION_NODATAMESSAGES
;
123 if( sessionDwFlags
& DPSESSION_NOMESSAGEID
)
125 sessionDwFlags
&= ~DPSESSION_NOMESSAGEID
;
128 if( sessionDwFlags
& DPSESSION_PASSWORDREQUIRED
)
130 sessionDwFlags
&= ~DPSESSION_PASSWORDREQUIRED
;
140 /*********************************************************
142 * Direct Play and Direct Play Lobby Interface Implementation
144 *********************************************************/
146 /* The COM interface for upversioning an interface
147 * We've been given a GUID (riid) and we need to replace the present
148 * interface with that of the requested interface.
150 * Snip from some Microsoft document:
151 * There are four requirements for implementations of QueryInterface (In these
152 * cases, "must succeed" means "must succeed barring catastrophic failure."):
154 * * The set of interfaces accessible on an object through
155 * IUnknown::QueryInterface must be static, not dynamic. This means that
156 * if a call to QueryInterface for a pointer to a specified interface
157 * succeeds the first time, it must succeed again, and if it fails the
158 * first time, it must fail on all subsequent queries.
159 * * It must be symmetric ~W if a client holds a pointer to an interface on
160 * an object, and queries for that interface, the call must succeed.
161 * * It must be reflexive ~W if a client holding a pointer to one interface
162 * queries successfully for another, a query through the obtained pointer
163 * for the first interface must succeed.
164 * * It must be transitive ~W if a client holding a pointer to one interface
165 * queries successfully for a second, and through that pointer queries
166 * successfully for a third interface, a query for the first interface
167 * through the pointer for the third interface must succeed.
169 * As you can see, this interface doesn't qualify but will most likely
170 * be good enough for the time being.
172 static HRESULT WINAPI IDirectPlayLobbyA_QueryInterface
173 ( LPDIRECTPLAYLOBBYA
this,
177 FIXME( dplay
, "(%p)->(%p,%p): stub\n", this, riid
, ppvObj
);
178 return E_NOINTERFACE
;
181 static HRESULT WINAPI IDirectPlayLobbyW_QueryInterface
182 ( LPDIRECTPLAYLOBBY
this,
186 FIXME( dplay
, "(%p)->(%p,%p): stub\n", this, riid
, ppvObj
);
187 return E_NOINTERFACE
;
191 static HRESULT WINAPI IDirectPlayLobby2A_QueryInterface
192 ( LPDIRECTPLAYLOBBY2A
this,
196 TRACE( dplay
, "(%p)->(%p,%p)\n", this, riid
, ppvObj
);
198 /* Compare riids. We know this object is a direct play lobby 2A object.
199 If we are asking about the same type of interface we're fine.
201 if( IsEqualGUID( &IID_IUnknown
, riid
) ||
202 IsEqualGUID( &IID_IDirectPlayLobby2A
, riid
)
205 this->lpVtbl
->fnAddRef( this );
209 /* They're requesting a unicode version of the interface */
210 else if( IsEqualGUID( &IID_IDirectPlayLobby2
, riid
) )
212 LPDIRECTPLAYLOBBY2 lpDpL
= (LPDIRECTPLAYLOBBY2
)(*ppvObj
);
214 lpDpL
= (LPDIRECTPLAYLOBBY2
)HeapAlloc( GetProcessHeap(), HEAP_ZERO_MEMORY
,
215 sizeof( IDirectPlayLobby2
) );
219 return E_NOINTERFACE
;
222 lpDpL
->lpVtbl
= &directPlayLobby2WVT
;
228 /* Unexpected interface request! */
230 return E_NOINTERFACE
;
233 static HRESULT WINAPI IDirectPlayLobby2W_QueryInterface
234 ( LPDIRECTPLAYLOBBY2
this,
239 /* Compare riids. We know this object is a direct play lobby 2 object.
240 If we are asking about the same type of interface we're fine.
242 if( IsEqualGUID( &IID_IUnknown
, riid
) ||
243 IsEqualGUID( &IID_IDirectPlayLobby2
, riid
)
246 this->lpVtbl
->fnAddRef( this );
250 else if( IsEqualGUID( &IID_IDirectPlayLobby2A
, riid
) )
252 LPDIRECTPLAYLOBBY2A lpDpL
= (LPDIRECTPLAYLOBBY2A
)(*ppvObj
);
254 lpDpL
= (LPDIRECTPLAYLOBBY2A
)HeapAlloc( GetProcessHeap(), HEAP_ZERO_MEMORY
,
255 sizeof( IDirectPlayLobby2A
) );
259 return E_NOINTERFACE
;
262 lpDpL
->lpVtbl
= &directPlayLobby2AVT
;
268 /* Unexpected interface request! */
270 return E_NOINTERFACE
;
275 * Simple procedure. Just increment the reference count to this
276 * structure and return the new reference count.
278 static ULONG WINAPI IDirectPlayLobby2A_AddRef
279 ( LPDIRECTPLAYLOBBY2A
this )
282 TRACE( dplay
,"ref count now %lu\n", this->ref
);
286 static ULONG WINAPI IDirectPlayLobby2W_AddRef
287 ( LPDIRECTPLAYLOBBY2
this )
289 return IDirectPlayLobby2A_AddRef( (LPDIRECTPLAYLOBBY2
) this );
294 * Simple COM procedure. Decrease the reference count to this object.
295 * If the object no longer has any reference counts, free up the associated
298 static ULONG WINAPI IDirectPlayLobby2A_Release
299 ( LPDIRECTPLAYLOBBY2A
this )
301 TRACE( dplay
, "ref count decremeneted from %lu\n", this->ref
);
305 /* Deallocate if this is the last reference to the object */
308 FIXME( dplay
, "memory leak\n" );
309 /* Implement memory deallocation */
311 HeapFree( GetProcessHeap(), 0, this );
319 static ULONG WINAPI IDirectPlayLobby2W_Release
320 ( LPDIRECTPLAYLOBBY2
this )
322 return IDirectPlayLobby2A_Release( (LPDIRECTPLAYLOBBY2A
) this );
326 /********************************************************************
328 * Connects an application to the session specified by the DPLCONNECTION
329 * structure currently stored with the DirectPlayLobby object.
331 * Returns a IDirectPlay interface.
334 static HRESULT WINAPI IDirectPlayLobby2A_Connect
335 ( LPDIRECTPLAYLOBBY2A
this,
337 LPDIRECTPLAY2
* lplpDP
,
340 FIXME( dplay
, ": dwFlags=%08lx %p %p stub\n", dwFlags
, lplpDP
, pUnk
);
341 return DPERR_OUTOFMEMORY
;
344 static HRESULT WINAPI IDirectPlayLobby2W_Connect
345 ( LPDIRECTPLAYLOBBY2
this,
347 LPDIRECTPLAY2
* lplpDP
,
350 LPDIRECTPLAY2
* directPlay2W
;
353 FIXME( dplay
, ": dwFlags=%08lx %p %p stub\n", dwFlags
, lplpDP
, pUnk
);
357 return DPERR_INVALIDPARAMS
;
360 if( ( createRC
= DirectPlayCreate( &IID_IDirectPlayLobby2
, lplpDP
, pUnk
) ) != DP_OK
)
362 ERR( dplay
, "error creating Direct Play 2 (W) interface. Return Code = %ld.\n", createRC
);
366 /* This should invoke IDirectPlay3::InitializeConnection IDirectPlay3::Open */
367 directPlay2W
= lplpDP
;
372 /* All the stuff below this is WRONG! */
373 if( this->lpSession
->dwFlags
== DPLCONNECTION_CREATESESSION
)
377 /* Spawn a thread to deal with all of this and to handle the incomming requests */
378 threadIdSink
= CreateThread( NULL
, 0, &DPLobby_Spawn_Server
,
379 (LPVOID
)this->lpSession
->lpConn
->lpSessionDesc
, 0, &threadIdSink
);
382 else if ( this->lpSession
->dwFlags
== DPLCONNECTION_JOINSESSION
)
384 /* Let's search for a matching session */
385 FIXME( dplay
, "joining session not yet supported.\n");
386 return DPERR_OUTOFMEMORY
;
388 else /* Unknown type of connection request */
390 ERR( dplay
, ": Unknown connection request lpConn->dwFlags=%08lx\n",
393 return DPERR_OUTOFMEMORY
;
396 /* This does the work of the following methods...
397 IDirectPlay3::InitializeConnection,
398 IDirectPlay3::EnumSessions,
409 /********************************************************************
411 * Creates a DirectPlay Address, given a service provider-specific network
413 * Returns an address contains the globally unique identifier
414 * (GUID) of the service provider and data that the service provider can
415 * interpret as a network address.
418 static HRESULT WINAPI IDirectPlayLobby2A_CreateAddress
419 ( LPDIRECTPLAYLOBBY2A
this,
421 REFGUID guidDataType
,
425 LPDWORD lpdwAddressSize
)
427 FIXME( dplay
, ":stub\n");
428 return DPERR_OUTOFMEMORY
;
431 static HRESULT WINAPI IDirectPlayLobby2W_CreateAddress
432 ( LPDIRECTPLAYLOBBY2
this,
434 REFGUID guidDataType
,
438 LPDWORD lpdwAddressSize
)
440 FIXME( dplay
, ":stub\n");
441 return DPERR_OUTOFMEMORY
;
445 /********************************************************************
447 * Parses out chunks from the DirectPlay Address buffer by calling the
448 * given callback function, with lpContext, for each of the chunks.
451 static HRESULT WINAPI IDirectPlayLobby2A_EnumAddress
452 ( LPDIRECTPLAYLOBBY2A
this,
453 LPDPENUMADDRESSCALLBACK lpEnumAddressCallback
,
458 FIXME( dplay
, ":stub\n");
459 return DPERR_OUTOFMEMORY
;
462 static HRESULT WINAPI IDirectPlayLobby2W_EnumAddress
463 ( LPDIRECTPLAYLOBBY2
this,
464 LPDPENUMADDRESSCALLBACK lpEnumAddressCallback
,
469 FIXME( dplay
, ":stub\n");
470 return DPERR_OUTOFMEMORY
;
473 /********************************************************************
475 * Enumerates all the address types that a given service provider needs to
476 * build the DirectPlay Address.
479 static HRESULT WINAPI IDirectPlayLobbyA_EnumAddressTypes
480 ( LPDIRECTPLAYLOBBYA
this,
481 LPDPLENUMADDRESSTYPESCALLBACK lpEnumAddressTypeCallback
,
486 FIXME( dplay
, ":stub\n");
487 return DPERR_OUTOFMEMORY
;
490 static HRESULT WINAPI IDirectPlayLobby2A_EnumAddressTypes
491 ( LPDIRECTPLAYLOBBY2A
this,
492 LPDPLENUMADDRESSTYPESCALLBACK lpEnumAddressTypeCallback
,
497 return IDirectPlayLobbyA_EnumAddressTypes( (LPDIRECTPLAYLOBBYA
)this, lpEnumAddressTypeCallback
,
498 guidSP
, lpContext
, dwFlags
);
501 static HRESULT WINAPI IDirectPlayLobby2W_EnumAddressTypes
502 ( LPDIRECTPLAYLOBBY2
this,
503 LPDPLENUMADDRESSTYPESCALLBACK lpEnumAddressTypeCallback
,
508 FIXME( dplay
, ":stub\n");
509 return DPERR_OUTOFMEMORY
;
512 /********************************************************************
514 * Enumerates what applications are registered with DirectPlay by
515 * invoking the callback function with lpContext.
518 static HRESULT WINAPI IDirectPlayLobbyW_EnumLocalApplications
519 ( LPDIRECTPLAYLOBBY
this,
520 LPDPLENUMLOCALAPPLICATIONSCALLBACK a
,
524 FIXME( dplay
, ":stub\n");
525 return DPERR_OUTOFMEMORY
;
528 static HRESULT WINAPI IDirectPlayLobby2W_EnumLocalApplications
529 ( LPDIRECTPLAYLOBBY2
this,
530 LPDPLENUMLOCALAPPLICATIONSCALLBACK a
,
534 return IDirectPlayLobbyW_EnumLocalApplications( (LPDIRECTPLAYLOBBY
)this, a
,
535 lpContext
, dwFlags
);
538 static HRESULT WINAPI IDirectPlayLobbyA_EnumLocalApplications
539 ( LPDIRECTPLAYLOBBYA
this,
540 LPDPLENUMLOCALAPPLICATIONSCALLBACK a
,
544 FIXME( dplay
, ":stub\n");
545 return DPERR_OUTOFMEMORY
;
548 static HRESULT WINAPI IDirectPlayLobby2A_EnumLocalApplications
549 ( LPDIRECTPLAYLOBBY2A
this,
550 LPDPLENUMLOCALAPPLICATIONSCALLBACK a
,
554 return IDirectPlayLobbyA_EnumLocalApplications( (LPDIRECTPLAYLOBBYA
)this, a
,
555 lpContext
, dwFlags
);
559 /********************************************************************
561 * Retrieves the DPLCONNECTION structure that contains all the information
562 * needed to start and connect an application. This was generated using
563 * either the RunApplication or SetConnectionSettings methods.
565 * NOTES: If lpData is NULL then just return lpdwDataSize. This allows
566 * the data structure to be allocated by our caller which can then
567 * call this procedure/method again with a valid data pointer.
569 static HRESULT WINAPI IDirectPlayLobbyA_GetConnectionSettings
570 ( LPDIRECTPLAYLOBBYA
this,
573 LPDWORD lpdwDataSize
)
575 LPDPLCONNECTION lpDplConnection
;
577 FIXME( dplay
, ": semi stub (%p)->(0x%08lx,%p,%p)\n", this, dwAppID
, lpData
, lpdwDataSize
);
579 /* Application is requesting us to give the required size */
582 /* Let's check the size of the buffer that the application has allocated */
583 if( *lpdwDataSize
>= sizeof( DPLCONNECTION
) )
589 *lpdwDataSize
= sizeof( DPLCONNECTION
);
590 return DPERR_BUFFERTOOSMALL
;
594 /* Fill in the fields - let them just use the ptrs */
595 lpDplConnection
= (LPDPLCONNECTION
)lpData
;
597 /* Make sure we were given the right size */
598 if( lpDplConnection
->dwSize
< sizeof( DPLCONNECTION
) )
600 ERR( dplay
, "bad passed size 0x%08lx.\n", lpDplConnection
->dwSize
);
601 return DPERR_INVALIDPARAMS
;
604 /* Copy everything we've got into here */
605 /* Need to actually store the stuff here. Check if we've already allocated each field first. */
606 lpDplConnection
->dwFlags
= this->dwConnFlags
;
608 /* Copy LPDPSESSIONDESC2 struct */
609 lpDplConnection
->lpSessionDesc
= HeapAlloc( GetProcessHeap(), HEAP_ZERO_MEMORY
, sizeof( this->sessionDesc
) );
610 memcpy( lpDplConnection
, &(this->sessionDesc
), sizeof( this->sessionDesc
) );
612 if( this->sessionDesc
.sess
.lpszSessionName
)
614 lpDplConnection
->lpSessionDesc
->sess
.lpszSessionName
=
615 HEAP_strdupW( GetProcessHeap(), HEAP_ZERO_MEMORY
, this->sessionDesc
.sess
.lpszSessionName
);
618 if( this->sessionDesc
.pass
.lpszPassword
)
620 lpDplConnection
->lpSessionDesc
->pass
.lpszPassword
=
621 HEAP_strdupW( GetProcessHeap(), HEAP_ZERO_MEMORY
, this->sessionDesc
.pass
.lpszPassword
);
624 /* I don't know what to use the reserved for. We'll set it to 0 just for fun */
625 this->sessionDesc
.dwReserved1
= this->sessionDesc
.dwReserved2
= 0;
627 /* Copy DPNAME struct - seems to be optional - check for existance first */
628 lpDplConnection
->lpPlayerName
= HeapAlloc( GetProcessHeap(), HEAP_ZERO_MEMORY
, sizeof( this->playerName
) );
629 memcpy( lpDplConnection
->lpPlayerName
, &(this->playerName
), sizeof( this->playerName
) );
631 if( this->playerName
.psn
.lpszShortName
)
633 lpDplConnection
->lpPlayerName
->psn
.lpszShortName
=
634 HEAP_strdupW( GetProcessHeap(), HEAP_ZERO_MEMORY
, this->playerName
.psn
.lpszShortName
);
637 if( this->playerName
.pln
.lpszLongName
)
639 lpDplConnection
->lpPlayerName
->pln
.lpszLongName
=
640 HEAP_strdupW( GetProcessHeap(), HEAP_ZERO_MEMORY
, this->playerName
.pln
.lpszLongName
);
645 memcpy( &(lpDplConnection
->guidSP
), &(this->guidSP
), sizeof( this->guidSP
) );
647 lpDplConnection
->lpAddress
= HeapAlloc( GetProcessHeap(), HEAP_ZERO_MEMORY
, this->dwAddressSize
);
648 memcpy( lpDplConnection
->lpAddress
, this->lpAddress
, this->dwAddressSize
);
650 lpDplConnection
->dwAddressSize
= this->dwAddressSize
;
655 static HRESULT WINAPI IDirectPlayLobby2A_GetConnectionSettings
656 ( LPDIRECTPLAYLOBBY2A
this,
659 LPDWORD lpdwDataSize
)
661 return IDirectPlayLobbyA_GetConnectionSettings( (LPDIRECTPLAYLOBBYA
)this,
662 dwAppID
, lpData
, lpdwDataSize
);
665 static HRESULT WINAPI IDirectPlayLobbyW_GetConnectionSettings
666 ( LPDIRECTPLAYLOBBY
this,
669 LPDWORD lpdwDataSize
)
671 FIXME( dplay
, ":semi stub %p %08lx %p %p \n", this, dwAppID
, lpData
, lpdwDataSize
);
673 /* Application is requesting us to give the required size */
676 /* Let's check the size of the buffer that the application has allocated */
677 if( *lpdwDataSize
>= sizeof( DPLCONNECTION
) )
683 *lpdwDataSize
= sizeof( DPLCONNECTION
);
684 return DPERR_BUFFERTOOSMALL
;
688 /* Fill in the fields - let them just use the ptrs */
689 FIXME( dplay
, "stub\n" );
694 static HRESULT WINAPI IDirectPlayLobby2W_GetConnectionSettings
695 ( LPDIRECTPLAYLOBBY2
this,
698 LPDWORD lpdwDataSize
)
700 return IDirectPlayLobbyW_GetConnectionSettings( (LPDIRECTPLAYLOBBY
)this,
701 dwAppID
, lpData
, lpdwDataSize
);
704 /********************************************************************
706 * Retrieves the message sent between a lobby client and a DirectPlay
707 * application. All messages are queued until received.
710 static HRESULT WINAPI IDirectPlayLobbyA_ReceiveLobbyMessage
711 ( LPDIRECTPLAYLOBBYA
this,
714 LPDWORD lpdwMessageFlags
,
716 LPDWORD lpdwDataSize
)
718 FIXME( dplay
, ":stub %p %08lx %08lx %p %p %p\n", this, dwFlags
, dwAppID
, lpdwMessageFlags
, lpData
,
720 return DPERR_OUTOFMEMORY
;
723 static HRESULT WINAPI IDirectPlayLobby2A_ReceiveLobbyMessage
724 ( LPDIRECTPLAYLOBBY2A
this,
727 LPDWORD lpdwMessageFlags
,
729 LPDWORD lpdwDataSize
)
731 return IDirectPlayLobbyA_ReceiveLobbyMessage( (LPDIRECTPLAYLOBBYA
)this, dwFlags
, dwAppID
,
732 lpdwMessageFlags
, lpData
, lpdwDataSize
);
736 static HRESULT WINAPI IDirectPlayLobbyW_ReceiveLobbyMessage
737 ( LPDIRECTPLAYLOBBY
this,
740 LPDWORD lpdwMessageFlags
,
742 LPDWORD lpdwDataSize
)
744 FIXME( dplay
, ":stub %p %08lx %08lx %p %p %p\n", this, dwFlags
, dwAppID
, lpdwMessageFlags
, lpData
,
746 return DPERR_OUTOFMEMORY
;
749 static HRESULT WINAPI IDirectPlayLobby2W_ReceiveLobbyMessage
750 ( LPDIRECTPLAYLOBBY2
this,
753 LPDWORD lpdwMessageFlags
,
755 LPDWORD lpdwDataSize
)
757 return IDirectPlayLobbyW_ReceiveLobbyMessage( (LPDIRECTPLAYLOBBY
)this, dwFlags
, dwAppID
,
758 lpdwMessageFlags
, lpData
, lpdwDataSize
);
761 /********************************************************************
763 * Starts an application and passes to it all the information to
764 * connect to a session.
767 static HRESULT WINAPI IDirectPlayLobbyA_RunApplication
768 ( LPDIRECTPLAYLOBBYA
this,
771 LPDPLCONNECTION lpConn
,
772 HANDLE32 hReceiveEvent
)
774 FIXME( dplay
, ":stub\n");
775 return DPERR_OUTOFMEMORY
;
778 static HRESULT WINAPI IDirectPlayLobby2A_RunApplication
779 ( LPDIRECTPLAYLOBBY2A
this,
782 LPDPLCONNECTION lpConn
,
783 HANDLE32 hReceiveEvent
)
785 return IDirectPlayLobbyA_RunApplication( (LPDIRECTPLAYLOBBYA
)this, dwFlags
,
786 lpdwAppID
, lpConn
, hReceiveEvent
);
789 static HRESULT WINAPI IDirectPlayLobbyW_RunApplication
790 ( LPDIRECTPLAYLOBBY
this,
793 LPDPLCONNECTION lpConn
,
794 HANDLE32 hReceiveEvent
)
796 FIXME( dplay
, ":stub\n");
797 return DPERR_OUTOFMEMORY
;
800 static HRESULT WINAPI IDirectPlayLobby2W_RunApplication
801 ( LPDIRECTPLAYLOBBY2
this,
804 LPDPLCONNECTION lpConn
,
805 HANDLE32 hReceiveEvent
)
807 return IDirectPlayLobbyW_RunApplication( (LPDIRECTPLAYLOBBY
)this, dwFlags
,
808 lpdwAppID
, lpConn
, hReceiveEvent
);
812 /********************************************************************
814 * Sends a message between the application and the lobby client.
815 * All messages are queued until received.
818 static HRESULT WINAPI IDirectPlayLobbyA_SendLobbyMessage
819 ( LPDIRECTPLAYLOBBYA
this,
825 FIXME( dplay
, ":stub\n");
826 return DPERR_OUTOFMEMORY
;
829 static HRESULT WINAPI IDirectPlayLobby2A_SendLobbyMessage
830 ( LPDIRECTPLAYLOBBY2A
this,
836 return IDirectPlayLobbyA_SendLobbyMessage( (LPDIRECTPLAYLOBBYA
)this, dwFlags
,
837 dwAppID
, lpData
, dwDataSize
);
841 static HRESULT WINAPI IDirectPlayLobbyW_SendLobbyMessage
842 ( LPDIRECTPLAYLOBBY
this,
848 FIXME( dplay
, ":stub\n");
849 return DPERR_OUTOFMEMORY
;
852 static HRESULT WINAPI IDirectPlayLobby2W_SendLobbyMessage
853 ( LPDIRECTPLAYLOBBY2
this,
859 return IDirectPlayLobbyW_SendLobbyMessage( (LPDIRECTPLAYLOBBY
)this, dwFlags
,
860 dwAppID
, lpData
, dwDataSize
);
863 /********************************************************************
865 * Modifies the DPLCONNECTION structure to contain all information
866 * needed to start and connect an application.
869 static HRESULT WINAPI IDirectPlayLobbyW_SetConnectionSettings
870 ( LPDIRECTPLAYLOBBY
this,
873 LPDPLCONNECTION lpConn
)
875 TRACE( dplay
, ": this=%p, dwFlags=%08lx, dwAppId=%08lx, lpConn=%p\n",
876 this, dwFlags
, dwAppID
, lpConn
);
878 /* Paramater check */
879 if( dwFlags
|| !this || !lpConn
)
881 ERR( dplay
, "invalid parameters.\n");
882 return DPERR_INVALIDPARAMS
;
885 /* See if there is a connection associated with this request.
886 * dwAppID == 0 indicates that this request isn't associated with a connection.
890 FIXME( dplay
, ": Connection dwAppID=%08lx given. Not implemented yet.\n",
893 /* Need to add a check for this application Id...*/
894 return DPERR_NOTLOBBIED
;
897 if( lpConn
->dwSize
!= sizeof(DPLCONNECTION
) )
899 ERR( dplay
, ": old/new DPLCONNECTION type? Size=%08lx vs. expected=%ul bytes\n",
900 lpConn
->dwSize
, sizeof( DPLCONNECTION
) );
901 return DPERR_INVALIDPARAMS
;
904 /* Need to investigate the lpConn->lpSessionDesc to figure out
905 * what type of session we need to join/create.
907 if( (!lpConn
->lpSessionDesc
) ||
908 ( lpConn
->lpSessionDesc
->dwSize
!= sizeof( DPSESSIONDESC2
) )
911 ERR( dplay
, "DPSESSIONDESC passed in? Size=%08lx vs. expected=%ul bytes\n",
912 lpConn
->lpSessionDesc
->dwSize
, sizeof( DPSESSIONDESC2
) );
913 return DPERR_INVALIDPARAMS
;
916 /* Need to actually store the stuff here. Check if we've already allocated each field first. */
917 this->dwConnFlags
= lpConn
->dwFlags
;
919 /* Copy LPDPSESSIONDESC2 struct - this is required */
920 memcpy( &(this->sessionDesc
), lpConn
->lpSessionDesc
, sizeof( *(lpConn
->lpSessionDesc
) ) );
922 if( lpConn
->lpSessionDesc
->sess
.lpszSessionName
)
923 this->sessionDesc
.sess
.lpszSessionName
= HEAP_strdupW( GetProcessHeap(), HEAP_ZERO_MEMORY
, lpConn
->lpSessionDesc
->sess
.lpszSessionName
);
925 this->sessionDesc
.sess
.lpszSessionName
= NULL
;
927 if( lpConn
->lpSessionDesc
->pass
.lpszPassword
)
928 this->sessionDesc
.pass
.lpszPassword
= HEAP_strdupW( GetProcessHeap(), HEAP_ZERO_MEMORY
, lpConn
->lpSessionDesc
->pass
.lpszPassword
);
930 this->sessionDesc
.pass
.lpszPassword
= NULL
;
932 /* I don't know what to use the reserved for ... */
933 this->sessionDesc
.dwReserved1
= this->sessionDesc
.dwReserved2
= 0;
935 /* Copy DPNAME struct - seems to be optional - check for existance first */
936 if( lpConn
->lpPlayerName
)
938 memcpy( &(this->playerName
), lpConn
->lpPlayerName
, sizeof( *lpConn
->lpPlayerName
) );
940 if( lpConn
->lpPlayerName
->psn
.lpszShortName
)
941 this->playerName
.psn
.lpszShortName
= HEAP_strdupW( GetProcessHeap(), HEAP_ZERO_MEMORY
, lpConn
->lpPlayerName
->psn
.lpszShortName
);
943 if( lpConn
->lpPlayerName
->pln
.lpszLongName
)
944 this->playerName
.pln
.lpszLongName
= HEAP_strdupW( GetProcessHeap(), HEAP_ZERO_MEMORY
, lpConn
->lpPlayerName
->pln
.lpszLongName
);
948 memcpy( &(this->guidSP
), &(lpConn
->guidSP
), sizeof( lpConn
->guidSP
) );
950 this->lpAddress
= HeapAlloc( GetProcessHeap(), HEAP_ZERO_MEMORY
, lpConn
->dwAddressSize
);
951 memcpy( this->lpAddress
, lpConn
->lpAddress
, lpConn
->dwAddressSize
);
953 this->dwAddressSize
= lpConn
->dwAddressSize
;
958 static HRESULT WINAPI IDirectPlayLobby2W_SetConnectionSettings
959 ( LPDIRECTPLAYLOBBY2
this,
962 LPDPLCONNECTION lpConn
)
964 return IDirectPlayLobbyW_SetConnectionSettings( (LPDIRECTPLAYLOBBY
)this,
965 dwFlags
, dwAppID
, lpConn
);
968 static HRESULT WINAPI IDirectPlayLobbyA_SetConnectionSettings
969 ( LPDIRECTPLAYLOBBYA
this,
972 LPDPLCONNECTION lpConn
)
974 FIXME( dplay
, ": this=%p, dwFlags=%08lx, dwAppId=%08lx, lpConn=%p: stub\n",
975 this, dwFlags
, dwAppID
, lpConn
);
976 return DPERR_OUTOFMEMORY
;
979 static HRESULT WINAPI IDirectPlayLobby2A_SetConnectionSettings
980 ( LPDIRECTPLAYLOBBY2A
this,
983 LPDPLCONNECTION lpConn
)
985 return IDirectPlayLobbyA_SetConnectionSettings( (LPDIRECTPLAYLOBBYA
)this,
986 dwFlags
, dwAppID
, lpConn
);
989 /********************************************************************
991 * Registers an event that will be set when a lobby message is received.
994 static HRESULT WINAPI IDirectPlayLobbyA_SetLobbyMessageEvent
995 ( LPDIRECTPLAYLOBBYA
this,
998 HANDLE32 hReceiveEvent
)
1000 FIXME( dplay
, ":stub\n");
1001 return DPERR_OUTOFMEMORY
;
1004 static HRESULT WINAPI IDirectPlayLobby2A_SetLobbyMessageEvent
1005 ( LPDIRECTPLAYLOBBY2A
this,
1008 HANDLE32 hReceiveEvent
)
1010 return IDirectPlayLobbyA_SetLobbyMessageEvent( (LPDIRECTPLAYLOBBYA
)this, dwFlags
,
1011 dwAppID
, hReceiveEvent
);
1014 static HRESULT WINAPI IDirectPlayLobbyW_SetLobbyMessageEvent
1015 ( LPDIRECTPLAYLOBBY
this,
1018 HANDLE32 hReceiveEvent
)
1020 FIXME( dplay
, ":stub\n");
1021 return DPERR_OUTOFMEMORY
;
1024 static HRESULT WINAPI IDirectPlayLobby2W_SetLobbyMessageEvent
1025 ( LPDIRECTPLAYLOBBY2
this,
1028 HANDLE32 hReceiveEvent
)
1030 return IDirectPlayLobbyW_SetLobbyMessageEvent( (LPDIRECTPLAYLOBBY
)this, dwFlags
,
1031 dwAppID
, hReceiveEvent
);
1035 /********************************************************************
1037 * Registers an event that will be set when a lobby message is received.
1040 static HRESULT WINAPI IDirectPlayLobby2W_CreateCompoundAddress
1041 ( LPDIRECTPLAYLOBBY2
this,
1042 LPCDPCOMPOUNDADDRESSELEMENT lpElements
,
1043 DWORD dwElementCount
,
1045 LPDWORD lpdwAddressSize
)
1047 FIXME( dplay
, ":stub\n");
1048 return DPERR_OUTOFMEMORY
;
1051 static HRESULT WINAPI IDirectPlayLobby2A_CreateCompoundAddress
1052 ( LPDIRECTPLAYLOBBY2A
this,
1053 LPCDPCOMPOUNDADDRESSELEMENT lpElements
,
1054 DWORD dwElementCount
,
1056 LPDWORD lpdwAddressSize
)
1058 FIXME( dplay
, ":stub\n");
1059 return DPERR_OUTOFMEMORY
;
1063 /* Direct Play Lobby 1 (ascii) Virtual Table for methods */
1064 /* All lobby 1 methods are exactly the same except QueryInterface */
1065 static struct tagLPDIRECTPLAYLOBBY_VTABLE directPlayLobbyAVT
= {
1066 IDirectPlayLobbyA_QueryInterface
,
1067 (void*)IDirectPlayLobby2A_AddRef
,
1068 (void*)IDirectPlayLobby2A_Release
,
1069 (void*)IDirectPlayLobby2A_Connect
,
1070 (void*)IDirectPlayLobby2A_CreateAddress
,
1071 (void*)IDirectPlayLobby2A_EnumAddress
,
1072 (void*)IDirectPlayLobby2A_EnumAddressTypes
,
1073 (void*)IDirectPlayLobby2A_EnumLocalApplications
,
1074 (void*)IDirectPlayLobby2A_GetConnectionSettings
,
1075 (void*)IDirectPlayLobby2A_ReceiveLobbyMessage
,
1076 (void*)IDirectPlayLobby2A_RunApplication
,
1077 (void*)IDirectPlayLobby2A_SendLobbyMessage
,
1078 (void*)IDirectPlayLobby2A_SetConnectionSettings
,
1079 (void*)IDirectPlayLobby2A_SetLobbyMessageEvent
1082 /* Direct Play Lobby 1 (unicode) Virtual Table for methods */
1083 static struct tagLPDIRECTPLAYLOBBY_VTABLE directPlayLobbyWVT
= {
1084 IDirectPlayLobbyW_QueryInterface
,
1085 (void*)IDirectPlayLobby2W_AddRef
,
1086 (void*)IDirectPlayLobby2W_Release
,
1087 (void*)IDirectPlayLobby2W_Connect
,
1088 (void*)IDirectPlayLobby2W_CreateAddress
,
1089 (void*)IDirectPlayLobby2W_EnumAddress
,
1090 (void*)IDirectPlayLobby2W_EnumAddressTypes
,
1091 (void*)IDirectPlayLobby2W_EnumLocalApplications
,
1092 (void*)IDirectPlayLobby2W_GetConnectionSettings
,
1093 (void*)IDirectPlayLobby2W_ReceiveLobbyMessage
,
1094 (void*)IDirectPlayLobby2W_RunApplication
,
1095 (void*)IDirectPlayLobby2W_SendLobbyMessage
,
1096 (void*)IDirectPlayLobby2W_SetConnectionSettings
,
1097 (void*)IDirectPlayLobby2W_SetLobbyMessageEvent
1101 /* Direct Play Lobby 2 (ascii) Virtual Table for methods */
1102 static struct tagLPDIRECTPLAYLOBBY2_VTABLE directPlayLobby2AVT
= {
1103 IDirectPlayLobby2A_QueryInterface
,
1104 IDirectPlayLobby2A_AddRef
,
1105 IDirectPlayLobby2A_Release
,
1106 IDirectPlayLobby2A_Connect
,
1107 IDirectPlayLobby2A_CreateAddress
,
1108 IDirectPlayLobby2A_EnumAddress
,
1109 IDirectPlayLobby2A_EnumAddressTypes
,
1110 IDirectPlayLobby2A_EnumLocalApplications
,
1111 IDirectPlayLobby2A_GetConnectionSettings
,
1112 IDirectPlayLobby2A_ReceiveLobbyMessage
,
1113 IDirectPlayLobby2A_RunApplication
,
1114 IDirectPlayLobby2A_SendLobbyMessage
,
1115 IDirectPlayLobby2A_SetConnectionSettings
,
1116 IDirectPlayLobby2A_SetLobbyMessageEvent
,
1117 IDirectPlayLobby2A_CreateCompoundAddress
1120 /* Direct Play Lobby 2 (unicode) Virtual Table for methods */
1121 static struct tagLPDIRECTPLAYLOBBY2_VTABLE directPlayLobby2WVT
= {
1122 IDirectPlayLobby2W_QueryInterface
,
1123 IDirectPlayLobby2W_AddRef
,
1124 IDirectPlayLobby2W_Release
,
1125 IDirectPlayLobby2W_Connect
,
1126 IDirectPlayLobby2W_CreateAddress
,
1127 IDirectPlayLobby2W_EnumAddress
,
1128 IDirectPlayLobby2W_EnumAddressTypes
,
1129 IDirectPlayLobby2W_EnumLocalApplications
,
1130 IDirectPlayLobby2W_GetConnectionSettings
,
1131 IDirectPlayLobby2W_ReceiveLobbyMessage
,
1132 IDirectPlayLobby2W_RunApplication
,
1133 IDirectPlayLobby2W_SendLobbyMessage
,
1134 IDirectPlayLobby2W_SetConnectionSettings
,
1135 IDirectPlayLobby2W_SetLobbyMessageEvent
,
1136 IDirectPlayLobby2W_CreateCompoundAddress
1139 /***************************************************************************
1140 * DirectPlayLobbyCreateA (DPLAYX.4)
1143 HRESULT WINAPI
DirectPlayLobbyCreateA( LPGUID lpGUIDDSP
,
1144 LPDIRECTPLAYLOBBYA
*lplpDPL
,
1149 TRACE(dplay
,"lpGUIDDSP=%p lplpDPL=%p lpUnk=%p lpData=%p dwDataSize=%08lx\n",
1150 lpGUIDDSP
,lplpDPL
,lpUnk
,lpData
,dwDataSize
);
1152 /* Parameter Check: lpGUIDSP, lpUnk & lpData must be NULL. dwDataSize must
1153 * equal 0. These fields are mostly for future expansion.
1155 if ( lpGUIDDSP
|| lpUnk
|| lpData
|| dwDataSize
)
1158 return DPERR_INVALIDPARAMS
;
1161 /* Yes...really we should be returning a lobby 1 object */
1162 *lplpDPL
= (LPDIRECTPLAYLOBBYA
)HeapAlloc( GetProcessHeap(), HEAP_ZERO_MEMORY
,
1163 sizeof( IDirectPlayLobbyA
) );
1167 return DPERR_OUTOFMEMORY
;
1170 (*lplpDPL
)->lpVtbl
= &directPlayLobbyAVT
;
1171 (*lplpDPL
)->ref
= 1;
1173 /* All fields were nulled out by the allocation */
1178 /***************************************************************************
1179 * DirectPlayLobbyCreateW (DPLAYX.5)
1182 HRESULT WINAPI
DirectPlayLobbyCreateW( LPGUID lpGUIDDSP
,
1183 LPDIRECTPLAYLOBBY
*lplpDPL
,
1188 TRACE(dplay
,"lpGUIDDSP=%p lplpDPL=%p lpUnk=%p lpData=%p dwDataSize=%08lx\n",
1189 lpGUIDDSP
,lplpDPL
,lpUnk
,lpData
,dwDataSize
);
1191 /* Parameter Check: lpGUIDSP, lpUnk & lpData must be NULL. dwDataSize must
1192 * equal 0. These fields are mostly for future expansion.
1194 if ( lpGUIDDSP
|| lpUnk
|| lpData
|| dwDataSize
)
1197 ERR( dplay
, "Bad parameters!\n" );
1198 return DPERR_INVALIDPARAMS
;
1201 /* Yes...really we should bre returning a lobby 1 object */
1202 *lplpDPL
= (LPDIRECTPLAYLOBBY
)HeapAlloc( GetProcessHeap(), HEAP_ZERO_MEMORY
,
1203 sizeof( IDirectPlayLobby
) );
1207 return DPERR_OUTOFMEMORY
;
1210 (*lplpDPL
)->lpVtbl
= &directPlayLobbyWVT
;
1211 (*lplpDPL
)->ref
= 1;
1213 /* All fields were nulled out by the allocation */
1219 /***************************************************************************
1220 * DirectPlayEnumerateA (DPLAYX.2)
1222 * The pointer to the structure lpContext will be filled with the
1223 * appropriate data for each service offered by the OS. These services are
1224 * not necessarily available on this particular machine but are defined
1225 * as simple service providers under the "Service Providers" registry key.
1226 * This structure is then passed to lpEnumCallback for each of the different
1229 * This API is useful only for applications written using DirectX3 or
1230 * worse. It is superceeded by IDirectPlay3::EnumConnections which also
1231 * gives information on the actual connections.
1233 * defn of a service provider:
1234 * A dynamic-link library used by DirectPlay to communicate over a network.
1235 * The service provider contains all the network-specific code required
1236 * to send and receive messages. Online services and network operators can
1237 * supply service providers to use specialized hardware, protocols, communications
1238 * media, and network resources.
1240 * TODO: Allocate string buffer space from the heap (length from reg)
1241 * Pass real device driver numbers...
1242 * Get the GUID properly...
1244 HRESULT WINAPI
DirectPlayEnumerateA( LPDPENUMDPCALLBACKA lpEnumCallback
,
1249 LPCSTR searchSubKey
= "SOFTWARE\\Microsoft\\DirectPlay\\Service Providers";
1250 LPSTR guidDataSubKey
= "Guid";
1251 LPSTR majVerDataSubKey
= "dwReserved1";
1252 DWORD dwIndex
, sizeOfSubKeyName
=50;
1253 char subKeyName
[51];
1255 TRACE( dplay
, ": lpEnumCallback=%p lpContext=%p\n", lpEnumCallback
, lpContext
);
1257 if( !lpEnumCallback
|| !*lpEnumCallback
)
1259 return DPERR_INVALIDPARAMS
;
1262 /* Need to loop over the service providers in the registry */
1263 if( RegOpenKeyEx32A( HKEY_LOCAL_MACHINE
, searchSubKey
,
1264 0, KEY_ENUMERATE_SUB_KEYS
, &hkResult
) != ERROR_SUCCESS
)
1266 /* Hmmm. Does this mean that there are no service providers? */
1267 ERR(dplay
, ": no service providers?\n");
1271 /* Traverse all the service providers we have available */
1273 RegEnumKey32A( hkResult
, dwIndex
, subKeyName
, sizeOfSubKeyName
) !=
1274 ERROR_NO_MORE_ITEMS
;
1277 HKEY hkServiceProvider
;
1278 GUID serviceProviderGUID
;
1279 DWORD returnTypeGUID
, returnTypeReserved1
, sizeOfReturnBuffer
=50;
1280 char returnBuffer
[51];
1281 DWORD majVersionNum
/*, minVersionNum */;
1282 LPWSTR lpWGUIDString
;
1284 TRACE( dplay
, " this time through: %s\n", subKeyName
);
1286 /* Get a handle for this particular service provider */
1287 if( RegOpenKeyEx32A( hkResult
, subKeyName
, 0, KEY_QUERY_VALUE
,
1288 &hkServiceProvider
) != ERROR_SUCCESS
)
1290 ERR( dplay
, ": what the heck is going on?\n" );
1294 /* Get the GUID, Device major number and device minor number
1295 * from the registry.
1297 if( RegQueryValueEx32A( hkServiceProvider
, guidDataSubKey
,
1298 NULL
, &returnTypeGUID
, returnBuffer
,
1299 &sizeOfReturnBuffer
) != ERROR_SUCCESS
)
1301 ERR( dplay
, ": missing GUID registry data members\n" );
1305 /* FIXME: Check return types to ensure we're interpreting data right */
1306 lpWGUIDString
= HEAP_strdupAtoW( GetProcessHeap(), 0, returnBuffer
);
1307 CLSIDFromString32( (LPCOLESTR32
)lpWGUIDString
, &serviceProviderGUID
);
1308 HeapFree( GetProcessHeap(), 0, lpWGUIDString
);
1310 sizeOfReturnBuffer
= 50;
1312 if( RegQueryValueEx32A( hkServiceProvider
, majVerDataSubKey
,
1313 NULL
, &returnTypeReserved1
, returnBuffer
,
1314 &sizeOfReturnBuffer
) != ERROR_SUCCESS
)
1316 ERR( dplay
, ": missing dwReserved1 registry data members\n") ;
1319 /* FIXME: This couldn't possibly be right...*/
1320 majVersionNum
= GET_DWORD( returnBuffer
);
1322 /* The enumeration will return FALSE if we are not to continue */
1323 if( !lpEnumCallback( &serviceProviderGUID
, subKeyName
,
1324 majVersionNum
, (DWORD
)0, lpContext
) )
1326 WARN( dplay
, "lpEnumCallback returning FALSE\n" );
1335 /***************************************************************************
1336 * DirectPlayEnumerateW (DPLAYX.3)
1339 HRESULT WINAPI
DirectPlayEnumerateW( LPDPENUMDPCALLBACKW lpEnumCallback
, LPVOID lpContext
)
1342 FIXME( dplay
, ":stub\n");
1344 return DPERR_OUTOFMEMORY
;
1348 /***************************************************************************
1349 * DirectPlayCreate (DPLAYX.1) (DPLAY.1)
1352 HRESULT WINAPI DirectPlayCreate
1353 ( LPGUID lpGUID
, LPDIRECTPLAY2
*lplpDP
, IUnknown
*pUnk
)
1360 /* Hmmm...wonder what this means! */
1361 ERR(dplay
, "What does a NULL here mean?\n" );
1362 return DPERR_OUTOFMEMORY
;
1365 *lplpDP
= (LPDIRECTPLAY2
)HeapAlloc( GetProcessHeap(), HEAP_ZERO_MEMORY
,
1366 sizeof( **lplpDP
) );
1370 return DPERR_OUTOFMEMORY
;
1373 (*lplpDP
)->lpVtbl
= &directPlay2AVT
;
1381 /* Direct Play methods */
1382 static HRESULT WINAPI DirectPlay2W_QueryInterface
1383 ( LPDIRECTPLAY2
this, REFIID riid
, LPVOID
* ppvObj
)
1385 FIXME( dplay
, "(%p)->(%p,%p): stub\n", this, riid
, ppvObj
);
1386 return E_NOINTERFACE
;
1389 static HRESULT WINAPI DirectPlay2A_QueryInterface
1390 ( LPDIRECTPLAY2A
this, REFIID riid
, LPVOID
* ppvObj
)
1392 FIXME( dplay
, "(%p)->(%p,%p): stub\n", this, riid
, ppvObj
);
1393 return E_NOINTERFACE
;
1396 static HRESULT WINAPI DirectPlay3W_QueryInterface
1397 ( LPDIRECTPLAY3
this, REFIID riid
, LPVOID
* ppvObj
)
1399 FIXME( dplay
, "(%p)->(%p,%p): stub\n", this, riid
, ppvObj
);
1400 return E_NOINTERFACE
;
1403 static HRESULT WINAPI DirectPlay3A_QueryInterface
1404 ( LPDIRECTPLAY3A
this, REFIID riid
, LPVOID
* ppvObj
)
1406 FIXME( dplay
, "(%p)->(%p,%p): stub\n", this, riid
, ppvObj
);
1407 return E_NOINTERFACE
;
1411 static ULONG WINAPI DirectPlay3W_AddRef
1412 ( LPDIRECTPLAY3
this )
1415 TRACE( dplay
,"ref count now %lu\n", this->ref
);
1419 static ULONG WINAPI DirectPlay3W_Release
1420 ( LPDIRECTPLAY3
this )
1422 TRACE( dplay
, "ref count decremeneted from %lu\n", this->ref
);
1426 /* Deallocate if this is the last reference to the object */
1429 FIXME( dplay
, "memory leak\n" );
1430 /* Implement memory deallocation */
1432 HeapFree( GetProcessHeap(), 0, this );
1443 HRESULT WINAPI DirectPlay3W_AddPlayerToGroup
1444 ( LPDIRECTPLAY3
this, DPID a
, DPID b
)
1446 FIXME( dplay
,"(%p)->(0x%08lx,0x%08lx): stub", this, a
, b
);
1450 HRESULT WINAPI DirectPlay3W_Close
1451 ( LPDIRECTPLAY3
this )
1453 FIXME( dplay
,"(%p)->(): stub", this );
1457 HRESULT WINAPI DirectPlay3W_CreateGroup
1458 ( LPDIRECTPLAY3
this, LPDPID a
, LPDPNAME b
, LPVOID c
, DWORD d
, DWORD e
)
1460 FIXME( dplay
,"(%p)->(%p,%p,%p,0x%08lx,0x%08lx): stub", this, a
, b
, c
, d
, e
);
1464 HRESULT WINAPI DirectPlay3W_CreatePlayer
1465 ( LPDIRECTPLAY3
this, LPDPID a
, LPDPNAME b
, HANDLE32 c
, LPVOID d
, DWORD e
, DWORD f
)
1467 FIXME( dplay
,"(%p)->(%p,%p,%d,%p,0x%08lx,0x%08lx): stub", this, a
, b
, c
, d
, e
, f
);
1471 HRESULT WINAPI DirectPlay3W_DeletePlayerFromGroup
1472 ( LPDIRECTPLAY3
this, DPID a
, DPID b
)
1474 FIXME( dplay
,"(%p)->(0x%08lx,0x%08lx): stub", this, a
, b
);
1478 HRESULT WINAPI DirectPlay3W_DestroyGroup
1479 ( LPDIRECTPLAY3
this, DPID a
)
1481 FIXME( dplay
,"(%p)->(0x%08lx): stub", this, a
);
1485 HRESULT WINAPI DirectPlay3W_DestroyPlayer
1486 ( LPDIRECTPLAY3
this, DPID a
)
1488 FIXME( dplay
,"(%p)->(0x%08lx): stub", this, a
);
1492 HRESULT WINAPI DirectPlay3W_EnumGroupPlayers
1493 ( LPDIRECTPLAY3
this, DPID a
, LPGUID b
, LPDPENUMPLAYERSCALLBACK2 c
,
1496 FIXME( dplay
,"(%p)->(0x%08lx,%p,%p,%p,0x%08lx): stub", this, a
, b
, c
, d
, e
);
1500 HRESULT WINAPI DirectPlay3W_EnumGroups
1501 ( LPDIRECTPLAY3
this, LPGUID a
, LPDPENUMPLAYERSCALLBACK2 b
, LPVOID c
, DWORD d
)
1503 FIXME( dplay
,"(%p)->(%p,%p,%p,0x%08lx): stub", this, a
, b
, c
, d
);
1507 HRESULT WINAPI DirectPlay3W_EnumPlayers
1508 ( LPDIRECTPLAY3
this, LPGUID a
, LPDPENUMPLAYERSCALLBACK2 b
, LPVOID c
, DWORD d
)
1510 FIXME( dplay
,"(%p)->(%p,%p,%p,0x%08lx): stub", this, a
, b
, c
, d
);
1514 HRESULT WINAPI DirectPlay3W_EnumSessions
1515 ( LPDIRECTPLAY3
this, LPDPSESSIONDESC2 a
, DWORD b
, LPDPENUMSESSIONSCALLBACK2 c
,
1518 FIXME( dplay
,"(%p)->(%p,0x%08lx,%p,%p,0x%08lx): stub", this, a
, b
, c
, d
, e
);
1522 HRESULT WINAPI DirectPlay3W_GetCaps
1523 ( LPDIRECTPLAY3
this, LPDPCAPS a
, DWORD b
)
1525 FIXME( dplay
,"(%p)->(%p,0x%08lx): stub", this, a
, b
);
1529 HRESULT WINAPI DirectPlay3W_GetGroupData
1530 ( LPDIRECTPLAY3
this, DPID a
, LPVOID b
, LPDWORD c
, DWORD d
)
1532 FIXME( dplay
,"(%p)->(0x%08lx,%p,%p,0x%08lx): stub", this, a
, b
, c
, d
);
1536 HRESULT WINAPI DirectPlay3W_GetGroupName
1537 ( LPDIRECTPLAY3
this, DPID a
, LPVOID b
, LPDWORD c
)
1539 FIXME( dplay
,"(%p)->(0x%08lx,%p,%p): stub", this, a
, b
, c
);
1543 HRESULT WINAPI DirectPlay3W_GetMessageCount
1544 ( LPDIRECTPLAY3
this, DPID a
, LPDWORD b
)
1546 FIXME( dplay
,"(%p)->(0x%08lx,%p): stub", this, a
, b
);
1550 HRESULT WINAPI DirectPlay3W_GetPlayerAddress
1551 ( LPDIRECTPLAY3
this, DPID a
, LPVOID b
, LPDWORD c
)
1553 FIXME( dplay
,"(%p)->(0x%08lx,%p,%p): stub", this, a
, b
, c
);
1557 HRESULT WINAPI DirectPlay3W_GetPlayerCaps
1558 ( LPDIRECTPLAY3
this, DPID a
, LPDPCAPS b
, DWORD c
)
1560 FIXME( dplay
,"(%p)->(0x%08lx,%p,0x%08lx): stub", this, a
, b
, c
);
1564 HRESULT WINAPI DirectPlay3W_GetPlayerData
1565 ( LPDIRECTPLAY3
this, DPID a
, LPVOID b
, LPDWORD c
, DWORD d
)
1567 FIXME( dplay
,"(%p)->(0x%08lx,%p,%p,0x%08lx): stub", this, a
, b
, c
, d
);
1571 HRESULT WINAPI DirectPlay3W_GetPlayerName
1572 ( LPDIRECTPLAY3
this, DPID a
, LPVOID b
, LPDWORD c
)
1574 FIXME( dplay
,"(%p)->(0x%08lx,%p,%p): stub", this, a
, b
, c
);
1578 HRESULT WINAPI DirectPlay3W_GetSessionDesc
1579 ( LPDIRECTPLAY3
this, LPVOID a
, LPDWORD b
)
1581 FIXME( dplay
,"(%p)->(%p,%p): stub", this, a
, b
);
1585 HRESULT WINAPI DirectPlay3W_Initialize
1586 ( LPDIRECTPLAY3
this, LPGUID a
)
1588 FIXME( dplay
,"(%p)->(%p): stub", this, a
);
1592 HRESULT WINAPI DirectPlay3W_Open
1593 ( LPDIRECTPLAY3
this, LPDPSESSIONDESC2 a
, DWORD b
)
1595 FIXME( dplay
,"(%p)->(%p,0x%08lx): stub", this, a
, b
);
1599 HRESULT WINAPI DirectPlay3W_Receive
1600 ( LPDIRECTPLAY3
this, LPDPID a
, LPDPID b
, DWORD c
, LPVOID d
, LPDWORD e
)
1602 FIXME( dplay
,"(%p)->(%p,%p,0x%08lx,%p,%p): stub", this, a
, b
, c
, d
, e
);
1606 HRESULT WINAPI DirectPlay3W_Send
1607 ( LPDIRECTPLAY3
this, DPID a
, DPID b
, DWORD c
, LPVOID d
, DWORD e
)
1609 FIXME( dplay
,"(%p)->(0x%08lx,0x%08lx,0x%08lx,%p,0x%08lx): stub", this, a
, b
, c
, d
, e
);
1613 HRESULT WINAPI DirectPlay3W_SetGroupData
1614 ( LPDIRECTPLAY3
this, DPID a
, LPVOID b
, DWORD c
, DWORD d
)
1616 FIXME( dplay
,"(%p)->(0x%08lx,%p,0x%08lx,0x%08lx): stub", this, a
, b
, c
, d
);
1620 HRESULT WINAPI DirectPlay3W_SetGroupName
1621 ( LPDIRECTPLAY3
this, DPID a
, LPDPNAME b
, DWORD c
)
1623 FIXME( dplay
,"(%p)->(0x%08lx,%p,0x%08lx): stub", this, a
, b
, c
);
1627 HRESULT WINAPI DirectPlay3W_SetPlayerData
1628 ( LPDIRECTPLAY3
this, DPID a
, LPVOID b
, DWORD c
, DWORD d
)
1630 FIXME( dplay
,"(%p)->(0x%08lx,%p,0x%08lx,0x%08lx): stub", this, a
, b
, c
, d
);
1634 HRESULT WINAPI DirectPlay3W_SetPlayerName
1635 ( LPDIRECTPLAY3
this, DPID a
, LPDPNAME b
, DWORD c
)
1637 FIXME( dplay
,"(%p)->(0x%08lx,%p,0x%08lx): stub", this, a
, b
, c
);
1641 HRESULT WINAPI DirectPlay3W_SetSessionDesc
1642 ( LPDIRECTPLAY3
this, LPDPSESSIONDESC2 a
, DWORD b
)
1644 FIXME( dplay
,"(%p)->(%p,0x%08lx): stub", this, a
, b
);
1648 HRESULT WINAPI DirectPlay3W_AddGroupToGroup
1649 ( LPDIRECTPLAY3
this, DPID a
, DPID b
)
1651 FIXME( dplay
,"(%p)->(0x%08lx,0x%08lx): stub", this, a
, b
);
1655 HRESULT WINAPI DirectPlay3W_CreateGroupInGroup
1656 ( LPDIRECTPLAY3
this, DPID a
, LPDPID b
, LPDPNAME c
, LPVOID d
, DWORD e
, DWORD f
)
1658 FIXME( dplay
,"(%p)->(0x%08lx,%p,%p,%p,0x%08lx,0x%08lx): stub", this, a
, b
, c
, d
, e
, f
);
1662 HRESULT WINAPI DirectPlay3W_DeleteGroupFromGroup
1663 ( LPDIRECTPLAY3
this, DPID a
, DPID b
)
1665 FIXME( dplay
,"(%p)->(0x%08lx,0x%08lx): stub", this, a
, b
);
1669 HRESULT WINAPI DirectPlay3W_EnumConnections
1670 ( LPDIRECTPLAY3
this, LPCGUID a
, LPDPENUMCONNECTIONSCALLBACK b
, LPVOID c
, DWORD d
)
1672 FIXME( dplay
,"(%p)->(%p,%p,%p,0x%08lx): stub", this, a
, b
, c
, d
);
1676 HRESULT WINAPI DirectPlay3W_EnumGroupsInGroup
1677 ( LPDIRECTPLAY3
this, DPID a
, LPGUID b
, LPDPENUMPLAYERSCALLBACK2 c
, LPVOID d
, DWORD e
)
1679 FIXME( dplay
,"(%p)->(0x%08lx,%p,%p,%p,0x%08lx): stub", this, a
, b
, c
, d
, e
);
1683 HRESULT WINAPI DirectPlay3W_GetGroupConnectionSettings
1684 ( LPDIRECTPLAY3
this, DWORD a
, DPID b
, LPVOID c
, LPDWORD d
)
1686 FIXME( dplay
,"(%p)->(0x%08lx,0x%08lx,%p,%p): stub", this, a
, b
, c
, d
);
1690 HRESULT WINAPI DirectPlay3W_InitializeConnection
1691 ( LPDIRECTPLAY3
this, LPVOID a
, DWORD b
)
1693 FIXME( dplay
,"(%p)->(%p,0x%08lx): stub", this, a
, b
);
1697 HRESULT WINAPI DirectPlay3W_SecureOpen
1698 ( LPDIRECTPLAY3
this, LPCDPSESSIONDESC2 a
, DWORD b
, LPCDPSECURITYDESC c
, LPCDPCREDENTIALS d
)
1700 FIXME( dplay
,"(%p)->(%p,0x%08lx,%p,%p): stub", this, a
, b
, c
, d
);
1704 HRESULT WINAPI DirectPlay3W_SendChatMessage
1705 ( LPDIRECTPLAY3
this, DPID a
, DPID b
, DWORD c
, LPDPCHAT d
)
1707 FIXME( dplay
,"(%p)->(0x%08lx,0x%08lx,0x%08lx,%p): stub", this, a
, b
, c
, d
);
1711 HRESULT WINAPI DirectPlay3W_SetGroupConnectionSettings
1712 ( LPDIRECTPLAY3
this, DWORD a
, DPID b
, LPDPLCONNECTION c
)
1714 FIXME( dplay
,"(%p)->(0x%08lx,0x%08lx,%p): stub", this, a
, b
, c
);
1718 HRESULT WINAPI DirectPlay3W_StartSession
1719 ( LPDIRECTPLAY3
this, DWORD a
, DPID b
)
1721 FIXME( dplay
,"(%p)->(0x%08lx,0x%08lx): stub", this, a
, b
);
1725 HRESULT WINAPI DirectPlay3W_GetGroupFlags
1726 ( LPDIRECTPLAY3
this, DPID a
, LPDWORD b
)
1728 FIXME( dplay
,"(%p)->(0x%08lx,%p): stub", this, a
, b
);
1732 HRESULT WINAPI DirectPlay3W_GetGroupParent
1733 ( LPDIRECTPLAY3
this, DPID a
, LPDPID b
)
1735 FIXME( dplay
,"(%p)->(0x%08lx,%p): stub", this, a
, b
);
1739 HRESULT WINAPI DirectPlay3W_GetPlayerAccount
1740 ( LPDIRECTPLAY3
this, DPID a
, DWORD b
, LPVOID c
, LPDWORD d
)
1742 FIXME( dplay
,"(%p)->(0x%08lx,0x%08lx,%p,%p): stub", this, a
, b
, c
, d
);
1746 HRESULT WINAPI DirectPlay3W_GetPlayerFlags
1747 ( LPDIRECTPLAY3
this, DPID a
, LPDWORD b
)
1749 FIXME( dplay
,"(%p)->(0x%08lx,%p): stub", this, a
, b
);
1753 static struct tagLPDIRECTPLAY2_VTABLE directPlay2WVT
= {
1754 DirectPlay2W_QueryInterface
,
1755 (void*)DirectPlay3W_AddRef
,
1756 (void*)DirectPlay3W_Release
,
1757 (void*)DirectPlay3W_AddPlayerToGroup
,
1758 (void*)DirectPlay3W_Close
,
1759 (void*)DirectPlay3W_CreateGroup
,
1760 (void*)DirectPlay3W_CreatePlayer
,
1761 (void*)DirectPlay3W_DeletePlayerFromGroup
,
1762 (void*)DirectPlay3W_DestroyGroup
,
1763 (void*)DirectPlay3W_DestroyPlayer
,
1764 (void*)DirectPlay3W_EnumGroupPlayers
,
1765 (void*)DirectPlay3W_EnumGroups
,
1766 (void*)DirectPlay3W_EnumPlayers
,
1767 (void*)DirectPlay3W_EnumSessions
,
1768 (void*)DirectPlay3W_GetCaps
,
1769 (void*)DirectPlay3W_GetGroupData
,
1770 (void*)DirectPlay3W_GetGroupName
,
1771 (void*)DirectPlay3W_GetMessageCount
,
1772 (void*)DirectPlay3W_GetPlayerAddress
,
1773 (void*)DirectPlay3W_GetPlayerCaps
,
1774 (void*)DirectPlay3W_GetPlayerData
,
1775 (void*)DirectPlay3W_GetPlayerName
,
1776 (void*)DirectPlay3W_GetSessionDesc
,
1777 (void*)DirectPlay3W_Initialize
,
1778 (void*)DirectPlay3W_Open
,
1779 (void*)DirectPlay3W_Receive
,
1780 (void*)DirectPlay3W_Send
,
1781 (void*)DirectPlay3W_SetGroupData
,
1782 (void*)DirectPlay3W_SetGroupName
,
1783 (void*)DirectPlay3W_SetPlayerData
,
1784 (void*)DirectPlay3W_SetPlayerName
,
1785 (void*)DirectPlay3W_SetSessionDesc
1788 static struct tagLPDIRECTPLAY2_VTABLE directPlay2AVT
= {
1789 DirectPlay2A_QueryInterface
,
1790 (void*)DirectPlay3W_AddRef
,
1791 (void*)DirectPlay3W_Release
,
1792 (void*)DirectPlay3W_AddPlayerToGroup
,
1793 (void*)DirectPlay3W_Close
,
1794 (void*)DirectPlay3W_CreateGroup
,
1795 (void*)DirectPlay3W_CreatePlayer
,
1796 (void*)DirectPlay3W_DeletePlayerFromGroup
,
1797 (void*)DirectPlay3W_DestroyGroup
,
1798 (void*)DirectPlay3W_DestroyPlayer
,
1799 (void*)DirectPlay3W_EnumGroupPlayers
,
1800 (void*)DirectPlay3W_EnumGroups
,
1801 (void*)DirectPlay3W_EnumPlayers
,
1802 (void*)DirectPlay3W_EnumSessions
,
1803 (void*)DirectPlay3W_GetCaps
,
1804 (void*)DirectPlay3W_GetGroupData
,
1805 (void*)DirectPlay3W_GetGroupName
,
1806 (void*)DirectPlay3W_GetMessageCount
,
1807 (void*)DirectPlay3W_GetPlayerAddress
,
1808 (void*)DirectPlay3W_GetPlayerCaps
,
1809 (void*)DirectPlay3W_GetPlayerData
,
1810 (void*)DirectPlay3W_GetPlayerName
,
1811 (void*)DirectPlay3W_GetSessionDesc
,
1812 (void*)DirectPlay3W_Initialize
,
1813 (void*)DirectPlay3W_Open
,
1814 (void*)DirectPlay3W_Receive
,
1815 (void*)DirectPlay3W_Send
,
1816 (void*)DirectPlay3W_SetGroupData
,
1817 (void*)DirectPlay3W_SetGroupName
,
1818 (void*)DirectPlay3W_SetPlayerData
,
1819 (void*)DirectPlay3W_SetPlayerName
,
1820 (void*)DirectPlay3W_SetSessionDesc
1823 static struct tagLPDIRECTPLAY3_VTABLE directPlay3AVT
= {
1824 DirectPlay3A_QueryInterface
,
1825 (void*)DirectPlay3W_AddRef
,
1826 (void*)DirectPlay3W_Release
,
1827 (void*)DirectPlay3W_AddPlayerToGroup
,
1828 (void*)DirectPlay3W_Close
,
1829 (void*)DirectPlay3W_CreateGroup
,
1830 (void*)DirectPlay3W_CreatePlayer
,
1831 (void*)DirectPlay3W_DeletePlayerFromGroup
,
1832 (void*)DirectPlay3W_DestroyGroup
,
1833 (void*)DirectPlay3W_DestroyPlayer
,
1834 (void*)DirectPlay3W_EnumGroupPlayers
,
1835 (void*)DirectPlay3W_EnumGroups
,
1836 (void*)DirectPlay3W_EnumPlayers
,
1837 (void*)DirectPlay3W_EnumSessions
,
1838 (void*)DirectPlay3W_GetCaps
,
1839 (void*)DirectPlay3W_GetGroupData
,
1840 (void*)DirectPlay3W_GetGroupName
,
1841 (void*)DirectPlay3W_GetMessageCount
,
1842 (void*)DirectPlay3W_GetPlayerAddress
,
1843 (void*)DirectPlay3W_GetPlayerCaps
,
1844 (void*)DirectPlay3W_GetPlayerData
,
1845 (void*)DirectPlay3W_GetPlayerName
,
1846 (void*)DirectPlay3W_GetSessionDesc
,
1847 (void*)DirectPlay3W_Initialize
,
1848 (void*)DirectPlay3W_Open
,
1849 (void*)DirectPlay3W_Receive
,
1850 (void*)DirectPlay3W_Send
,
1851 (void*)DirectPlay3W_SetGroupData
,
1852 (void*)DirectPlay3W_SetGroupName
,
1853 (void*)DirectPlay3W_SetPlayerData
,
1854 (void*)DirectPlay3W_SetPlayerName
,
1855 (void*)DirectPlay3W_SetSessionDesc
,
1857 (void*)DirectPlay3W_AddGroupToGroup
,
1858 (void*)DirectPlay3W_CreateGroupInGroup
,
1859 (void*)DirectPlay3W_DeleteGroupFromGroup
,
1860 (void*)DirectPlay3W_EnumConnections
,
1861 (void*)DirectPlay3W_EnumGroupsInGroup
,
1862 (void*)DirectPlay3W_GetGroupConnectionSettings
,
1863 (void*)DirectPlay3W_InitializeConnection
,
1864 (void*)DirectPlay3W_SecureOpen
,
1865 (void*)DirectPlay3W_SendChatMessage
,
1866 (void*)DirectPlay3W_SetGroupConnectionSettings
,
1867 (void*)DirectPlay3W_StartSession
,
1868 (void*)DirectPlay3W_GetGroupFlags
,
1869 (void*)DirectPlay3W_GetGroupParent
,
1870 (void*)DirectPlay3W_GetPlayerAccount
,
1871 (void*)DirectPlay3W_GetPlayerFlags
1874 static struct tagLPDIRECTPLAY3_VTABLE directPlay3WVT
= {
1875 DirectPlay3W_QueryInterface
,
1876 DirectPlay3W_AddRef
,
1877 DirectPlay3W_Release
,
1878 DirectPlay3W_AddPlayerToGroup
,
1880 DirectPlay3W_CreateGroup
,
1881 DirectPlay3W_CreatePlayer
,
1882 DirectPlay3W_DeletePlayerFromGroup
,
1883 DirectPlay3W_DestroyGroup
,
1884 DirectPlay3W_DestroyPlayer
,
1885 DirectPlay3W_EnumGroupPlayers
,
1886 DirectPlay3W_EnumGroups
,
1887 DirectPlay3W_EnumPlayers
,
1888 DirectPlay3W_EnumSessions
,
1889 DirectPlay3W_GetCaps
,
1890 DirectPlay3W_GetGroupData
,
1891 DirectPlay3W_GetGroupName
,
1892 DirectPlay3W_GetMessageCount
,
1893 DirectPlay3W_GetPlayerAddress
,
1894 DirectPlay3W_GetPlayerCaps
,
1895 DirectPlay3W_GetPlayerData
,
1896 DirectPlay3W_GetPlayerName
,
1897 DirectPlay3W_GetSessionDesc
,
1898 DirectPlay3W_Initialize
,
1900 DirectPlay3W_Receive
,
1902 DirectPlay3W_SetGroupData
,
1903 DirectPlay3W_SetGroupName
,
1904 DirectPlay3W_SetPlayerData
,
1905 DirectPlay3W_SetPlayerName
,
1906 DirectPlay3W_SetSessionDesc
,
1908 DirectPlay3W_AddGroupToGroup
,
1909 DirectPlay3W_CreateGroupInGroup
,
1910 DirectPlay3W_DeleteGroupFromGroup
,
1911 DirectPlay3W_EnumConnections
,
1912 DirectPlay3W_EnumGroupsInGroup
,
1913 DirectPlay3W_GetGroupConnectionSettings
,
1914 DirectPlay3W_InitializeConnection
,
1915 DirectPlay3W_SecureOpen
,
1916 DirectPlay3W_SendChatMessage
,
1917 DirectPlay3W_SetGroupConnectionSettings
,
1918 DirectPlay3W_StartSession
,
1919 DirectPlay3W_GetGroupFlags
,
1920 DirectPlay3W_GetGroupParent
,
1921 DirectPlay3W_GetPlayerAccount
,
1922 DirectPlay3W_GetPlayerFlags