-Fixed MESSAGE functions that were thunking down to 16 bits implementation.
[wine/dcerpc.git] / multimedia / dplay.c
blob281824a2b2595a3f85e4793a42814793ea928c8b
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 "heap.h"
9 #include "winerror.h"
10 #include "debug.h"
11 #include "winnt.h"
12 #include "winreg.h"
13 #include "dplay.h"
15 #include "thread.h"
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;
23 ULONG ref;
24 DWORD dwConnFlags;
25 DPSESSIONDESC2 sessionDesc;
26 DPNAME playerName;
27 GUID guidSP;
28 LPVOID lpAddress;
29 DWORD dwAddressSize;
32 struct IDirectPlayLobby2 {
33 LPDIRECTPLAYLOBBY2_VTABLE lpVtbl;
34 ULONG ref;
35 DWORD dwConnFlags;
36 DPSESSIONDESC2 lpSessionDesc;
37 DPNAME lpPlayerName;
38 GUID guidSP;
39 LPVOID lpAddress;
40 DWORD dwAddressSize;
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 directPlay2WVT;
52 static DIRECTPLAY2_VTABLE directPlay2AVT;
53 static DIRECTPLAY3_VTABLE directPlay3WVT;
54 static DIRECTPLAY3_VTABLE directPlay3AVT;
59 struct IDirectPlay2 {
60 LPDIRECTPLAY2_VTABLE lpVtbl;
61 ULONG ref;
64 struct IDirectPlay3 {
65 LPDIRECTPLAY3_VTABLE lpVtbl;
66 ULONG ref;
69 /* Routine called when starting up the server thread */
70 DWORD DPLobby_Spawn_Server( LPVOID startData )
72 DPSESSIONDESC2* lpSession = (DPSESSIONDESC2*) startData;
73 DWORD sessionDwFlags = lpSession->dwFlags;
75 TRACE( dplay, "spawing thread for lpConn=%p dwFlags=%08lx\n", lpSession, sessionDwFlags );
76 FIXME( dplay, "thread needs something to do\n" );
78 /*for(;;)*/
81 /* Check out the connection flags to determine what to do. Ensure we have
82 no leftover bits in this structure */
83 if( sessionDwFlags & DPSESSION_CLIENTSERVER )
85 /* This indicates that the application which is requesting the creation
86 * of this session is going to be the server (application/player)
87 */
88 if( sessionDwFlags & DPSESSION_SECURESERVER )
90 sessionDwFlags &= ~DPSESSION_SECURESERVER;
92 sessionDwFlags &= ~DPSESSION_CLIENTSERVER;
95 if( sessionDwFlags & DPSESSION_JOINDISABLED )
97 sessionDwFlags &= ~DPSESSION_JOINDISABLED;
100 if( sessionDwFlags & DPSESSION_KEEPALIVE )
102 sessionDwFlags &= ~DPSESSION_KEEPALIVE;
105 if( sessionDwFlags & DPSESSION_MIGRATEHOST )
107 sessionDwFlags &= ~DPSESSION_MIGRATEHOST;
110 if( sessionDwFlags & DPSESSION_MULTICASTSERVER )
112 sessionDwFlags &= ~DPSESSION_MULTICASTSERVER;
115 if( sessionDwFlags & DPSESSION_NEWPLAYERSDISABLED )
117 sessionDwFlags &= ~DPSESSION_NEWPLAYERSDISABLED;
120 if( sessionDwFlags & DPSESSION_NODATAMESSAGES )
122 sessionDwFlags &= ~DPSESSION_NODATAMESSAGES;
125 if( sessionDwFlags & DPSESSION_NOMESSAGEID )
127 sessionDwFlags &= ~DPSESSION_NOMESSAGEID;
130 if( sessionDwFlags & DPSESSION_PASSWORDREQUIRED )
132 sessionDwFlags &= ~DPSESSION_PASSWORDREQUIRED;
137 ExitThread(0);
138 return 0;
142 /*********************************************************
144 * Direct Play and Direct Play Lobby Interface Implementation
146 *********************************************************/
148 /* The COM interface for upversioning an interface
149 * We've been given a GUID (riid) and we need to replace the present
150 * interface with that of the requested interface.
152 * Snip from some Microsoft document:
153 * There are four requirements for implementations of QueryInterface (In these
154 * cases, "must succeed" means "must succeed barring catastrophic failure."):
156 * * The set of interfaces accessible on an object through
157 * IUnknown::QueryInterface must be static, not dynamic. This means that
158 * if a call to QueryInterface for a pointer to a specified interface
159 * succeeds the first time, it must succeed again, and if it fails the
160 * first time, it must fail on all subsequent queries.
161 * * It must be symmetric ~W if a client holds a pointer to an interface on
162 * an object, and queries for that interface, the call must succeed.
163 * * It must be reflexive ~W if a client holding a pointer to one interface
164 * queries successfully for another, a query through the obtained pointer
165 * for the first interface must succeed.
166 * * It must be transitive ~W if a client holding a pointer to one interface
167 * queries successfully for a second, and through that pointer queries
168 * successfully for a third interface, a query for the first interface
169 * through the pointer for the third interface must succeed.
171 * As you can see, this interface doesn't qualify but will most likely
172 * be good enough for the time being.
175 /* Helper function for DirectPlayLobby QueryInterface */
176 static HRESULT directPlayLobby_QueryInterface
177 ( REFIID riid, LPVOID* ppvObj )
180 if( IsEqualGUID( &IID_IDirectPlayLobby, riid ) )
182 LPDIRECTPLAYLOBBY lpDpL = (LPDIRECTPLAYLOBBY)(*ppvObj);
184 lpDpL = (LPDIRECTPLAYLOBBY)HeapAlloc( GetProcessHeap(), HEAP_ZERO_MEMORY,
185 sizeof( *lpDpL ) );
187 if( !lpDpL )
189 return E_NOINTERFACE;
192 lpDpL->lpVtbl = &directPlayLobbyWVT;
193 lpDpL->ref = 1;
195 return S_OK;
197 else if( IsEqualGUID( &IID_IDirectPlayLobbyA, riid ) )
199 LPDIRECTPLAYLOBBYA lpDpL = (LPDIRECTPLAYLOBBYA)(*ppvObj);
201 lpDpL = (LPDIRECTPLAYLOBBYA)HeapAlloc( GetProcessHeap(), HEAP_ZERO_MEMORY,
202 sizeof( *lpDpL ) );
204 if( !lpDpL )
206 return E_NOINTERFACE;
209 lpDpL->lpVtbl = &directPlayLobbyAVT;
210 lpDpL->ref = 1;
212 return S_OK;
214 else if( IsEqualGUID( &IID_IDirectPlayLobby2, riid ) )
216 LPDIRECTPLAYLOBBY2 lpDpL = (LPDIRECTPLAYLOBBY2)(*ppvObj);
218 lpDpL = (LPDIRECTPLAYLOBBY2)HeapAlloc( GetProcessHeap(), HEAP_ZERO_MEMORY,
219 sizeof( *lpDpL ) );
221 if( !lpDpL )
223 return E_NOINTERFACE;
226 lpDpL->lpVtbl = &directPlayLobby2WVT;
227 lpDpL->ref = 1;
229 return S_OK;
231 else if( IsEqualGUID( &IID_IDirectPlayLobby2A, riid ) )
233 LPDIRECTPLAYLOBBY2A lpDpL = (LPDIRECTPLAYLOBBY2A)(*ppvObj);
235 lpDpL = (LPDIRECTPLAYLOBBY2)HeapAlloc( GetProcessHeap(), HEAP_ZERO_MEMORY,
236 sizeof( *lpDpL ) );
238 if( !lpDpL )
240 return E_NOINTERFACE;
243 lpDpL->lpVtbl = &directPlayLobby2AVT;
244 lpDpL->ref = 1;
246 return S_OK;
249 /* Unknown interface */
250 *ppvObj = NULL;
251 return E_NOINTERFACE;
253 static HRESULT WINAPI IDirectPlayLobbyA_QueryInterface
254 ( LPDIRECTPLAYLOBBYA this,
255 REFIID riid,
256 LPVOID* ppvObj )
258 TRACE( dplay, "(%p)->(%p,%p)\n", this, riid, ppvObj );
260 if( IsEqualGUID( &IID_IUnknown, riid ) ||
261 IsEqualGUID( &IID_IDirectPlayLobbyA, riid )
264 this->lpVtbl->fnAddRef( this );
265 *ppvObj = this;
266 return S_OK;
269 return directPlayLobby_QueryInterface( riid, ppvObj );
273 static HRESULT WINAPI IDirectPlayLobbyW_QueryInterface
274 ( LPDIRECTPLAYLOBBY this,
275 REFIID riid,
276 LPVOID* ppvObj )
278 TRACE( dplay, "(%p)->(%p,%p)\n", this, riid, ppvObj );
280 if( IsEqualGUID( &IID_IUnknown, riid ) ||
281 IsEqualGUID( &IID_IDirectPlayLobby, riid )
284 this->lpVtbl->fnAddRef( this );
285 *ppvObj = this;
286 return S_OK;
289 return directPlayLobby_QueryInterface( riid, ppvObj );
293 static HRESULT WINAPI IDirectPlayLobby2A_QueryInterface
294 ( LPDIRECTPLAYLOBBY2A this,
295 REFIID riid,
296 LPVOID* ppvObj )
298 TRACE( dplay, "(%p)->(%p,%p)\n", this, riid, ppvObj );
300 /* Compare riids. We know this object is a direct play lobby 2A object.
301 If we are asking about the same type of interface we're fine.
303 if( IsEqualGUID( &IID_IUnknown, riid ) ||
304 IsEqualGUID( &IID_IDirectPlayLobby2A, riid )
307 this->lpVtbl->fnAddRef( this );
308 *ppvObj = this;
309 return S_OK;
311 return directPlayLobby_QueryInterface( riid, ppvObj );
314 static HRESULT WINAPI IDirectPlayLobby2W_QueryInterface
315 ( LPDIRECTPLAYLOBBY2 this,
316 REFIID riid,
317 LPVOID* ppvObj )
320 /* Compare riids. We know this object is a direct play lobby 2 object.
321 If we are asking about the same type of interface we're fine.
323 if( IsEqualGUID( &IID_IUnknown, riid ) ||
324 IsEqualGUID( &IID_IDirectPlayLobby2, riid )
327 this->lpVtbl->fnAddRef( this );
328 *ppvObj = this;
329 return S_OK;
332 return directPlayLobby_QueryInterface( riid, ppvObj );
337 * Simple procedure. Just increment the reference count to this
338 * structure and return the new reference count.
340 static ULONG WINAPI IDirectPlayLobby2A_AddRef
341 ( LPDIRECTPLAYLOBBY2A this )
343 ++(this->ref);
344 TRACE( dplay,"ref count now %lu\n", this->ref );
345 return (this->ref);
348 static ULONG WINAPI IDirectPlayLobby2W_AddRef
349 ( LPDIRECTPLAYLOBBY2 this )
351 return IDirectPlayLobby2A_AddRef( (LPDIRECTPLAYLOBBY2) this );
356 * Simple COM procedure. Decrease the reference count to this object.
357 * If the object no longer has any reference counts, free up the associated
358 * memory.
360 static ULONG WINAPI IDirectPlayLobby2A_Release
361 ( LPDIRECTPLAYLOBBY2A this )
363 TRACE( dplay, "ref count decremeneted from %lu\n", this->ref );
365 this->ref--;
367 /* Deallocate if this is the last reference to the object */
368 if( !(this->ref) )
370 FIXME( dplay, "memory leak\n" );
371 /* Implement memory deallocation */
373 HeapFree( GetProcessHeap(), 0, this );
375 return 0;
378 return this->ref;
381 static ULONG WINAPI IDirectPlayLobby2W_Release
382 ( LPDIRECTPLAYLOBBY2 this )
384 return IDirectPlayLobby2A_Release( (LPDIRECTPLAYLOBBY2A) this );
388 /********************************************************************
390 * Connects an application to the session specified by the DPLCONNECTION
391 * structure currently stored with the DirectPlayLobby object.
393 * Returns a IDirectPlay interface.
396 static HRESULT WINAPI IDirectPlayLobby2A_Connect
397 ( LPDIRECTPLAYLOBBY2A this,
398 DWORD dwFlags,
399 LPDIRECTPLAY2* lplpDP,
400 IUnknown* pUnk)
402 FIXME( dplay, ": dwFlags=%08lx %p %p stub\n", dwFlags, lplpDP, pUnk );
403 return DPERR_OUTOFMEMORY;
406 static HRESULT WINAPI IDirectPlayLobby2W_Connect
407 ( LPDIRECTPLAYLOBBY2 this,
408 DWORD dwFlags,
409 LPDIRECTPLAY2* lplpDP,
410 IUnknown* pUnk)
412 LPDIRECTPLAY2* directPlay2W;
413 HRESULT createRC;
415 FIXME( dplay, "(%p)->(%08lx,%p,%p): stub\n", this, dwFlags, lplpDP, pUnk );
417 if( dwFlags )
419 return DPERR_INVALIDPARAMS;
422 if( ( createRC = DirectPlayCreate( &IID_IDirectPlayLobby2, lplpDP, pUnk ) ) != DP_OK )
424 ERR( dplay, "error creating Direct Play 2W interface. Return Code = %ld.\n", createRC );
425 return createRC;
428 /* This should invoke IDirectPlay3::InitializeConnection IDirectPlay3::Open */
429 directPlay2W = lplpDP;
434 #if 0
435 /* All the stuff below this is WRONG! */
436 if( this->lpSession->dwFlags == DPLCONNECTION_CREATESESSION )
438 DWORD threadIdSink;
440 /* Spawn a thread to deal with all of this and to handle the incomming requests */
441 threadIdSink = CreateThread( NULL, 0, &DPLobby_Spawn_Server,
442 (LPVOID)this->lpSession->lpConn->lpSessionDesc, 0, &threadIdSink );
445 else if ( this->lpSession->dwFlags == DPLCONNECTION_JOINSESSION )
447 /* Let's search for a matching session */
448 FIXME( dplay, "joining session not yet supported.\n");
449 return DPERR_OUTOFMEMORY;
451 else /* Unknown type of connection request */
453 ERR( dplay, ": Unknown connection request lpConn->dwFlags=%08lx\n",
454 lpConn->dwFlags );
456 return DPERR_OUTOFMEMORY;
459 /* This does the work of the following methods...
460 IDirectPlay3::InitializeConnection,
461 IDirectPlay3::EnumSessions,
462 IDirectPlay3::Open
466 #endif
468 return DP_OK;
472 /********************************************************************
474 * Creates a DirectPlay Address, given a service provider-specific network
475 * address.
476 * Returns an address contains the globally unique identifier
477 * (GUID) of the service provider and data that the service provider can
478 * interpret as a network address.
481 static HRESULT WINAPI IDirectPlayLobby2A_CreateAddress
482 ( LPDIRECTPLAYLOBBY2A this,
483 REFGUID guidSP,
484 REFGUID guidDataType,
485 LPCVOID lpData,
486 DWORD dwDataSize,
487 LPVOID lpAddress,
488 LPDWORD lpdwAddressSize )
490 FIXME( dplay, ":stub\n");
491 return DPERR_OUTOFMEMORY;
494 static HRESULT WINAPI IDirectPlayLobby2W_CreateAddress
495 ( LPDIRECTPLAYLOBBY2 this,
496 REFGUID guidSP,
497 REFGUID guidDataType,
498 LPCVOID lpData,
499 DWORD dwDataSize,
500 LPVOID lpAddress,
501 LPDWORD lpdwAddressSize )
503 FIXME( dplay, ":stub\n");
504 return DPERR_OUTOFMEMORY;
508 /********************************************************************
510 * Parses out chunks from the DirectPlay Address buffer by calling the
511 * given callback function, with lpContext, for each of the chunks.
514 static HRESULT WINAPI IDirectPlayLobby2A_EnumAddress
515 ( LPDIRECTPLAYLOBBY2A this,
516 LPDPENUMADDRESSCALLBACK lpEnumAddressCallback,
517 LPCVOID lpAddress,
518 DWORD dwAddressSize,
519 LPVOID lpContext )
521 FIXME( dplay, ":stub\n");
522 return DPERR_OUTOFMEMORY;
525 static HRESULT WINAPI IDirectPlayLobby2W_EnumAddress
526 ( LPDIRECTPLAYLOBBY2 this,
527 LPDPENUMADDRESSCALLBACK lpEnumAddressCallback,
528 LPCVOID lpAddress,
529 DWORD dwAddressSize,
530 LPVOID lpContext )
532 FIXME( dplay, ":stub\n");
533 return DPERR_OUTOFMEMORY;
536 /********************************************************************
538 * Enumerates all the address types that a given service provider needs to
539 * build the DirectPlay Address.
542 static HRESULT WINAPI IDirectPlayLobbyA_EnumAddressTypes
543 ( LPDIRECTPLAYLOBBYA this,
544 LPDPLENUMADDRESSTYPESCALLBACK lpEnumAddressTypeCallback,
545 REFGUID guidSP,
546 LPVOID lpContext,
547 DWORD dwFlags )
549 FIXME( dplay, ":stub\n");
550 return DPERR_OUTOFMEMORY;
553 static HRESULT WINAPI IDirectPlayLobby2A_EnumAddressTypes
554 ( LPDIRECTPLAYLOBBY2A this,
555 LPDPLENUMADDRESSTYPESCALLBACK lpEnumAddressTypeCallback,
556 REFGUID guidSP,
557 LPVOID lpContext,
558 DWORD dwFlags )
560 return IDirectPlayLobbyA_EnumAddressTypes( (LPDIRECTPLAYLOBBYA)this, lpEnumAddressTypeCallback,
561 guidSP, lpContext, dwFlags );
564 static HRESULT WINAPI IDirectPlayLobby2W_EnumAddressTypes
565 ( LPDIRECTPLAYLOBBY2 this,
566 LPDPLENUMADDRESSTYPESCALLBACK lpEnumAddressTypeCallback,
567 REFGUID guidSP,
568 LPVOID lpContext,
569 DWORD dwFlags )
571 FIXME( dplay, ":stub\n");
572 return DPERR_OUTOFMEMORY;
575 /********************************************************************
577 * Enumerates what applications are registered with DirectPlay by
578 * invoking the callback function with lpContext.
581 static HRESULT WINAPI IDirectPlayLobbyW_EnumLocalApplications
582 ( LPDIRECTPLAYLOBBY this,
583 LPDPLENUMLOCALAPPLICATIONSCALLBACK a,
584 LPVOID lpContext,
585 DWORD dwFlags )
587 FIXME( dplay, ":stub\n");
588 return DPERR_OUTOFMEMORY;
591 static HRESULT WINAPI IDirectPlayLobby2W_EnumLocalApplications
592 ( LPDIRECTPLAYLOBBY2 this,
593 LPDPLENUMLOCALAPPLICATIONSCALLBACK a,
594 LPVOID lpContext,
595 DWORD dwFlags )
597 return IDirectPlayLobbyW_EnumLocalApplications( (LPDIRECTPLAYLOBBY)this, a,
598 lpContext, dwFlags );
601 static HRESULT WINAPI IDirectPlayLobbyA_EnumLocalApplications
602 ( LPDIRECTPLAYLOBBYA this,
603 LPDPLENUMLOCALAPPLICATIONSCALLBACK a,
604 LPVOID lpContext,
605 DWORD dwFlags )
607 FIXME( dplay, ":stub\n");
608 return DPERR_OUTOFMEMORY;
611 static HRESULT WINAPI IDirectPlayLobby2A_EnumLocalApplications
612 ( LPDIRECTPLAYLOBBY2A this,
613 LPDPLENUMLOCALAPPLICATIONSCALLBACK a,
614 LPVOID lpContext,
615 DWORD dwFlags )
617 return IDirectPlayLobbyA_EnumLocalApplications( (LPDIRECTPLAYLOBBYA)this, a,
618 lpContext, dwFlags );
622 /********************************************************************
624 * Retrieves the DPLCONNECTION structure that contains all the information
625 * needed to start and connect an application. This was generated using
626 * either the RunApplication or SetConnectionSettings methods.
628 * NOTES: If lpData is NULL then just return lpdwDataSize. This allows
629 * the data structure to be allocated by our caller which can then
630 * call this procedure/method again with a valid data pointer.
632 static HRESULT WINAPI IDirectPlayLobbyA_GetConnectionSettings
633 ( LPDIRECTPLAYLOBBYA this,
634 DWORD dwAppID,
635 LPVOID lpData,
636 LPDWORD lpdwDataSize )
638 LPDPLCONNECTION lpDplConnection;
640 FIXME( dplay, ": semi stub (%p)->(0x%08lx,%p,%p)\n", this, dwAppID, lpData, lpdwDataSize );
642 /* Application is requesting us to give the required size */
643 if ( !lpData )
645 /* Let's check the size of the buffer that the application has allocated */
646 if( *lpdwDataSize >= sizeof( DPLCONNECTION ) )
648 return DP_OK;
650 else
652 *lpdwDataSize = sizeof( DPLCONNECTION );
653 return DPERR_BUFFERTOOSMALL;
657 /* Fill in the fields - let them just use the ptrs */
658 lpDplConnection = (LPDPLCONNECTION)lpData;
660 /* Make sure we were given the right size */
661 if( lpDplConnection->dwSize < sizeof( DPLCONNECTION ) )
663 ERR( dplay, "bad passed size 0x%08lx.\n", lpDplConnection->dwSize );
664 return DPERR_INVALIDPARAMS;
667 /* Copy everything we've got into here */
668 /* Need to actually store the stuff here. Check if we've already allocated each field first. */
669 lpDplConnection->dwFlags = this->dwConnFlags;
671 /* Copy LPDPSESSIONDESC2 struct */
672 lpDplConnection->lpSessionDesc = HeapAlloc( GetProcessHeap(), HEAP_ZERO_MEMORY, sizeof( this->sessionDesc ) );
673 memcpy( lpDplConnection->lpSessionDesc, &(this->sessionDesc), sizeof( this->sessionDesc ) );
675 if( this->sessionDesc.sess.lpszSessionName )
677 lpDplConnection->lpSessionDesc->sess.lpszSessionName =
678 HEAP_strdupW( GetProcessHeap(), HEAP_ZERO_MEMORY, this->sessionDesc.sess.lpszSessionName );
681 if( this->sessionDesc.pass.lpszPassword )
683 lpDplConnection->lpSessionDesc->pass.lpszPassword =
684 HEAP_strdupW( GetProcessHeap(), HEAP_ZERO_MEMORY, this->sessionDesc.pass.lpszPassword );
687 /* I don't know what to use the reserved for. We'll set it to 0 just for fun */
688 this->sessionDesc.dwReserved1 = this->sessionDesc.dwReserved2 = 0;
690 /* Copy DPNAME struct - seems to be optional - check for existance first */
691 lpDplConnection->lpPlayerName = HeapAlloc( GetProcessHeap(), HEAP_ZERO_MEMORY, sizeof( this->playerName ) );
692 memcpy( lpDplConnection->lpPlayerName, &(this->playerName), sizeof( this->playerName ) );
694 if( this->playerName.psn.lpszShortName )
696 lpDplConnection->lpPlayerName->psn.lpszShortName =
697 HEAP_strdupW( GetProcessHeap(), HEAP_ZERO_MEMORY, this->playerName.psn.lpszShortName );
700 if( this->playerName.pln.lpszLongName )
702 lpDplConnection->lpPlayerName->pln.lpszLongName =
703 HEAP_strdupW( GetProcessHeap(), HEAP_ZERO_MEMORY, this->playerName.pln.lpszLongName );
708 memcpy( &(lpDplConnection->guidSP), &(this->guidSP), sizeof( this->guidSP ) );
710 lpDplConnection->lpAddress = HeapAlloc( GetProcessHeap(), HEAP_ZERO_MEMORY, this->dwAddressSize );
711 memcpy( lpDplConnection->lpAddress, this->lpAddress, this->dwAddressSize );
713 lpDplConnection->dwAddressSize = this->dwAddressSize;
715 return DP_OK;
718 static HRESULT WINAPI IDirectPlayLobby2A_GetConnectionSettings
719 ( LPDIRECTPLAYLOBBY2A this,
720 DWORD dwAppID,
721 LPVOID lpData,
722 LPDWORD lpdwDataSize )
724 return IDirectPlayLobbyA_GetConnectionSettings( (LPDIRECTPLAYLOBBYA)this,
725 dwAppID, lpData, lpdwDataSize );
728 static HRESULT WINAPI IDirectPlayLobbyW_GetConnectionSettings
729 ( LPDIRECTPLAYLOBBY this,
730 DWORD dwAppID,
731 LPVOID lpData,
732 LPDWORD lpdwDataSize )
734 FIXME( dplay, ":semi stub %p %08lx %p %p \n", this, dwAppID, lpData, lpdwDataSize );
736 /* Application is requesting us to give the required size */
737 if ( !lpData )
739 /* Let's check the size of the buffer that the application has allocated */
740 if( *lpdwDataSize >= sizeof( DPLCONNECTION ) )
742 return DP_OK;
744 else
746 *lpdwDataSize = sizeof( DPLCONNECTION );
747 return DPERR_BUFFERTOOSMALL;
751 /* Fill in the fields - let them just use the ptrs */
752 FIXME( dplay, "stub\n" );
754 return DP_OK;
757 static HRESULT WINAPI IDirectPlayLobby2W_GetConnectionSettings
758 ( LPDIRECTPLAYLOBBY2 this,
759 DWORD dwAppID,
760 LPVOID lpData,
761 LPDWORD lpdwDataSize )
763 return IDirectPlayLobbyW_GetConnectionSettings( (LPDIRECTPLAYLOBBY)this,
764 dwAppID, lpData, lpdwDataSize );
767 /********************************************************************
769 * Retrieves the message sent between a lobby client and a DirectPlay
770 * application. All messages are queued until received.
773 static HRESULT WINAPI IDirectPlayLobbyA_ReceiveLobbyMessage
774 ( LPDIRECTPLAYLOBBYA this,
775 DWORD dwFlags,
776 DWORD dwAppID,
777 LPDWORD lpdwMessageFlags,
778 LPVOID lpData,
779 LPDWORD lpdwDataSize )
781 FIXME( dplay, ":stub %p %08lx %08lx %p %p %p\n", this, dwFlags, dwAppID, lpdwMessageFlags, lpData,
782 lpdwDataSize );
783 return DPERR_OUTOFMEMORY;
786 static HRESULT WINAPI IDirectPlayLobby2A_ReceiveLobbyMessage
787 ( LPDIRECTPLAYLOBBY2A this,
788 DWORD dwFlags,
789 DWORD dwAppID,
790 LPDWORD lpdwMessageFlags,
791 LPVOID lpData,
792 LPDWORD lpdwDataSize )
794 return IDirectPlayLobbyA_ReceiveLobbyMessage( (LPDIRECTPLAYLOBBYA)this, dwFlags, dwAppID,
795 lpdwMessageFlags, lpData, lpdwDataSize );
799 static HRESULT WINAPI IDirectPlayLobbyW_ReceiveLobbyMessage
800 ( LPDIRECTPLAYLOBBY this,
801 DWORD dwFlags,
802 DWORD dwAppID,
803 LPDWORD lpdwMessageFlags,
804 LPVOID lpData,
805 LPDWORD lpdwDataSize )
807 FIXME( dplay, ":stub %p %08lx %08lx %p %p %p\n", this, dwFlags, dwAppID, lpdwMessageFlags, lpData,
808 lpdwDataSize );
809 return DPERR_OUTOFMEMORY;
812 static HRESULT WINAPI IDirectPlayLobby2W_ReceiveLobbyMessage
813 ( LPDIRECTPLAYLOBBY2 this,
814 DWORD dwFlags,
815 DWORD dwAppID,
816 LPDWORD lpdwMessageFlags,
817 LPVOID lpData,
818 LPDWORD lpdwDataSize )
820 return IDirectPlayLobbyW_ReceiveLobbyMessage( (LPDIRECTPLAYLOBBY)this, dwFlags, dwAppID,
821 lpdwMessageFlags, lpData, lpdwDataSize );
824 /********************************************************************
826 * Starts an application and passes to it all the information to
827 * connect to a session.
830 static HRESULT WINAPI IDirectPlayLobbyA_RunApplication
831 ( LPDIRECTPLAYLOBBYA this,
832 DWORD dwFlags,
833 LPDWORD lpdwAppID,
834 LPDPLCONNECTION lpConn,
835 HANDLE32 hReceiveEvent )
837 FIXME( dplay, ":stub\n");
838 return DPERR_OUTOFMEMORY;
841 static HRESULT WINAPI IDirectPlayLobby2A_RunApplication
842 ( LPDIRECTPLAYLOBBY2A this,
843 DWORD dwFlags,
844 LPDWORD lpdwAppID,
845 LPDPLCONNECTION lpConn,
846 HANDLE32 hReceiveEvent )
848 return IDirectPlayLobbyA_RunApplication( (LPDIRECTPLAYLOBBYA)this, dwFlags,
849 lpdwAppID, lpConn, hReceiveEvent );
852 static HRESULT WINAPI IDirectPlayLobbyW_RunApplication
853 ( LPDIRECTPLAYLOBBY this,
854 DWORD dwFlags,
855 LPDWORD lpdwAppID,
856 LPDPLCONNECTION lpConn,
857 HANDLE32 hReceiveEvent )
859 FIXME( dplay, ":stub\n");
860 return DPERR_OUTOFMEMORY;
863 static HRESULT WINAPI IDirectPlayLobby2W_RunApplication
864 ( LPDIRECTPLAYLOBBY2 this,
865 DWORD dwFlags,
866 LPDWORD lpdwAppID,
867 LPDPLCONNECTION lpConn,
868 HANDLE32 hReceiveEvent )
870 return IDirectPlayLobbyW_RunApplication( (LPDIRECTPLAYLOBBY)this, dwFlags,
871 lpdwAppID, lpConn, hReceiveEvent );
875 /********************************************************************
877 * Sends a message between the application and the lobby client.
878 * All messages are queued until received.
881 static HRESULT WINAPI IDirectPlayLobbyA_SendLobbyMessage
882 ( LPDIRECTPLAYLOBBYA this,
883 DWORD dwFlags,
884 DWORD dwAppID,
885 LPVOID lpData,
886 DWORD dwDataSize )
888 FIXME( dplay, ":stub\n");
889 return DPERR_OUTOFMEMORY;
892 static HRESULT WINAPI IDirectPlayLobby2A_SendLobbyMessage
893 ( LPDIRECTPLAYLOBBY2A this,
894 DWORD dwFlags,
895 DWORD dwAppID,
896 LPVOID lpData,
897 DWORD dwDataSize )
899 return IDirectPlayLobbyA_SendLobbyMessage( (LPDIRECTPLAYLOBBYA)this, dwFlags,
900 dwAppID, lpData, dwDataSize );
904 static HRESULT WINAPI IDirectPlayLobbyW_SendLobbyMessage
905 ( LPDIRECTPLAYLOBBY this,
906 DWORD dwFlags,
907 DWORD dwAppID,
908 LPVOID lpData,
909 DWORD dwDataSize )
911 FIXME( dplay, ":stub\n");
912 return DPERR_OUTOFMEMORY;
915 static HRESULT WINAPI IDirectPlayLobby2W_SendLobbyMessage
916 ( LPDIRECTPLAYLOBBY2 this,
917 DWORD dwFlags,
918 DWORD dwAppID,
919 LPVOID lpData,
920 DWORD dwDataSize )
922 return IDirectPlayLobbyW_SendLobbyMessage( (LPDIRECTPLAYLOBBY)this, dwFlags,
923 dwAppID, lpData, dwDataSize );
926 /********************************************************************
928 * Modifies the DPLCONNECTION structure to contain all information
929 * needed to start and connect an application.
932 static HRESULT WINAPI IDirectPlayLobbyW_SetConnectionSettings
933 ( LPDIRECTPLAYLOBBY this,
934 DWORD dwFlags,
935 DWORD dwAppID,
936 LPDPLCONNECTION lpConn )
938 TRACE( dplay, ": this=%p, dwFlags=%08lx, dwAppId=%08lx, lpConn=%p\n",
939 this, dwFlags, dwAppID, lpConn );
941 /* Paramater check */
942 if( dwFlags || !this || !lpConn )
944 ERR( dplay, "invalid parameters.\n");
945 return DPERR_INVALIDPARAMS;
948 /* See if there is a connection associated with this request.
949 * dwAppID == 0 indicates that this request isn't associated with a connection.
951 if( dwAppID )
953 FIXME( dplay, ": Connection dwAppID=%08lx given. Not implemented yet.\n",
954 dwAppID );
956 /* Need to add a check for this application Id...*/
957 return DPERR_NOTLOBBIED;
960 if( lpConn->dwSize != sizeof(DPLCONNECTION) )
962 ERR( dplay, ": old/new DPLCONNECTION type? Size=%08lx vs. expected=%ul bytes\n",
963 lpConn->dwSize, sizeof( DPLCONNECTION ) );
964 return DPERR_INVALIDPARAMS;
967 /* Need to investigate the lpConn->lpSessionDesc to figure out
968 * what type of session we need to join/create.
970 if( (!lpConn->lpSessionDesc ) ||
971 ( lpConn->lpSessionDesc->dwSize != sizeof( DPSESSIONDESC2 ) )
974 ERR( dplay, "DPSESSIONDESC passed in? Size=%08lx vs. expected=%ul bytes\n",
975 lpConn->lpSessionDesc->dwSize, sizeof( DPSESSIONDESC2 ) );
976 return DPERR_INVALIDPARAMS;
979 /* Need to actually store the stuff here. Check if we've already allocated each field first. */
980 this->dwConnFlags = lpConn->dwFlags;
982 /* Copy LPDPSESSIONDESC2 struct - this is required */
983 memcpy( &(this->sessionDesc), lpConn->lpSessionDesc, sizeof( *(lpConn->lpSessionDesc) ) );
985 if( lpConn->lpSessionDesc->sess.lpszSessionName )
986 this->sessionDesc.sess.lpszSessionName = HEAP_strdupW( GetProcessHeap(), HEAP_ZERO_MEMORY, lpConn->lpSessionDesc->sess.lpszSessionName );
987 else
988 this->sessionDesc.sess.lpszSessionName = NULL;
990 if( lpConn->lpSessionDesc->pass.lpszPassword )
991 this->sessionDesc.pass.lpszPassword = HEAP_strdupW( GetProcessHeap(), HEAP_ZERO_MEMORY, lpConn->lpSessionDesc->pass.lpszPassword );
992 else
993 this->sessionDesc.pass.lpszPassword = NULL;
995 /* I don't know what to use the reserved for ... */
996 this->sessionDesc.dwReserved1 = this->sessionDesc.dwReserved2 = 0;
998 /* Copy DPNAME struct - seems to be optional - check for existance first */
999 if( lpConn->lpPlayerName )
1001 memcpy( &(this->playerName), lpConn->lpPlayerName, sizeof( *lpConn->lpPlayerName ) );
1003 if( lpConn->lpPlayerName->psn.lpszShortName )
1004 this->playerName.psn.lpszShortName = HEAP_strdupW( GetProcessHeap(), HEAP_ZERO_MEMORY, lpConn->lpPlayerName->psn.lpszShortName );
1006 if( lpConn->lpPlayerName->pln.lpszLongName )
1007 this->playerName.pln.lpszLongName = HEAP_strdupW( GetProcessHeap(), HEAP_ZERO_MEMORY, lpConn->lpPlayerName->pln.lpszLongName );
1011 memcpy( &(this->guidSP), &(lpConn->guidSP), sizeof( lpConn->guidSP ) );
1013 this->lpAddress = HeapAlloc( GetProcessHeap(), HEAP_ZERO_MEMORY, lpConn->dwAddressSize );
1014 memcpy( this->lpAddress, lpConn->lpAddress, lpConn->dwAddressSize );
1016 this->dwAddressSize = lpConn->dwAddressSize;
1018 return DP_OK;
1021 static HRESULT WINAPI IDirectPlayLobby2W_SetConnectionSettings
1022 ( LPDIRECTPLAYLOBBY2 this,
1023 DWORD dwFlags,
1024 DWORD dwAppID,
1025 LPDPLCONNECTION lpConn )
1027 return IDirectPlayLobbyW_SetConnectionSettings( (LPDIRECTPLAYLOBBY)this,
1028 dwFlags, dwAppID, lpConn );
1031 static HRESULT WINAPI IDirectPlayLobbyA_SetConnectionSettings
1032 ( LPDIRECTPLAYLOBBYA this,
1033 DWORD dwFlags,
1034 DWORD dwAppID,
1035 LPDPLCONNECTION lpConn )
1037 FIXME( dplay, ": this=%p, dwFlags=%08lx, dwAppId=%08lx, lpConn=%p: stub\n",
1038 this, dwFlags, dwAppID, lpConn );
1039 return DPERR_OUTOFMEMORY;
1042 static HRESULT WINAPI IDirectPlayLobby2A_SetConnectionSettings
1043 ( LPDIRECTPLAYLOBBY2A this,
1044 DWORD dwFlags,
1045 DWORD dwAppID,
1046 LPDPLCONNECTION lpConn )
1048 return IDirectPlayLobbyA_SetConnectionSettings( (LPDIRECTPLAYLOBBYA)this,
1049 dwFlags, dwAppID, lpConn );
1052 /********************************************************************
1054 * Registers an event that will be set when a lobby message is received.
1057 static HRESULT WINAPI IDirectPlayLobbyA_SetLobbyMessageEvent
1058 ( LPDIRECTPLAYLOBBYA this,
1059 DWORD dwFlags,
1060 DWORD dwAppID,
1061 HANDLE32 hReceiveEvent )
1063 FIXME( dplay, ":stub\n");
1064 return DPERR_OUTOFMEMORY;
1067 static HRESULT WINAPI IDirectPlayLobby2A_SetLobbyMessageEvent
1068 ( LPDIRECTPLAYLOBBY2A this,
1069 DWORD dwFlags,
1070 DWORD dwAppID,
1071 HANDLE32 hReceiveEvent )
1073 return IDirectPlayLobbyA_SetLobbyMessageEvent( (LPDIRECTPLAYLOBBYA)this, dwFlags,
1074 dwAppID, hReceiveEvent );
1077 static HRESULT WINAPI IDirectPlayLobbyW_SetLobbyMessageEvent
1078 ( LPDIRECTPLAYLOBBY this,
1079 DWORD dwFlags,
1080 DWORD dwAppID,
1081 HANDLE32 hReceiveEvent )
1083 FIXME( dplay, ":stub\n");
1084 return DPERR_OUTOFMEMORY;
1087 static HRESULT WINAPI IDirectPlayLobby2W_SetLobbyMessageEvent
1088 ( LPDIRECTPLAYLOBBY2 this,
1089 DWORD dwFlags,
1090 DWORD dwAppID,
1091 HANDLE32 hReceiveEvent )
1093 return IDirectPlayLobbyW_SetLobbyMessageEvent( (LPDIRECTPLAYLOBBY)this, dwFlags,
1094 dwAppID, hReceiveEvent );
1098 /********************************************************************
1100 * Registers an event that will be set when a lobby message is received.
1103 static HRESULT WINAPI IDirectPlayLobby2W_CreateCompoundAddress
1104 ( LPDIRECTPLAYLOBBY2 this,
1105 LPCDPCOMPOUNDADDRESSELEMENT lpElements,
1106 DWORD dwElementCount,
1107 LPVOID lpAddress,
1108 LPDWORD lpdwAddressSize )
1110 FIXME( dplay, ":stub\n");
1111 return DPERR_OUTOFMEMORY;
1114 static HRESULT WINAPI IDirectPlayLobby2A_CreateCompoundAddress
1115 ( LPDIRECTPLAYLOBBY2A this,
1116 LPCDPCOMPOUNDADDRESSELEMENT lpElements,
1117 DWORD dwElementCount,
1118 LPVOID lpAddress,
1119 LPDWORD lpdwAddressSize )
1121 FIXME( dplay, ":stub\n");
1122 return DPERR_OUTOFMEMORY;
1126 /* Direct Play Lobby 1 (ascii) Virtual Table for methods */
1127 /* All lobby 1 methods are exactly the same except QueryInterface */
1128 static struct tagLPDIRECTPLAYLOBBY_VTABLE directPlayLobbyAVT = {
1129 IDirectPlayLobbyA_QueryInterface,
1130 (void*)IDirectPlayLobby2A_AddRef,
1131 (void*)IDirectPlayLobby2A_Release,
1132 (void*)IDirectPlayLobby2A_Connect,
1133 (void*)IDirectPlayLobby2A_CreateAddress,
1134 (void*)IDirectPlayLobby2A_EnumAddress,
1135 (void*)IDirectPlayLobby2A_EnumAddressTypes,
1136 (void*)IDirectPlayLobby2A_EnumLocalApplications,
1137 (void*)IDirectPlayLobby2A_GetConnectionSettings,
1138 (void*)IDirectPlayLobby2A_ReceiveLobbyMessage,
1139 (void*)IDirectPlayLobby2A_RunApplication,
1140 (void*)IDirectPlayLobby2A_SendLobbyMessage,
1141 (void*)IDirectPlayLobby2A_SetConnectionSettings,
1142 (void*)IDirectPlayLobby2A_SetLobbyMessageEvent
1145 /* Direct Play Lobby 1 (unicode) Virtual Table for methods */
1146 static struct tagLPDIRECTPLAYLOBBY_VTABLE directPlayLobbyWVT = {
1147 IDirectPlayLobbyW_QueryInterface,
1148 (void*)IDirectPlayLobby2W_AddRef,
1149 (void*)IDirectPlayLobby2W_Release,
1150 (void*)IDirectPlayLobby2W_Connect,
1151 (void*)IDirectPlayLobby2W_CreateAddress,
1152 (void*)IDirectPlayLobby2W_EnumAddress,
1153 (void*)IDirectPlayLobby2W_EnumAddressTypes,
1154 (void*)IDirectPlayLobby2W_EnumLocalApplications,
1155 (void*)IDirectPlayLobby2W_GetConnectionSettings,
1156 (void*)IDirectPlayLobby2W_ReceiveLobbyMessage,
1157 (void*)IDirectPlayLobby2W_RunApplication,
1158 (void*)IDirectPlayLobby2W_SendLobbyMessage,
1159 (void*)IDirectPlayLobby2W_SetConnectionSettings,
1160 (void*)IDirectPlayLobby2W_SetLobbyMessageEvent
1164 /* Direct Play Lobby 2 (ascii) Virtual Table for methods */
1165 static struct tagLPDIRECTPLAYLOBBY2_VTABLE directPlayLobby2AVT = {
1166 IDirectPlayLobby2A_QueryInterface,
1167 IDirectPlayLobby2A_AddRef,
1168 IDirectPlayLobby2A_Release,
1169 IDirectPlayLobby2A_Connect,
1170 IDirectPlayLobby2A_CreateAddress,
1171 IDirectPlayLobby2A_EnumAddress,
1172 IDirectPlayLobby2A_EnumAddressTypes,
1173 IDirectPlayLobby2A_EnumLocalApplications,
1174 IDirectPlayLobby2A_GetConnectionSettings,
1175 IDirectPlayLobby2A_ReceiveLobbyMessage,
1176 IDirectPlayLobby2A_RunApplication,
1177 IDirectPlayLobby2A_SendLobbyMessage,
1178 IDirectPlayLobby2A_SetConnectionSettings,
1179 IDirectPlayLobby2A_SetLobbyMessageEvent,
1180 IDirectPlayLobby2A_CreateCompoundAddress
1183 /* Direct Play Lobby 2 (unicode) Virtual Table for methods */
1184 static struct tagLPDIRECTPLAYLOBBY2_VTABLE directPlayLobby2WVT = {
1185 IDirectPlayLobby2W_QueryInterface,
1186 IDirectPlayLobby2W_AddRef,
1187 IDirectPlayLobby2W_Release,
1188 IDirectPlayLobby2W_Connect,
1189 IDirectPlayLobby2W_CreateAddress,
1190 IDirectPlayLobby2W_EnumAddress,
1191 IDirectPlayLobby2W_EnumAddressTypes,
1192 IDirectPlayLobby2W_EnumLocalApplications,
1193 IDirectPlayLobby2W_GetConnectionSettings,
1194 IDirectPlayLobby2W_ReceiveLobbyMessage,
1195 IDirectPlayLobby2W_RunApplication,
1196 IDirectPlayLobby2W_SendLobbyMessage,
1197 IDirectPlayLobby2W_SetConnectionSettings,
1198 IDirectPlayLobby2W_SetLobbyMessageEvent,
1199 IDirectPlayLobby2W_CreateCompoundAddress
1202 /***************************************************************************
1203 * DirectPlayLobbyCreateA (DPLAYX.4)
1206 HRESULT WINAPI DirectPlayLobbyCreateA( LPGUID lpGUIDDSP,
1207 LPDIRECTPLAYLOBBYA *lplpDPL,
1208 IUnknown *lpUnk,
1209 LPVOID lpData,
1210 DWORD dwDataSize )
1212 TRACE(dplay,"lpGUIDDSP=%p lplpDPL=%p lpUnk=%p lpData=%p dwDataSize=%08lx\n",
1213 lpGUIDDSP,lplpDPL,lpUnk,lpData,dwDataSize);
1215 /* Parameter Check: lpGUIDSP, lpUnk & lpData must be NULL. dwDataSize must
1216 * equal 0. These fields are mostly for future expansion.
1218 if ( lpGUIDDSP || lpUnk || lpData || dwDataSize )
1220 *lplpDPL = NULL;
1221 return DPERR_INVALIDPARAMS;
1224 /* Yes...really we should be returning a lobby 1 object */
1225 *lplpDPL = (LPDIRECTPLAYLOBBYA)HeapAlloc( GetProcessHeap(), HEAP_ZERO_MEMORY,
1226 sizeof( IDirectPlayLobbyA ) );
1228 if( ! (*lplpDPL) )
1230 return DPERR_OUTOFMEMORY;
1233 (*lplpDPL)->lpVtbl = &directPlayLobbyAVT;
1234 (*lplpDPL)->ref = 1;
1236 /* All fields were nulled out by the allocation */
1238 return DP_OK;
1241 /***************************************************************************
1242 * DirectPlayLobbyCreateW (DPLAYX.5)
1245 HRESULT WINAPI DirectPlayLobbyCreateW( LPGUID lpGUIDDSP,
1246 LPDIRECTPLAYLOBBY *lplpDPL,
1247 IUnknown *lpUnk,
1248 LPVOID lpData,
1249 DWORD dwDataSize )
1251 TRACE(dplay,"lpGUIDDSP=%p lplpDPL=%p lpUnk=%p lpData=%p dwDataSize=%08lx\n",
1252 lpGUIDDSP,lplpDPL,lpUnk,lpData,dwDataSize);
1254 /* Parameter Check: lpGUIDSP, lpUnk & lpData must be NULL. dwDataSize must
1255 * equal 0. These fields are mostly for future expansion.
1257 if ( lpGUIDDSP || lpUnk || lpData || dwDataSize )
1259 *lplpDPL = NULL;
1260 ERR( dplay, "Bad parameters!\n" );
1261 return DPERR_INVALIDPARAMS;
1264 /* Yes...really we should bre returning a lobby 1 object */
1265 *lplpDPL = (LPDIRECTPLAYLOBBY)HeapAlloc( GetProcessHeap(), HEAP_ZERO_MEMORY,
1266 sizeof( IDirectPlayLobby ) );
1268 if( !*lplpDPL)
1270 return DPERR_OUTOFMEMORY;
1273 (*lplpDPL)->lpVtbl = &directPlayLobbyWVT;
1274 (*lplpDPL)->ref = 1;
1276 /* All fields were nulled out by the allocation */
1278 return DP_OK;
1282 /***************************************************************************
1283 * DirectPlayEnumerateA (DPLAYX.2)
1285 * The pointer to the structure lpContext will be filled with the
1286 * appropriate data for each service offered by the OS. These services are
1287 * not necessarily available on this particular machine but are defined
1288 * as simple service providers under the "Service Providers" registry key.
1289 * This structure is then passed to lpEnumCallback for each of the different
1290 * services.
1292 * This API is useful only for applications written using DirectX3 or
1293 * worse. It is superceeded by IDirectPlay3::EnumConnections which also
1294 * gives information on the actual connections.
1296 * defn of a service provider:
1297 * A dynamic-link library used by DirectPlay to communicate over a network.
1298 * The service provider contains all the network-specific code required
1299 * to send and receive messages. Online services and network operators can
1300 * supply service providers to use specialized hardware, protocols, communications
1301 * media, and network resources.
1303 * TODO: Allocate string buffer space from the heap (length from reg)
1304 * Pass real device driver numbers...
1305 * Get the GUID properly...
1307 HRESULT WINAPI DirectPlayEnumerateA( LPDPENUMDPCALLBACKA lpEnumCallback,
1308 LPVOID lpContext )
1311 HKEY hkResult;
1312 LPCSTR searchSubKey = "SOFTWARE\\Microsoft\\DirectPlay\\Service Providers";
1313 LPSTR guidDataSubKey = "Guid";
1314 LPSTR majVerDataSubKey = "dwReserved1";
1315 DWORD dwIndex, sizeOfSubKeyName=50;
1316 char subKeyName[51];
1318 TRACE( dplay, ": lpEnumCallback=%p lpContext=%p\n", lpEnumCallback, lpContext );
1320 if( !lpEnumCallback || !*lpEnumCallback )
1322 return DPERR_INVALIDPARAMS;
1325 /* Need to loop over the service providers in the registry */
1326 if( RegOpenKeyEx32A( HKEY_LOCAL_MACHINE, searchSubKey,
1327 0, KEY_ENUMERATE_SUB_KEYS, &hkResult ) != ERROR_SUCCESS )
1329 /* Hmmm. Does this mean that there are no service providers? */
1330 ERR(dplay, ": no service providers?\n");
1331 return DP_OK;
1334 /* Traverse all the service providers we have available */
1335 for( dwIndex=0;
1336 RegEnumKey32A( hkResult, dwIndex, subKeyName, sizeOfSubKeyName ) !=
1337 ERROR_NO_MORE_ITEMS;
1338 ++dwIndex )
1340 HKEY hkServiceProvider;
1341 GUID serviceProviderGUID;
1342 DWORD returnTypeGUID, returnTypeReserved1, sizeOfReturnBuffer=50;
1343 char returnBuffer[51];
1344 DWORD majVersionNum /*, minVersionNum */;
1345 LPWSTR lpWGUIDString;
1347 TRACE( dplay, " this time through: %s\n", subKeyName );
1349 /* Get a handle for this particular service provider */
1350 if( RegOpenKeyEx32A( hkResult, subKeyName, 0, KEY_QUERY_VALUE,
1351 &hkServiceProvider ) != ERROR_SUCCESS )
1353 ERR( dplay, ": what the heck is going on?\n" );
1354 continue;
1357 /* Get the GUID, Device major number and device minor number
1358 * from the registry.
1360 if( RegQueryValueEx32A( hkServiceProvider, guidDataSubKey,
1361 NULL, &returnTypeGUID, returnBuffer,
1362 &sizeOfReturnBuffer ) != ERROR_SUCCESS )
1364 ERR( dplay, ": missing GUID registry data members\n" );
1365 continue;
1368 /* FIXME: Check return types to ensure we're interpreting data right */
1369 lpWGUIDString = HEAP_strdupAtoW( GetProcessHeap(), 0, returnBuffer );
1370 CLSIDFromString32( (LPCOLESTR32)lpWGUIDString, &serviceProviderGUID );
1371 HeapFree( GetProcessHeap(), 0, lpWGUIDString );
1373 sizeOfReturnBuffer = 50;
1375 if( RegQueryValueEx32A( hkServiceProvider, majVerDataSubKey,
1376 NULL, &returnTypeReserved1, returnBuffer,
1377 &sizeOfReturnBuffer ) != ERROR_SUCCESS )
1379 ERR( dplay, ": missing dwReserved1 registry data members\n") ;
1380 continue;
1382 /* FIXME: This couldn't possibly be right...*/
1383 majVersionNum = GET_DWORD( returnBuffer );
1385 /* The enumeration will return FALSE if we are not to continue */
1386 if( !lpEnumCallback( &serviceProviderGUID , subKeyName,
1387 majVersionNum, (DWORD)0, lpContext ) )
1389 WARN( dplay, "lpEnumCallback returning FALSE\n" );
1390 break;
1394 return DP_OK;
1398 /***************************************************************************
1399 * DirectPlayEnumerateW (DPLAYX.3)
1402 HRESULT WINAPI DirectPlayEnumerateW( LPDPENUMDPCALLBACKW lpEnumCallback, LPVOID lpContext )
1405 FIXME( dplay, ":stub\n");
1407 return DPERR_OUTOFMEMORY;
1411 /***************************************************************************
1412 * DirectPlayCreate (DPLAYX.1) (DPLAY.1)
1415 HRESULT WINAPI DirectPlayCreate
1416 ( LPGUID lpGUID, LPDIRECTPLAY2 *lplpDP, IUnknown *pUnk)
1419 TRACE(dplay,"lpGUID=%p lplpDP=%p pUnk=%p\n", lpGUID,lplpDP,pUnk);
1421 if( pUnk != NULL )
1423 /* Hmmm...wonder what this means! */
1424 ERR(dplay, "What does a NULL here mean?\n" );
1425 return DPERR_OUTOFMEMORY;
1428 if( IsEqualGUID( &IID_IDirectPlay2A, lpGUID ) )
1430 *lplpDP = (LPDIRECTPLAY2A)HeapAlloc( GetProcessHeap(), HEAP_ZERO_MEMORY,
1431 sizeof( **lplpDP ) );
1433 if( !*lplpDP )
1435 return DPERR_OUTOFMEMORY;
1438 (*lplpDP)->lpVtbl = &directPlay2AVT;
1439 (*lplpDP)->ref = 1;
1441 return DP_OK;
1443 else if( IsEqualGUID( &IID_IDirectPlay2, lpGUID ) )
1445 *lplpDP = (LPDIRECTPLAY2)HeapAlloc( GetProcessHeap(), HEAP_ZERO_MEMORY,
1446 sizeof( **lplpDP ) );
1448 if( !*lplpDP )
1450 return DPERR_OUTOFMEMORY;
1453 (*lplpDP)->lpVtbl = &directPlay2WVT;
1454 (*lplpDP)->ref = 1;
1456 return DP_OK;
1459 /* Unknown interface type */
1460 return DPERR_NOINTERFACE;
1464 /* Direct Play helper methods */
1466 /* Get a new interface. To be used by QueryInterface. */
1467 static HRESULT directPlay_QueryInterface
1468 ( REFIID riid, LPVOID* ppvObj )
1471 if( IsEqualGUID( &IID_IDirectPlay2, riid ) )
1473 LPDIRECTPLAY2 lpDP = (LPDIRECTPLAY2)*ppvObj;
1475 lpDP = (LPDIRECTPLAY2)HeapAlloc( GetProcessHeap(), HEAP_ZERO_MEMORY,
1476 sizeof( *lpDP ) );
1478 if( !lpDP )
1480 return DPERR_OUTOFMEMORY;
1483 lpDP->lpVtbl = &directPlay2WVT;
1484 lpDP->ref = 1;
1486 return S_OK;
1488 else if( IsEqualGUID( &IID_IDirectPlay2A, riid ) )
1490 LPDIRECTPLAY2A lpDP = (LPDIRECTPLAY2A)*ppvObj;
1492 lpDP = (LPDIRECTPLAY2A)HeapAlloc( GetProcessHeap(), HEAP_ZERO_MEMORY,
1493 sizeof( *lpDP ) );
1495 if( !lpDP )
1497 return DPERR_OUTOFMEMORY;
1500 lpDP->lpVtbl = &directPlay2AVT;
1501 lpDP->ref = 1;
1503 return S_OK;
1505 else if( IsEqualGUID( &IID_IDirectPlay3, riid ) )
1507 LPDIRECTPLAY3 lpDP = (LPDIRECTPLAY3)*ppvObj;
1509 lpDP = (LPDIRECTPLAY3)HeapAlloc( GetProcessHeap(), HEAP_ZERO_MEMORY,
1510 sizeof( *lpDP ) );
1512 if( !lpDP )
1514 return DPERR_OUTOFMEMORY;
1517 lpDP->lpVtbl = &directPlay3WVT;
1518 lpDP->ref = 1;
1520 return S_OK;
1522 else if( IsEqualGUID( &IID_IDirectPlay3A, riid ) )
1524 LPDIRECTPLAY3A lpDP = (LPDIRECTPLAY3A)*ppvObj;
1526 lpDP = (LPDIRECTPLAY3A)HeapAlloc( GetProcessHeap(), HEAP_ZERO_MEMORY,
1527 sizeof( *lpDP ) );
1529 if( !lpDP )
1531 return DPERR_OUTOFMEMORY;
1534 lpDP->lpVtbl = &directPlay3AVT;
1535 lpDP->ref = 1;
1537 return S_OK;
1541 *ppvObj = NULL;
1542 return E_NOINTERFACE;
1546 /* Direct Play methods */
1547 static HRESULT WINAPI DirectPlay2W_QueryInterface
1548 ( LPDIRECTPLAY2 this, REFIID riid, LPVOID* ppvObj )
1550 TRACE( dplay, "(%p)->(%p,%p)\n", this, riid, ppvObj );
1552 if( IsEqualGUID( &IID_IUnknown, riid ) ||
1553 IsEqualGUID( &IID_IDirectPlay2, riid )
1556 this->lpVtbl->fnAddRef( this );
1557 *ppvObj = this;
1558 return S_OK;
1560 return directPlay_QueryInterface( riid, ppvObj );
1563 static HRESULT WINAPI DirectPlay2A_QueryInterface
1564 ( LPDIRECTPLAY2A this, REFIID riid, LPVOID* ppvObj )
1566 TRACE( dplay, "(%p)->(%p,%p)\n", this, riid, ppvObj );
1568 if( IsEqualGUID( &IID_IUnknown, riid ) ||
1569 IsEqualGUID( &IID_IDirectPlay2A, riid )
1572 this->lpVtbl->fnAddRef( this );
1573 *ppvObj = this;
1574 return S_OK;
1577 return directPlay_QueryInterface( riid, ppvObj );
1580 static HRESULT WINAPI DirectPlay3W_QueryInterface
1581 ( LPDIRECTPLAY3 this, REFIID riid, LPVOID* ppvObj )
1583 TRACE( dplay, "(%p)->(%p,%p)\n", this, riid, ppvObj );
1585 if( IsEqualGUID( &IID_IUnknown, riid ) ||
1586 IsEqualGUID( &IID_IDirectPlay3, riid )
1589 this->lpVtbl->fnAddRef( this );
1590 *ppvObj = this;
1591 return S_OK;
1594 return directPlay_QueryInterface( riid, ppvObj );
1597 static HRESULT WINAPI DirectPlay3A_QueryInterface
1598 ( LPDIRECTPLAY3A this, REFIID riid, LPVOID* ppvObj )
1600 TRACE( dplay, "(%p)->(%p,%p)\n", this, riid, ppvObj );
1602 if( IsEqualGUID( &IID_IUnknown, riid ) ||
1603 IsEqualGUID( &IID_IDirectPlay3A, riid )
1606 this->lpVtbl->fnAddRef( this );
1607 *ppvObj = this;
1608 return S_OK;
1611 return directPlay_QueryInterface( riid, ppvObj );
1615 /* Shared between all dplay types */
1616 static ULONG WINAPI DirectPlay3W_AddRef
1617 ( LPDIRECTPLAY3 this )
1619 ++(this->ref);
1620 TRACE( dplay,"ref count now %lu\n", this->ref );
1621 return (this->ref);
1624 static ULONG WINAPI DirectPlay3W_Release
1625 ( LPDIRECTPLAY3 this )
1627 TRACE( dplay, "ref count decremeneted from %lu\n", this->ref );
1629 this->ref--;
1631 /* Deallocate if this is the last reference to the object */
1632 if( !(this->ref) )
1634 FIXME( dplay, "memory leak\n" );
1635 /* Implement memory deallocation */
1637 HeapFree( GetProcessHeap(), 0, this );
1639 return 0;
1642 return this->ref;
1645 static ULONG WINAPI DirectPlay3A_Release
1646 ( LPDIRECTPLAY3A this )
1648 TRACE( dplay, "ref count decremeneted from %lu\n", this->ref );
1650 this->ref--;
1652 /* Deallocate if this is the last reference to the object */
1653 if( !(this->ref) )
1655 FIXME( dplay, "memory leak\n" );
1656 /* Implement memory deallocation */
1658 HeapFree( GetProcessHeap(), 0, this );
1660 return 0;
1663 return this->ref;
1666 HRESULT WINAPI DirectPlay3A_AddPlayerToGroup
1667 ( LPDIRECTPLAY3A this, DPID a, DPID b )
1669 FIXME( dplay,"(%p)->(0x%08lx,0x%08lx): stub", this, a, b );
1670 return DP_OK;
1673 HRESULT WINAPI DirectPlay3W_AddPlayerToGroup
1674 ( LPDIRECTPLAY3 this, DPID a, DPID b )
1676 FIXME( dplay,"(%p)->(0x%08lx,0x%08lx): stub", this, a, b );
1677 return DP_OK;
1681 HRESULT WINAPI DirectPlay3A_Close
1682 ( LPDIRECTPLAY3A this )
1684 FIXME( dplay,"(%p)->(): stub", this );
1685 return DP_OK;
1688 HRESULT WINAPI DirectPlay3W_Close
1689 ( LPDIRECTPLAY3 this )
1691 FIXME( dplay,"(%p)->(): stub", this );
1692 return DP_OK;
1695 HRESULT WINAPI DirectPlay3A_CreateGroup
1696 ( LPDIRECTPLAY3A this, LPDPID a, LPDPNAME b, LPVOID c, DWORD d, DWORD e )
1698 FIXME( dplay,"(%p)->(%p,%p,%p,0x%08lx,0x%08lx): stub", this, a, b, c, d, e );
1699 return DP_OK;
1702 HRESULT WINAPI DirectPlay3W_CreateGroup
1703 ( LPDIRECTPLAY3 this, LPDPID a, LPDPNAME b, LPVOID c, DWORD d, DWORD e )
1705 FIXME( dplay,"(%p)->(%p,%p,%p,0x%08lx,0x%08lx): stub", this, a, b, c, d, e );
1706 return DP_OK;
1709 HRESULT WINAPI DirectPlay3A_CreatePlayer
1710 ( LPDIRECTPLAY3A this, LPDPID a, LPDPNAME b, HANDLE32 c, LPVOID d, DWORD e, DWORD f )
1712 FIXME( dplay,"(%p)->(%p,%p,%d,%p,0x%08lx,0x%08lx): stub", this, a, b, c, d, e, f );
1713 return DP_OK;
1716 HRESULT WINAPI DirectPlay3W_CreatePlayer
1717 ( LPDIRECTPLAY3 this, LPDPID a, LPDPNAME b, HANDLE32 c, LPVOID d, DWORD e, DWORD f )
1719 FIXME( dplay,"(%p)->(%p,%p,%d,%p,0x%08lx,0x%08lx): stub", this, a, b, c, d, e, f );
1720 return DP_OK;
1723 HRESULT WINAPI DirectPlay3A_DeletePlayerFromGroup
1724 ( LPDIRECTPLAY3A this, DPID a, DPID b )
1726 FIXME( dplay,"(%p)->(0x%08lx,0x%08lx): stub", this, a, b );
1727 return DP_OK;
1730 HRESULT WINAPI DirectPlay3W_DeletePlayerFromGroup
1731 ( LPDIRECTPLAY3 this, DPID a, DPID b )
1733 FIXME( dplay,"(%p)->(0x%08lx,0x%08lx): stub", this, a, b );
1734 return DP_OK;
1737 HRESULT WINAPI DirectPlay3A_DestroyGroup
1738 ( LPDIRECTPLAY3A this, DPID a )
1740 FIXME( dplay,"(%p)->(0x%08lx): stub", this, a );
1741 return DP_OK;
1744 HRESULT WINAPI DirectPlay3W_DestroyGroup
1745 ( LPDIRECTPLAY3 this, DPID a )
1747 FIXME( dplay,"(%p)->(0x%08lx): stub", this, a );
1748 return DP_OK;
1751 HRESULT WINAPI DirectPlay3A_DestroyPlayer
1752 ( LPDIRECTPLAY3A this, DPID a )
1754 FIXME( dplay,"(%p)->(0x%08lx): stub", this, a );
1755 return DP_OK;
1758 HRESULT WINAPI DirectPlay3W_DestroyPlayer
1759 ( LPDIRECTPLAY3 this, DPID a )
1761 FIXME( dplay,"(%p)->(0x%08lx): stub", this, a );
1762 return DP_OK;
1765 HRESULT WINAPI DirectPlay3A_EnumGroupPlayers
1766 ( LPDIRECTPLAY3A this, DPID a, LPGUID b, LPDPENUMPLAYERSCALLBACK2 c,
1767 LPVOID d, DWORD e )
1769 FIXME( dplay,"(%p)->(0x%08lx,%p,%p,%p,0x%08lx): stub", this, a, b, c, d, e );
1770 return DP_OK;
1773 HRESULT WINAPI DirectPlay3W_EnumGroupPlayers
1774 ( LPDIRECTPLAY3 this, DPID a, LPGUID b, LPDPENUMPLAYERSCALLBACK2 c,
1775 LPVOID d, DWORD e )
1777 FIXME( dplay,"(%p)->(0x%08lx,%p,%p,%p,0x%08lx): stub", this, a, b, c, d, e );
1778 return DP_OK;
1781 HRESULT WINAPI DirectPlay3A_EnumGroups
1782 ( LPDIRECTPLAY3A this, LPGUID a, LPDPENUMPLAYERSCALLBACK2 b, LPVOID c, DWORD d )
1784 FIXME( dplay,"(%p)->(%p,%p,%p,0x%08lx): stub", this, a, b, c, d );
1785 return DP_OK;
1788 HRESULT WINAPI DirectPlay3W_EnumGroups
1789 ( LPDIRECTPLAY3 this, LPGUID a, LPDPENUMPLAYERSCALLBACK2 b, LPVOID c, DWORD d )
1791 FIXME( dplay,"(%p)->(%p,%p,%p,0x%08lx): stub", this, a, b, c, d );
1792 return DP_OK;
1795 HRESULT WINAPI DirectPlay3A_EnumPlayers
1796 ( LPDIRECTPLAY3A this, LPGUID a, LPDPENUMPLAYERSCALLBACK2 b, LPVOID c, DWORD d )
1798 FIXME( dplay,"(%p)->(%p,%p,%p,0x%08lx): stub", this, a, b, c, d );
1799 return DP_OK;
1802 HRESULT WINAPI DirectPlay3W_EnumPlayers
1803 ( LPDIRECTPLAY3 this, LPGUID a, LPDPENUMPLAYERSCALLBACK2 b, LPVOID c, DWORD d )
1805 FIXME( dplay,"(%p)->(%p,%p,%p,0x%08lx): stub", this, a, b, c, d );
1806 return DP_OK;
1809 HRESULT WINAPI DirectPlay3A_EnumSessions
1810 ( LPDIRECTPLAY3A this, LPDPSESSIONDESC2 a, DWORD b, LPDPENUMSESSIONSCALLBACK2 c,
1811 LPVOID d, DWORD e )
1813 FIXME( dplay,"(%p)->(%p,0x%08lx,%p,%p,0x%08lx): stub", this, a, b, c, d, e );
1814 return DP_OK;
1817 HRESULT WINAPI DirectPlay3W_EnumSessions
1818 ( LPDIRECTPLAY3 this, LPDPSESSIONDESC2 a, DWORD b, LPDPENUMSESSIONSCALLBACK2 c,
1819 LPVOID d, DWORD e )
1821 FIXME( dplay,"(%p)->(%p,0x%08lx,%p,%p,0x%08lx): stub", this, a, b, c, d, e );
1822 return DP_OK;
1825 HRESULT WINAPI DirectPlay3A_GetCaps
1826 ( LPDIRECTPLAY3A this, LPDPCAPS a, DWORD b )
1828 FIXME( dplay,"(%p)->(%p,0x%08lx): stub", this, a, b );
1829 return DP_OK;
1832 HRESULT WINAPI DirectPlay3W_GetCaps
1833 ( LPDIRECTPLAY3 this, LPDPCAPS a, DWORD b )
1835 FIXME( dplay,"(%p)->(%p,0x%08lx): stub", this, a, b );
1836 return DP_OK;
1839 HRESULT WINAPI DirectPlay3A_GetGroupData
1840 ( LPDIRECTPLAY3 this, DPID a, LPVOID b, LPDWORD c, DWORD d )
1842 FIXME( dplay,"(%p)->(0x%08lx,%p,%p,0x%08lx): stub", this, a, b, c, d );
1843 return DP_OK;
1846 HRESULT WINAPI DirectPlay3W_GetGroupData
1847 ( LPDIRECTPLAY3 this, DPID a, LPVOID b, LPDWORD c, DWORD d )
1849 FIXME( dplay,"(%p)->(0x%08lx,%p,%p,0x%08lx): stub", this, a, b, c, d );
1850 return DP_OK;
1853 HRESULT WINAPI DirectPlay3A_GetGroupName
1854 ( LPDIRECTPLAY3A this, DPID a, LPVOID b, LPDWORD c )
1856 FIXME( dplay,"(%p)->(0x%08lx,%p,%p): stub", this, a, b, c );
1857 return DP_OK;
1860 HRESULT WINAPI DirectPlay3W_GetGroupName
1861 ( LPDIRECTPLAY3 this, DPID a, LPVOID b, LPDWORD c )
1863 FIXME( dplay,"(%p)->(0x%08lx,%p,%p): stub", this, a, b, c );
1864 return DP_OK;
1867 HRESULT WINAPI DirectPlay3A_GetMessageCount
1868 ( LPDIRECTPLAY3A this, DPID a, LPDWORD b )
1870 FIXME( dplay,"(%p)->(0x%08lx,%p): stub", this, a, b );
1871 return DP_OK;
1874 HRESULT WINAPI DirectPlay3W_GetMessageCount
1875 ( LPDIRECTPLAY3 this, DPID a, LPDWORD b )
1877 FIXME( dplay,"(%p)->(0x%08lx,%p): stub", this, a, b );
1878 return DP_OK;
1881 HRESULT WINAPI DirectPlay3A_GetPlayerAddress
1882 ( LPDIRECTPLAY3A this, DPID a, LPVOID b, LPDWORD c )
1884 FIXME( dplay,"(%p)->(0x%08lx,%p,%p): stub", this, a, b, c );
1885 return DP_OK;
1888 HRESULT WINAPI DirectPlay3W_GetPlayerAddress
1889 ( LPDIRECTPLAY3 this, DPID a, LPVOID b, LPDWORD c )
1891 FIXME( dplay,"(%p)->(0x%08lx,%p,%p): stub", this, a, b, c );
1892 return DP_OK;
1895 HRESULT WINAPI DirectPlay3A_GetPlayerCaps
1896 ( LPDIRECTPLAY3A this, DPID a, LPDPCAPS b, DWORD c )
1898 FIXME( dplay,"(%p)->(0x%08lx,%p,0x%08lx): stub", this, a, b, c );
1899 return DP_OK;
1902 HRESULT WINAPI DirectPlay3W_GetPlayerCaps
1903 ( LPDIRECTPLAY3 this, DPID a, LPDPCAPS b, DWORD c )
1905 FIXME( dplay,"(%p)->(0x%08lx,%p,0x%08lx): stub", this, a, b, c );
1906 return DP_OK;
1909 HRESULT WINAPI DirectPlay3A_GetPlayerData
1910 ( LPDIRECTPLAY3A this, DPID a, LPVOID b, LPDWORD c, DWORD d )
1912 FIXME( dplay,"(%p)->(0x%08lx,%p,%p,0x%08lx): stub", this, a, b, c, d );
1913 return DP_OK;
1916 HRESULT WINAPI DirectPlay3W_GetPlayerData
1917 ( LPDIRECTPLAY3 this, DPID a, LPVOID b, LPDWORD c, DWORD d )
1919 FIXME( dplay,"(%p)->(0x%08lx,%p,%p,0x%08lx): stub", this, a, b, c, d );
1920 return DP_OK;
1923 HRESULT WINAPI DirectPlay3A_GetPlayerName
1924 ( LPDIRECTPLAY3 this, DPID a, LPVOID b, LPDWORD c )
1926 FIXME( dplay,"(%p)->(0x%08lx,%p,%p): stub", this, a, b, c );
1927 return DP_OK;
1930 HRESULT WINAPI DirectPlay3W_GetPlayerName
1931 ( LPDIRECTPLAY3 this, DPID a, LPVOID b, LPDWORD c )
1933 FIXME( dplay,"(%p)->(0x%08lx,%p,%p): stub", this, a, b, c );
1934 return DP_OK;
1937 HRESULT WINAPI DirectPlay3A_GetSessionDesc
1938 ( LPDIRECTPLAY3A this, LPVOID a, LPDWORD b )
1940 FIXME( dplay,"(%p)->(%p,%p): stub", this, a, b );
1941 return DP_OK;
1944 HRESULT WINAPI DirectPlay3W_GetSessionDesc
1945 ( LPDIRECTPLAY3 this, LPVOID a, LPDWORD b )
1947 FIXME( dplay,"(%p)->(%p,%p): stub", this, a, b );
1948 return DP_OK;
1951 HRESULT WINAPI DirectPlay3A_Initialize
1952 ( LPDIRECTPLAY3A this, LPGUID a )
1954 FIXME( dplay,"(%p)->(%p): stub", this, a );
1955 return DP_OK;
1958 HRESULT WINAPI DirectPlay3W_Initialize
1959 ( LPDIRECTPLAY3 this, LPGUID a )
1961 FIXME( dplay,"(%p)->(%p): stub", this, a );
1962 return DP_OK;
1966 HRESULT WINAPI DirectPlay3A_Open
1967 ( LPDIRECTPLAY3A this, LPDPSESSIONDESC2 a, DWORD b )
1969 FIXME( dplay,"(%p)->(%p,0x%08lx): stub", this, a, b );
1970 return DP_OK;
1973 HRESULT WINAPI DirectPlay3W_Open
1974 ( LPDIRECTPLAY3 this, LPDPSESSIONDESC2 a, DWORD b )
1976 FIXME( dplay,"(%p)->(%p,0x%08lx): stub", this, a, b );
1977 return DP_OK;
1980 HRESULT WINAPI DirectPlay3A_Receive
1981 ( LPDIRECTPLAY3A this, LPDPID a, LPDPID b, DWORD c, LPVOID d, LPDWORD e )
1983 FIXME( dplay,"(%p)->(%p,%p,0x%08lx,%p,%p): stub", this, a, b, c, d, e );
1984 return DP_OK;
1987 HRESULT WINAPI DirectPlay3W_Receive
1988 ( LPDIRECTPLAY3 this, LPDPID a, LPDPID b, DWORD c, LPVOID d, LPDWORD e )
1990 FIXME( dplay,"(%p)->(%p,%p,0x%08lx,%p,%p): stub", this, a, b, c, d, e );
1991 return DP_OK;
1994 HRESULT WINAPI DirectPlay3A_Send
1995 ( LPDIRECTPLAY3A this, DPID a, DPID b, DWORD c, LPVOID d, DWORD e )
1997 FIXME( dplay,"(%p)->(0x%08lx,0x%08lx,0x%08lx,%p,0x%08lx): stub", this, a, b, c, d, e );
1998 return DP_OK;
2001 HRESULT WINAPI DirectPlay3W_Send
2002 ( LPDIRECTPLAY3 this, DPID a, DPID b, DWORD c, LPVOID d, DWORD e )
2004 FIXME( dplay,"(%p)->(0x%08lx,0x%08lx,0x%08lx,%p,0x%08lx): stub", this, a, b, c, d, e );
2005 return DP_OK;
2008 HRESULT WINAPI DirectPlay3A_SetGroupData
2009 ( LPDIRECTPLAY3A this, DPID a, LPVOID b, DWORD c, DWORD d )
2011 FIXME( dplay,"(%p)->(0x%08lx,%p,0x%08lx,0x%08lx): stub", this, a, b, c, d );
2012 return DP_OK;
2015 HRESULT WINAPI DirectPlay3W_SetGroupData
2016 ( LPDIRECTPLAY3 this, DPID a, LPVOID b, DWORD c, DWORD d )
2018 FIXME( dplay,"(%p)->(0x%08lx,%p,0x%08lx,0x%08lx): stub", this, a, b, c, d );
2019 return DP_OK;
2022 HRESULT WINAPI DirectPlay3A_SetGroupName
2023 ( LPDIRECTPLAY3A this, DPID a, LPDPNAME b, DWORD c )
2025 FIXME( dplay,"(%p)->(0x%08lx,%p,0x%08lx): stub", this, a, b, c );
2026 return DP_OK;
2029 HRESULT WINAPI DirectPlay3W_SetGroupName
2030 ( LPDIRECTPLAY3 this, DPID a, LPDPNAME b, DWORD c )
2032 FIXME( dplay,"(%p)->(0x%08lx,%p,0x%08lx): stub", this, a, b, c );
2033 return DP_OK;
2036 HRESULT WINAPI DirectPlay3A_SetPlayerData
2037 ( LPDIRECTPLAY3A this, DPID a, LPVOID b, DWORD c, DWORD d )
2039 FIXME( dplay,"(%p)->(0x%08lx,%p,0x%08lx,0x%08lx): stub", this, a, b, c, d );
2040 return DP_OK;
2043 HRESULT WINAPI DirectPlay3W_SetPlayerData
2044 ( LPDIRECTPLAY3 this, DPID a, LPVOID b, DWORD c, DWORD d )
2046 FIXME( dplay,"(%p)->(0x%08lx,%p,0x%08lx,0x%08lx): stub", this, a, b, c, d );
2047 return DP_OK;
2050 HRESULT WINAPI DirectPlay3A_SetPlayerName
2051 ( LPDIRECTPLAY3A this, DPID a, LPDPNAME b, DWORD c )
2053 FIXME( dplay,"(%p)->(0x%08lx,%p,0x%08lx): stub", this, a, b, c );
2054 return DP_OK;
2057 HRESULT WINAPI DirectPlay3W_SetPlayerName
2058 ( LPDIRECTPLAY3 this, DPID a, LPDPNAME b, DWORD c )
2060 FIXME( dplay,"(%p)->(0x%08lx,%p,0x%08lx): stub", this, a, b, c );
2061 return DP_OK;
2064 HRESULT WINAPI DirectPlay3A_SetSessionDesc
2065 ( LPDIRECTPLAY3A this, LPDPSESSIONDESC2 a, DWORD b )
2067 FIXME( dplay,"(%p)->(%p,0x%08lx): stub", this, a, b );
2068 return DP_OK;
2071 HRESULT WINAPI DirectPlay3W_SetSessionDesc
2072 ( LPDIRECTPLAY3 this, LPDPSESSIONDESC2 a, DWORD b )
2074 FIXME( dplay,"(%p)->(%p,0x%08lx): stub", this, a, b );
2075 return DP_OK;
2078 HRESULT WINAPI DirectPlay3A_AddGroupToGroup
2079 ( LPDIRECTPLAY3A this, DPID a, DPID b )
2081 FIXME( dplay,"(%p)->(0x%08lx,0x%08lx): stub", this, a, b );
2082 return DP_OK;
2085 HRESULT WINAPI DirectPlay3W_AddGroupToGroup
2086 ( LPDIRECTPLAY3 this, DPID a, DPID b )
2088 FIXME( dplay,"(%p)->(0x%08lx,0x%08lx): stub", this, a, b );
2089 return DP_OK;
2092 HRESULT WINAPI DirectPlay3A_CreateGroupInGroup
2093 ( LPDIRECTPLAY3A this, DPID a, LPDPID b, LPDPNAME c, LPVOID d, DWORD e, DWORD f )
2095 FIXME( dplay,"(%p)->(0x%08lx,%p,%p,%p,0x%08lx,0x%08lx): stub", this, a, b, c, d, e, f );
2096 return DP_OK;
2099 HRESULT WINAPI DirectPlay3W_CreateGroupInGroup
2100 ( LPDIRECTPLAY3 this, DPID a, LPDPID b, LPDPNAME c, LPVOID d, DWORD e, DWORD f )
2102 FIXME( dplay,"(%p)->(0x%08lx,%p,%p,%p,0x%08lx,0x%08lx): stub", this, a, b, c, d, e, f );
2103 return DP_OK;
2106 HRESULT WINAPI DirectPlay3A_DeleteGroupFromGroup
2107 ( LPDIRECTPLAY3A this, DPID a, DPID b )
2109 FIXME( dplay,"(%p)->(0x%08lx,0x%08lx): stub", this, a, b );
2110 return DP_OK;
2113 HRESULT WINAPI DirectPlay3W_DeleteGroupFromGroup
2114 ( LPDIRECTPLAY3 this, DPID a, DPID b )
2116 FIXME( dplay,"(%p)->(0x%08lx,0x%08lx): stub", this, a, b );
2117 return DP_OK;
2120 HRESULT WINAPI DirectPlay3A_EnumConnections
2121 ( LPDIRECTPLAY3A this, LPCGUID a, LPDPENUMCONNECTIONSCALLBACK b, LPVOID c, DWORD d )
2123 FIXME( dplay,"(%p)->(%p,%p,%p,0x%08lx): stub", this, a, b, c, d );
2124 return DP_OK;
2127 HRESULT WINAPI DirectPlay3W_EnumConnections
2128 ( LPDIRECTPLAY3 this, LPCGUID a, LPDPENUMCONNECTIONSCALLBACK b, LPVOID c, DWORD d )
2130 FIXME( dplay,"(%p)->(%p,%p,%p,0x%08lx): stub", this, a, b, c, d );
2131 return DP_OK;
2134 HRESULT WINAPI DirectPlay3A_EnumGroupsInGroup
2135 ( LPDIRECTPLAY3A this, DPID a, LPGUID b, LPDPENUMPLAYERSCALLBACK2 c, LPVOID d, DWORD e )
2137 FIXME( dplay,"(%p)->(0x%08lx,%p,%p,%p,0x%08lx): stub", this, a, b, c, d, e );
2138 return DP_OK;
2141 HRESULT WINAPI DirectPlay3W_EnumGroupsInGroup
2142 ( LPDIRECTPLAY3 this, DPID a, LPGUID b, LPDPENUMPLAYERSCALLBACK2 c, LPVOID d, DWORD e )
2144 FIXME( dplay,"(%p)->(0x%08lx,%p,%p,%p,0x%08lx): stub", this, a, b, c, d, e );
2145 return DP_OK;
2148 HRESULT WINAPI DirectPlay3A_GetGroupConnectionSettings
2149 ( LPDIRECTPLAY3A this, DWORD a, DPID b, LPVOID c, LPDWORD d )
2151 FIXME( dplay,"(%p)->(0x%08lx,0x%08lx,%p,%p): stub", this, a, b, c, d );
2152 return DP_OK;
2155 HRESULT WINAPI DirectPlay3W_GetGroupConnectionSettings
2156 ( LPDIRECTPLAY3 this, DWORD a, DPID b, LPVOID c, LPDWORD d )
2158 FIXME( dplay,"(%p)->(0x%08lx,0x%08lx,%p,%p): stub", this, a, b, c, d );
2159 return DP_OK;
2162 HRESULT WINAPI DirectPlay3A_InitializeConnection
2163 ( LPDIRECTPLAY3A this, LPVOID a, DWORD b )
2165 FIXME( dplay,"(%p)->(%p,0x%08lx): stub", this, a, b );
2166 return DP_OK;
2169 HRESULT WINAPI DirectPlay3W_InitializeConnection
2170 ( LPDIRECTPLAY3 this, LPVOID a, DWORD b )
2172 FIXME( dplay,"(%p)->(%p,0x%08lx): stub", this, a, b );
2173 return DP_OK;
2176 HRESULT WINAPI DirectPlay3A_SecureOpen
2177 ( LPDIRECTPLAY3A this, LPCDPSESSIONDESC2 a, DWORD b, LPCDPSECURITYDESC c, LPCDPCREDENTIALS d )
2179 FIXME( dplay,"(%p)->(%p,0x%08lx,%p,%p): stub", this, a, b, c, d );
2180 return DP_OK;
2183 HRESULT WINAPI DirectPlay3W_SecureOpen
2184 ( LPDIRECTPLAY3 this, LPCDPSESSIONDESC2 a, DWORD b, LPCDPSECURITYDESC c, LPCDPCREDENTIALS d )
2186 FIXME( dplay,"(%p)->(%p,0x%08lx,%p,%p): stub", this, a, b, c, d );
2187 return DP_OK;
2190 HRESULT WINAPI DirectPlay3A_SendChatMessage
2191 ( LPDIRECTPLAY3A this, DPID a, DPID b, DWORD c, LPDPCHAT d )
2193 FIXME( dplay,"(%p)->(0x%08lx,0x%08lx,0x%08lx,%p): stub", this, a, b, c, d );
2194 return DP_OK;
2197 HRESULT WINAPI DirectPlay3W_SendChatMessage
2198 ( LPDIRECTPLAY3 this, DPID a, DPID b, DWORD c, LPDPCHAT d )
2200 FIXME( dplay,"(%p)->(0x%08lx,0x%08lx,0x%08lx,%p): stub", this, a, b, c, d );
2201 return DP_OK;
2204 HRESULT WINAPI DirectPlay3A_SetGroupConnectionSettings
2205 ( LPDIRECTPLAY3A this, DWORD a, DPID b, LPDPLCONNECTION c )
2207 FIXME( dplay,"(%p)->(0x%08lx,0x%08lx,%p): stub", this, a, b, c );
2208 return DP_OK;
2211 HRESULT WINAPI DirectPlay3W_SetGroupConnectionSettings
2212 ( LPDIRECTPLAY3 this, DWORD a, DPID b, LPDPLCONNECTION c )
2214 FIXME( dplay,"(%p)->(0x%08lx,0x%08lx,%p): stub", this, a, b, c );
2215 return DP_OK;
2218 HRESULT WINAPI DirectPlay3A_StartSession
2219 ( LPDIRECTPLAY3A this, DWORD a, DPID b )
2221 FIXME( dplay,"(%p)->(0x%08lx,0x%08lx): stub", this, a, b );
2222 return DP_OK;
2225 HRESULT WINAPI DirectPlay3W_StartSession
2226 ( LPDIRECTPLAY3 this, DWORD a, DPID b )
2228 FIXME( dplay,"(%p)->(0x%08lx,0x%08lx): stub", this, a, b );
2229 return DP_OK;
2232 HRESULT WINAPI DirectPlay3A_GetGroupFlags
2233 ( LPDIRECTPLAY3A this, DPID a, LPDWORD b )
2235 FIXME( dplay,"(%p)->(0x%08lx,%p): stub", this, a, b );
2236 return DP_OK;
2239 HRESULT WINAPI DirectPlay3W_GetGroupFlags
2240 ( LPDIRECTPLAY3 this, DPID a, LPDWORD b )
2242 FIXME( dplay,"(%p)->(0x%08lx,%p): stub", this, a, b );
2243 return DP_OK;
2246 HRESULT WINAPI DirectPlay3A_GetGroupParent
2247 ( LPDIRECTPLAY3A this, DPID a, LPDPID b )
2249 FIXME( dplay,"(%p)->(0x%08lx,%p): stub", this, a, b );
2250 return DP_OK;
2253 HRESULT WINAPI DirectPlay3W_GetGroupParent
2254 ( LPDIRECTPLAY3 this, DPID a, LPDPID b )
2256 FIXME( dplay,"(%p)->(0x%08lx,%p): stub", this, a, b );
2257 return DP_OK;
2260 HRESULT WINAPI DirectPlay3A_GetPlayerAccount
2261 ( LPDIRECTPLAY3A this, DPID a, DWORD b, LPVOID c, LPDWORD d )
2263 FIXME( dplay,"(%p)->(0x%08lx,0x%08lx,%p,%p): stub", this, a, b, c, d );
2264 return DP_OK;
2267 HRESULT WINAPI DirectPlay3W_GetPlayerAccount
2268 ( LPDIRECTPLAY3 this, DPID a, DWORD b, LPVOID c, LPDWORD d )
2270 FIXME( dplay,"(%p)->(0x%08lx,0x%08lx,%p,%p): stub", this, a, b, c, d );
2271 return DP_OK;
2274 HRESULT WINAPI DirectPlay3A_GetPlayerFlags
2275 ( LPDIRECTPLAY3A this, DPID a, LPDWORD b )
2277 FIXME( dplay,"(%p)->(0x%08lx,%p): stub", this, a, b );
2278 return DP_OK;
2281 HRESULT WINAPI DirectPlay3W_GetPlayerFlags
2282 ( LPDIRECTPLAY3 this, DPID a, LPDWORD b )
2284 FIXME( dplay,"(%p)->(0x%08lx,%p): stub", this, a, b );
2285 return DP_OK;
2288 static struct tagLPDIRECTPLAY2_VTABLE directPlay2WVT = {
2289 DirectPlay2W_QueryInterface,
2290 (void*)DirectPlay3W_AddRef,
2291 (void*)DirectPlay3W_Release,
2292 (void*)DirectPlay3W_AddPlayerToGroup,
2293 (void*)DirectPlay3W_Close,
2294 (void*)DirectPlay3W_CreateGroup,
2295 (void*)DirectPlay3W_CreatePlayer,
2296 (void*)DirectPlay3W_DeletePlayerFromGroup,
2297 (void*)DirectPlay3W_DestroyGroup,
2298 (void*)DirectPlay3W_DestroyPlayer,
2299 (void*)DirectPlay3W_EnumGroupPlayers,
2300 (void*)DirectPlay3W_EnumGroups,
2301 (void*)DirectPlay3W_EnumPlayers,
2302 (void*)DirectPlay3W_EnumSessions,
2303 (void*)DirectPlay3W_GetCaps,
2304 (void*)DirectPlay3W_GetGroupData,
2305 (void*)DirectPlay3W_GetGroupName,
2306 (void*)DirectPlay3W_GetMessageCount,
2307 (void*)DirectPlay3W_GetPlayerAddress,
2308 (void*)DirectPlay3W_GetPlayerCaps,
2309 (void*)DirectPlay3W_GetPlayerData,
2310 (void*)DirectPlay3W_GetPlayerName,
2311 (void*)DirectPlay3W_GetSessionDesc,
2312 (void*)DirectPlay3W_Initialize,
2313 (void*)DirectPlay3W_Open,
2314 (void*)DirectPlay3W_Receive,
2315 (void*)DirectPlay3W_Send,
2316 (void*)DirectPlay3W_SetGroupData,
2317 (void*)DirectPlay3W_SetGroupName,
2318 (void*)DirectPlay3W_SetPlayerData,
2319 (void*)DirectPlay3W_SetPlayerName,
2320 (void*)DirectPlay3W_SetSessionDesc
2323 static struct tagLPDIRECTPLAY2_VTABLE directPlay2AVT = {
2324 DirectPlay2A_QueryInterface,
2325 (void*)DirectPlay3W_AddRef,
2326 (void*)DirectPlay3A_Release,
2327 (void*)DirectPlay3A_AddPlayerToGroup,
2328 (void*)DirectPlay3A_Close,
2329 (void*)DirectPlay3A_CreateGroup,
2330 (void*)DirectPlay3A_CreatePlayer,
2331 (void*)DirectPlay3A_DeletePlayerFromGroup,
2332 (void*)DirectPlay3A_DestroyGroup,
2333 (void*)DirectPlay3A_DestroyPlayer,
2334 (void*)DirectPlay3A_EnumGroupPlayers,
2335 (void*)DirectPlay3A_EnumGroups,
2336 (void*)DirectPlay3A_EnumPlayers,
2337 (void*)DirectPlay3A_EnumSessions,
2338 (void*)DirectPlay3A_GetCaps,
2339 (void*)DirectPlay3A_GetGroupData,
2340 (void*)DirectPlay3A_GetGroupName,
2341 (void*)DirectPlay3A_GetMessageCount,
2342 (void*)DirectPlay3A_GetPlayerAddress,
2343 (void*)DirectPlay3A_GetPlayerCaps,
2344 (void*)DirectPlay3A_GetPlayerData,
2345 (void*)DirectPlay3A_GetPlayerName,
2346 (void*)DirectPlay3A_GetSessionDesc,
2347 (void*)DirectPlay3A_Initialize,
2348 (void*)DirectPlay3A_Open,
2349 (void*)DirectPlay3A_Receive,
2350 (void*)DirectPlay3A_Send,
2351 (void*)DirectPlay3A_SetGroupData,
2352 (void*)DirectPlay3A_SetGroupName,
2353 (void*)DirectPlay3A_SetPlayerData,
2354 (void*)DirectPlay3A_SetPlayerName,
2355 (void*)DirectPlay3A_SetSessionDesc
2358 static struct tagLPDIRECTPLAY3_VTABLE directPlay3AVT = {
2359 DirectPlay3A_QueryInterface,
2360 (void*)DirectPlay3W_AddRef,
2361 DirectPlay3A_Release,
2362 DirectPlay3A_AddPlayerToGroup,
2363 DirectPlay3A_Close,
2364 DirectPlay3A_CreateGroup,
2365 DirectPlay3A_CreatePlayer,
2366 DirectPlay3A_DeletePlayerFromGroup,
2367 DirectPlay3A_DestroyGroup,
2368 DirectPlay3A_DestroyPlayer,
2369 DirectPlay3A_EnumGroupPlayers,
2370 DirectPlay3A_EnumGroups,
2371 DirectPlay3A_EnumPlayers,
2372 DirectPlay3A_EnumSessions,
2373 DirectPlay3A_GetCaps,
2374 DirectPlay3A_GetGroupData,
2375 DirectPlay3A_GetGroupName,
2376 DirectPlay3A_GetMessageCount,
2377 DirectPlay3A_GetPlayerAddress,
2378 DirectPlay3A_GetPlayerCaps,
2379 DirectPlay3A_GetPlayerData,
2380 DirectPlay3A_GetPlayerName,
2381 DirectPlay3A_GetSessionDesc,
2382 DirectPlay3A_Initialize,
2383 DirectPlay3A_Open,
2384 DirectPlay3A_Receive,
2385 DirectPlay3A_Send,
2386 DirectPlay3A_SetGroupData,
2387 DirectPlay3A_SetGroupName,
2388 DirectPlay3A_SetPlayerData,
2389 DirectPlay3A_SetPlayerName,
2390 DirectPlay3A_SetSessionDesc,
2392 DirectPlay3A_AddGroupToGroup,
2393 DirectPlay3A_CreateGroupInGroup,
2394 DirectPlay3A_DeleteGroupFromGroup,
2395 DirectPlay3A_EnumConnections,
2396 DirectPlay3A_EnumGroupsInGroup,
2397 DirectPlay3A_GetGroupConnectionSettings,
2398 DirectPlay3A_InitializeConnection,
2399 DirectPlay3A_SecureOpen,
2400 DirectPlay3A_SendChatMessage,
2401 DirectPlay3A_SetGroupConnectionSettings,
2402 DirectPlay3A_StartSession,
2403 DirectPlay3A_GetGroupFlags,
2404 DirectPlay3A_GetGroupParent,
2405 DirectPlay3A_GetPlayerAccount,
2406 DirectPlay3A_GetPlayerFlags
2409 static struct tagLPDIRECTPLAY3_VTABLE directPlay3WVT = {
2410 DirectPlay3W_QueryInterface,
2411 DirectPlay3W_AddRef,
2412 DirectPlay3W_Release,
2413 DirectPlay3W_AddPlayerToGroup,
2414 DirectPlay3W_Close,
2415 DirectPlay3W_CreateGroup,
2416 DirectPlay3W_CreatePlayer,
2417 DirectPlay3W_DeletePlayerFromGroup,
2418 DirectPlay3W_DestroyGroup,
2419 DirectPlay3W_DestroyPlayer,
2420 DirectPlay3W_EnumGroupPlayers,
2421 DirectPlay3W_EnumGroups,
2422 DirectPlay3W_EnumPlayers,
2423 DirectPlay3W_EnumSessions,
2424 DirectPlay3W_GetCaps,
2425 DirectPlay3W_GetGroupData,
2426 DirectPlay3W_GetGroupName,
2427 DirectPlay3W_GetMessageCount,
2428 DirectPlay3W_GetPlayerAddress,
2429 DirectPlay3W_GetPlayerCaps,
2430 DirectPlay3W_GetPlayerData,
2431 DirectPlay3W_GetPlayerName,
2432 DirectPlay3W_GetSessionDesc,
2433 DirectPlay3W_Initialize,
2434 DirectPlay3W_Open,
2435 DirectPlay3W_Receive,
2436 DirectPlay3W_Send,
2437 DirectPlay3W_SetGroupData,
2438 DirectPlay3W_SetGroupName,
2439 DirectPlay3W_SetPlayerData,
2440 DirectPlay3W_SetPlayerName,
2441 DirectPlay3W_SetSessionDesc,
2443 DirectPlay3W_AddGroupToGroup,
2444 DirectPlay3W_CreateGroupInGroup,
2445 DirectPlay3W_DeleteGroupFromGroup,
2446 DirectPlay3W_EnumConnections,
2447 DirectPlay3W_EnumGroupsInGroup,
2448 DirectPlay3W_GetGroupConnectionSettings,
2449 DirectPlay3W_InitializeConnection,
2450 DirectPlay3W_SecureOpen,
2451 DirectPlay3W_SendChatMessage,
2452 DirectPlay3W_SetGroupConnectionSettings,
2453 DirectPlay3W_StartSession,
2454 DirectPlay3W_GetGroupFlags,
2455 DirectPlay3W_GetGroupParent,
2456 DirectPlay3W_GetPlayerAccount,
2457 DirectPlay3W_GetPlayerFlags