2005-11-17 20:16:02 +00:00
|
|
|
/* This contains the implementation of the Lobby Service
|
|
|
|
* Providers interface required to communicate with Direct Play
|
|
|
|
*
|
|
|
|
* Copyright 2001 Peter Hunnisett
|
|
|
|
*
|
|
|
|
* 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
|
2013-04-13 13:08:11 +00:00
|
|
|
* Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA
|
2005-11-17 20:16:02 +00:00
|
|
|
*/
|
|
|
|
|
2018-03-08 12:39:19 +00:00
|
|
|
#include "winerror.h"
|
|
|
|
#include "wine/debug.h"
|
2005-11-17 20:16:02 +00:00
|
|
|
|
2018-03-08 12:39:19 +00:00
|
|
|
#include "lobbysp.h"
|
|
|
|
#include "dplay_global.h"
|
|
|
|
|
|
|
|
WINE_DEFAULT_DEBUG_CHANNEL(dplay);
|
2005-11-17 20:16:02 +00:00
|
|
|
|
2014-04-20 00:08:13 +00:00
|
|
|
typedef struct IDPLobbySPImpl
|
2005-11-17 20:16:02 +00:00
|
|
|
{
|
2014-04-20 00:08:13 +00:00
|
|
|
IDPLobbySP IDPLobbySP_iface;
|
|
|
|
LONG ref;
|
2013-09-30 18:14:44 +00:00
|
|
|
IDirectPlayImpl *dplay;
|
2014-04-20 00:08:13 +00:00
|
|
|
} IDPLobbySPImpl;
|
2005-11-17 20:16:02 +00:00
|
|
|
|
2014-04-20 00:08:13 +00:00
|
|
|
static inline IDPLobbySPImpl *impl_from_IDPLobbySP(IDPLobbySP *iface)
|
2005-11-17 20:16:02 +00:00
|
|
|
{
|
2014-04-20 00:08:13 +00:00
|
|
|
return CONTAINING_RECORD(iface, IDPLobbySPImpl, IDPLobbySP_iface);
|
2005-11-17 20:16:02 +00:00
|
|
|
}
|
|
|
|
|
2014-04-20 00:08:13 +00:00
|
|
|
static HRESULT WINAPI IDPLobbySPImpl_QueryInterface( IDPLobbySP *iface, REFIID riid,
|
|
|
|
void **ppv )
|
2005-11-17 20:16:02 +00:00
|
|
|
{
|
2014-04-20 00:08:13 +00:00
|
|
|
TRACE("(%p)->(%s,%p)\n", iface, debugstr_guid( riid ), ppv );
|
2005-11-17 20:16:02 +00:00
|
|
|
|
2014-04-20 00:08:13 +00:00
|
|
|
if ( IsEqualGUID( &IID_IUnknown, riid ) || IsEqualGUID( &IID_IDPLobbySP, riid ) )
|
2005-11-17 20:16:02 +00:00
|
|
|
{
|
2014-04-20 00:08:13 +00:00
|
|
|
*ppv = iface;
|
|
|
|
IDPLobbySP_AddRef(iface);
|
|
|
|
return S_OK;
|
2005-11-17 20:16:02 +00:00
|
|
|
}
|
|
|
|
|
2014-04-20 00:08:13 +00:00
|
|
|
FIXME("Unsupported interface %s\n", debugstr_guid(riid));
|
|
|
|
*ppv = NULL;
|
|
|
|
return E_NOINTERFACE;
|
2005-11-17 20:16:02 +00:00
|
|
|
}
|
|
|
|
|
2014-04-20 00:08:13 +00:00
|
|
|
static ULONG WINAPI IDPLobbySPImpl_AddRef( IDPLobbySP *iface )
|
2005-11-17 20:16:02 +00:00
|
|
|
{
|
2014-04-20 00:08:13 +00:00
|
|
|
IDPLobbySPImpl *This = impl_from_IDPLobbySP( iface );
|
|
|
|
ULONG ref = InterlockedIncrement( &This->ref );
|
2005-11-17 20:16:02 +00:00
|
|
|
|
2014-04-20 00:08:13 +00:00
|
|
|
TRACE( "(%p) ref=%d\n", This, ref );
|
2005-11-17 20:16:02 +00:00
|
|
|
|
2014-04-20 00:08:13 +00:00
|
|
|
return ref;
|
2005-11-17 20:16:02 +00:00
|
|
|
}
|
|
|
|
|
2014-04-20 00:08:13 +00:00
|
|
|
static ULONG WINAPI IDPLobbySPImpl_Release( IDPLobbySP *iface )
|
2005-11-17 20:16:02 +00:00
|
|
|
{
|
2014-04-20 00:08:13 +00:00
|
|
|
IDPLobbySPImpl *This = impl_from_IDPLobbySP( iface );
|
|
|
|
ULONG ref = InterlockedDecrement( &This->ref );
|
2005-11-17 20:16:02 +00:00
|
|
|
|
2014-04-20 00:08:13 +00:00
|
|
|
TRACE( "(%p) ref=%d\n", This, ref );
|
2005-11-17 20:16:02 +00:00
|
|
|
|
2014-04-20 00:08:13 +00:00
|
|
|
if( !ref )
|
2005-11-17 20:16:02 +00:00
|
|
|
HeapFree( GetProcessHeap(), 0, This );
|
|
|
|
|
2014-04-20 00:08:13 +00:00
|
|
|
return ref;
|
2005-11-17 20:16:02 +00:00
|
|
|
}
|
|
|
|
|
2014-04-20 00:08:13 +00:00
|
|
|
static HRESULT WINAPI IDPLobbySPImpl_AddGroupToGroup( IDPLobbySP *iface,
|
|
|
|
SPDATA_ADDREMOTEGROUPTOGROUP *argtg )
|
2005-11-17 20:16:02 +00:00
|
|
|
{
|
2014-04-20 00:08:13 +00:00
|
|
|
IDPLobbySPImpl *This = impl_from_IDPLobbySP( iface );
|
2005-11-17 20:16:02 +00:00
|
|
|
FIXME( "(%p)->(%p):stub\n", This, argtg );
|
|
|
|
return DP_OK;
|
|
|
|
}
|
|
|
|
|
2014-04-20 00:08:13 +00:00
|
|
|
static HRESULT WINAPI IDPLobbySPImpl_AddPlayerToGroup( IDPLobbySP *iface,
|
|
|
|
SPDATA_ADDREMOTEPLAYERTOGROUP *arptg )
|
2005-11-17 20:16:02 +00:00
|
|
|
{
|
2014-04-20 00:08:13 +00:00
|
|
|
IDPLobbySPImpl *This = impl_from_IDPLobbySP( iface );
|
2005-11-17 20:16:02 +00:00
|
|
|
FIXME( "(%p)->(%p):stub\n", This, arptg );
|
|
|
|
return DP_OK;
|
|
|
|
}
|
|
|
|
|
2014-04-20 00:08:13 +00:00
|
|
|
static HRESULT WINAPI IDPLobbySPImpl_CreateGroup( IDPLobbySP *iface,
|
|
|
|
SPDATA_CREATEREMOTEGROUP *crg )
|
2005-11-17 20:16:02 +00:00
|
|
|
{
|
2014-04-20 00:08:13 +00:00
|
|
|
IDPLobbySPImpl *This = impl_from_IDPLobbySP( iface );
|
2005-11-17 20:16:02 +00:00
|
|
|
FIXME( "(%p)->(%p):stub\n", This, crg );
|
|
|
|
return DP_OK;
|
|
|
|
}
|
|
|
|
|
2014-04-20 00:08:13 +00:00
|
|
|
static HRESULT WINAPI IDPLobbySPImpl_CreateGroupInGroup( IDPLobbySP *iface,
|
|
|
|
SPDATA_CREATEREMOTEGROUPINGROUP *crgig )
|
2005-11-17 20:16:02 +00:00
|
|
|
{
|
2014-04-20 00:08:13 +00:00
|
|
|
IDPLobbySPImpl *This = impl_from_IDPLobbySP( iface );
|
2005-11-17 20:16:02 +00:00
|
|
|
FIXME( "(%p)->(%p):stub\n", This, crgig );
|
|
|
|
return DP_OK;
|
|
|
|
}
|
|
|
|
|
2014-04-20 00:08:13 +00:00
|
|
|
static HRESULT WINAPI IDPLobbySPImpl_DeleteGroupFromGroup( IDPLobbySP *iface,
|
|
|
|
SPDATA_DELETEREMOTEGROUPFROMGROUP *drgfg )
|
2005-11-17 20:16:02 +00:00
|
|
|
{
|
2014-04-20 00:08:13 +00:00
|
|
|
IDPLobbySPImpl *This = impl_from_IDPLobbySP( iface );
|
2005-11-17 20:16:02 +00:00
|
|
|
FIXME( "(%p)->(%p):stub\n", This, drgfg );
|
|
|
|
return DP_OK;
|
|
|
|
}
|
|
|
|
|
2014-04-20 00:08:13 +00:00
|
|
|
static HRESULT WINAPI IDPLobbySPImpl_DeletePlayerFromGroup( IDPLobbySP *iface,
|
|
|
|
SPDATA_DELETEREMOTEPLAYERFROMGROUP *drpfg )
|
2005-11-17 20:16:02 +00:00
|
|
|
{
|
2014-04-20 00:08:13 +00:00
|
|
|
IDPLobbySPImpl *This = impl_from_IDPLobbySP( iface );
|
2005-11-17 20:16:02 +00:00
|
|
|
FIXME( "(%p)->(%p):stub\n", This, drpfg );
|
|
|
|
return DP_OK;
|
|
|
|
}
|
|
|
|
|
2014-04-20 00:08:13 +00:00
|
|
|
static HRESULT WINAPI IDPLobbySPImpl_DestroyGroup( IDPLobbySP *iface,
|
|
|
|
SPDATA_DESTROYREMOTEGROUP *drg )
|
2005-11-17 20:16:02 +00:00
|
|
|
{
|
2014-04-20 00:08:13 +00:00
|
|
|
IDPLobbySPImpl *This = impl_from_IDPLobbySP( iface );
|
2005-11-17 20:16:02 +00:00
|
|
|
FIXME( "(%p)->(%p):stub\n", This, drg );
|
|
|
|
return DP_OK;
|
|
|
|
}
|
|
|
|
|
2014-04-20 00:08:13 +00:00
|
|
|
static HRESULT WINAPI IDPLobbySPImpl_EnumSessionsResponse( IDPLobbySP *iface,
|
|
|
|
SPDATA_ENUMSESSIONSRESPONSE *er )
|
2005-11-17 20:16:02 +00:00
|
|
|
{
|
2014-04-20 00:08:13 +00:00
|
|
|
IDPLobbySPImpl *This = impl_from_IDPLobbySP( iface );
|
2005-11-17 20:16:02 +00:00
|
|
|
FIXME( "(%p)->(%p):stub\n", This, er );
|
|
|
|
return DP_OK;
|
|
|
|
}
|
|
|
|
|
2014-04-20 00:08:13 +00:00
|
|
|
static HRESULT WINAPI IDPLobbySPImpl_GetSPDataPointer( IDPLobbySP *iface, LPVOID* lplpData )
|
2005-11-17 20:16:02 +00:00
|
|
|
{
|
2014-04-20 00:08:13 +00:00
|
|
|
IDPLobbySPImpl *This = impl_from_IDPLobbySP( iface );
|
2005-11-17 20:16:02 +00:00
|
|
|
FIXME( "(%p)->(%p):stub\n", This, lplpData );
|
|
|
|
return DP_OK;
|
|
|
|
}
|
|
|
|
|
2014-04-20 00:08:13 +00:00
|
|
|
static HRESULT WINAPI IDPLobbySPImpl_HandleMessage( IDPLobbySP *iface, SPDATA_HANDLEMESSAGE *hm )
|
2005-11-17 20:16:02 +00:00
|
|
|
{
|
2014-04-20 00:08:13 +00:00
|
|
|
IDPLobbySPImpl *This = impl_from_IDPLobbySP( iface );
|
2005-11-17 20:16:02 +00:00
|
|
|
FIXME( "(%p)->(%p):stub\n", This, hm );
|
|
|
|
return DP_OK;
|
|
|
|
}
|
|
|
|
|
2014-04-20 00:08:13 +00:00
|
|
|
static HRESULT WINAPI IDPLobbySPImpl_SendChatMessage( IDPLobbySP *iface,
|
|
|
|
SPDATA_CHATMESSAGE *cm )
|
2005-11-17 20:16:02 +00:00
|
|
|
{
|
2014-04-20 00:08:13 +00:00
|
|
|
IDPLobbySPImpl *This = impl_from_IDPLobbySP( iface );
|
2005-11-17 20:16:02 +00:00
|
|
|
FIXME( "(%p)->(%p):stub\n", This, cm );
|
|
|
|
return DP_OK;
|
|
|
|
}
|
|
|
|
|
2014-04-20 00:08:13 +00:00
|
|
|
static HRESULT WINAPI IDPLobbySPImpl_SetGroupName( IDPLobbySP *iface,
|
|
|
|
SPDATA_SETREMOTEGROUPNAME *srgn )
|
2005-11-17 20:16:02 +00:00
|
|
|
{
|
2014-04-20 00:08:13 +00:00
|
|
|
IDPLobbySPImpl *This = impl_from_IDPLobbySP( iface );
|
2005-11-17 20:16:02 +00:00
|
|
|
FIXME( "(%p)->(%p):stub\n", This, srgn );
|
|
|
|
return DP_OK;
|
|
|
|
}
|
|
|
|
|
2014-04-20 00:08:13 +00:00
|
|
|
static HRESULT WINAPI IDPLobbySPImpl_SetPlayerName( IDPLobbySP *iface,
|
|
|
|
SPDATA_SETREMOTEPLAYERNAME *srpn )
|
2005-11-17 20:16:02 +00:00
|
|
|
{
|
2014-04-20 00:08:13 +00:00
|
|
|
IDPLobbySPImpl *This = impl_from_IDPLobbySP( iface );
|
2005-11-17 20:16:02 +00:00
|
|
|
FIXME( "(%p)->(%p):stub\n", This, srpn );
|
|
|
|
return DP_OK;
|
|
|
|
}
|
|
|
|
|
2014-04-20 00:08:13 +00:00
|
|
|
static HRESULT WINAPI IDPLobbySPImpl_SetSessionDesc( IDPLobbySP *iface,
|
|
|
|
SPDATA_SETSESSIONDESC *ssd )
|
2005-11-17 20:16:02 +00:00
|
|
|
{
|
2014-04-20 00:08:13 +00:00
|
|
|
IDPLobbySPImpl *This = impl_from_IDPLobbySP( iface );
|
2005-11-17 20:16:02 +00:00
|
|
|
FIXME( "(%p)->(%p):stub\n", This, ssd );
|
|
|
|
return DP_OK;
|
|
|
|
}
|
|
|
|
|
2014-04-20 00:08:13 +00:00
|
|
|
static HRESULT WINAPI IDPLobbySPImpl_SetSPDataPointer( IDPLobbySP *iface, void *lpData )
|
2005-11-17 20:16:02 +00:00
|
|
|
{
|
2014-04-20 00:08:13 +00:00
|
|
|
IDPLobbySPImpl *This = impl_from_IDPLobbySP( iface );
|
2005-11-17 20:16:02 +00:00
|
|
|
FIXME( "(%p)->(%p):stub\n", This, lpData );
|
|
|
|
return DP_OK;
|
|
|
|
}
|
|
|
|
|
2014-04-20 00:08:13 +00:00
|
|
|
static HRESULT WINAPI IDPLobbySPImpl_StartSession( IDPLobbySP *iface,
|
|
|
|
SPDATA_STARTSESSIONCOMMAND *ssc )
|
2005-11-17 20:16:02 +00:00
|
|
|
{
|
2014-04-20 00:08:13 +00:00
|
|
|
IDPLobbySPImpl *This = impl_from_IDPLobbySP( iface );
|
2005-11-17 20:16:02 +00:00
|
|
|
FIXME( "(%p)->(%p):stub\n", This, ssc );
|
|
|
|
return DP_OK;
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
static const IDPLobbySPVtbl dpLobbySPVT =
|
|
|
|
{
|
2014-04-20 00:08:13 +00:00
|
|
|
IDPLobbySPImpl_QueryInterface,
|
|
|
|
IDPLobbySPImpl_AddRef,
|
|
|
|
IDPLobbySPImpl_Release,
|
2005-11-17 20:16:02 +00:00
|
|
|
IDPLobbySPImpl_AddGroupToGroup,
|
|
|
|
IDPLobbySPImpl_AddPlayerToGroup,
|
|
|
|
IDPLobbySPImpl_CreateGroup,
|
|
|
|
IDPLobbySPImpl_CreateGroupInGroup,
|
|
|
|
IDPLobbySPImpl_DeleteGroupFromGroup,
|
|
|
|
IDPLobbySPImpl_DeletePlayerFromGroup,
|
|
|
|
IDPLobbySPImpl_DestroyGroup,
|
|
|
|
IDPLobbySPImpl_EnumSessionsResponse,
|
|
|
|
IDPLobbySPImpl_GetSPDataPointer,
|
|
|
|
IDPLobbySPImpl_HandleMessage,
|
|
|
|
IDPLobbySPImpl_SendChatMessage,
|
|
|
|
IDPLobbySPImpl_SetGroupName,
|
|
|
|
IDPLobbySPImpl_SetPlayerName,
|
|
|
|
IDPLobbySPImpl_SetSessionDesc,
|
|
|
|
IDPLobbySPImpl_SetSPDataPointer,
|
|
|
|
IDPLobbySPImpl_StartSession
|
|
|
|
};
|
2014-04-20 00:08:13 +00: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;
|
|
|
|
obj->ref = 1;
|
|
|
|
obj->dplay = dp;
|
|
|
|
|
|
|
|
hr = IDPLobbySP_QueryInterface( &obj->IDPLobbySP_iface, riid, ppv );
|
|
|
|
IDPLobbySP_Release( &obj->IDPLobbySP_iface );
|
|
|
|
|
|
|
|
return hr;
|
|
|
|
}
|