2001-04-12 23:10:54 +02:00
|
|
|
/* This contains the implementation of the Lobby Service
|
|
|
|
* Providers interface required to communicate with Direct Play
|
|
|
|
*
|
2003-09-29 22:12:05 +02:00
|
|
|
* Copyright 2001 Peter Hunnisett
|
2002-03-10 00:29:33 +01:00
|
|
|
*
|
|
|
|
* This library is free software; you can redistribute it and/or
|
|
|
|
* modify it under the terms of the GNU Lesser General Public
|
|
|
|
* License as published by the Free Software Foundation; either
|
|
|
|
* version 2.1 of the License, or (at your option) any later version.
|
|
|
|
*
|
|
|
|
* This library is distributed in the hope that it will be useful,
|
|
|
|
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
|
|
|
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
|
|
|
|
* Lesser General Public License for more details.
|
|
|
|
*
|
|
|
|
* You should have received a copy of the GNU Lesser General Public
|
|
|
|
* License along with this library; if not, write to the Free Software
|
2006-05-18 14:49:52 +02:00
|
|
|
* Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA
|
2001-04-12 23:10:54 +02:00
|
|
|
*/
|
|
|
|
|
|
|
|
#include "winerror.h"
|
2002-03-10 00:29:33 +01:00
|
|
|
#include "wine/debug.h"
|
2001-04-12 23:10:54 +02:00
|
|
|
|
|
|
|
#include "lobbysp.h"
|
|
|
|
#include "dplay_global.h"
|
|
|
|
|
2002-03-10 00:29:33 +01:00
|
|
|
WINE_DEFAULT_DEBUG_CHANNEL(dplay);
|
2001-04-12 23:10:54 +02:00
|
|
|
|
2013-09-03 23:22:44 +02:00
|
|
|
typedef struct IDPLobbySPImpl
|
2001-04-12 23:10:54 +02:00
|
|
|
{
|
2013-09-03 23:23:19 +02:00
|
|
|
IDPLobbySP IDPLobbySP_iface;
|
2013-09-03 23:20:21 +02:00
|
|
|
LONG ref;
|
2013-09-03 23:22:44 +02:00
|
|
|
IDirectPlayImpl *dplay;
|
|
|
|
} IDPLobbySPImpl;
|
2001-04-12 23:10:54 +02:00
|
|
|
|
2013-09-03 23:18:26 +02:00
|
|
|
static inline IDPLobbySPImpl *impl_from_IDPLobbySP(IDPLobbySP *iface)
|
|
|
|
{
|
2013-09-03 23:23:19 +02:00
|
|
|
return CONTAINING_RECORD(iface, IDPLobbySPImpl, IDPLobbySP_iface);
|
2013-09-03 23:18:26 +02:00
|
|
|
}
|
|
|
|
|
2013-09-03 23:17:09 +02:00
|
|
|
static HRESULT WINAPI IDPLobbySPImpl_QueryInterface( IDPLobbySP *iface, REFIID riid,
|
2013-09-03 23:20:21 +02:00
|
|
|
void **ppv )
|
2001-04-12 23:10:54 +02:00
|
|
|
{
|
2013-09-03 23:20:21 +02:00
|
|
|
TRACE("(%p)->(%s,%p)\n", iface, debugstr_guid( riid ), ppv );
|
2001-04-12 23:10:54 +02:00
|
|
|
|
2013-09-03 23:20:21 +02:00
|
|
|
if ( IsEqualGUID( &IID_IUnknown, riid ) || IsEqualGUID( &IID_IDPLobbySP, riid ) )
|
2001-04-12 23:10:54 +02:00
|
|
|
{
|
2013-09-03 23:20:21 +02:00
|
|
|
*ppv = iface;
|
|
|
|
IDPLobbySP_AddRef(iface);
|
|
|
|
return S_OK;
|
2001-04-12 23:10:54 +02:00
|
|
|
}
|
|
|
|
|
2013-09-03 23:20:21 +02:00
|
|
|
FIXME("Unsupported interface %s\n", debugstr_guid(riid));
|
|
|
|
*ppv = NULL;
|
|
|
|
return E_NOINTERFACE;
|
2001-04-12 23:10:54 +02:00
|
|
|
}
|
|
|
|
|
2013-09-03 23:17:09 +02:00
|
|
|
static ULONG WINAPI IDPLobbySPImpl_AddRef( IDPLobbySP *iface )
|
2001-04-12 23:10:54 +02:00
|
|
|
{
|
2013-09-03 23:18:26 +02:00
|
|
|
IDPLobbySPImpl *This = impl_from_IDPLobbySP( iface );
|
2013-09-03 23:20:21 +02:00
|
|
|
ULONG ref = InterlockedIncrement( &This->ref );
|
2001-04-12 23:10:54 +02:00
|
|
|
|
2013-09-03 23:20:21 +02:00
|
|
|
TRACE( "(%p) ref=%d\n", This, ref );
|
2001-04-12 23:10:54 +02:00
|
|
|
|
2013-09-03 23:20:21 +02:00
|
|
|
return ref;
|
2001-04-12 23:10:54 +02:00
|
|
|
}
|
|
|
|
|
2013-09-03 23:17:09 +02:00
|
|
|
static ULONG WINAPI IDPLobbySPImpl_Release( IDPLobbySP *iface )
|
2001-04-12 23:10:54 +02:00
|
|
|
{
|
2013-09-03 23:18:26 +02:00
|
|
|
IDPLobbySPImpl *This = impl_from_IDPLobbySP( iface );
|
2013-09-03 23:20:21 +02:00
|
|
|
ULONG ref = InterlockedDecrement( &This->ref );
|
2001-04-12 23:10:54 +02:00
|
|
|
|
2013-09-03 23:20:21 +02:00
|
|
|
TRACE( "(%p) ref=%d\n", This, ref );
|
2001-04-12 23:10:54 +02:00
|
|
|
|
2013-09-03 23:20:21 +02:00
|
|
|
if( !ref )
|
2001-04-12 23:10:54 +02:00
|
|
|
HeapFree( GetProcessHeap(), 0, This );
|
|
|
|
|
2013-09-03 23:20:21 +02:00
|
|
|
return ref;
|
2001-04-12 23:10:54 +02:00
|
|
|
}
|
|
|
|
|
2013-09-03 23:18:26 +02:00
|
|
|
static HRESULT WINAPI IDPLobbySPImpl_AddGroupToGroup( IDPLobbySP *iface,
|
|
|
|
SPDATA_ADDREMOTEGROUPTOGROUP *argtg )
|
2001-04-12 23:10:54 +02:00
|
|
|
{
|
2013-09-03 23:18:26 +02:00
|
|
|
IDPLobbySPImpl *This = impl_from_IDPLobbySP( iface );
|
2001-04-12 23:10:54 +02:00
|
|
|
FIXME( "(%p)->(%p):stub\n", This, argtg );
|
|
|
|
return DP_OK;
|
|
|
|
}
|
|
|
|
|
2013-09-03 23:18:26 +02:00
|
|
|
static HRESULT WINAPI IDPLobbySPImpl_AddPlayerToGroup( IDPLobbySP *iface,
|
|
|
|
SPDATA_ADDREMOTEPLAYERTOGROUP *arptg )
|
2001-04-12 23:10:54 +02:00
|
|
|
{
|
2013-09-03 23:18:26 +02:00
|
|
|
IDPLobbySPImpl *This = impl_from_IDPLobbySP( iface );
|
2001-04-12 23:10:54 +02:00
|
|
|
FIXME( "(%p)->(%p):stub\n", This, arptg );
|
|
|
|
return DP_OK;
|
|
|
|
}
|
|
|
|
|
2013-09-03 23:18:26 +02:00
|
|
|
static HRESULT WINAPI IDPLobbySPImpl_CreateGroup( IDPLobbySP *iface,
|
|
|
|
SPDATA_CREATEREMOTEGROUP *crg )
|
2001-04-12 23:10:54 +02:00
|
|
|
{
|
2013-09-03 23:18:26 +02:00
|
|
|
IDPLobbySPImpl *This = impl_from_IDPLobbySP( iface );
|
2001-04-12 23:10:54 +02:00
|
|
|
FIXME( "(%p)->(%p):stub\n", This, crg );
|
|
|
|
return DP_OK;
|
|
|
|
}
|
|
|
|
|
2013-09-03 23:18:26 +02:00
|
|
|
static HRESULT WINAPI IDPLobbySPImpl_CreateGroupInGroup( IDPLobbySP *iface,
|
|
|
|
SPDATA_CREATEREMOTEGROUPINGROUP *crgig )
|
2001-04-12 23:10:54 +02:00
|
|
|
{
|
2013-09-03 23:18:26 +02:00
|
|
|
IDPLobbySPImpl *This = impl_from_IDPLobbySP( iface );
|
2001-04-12 23:10:54 +02:00
|
|
|
FIXME( "(%p)->(%p):stub\n", This, crgig );
|
|
|
|
return DP_OK;
|
|
|
|
}
|
|
|
|
|
2013-09-03 23:18:26 +02:00
|
|
|
static HRESULT WINAPI IDPLobbySPImpl_DeleteGroupFromGroup( IDPLobbySP *iface,
|
|
|
|
SPDATA_DELETEREMOTEGROUPFROMGROUP *drgfg )
|
2001-04-12 23:10:54 +02:00
|
|
|
{
|
2013-09-03 23:18:26 +02:00
|
|
|
IDPLobbySPImpl *This = impl_from_IDPLobbySP( iface );
|
2001-04-12 23:10:54 +02:00
|
|
|
FIXME( "(%p)->(%p):stub\n", This, drgfg );
|
|
|
|
return DP_OK;
|
|
|
|
}
|
|
|
|
|
2013-09-03 23:18:26 +02:00
|
|
|
static HRESULT WINAPI IDPLobbySPImpl_DeletePlayerFromGroup( IDPLobbySP *iface,
|
|
|
|
SPDATA_DELETEREMOTEPLAYERFROMGROUP *drpfg )
|
2001-04-12 23:10:54 +02:00
|
|
|
{
|
2013-09-03 23:18:26 +02:00
|
|
|
IDPLobbySPImpl *This = impl_from_IDPLobbySP( iface );
|
2001-04-12 23:10:54 +02:00
|
|
|
FIXME( "(%p)->(%p):stub\n", This, drpfg );
|
|
|
|
return DP_OK;
|
|
|
|
}
|
|
|
|
|
2013-09-03 23:18:26 +02:00
|
|
|
static HRESULT WINAPI IDPLobbySPImpl_DestroyGroup( IDPLobbySP *iface,
|
|
|
|
SPDATA_DESTROYREMOTEGROUP *drg )
|
2001-04-12 23:10:54 +02:00
|
|
|
{
|
2013-09-03 23:18:26 +02:00
|
|
|
IDPLobbySPImpl *This = impl_from_IDPLobbySP( iface );
|
2001-04-12 23:10:54 +02:00
|
|
|
FIXME( "(%p)->(%p):stub\n", This, drg );
|
|
|
|
return DP_OK;
|
|
|
|
}
|
|
|
|
|
2013-09-03 23:18:26 +02:00
|
|
|
static HRESULT WINAPI IDPLobbySPImpl_EnumSessionsResponse( IDPLobbySP *iface,
|
|
|
|
SPDATA_ENUMSESSIONSRESPONSE *er )
|
2001-04-12 23:10:54 +02:00
|
|
|
{
|
2013-09-03 23:18:26 +02:00
|
|
|
IDPLobbySPImpl *This = impl_from_IDPLobbySP( iface );
|
2001-04-12 23:10:54 +02:00
|
|
|
FIXME( "(%p)->(%p):stub\n", This, er );
|
|
|
|
return DP_OK;
|
|
|
|
}
|
|
|
|
|
2013-09-03 23:18:26 +02:00
|
|
|
static HRESULT WINAPI IDPLobbySPImpl_GetSPDataPointer( IDPLobbySP *iface, LPVOID* lplpData )
|
2001-04-12 23:10:54 +02:00
|
|
|
{
|
2013-09-03 23:18:26 +02:00
|
|
|
IDPLobbySPImpl *This = impl_from_IDPLobbySP( iface );
|
2001-04-12 23:10:54 +02:00
|
|
|
FIXME( "(%p)->(%p):stub\n", This, lplpData );
|
|
|
|
return DP_OK;
|
|
|
|
}
|
|
|
|
|
2013-09-03 23:18:26 +02:00
|
|
|
static HRESULT WINAPI IDPLobbySPImpl_HandleMessage( IDPLobbySP *iface, SPDATA_HANDLEMESSAGE *hm )
|
2001-04-12 23:10:54 +02:00
|
|
|
{
|
2013-09-03 23:18:26 +02:00
|
|
|
IDPLobbySPImpl *This = impl_from_IDPLobbySP( iface );
|
2001-04-12 23:10:54 +02:00
|
|
|
FIXME( "(%p)->(%p):stub\n", This, hm );
|
|
|
|
return DP_OK;
|
|
|
|
}
|
|
|
|
|
2013-09-03 23:18:26 +02:00
|
|
|
static HRESULT WINAPI IDPLobbySPImpl_SendChatMessage( IDPLobbySP *iface,
|
|
|
|
SPDATA_CHATMESSAGE *cm )
|
2001-04-12 23:10:54 +02:00
|
|
|
{
|
2013-09-03 23:18:26 +02:00
|
|
|
IDPLobbySPImpl *This = impl_from_IDPLobbySP( iface );
|
2001-04-12 23:10:54 +02:00
|
|
|
FIXME( "(%p)->(%p):stub\n", This, cm );
|
|
|
|
return DP_OK;
|
|
|
|
}
|
|
|
|
|
2013-09-03 23:18:26 +02:00
|
|
|
static HRESULT WINAPI IDPLobbySPImpl_SetGroupName( IDPLobbySP *iface,
|
|
|
|
SPDATA_SETREMOTEGROUPNAME *srgn )
|
2001-04-12 23:10:54 +02:00
|
|
|
{
|
2013-09-03 23:18:26 +02:00
|
|
|
IDPLobbySPImpl *This = impl_from_IDPLobbySP( iface );
|
2001-04-12 23:10:54 +02:00
|
|
|
FIXME( "(%p)->(%p):stub\n", This, srgn );
|
|
|
|
return DP_OK;
|
|
|
|
}
|
|
|
|
|
2013-09-03 23:18:26 +02:00
|
|
|
static HRESULT WINAPI IDPLobbySPImpl_SetPlayerName( IDPLobbySP *iface,
|
|
|
|
SPDATA_SETREMOTEPLAYERNAME *srpn )
|
2001-04-12 23:10:54 +02:00
|
|
|
{
|
2013-09-03 23:18:26 +02:00
|
|
|
IDPLobbySPImpl *This = impl_from_IDPLobbySP( iface );
|
2001-04-12 23:10:54 +02:00
|
|
|
FIXME( "(%p)->(%p):stub\n", This, srpn );
|
|
|
|
return DP_OK;
|
|
|
|
}
|
|
|
|
|
2013-09-03 23:18:26 +02:00
|
|
|
static HRESULT WINAPI IDPLobbySPImpl_SetSessionDesc( IDPLobbySP *iface,
|
|
|
|
SPDATA_SETSESSIONDESC *ssd )
|
2001-04-12 23:10:54 +02:00
|
|
|
{
|
2013-09-03 23:18:26 +02:00
|
|
|
IDPLobbySPImpl *This = impl_from_IDPLobbySP( iface );
|
2001-04-12 23:10:54 +02:00
|
|
|
FIXME( "(%p)->(%p):stub\n", This, ssd );
|
|
|
|
return DP_OK;
|
|
|
|
}
|
|
|
|
|
2013-09-03 23:18:26 +02:00
|
|
|
static HRESULT WINAPI IDPLobbySPImpl_SetSPDataPointer( IDPLobbySP *iface, void *lpData )
|
2001-04-12 23:10:54 +02:00
|
|
|
{
|
2013-09-03 23:18:26 +02:00
|
|
|
IDPLobbySPImpl *This = impl_from_IDPLobbySP( iface );
|
2001-04-12 23:10:54 +02:00
|
|
|
FIXME( "(%p)->(%p):stub\n", This, lpData );
|
|
|
|
return DP_OK;
|
|
|
|
}
|
|
|
|
|
2013-09-03 23:18:26 +02:00
|
|
|
static HRESULT WINAPI IDPLobbySPImpl_StartSession( IDPLobbySP *iface,
|
|
|
|
SPDATA_STARTSESSIONCOMMAND *ssc )
|
2001-04-12 23:10:54 +02:00
|
|
|
{
|
2013-09-03 23:18:26 +02:00
|
|
|
IDPLobbySPImpl *This = impl_from_IDPLobbySP( iface );
|
2001-04-12 23:10:54 +02:00
|
|
|
FIXME( "(%p)->(%p):stub\n", This, ssc );
|
|
|
|
return DP_OK;
|
|
|
|
}
|
|
|
|
|
|
|
|
|
2005-06-01 21:57:42 +02:00
|
|
|
static const IDPLobbySPVtbl dpLobbySPVT =
|
2001-04-12 23:10:54 +02:00
|
|
|
{
|
2013-09-03 23:17:09 +02:00
|
|
|
IDPLobbySPImpl_QueryInterface,
|
|
|
|
IDPLobbySPImpl_AddRef,
|
|
|
|
IDPLobbySPImpl_Release,
|
2001-04-12 23:10:54 +02:00
|
|
|
IDPLobbySPImpl_AddGroupToGroup,
|
|
|
|
IDPLobbySPImpl_AddPlayerToGroup,
|
|
|
|
IDPLobbySPImpl_CreateGroup,
|
|
|
|
IDPLobbySPImpl_CreateGroupInGroup,
|
|
|
|
IDPLobbySPImpl_DeleteGroupFromGroup,
|
|
|
|
IDPLobbySPImpl_DeletePlayerFromGroup,
|
|
|
|
IDPLobbySPImpl_DestroyGroup,
|
|
|
|
IDPLobbySPImpl_EnumSessionsResponse,
|
|
|
|
IDPLobbySPImpl_GetSPDataPointer,
|
|
|
|
IDPLobbySPImpl_HandleMessage,
|
|
|
|
IDPLobbySPImpl_SendChatMessage,
|
2002-06-01 01:06:46 +02:00
|
|
|
IDPLobbySPImpl_SetGroupName,
|
|
|
|
IDPLobbySPImpl_SetPlayerName,
|
2001-04-12 23:10:54 +02:00
|
|
|
IDPLobbySPImpl_SetSessionDesc,
|
|
|
|
IDPLobbySPImpl_SetSPDataPointer,
|
|
|
|
IDPLobbySPImpl_StartSession
|
|
|
|
};
|
2013-09-03 23:24:58 +02:00
|
|
|
|
|
|
|
HRESULT dplobbysp_create( REFIID riid, void **ppv, IDirectPlayImpl *dp )
|
|
|
|
{
|
|
|
|
IDPLobbySPImpl *obj;
|
|
|
|
HRESULT hr;
|
|
|
|
|
|
|
|
TRACE( "(%s, %p)\n", debugstr_guid( riid ), ppv );
|
|
|
|
|
|
|
|
*ppv = NULL;
|
|
|
|
obj = HeapAlloc( GetProcessHeap(), 0, sizeof( *obj ) );
|
|
|
|
if ( !obj )
|
|
|
|
return DPERR_OUTOFMEMORY;
|
|
|
|
|
|
|
|
obj->IDPLobbySP_iface.lpVtbl = &dpLobbySPVT;
|
2013-09-04 23:45:28 +02:00
|
|
|
obj->ref = 1;
|
2013-09-03 23:24:58 +02:00
|
|
|
obj->dplay = dp;
|
|
|
|
|
|
|
|
hr = IDPLobbySP_QueryInterface( &obj->IDPLobbySP_iface, riid, ppv );
|
|
|
|
IDPLobbySP_Release( &obj->IDPLobbySP_iface );
|
|
|
|
|
|
|
|
return hr;
|
|
|
|
}
|