dplayx: Merge the IDirectPlay4_Close helper.

This commit is contained in:
Michael Stefaniuc 2013-03-29 16:52:03 +01:00 committed by Alexandre Julliard
parent 5e0da57087
commit 878a6a5a06
1 changed files with 29 additions and 40 deletions

View File

@ -156,7 +156,6 @@ static HRESULT DP_IF_SetGroupData
static HRESULT DP_IF_GetPlayerCaps static HRESULT DP_IF_GetPlayerCaps
( IDirectPlay2Impl* This, DPID idPlayer, LPDPCAPS lpDPCaps, ( IDirectPlay2Impl* This, DPID idPlayer, LPDPCAPS lpDPCaps,
DWORD dwFlags ); DWORD dwFlags );
static HRESULT DP_IF_Close( IDirectPlay2Impl* This, BOOL bAnsi );
static HRESULT DP_IF_CancelMessage static HRESULT DP_IF_CancelMessage
( IDirectPlay4Impl* This, DWORD dwMsgID, DWORD dwFlags, ( IDirectPlay4Impl* This, DWORD dwMsgID, DWORD dwFlags,
DWORD dwMinPriority, DWORD dwMaxPriority, BOOL bAnsi ); DWORD dwMinPriority, DWORD dwMaxPriority, BOOL bAnsi );
@ -670,11 +669,18 @@ static HRESULT WINAPI DirectPlay2WImpl_AddPlayerToGroup
return DP_IF_AddPlayerToGroup( This, NULL, idGroup, idPlayer, FALSE ); return DP_IF_AddPlayerToGroup( This, NULL, idGroup, idPlayer, FALSE );
} }
static HRESULT DP_IF_Close( IDirectPlay2Impl* This, BOOL bAnsi ) static HRESULT WINAPI IDirectPlay4AImpl_Close( IDirectPlay4A *iface )
{ {
IDirectPlayImpl *This = impl_from_IDirectPlay4A( iface );
return IDirectPlayX_Close( &This->IDirectPlay4_iface);
}
static HRESULT WINAPI IDirectPlay4Impl_Close( IDirectPlay4 *iface )
{
IDirectPlayImpl *This = impl_from_IDirectPlay4( iface );
HRESULT hr = DP_OK; HRESULT hr = DP_OK;
TRACE("(%p)->(%u)\n", This, bAnsi ); TRACE( "(%p)", This );
/* FIXME: Need to find a new host I assume (how?) */ /* FIXME: Need to find a new host I assume (how?) */
/* FIXME: Need to destroy all local groups */ /* FIXME: Need to destroy all local groups */
@ -686,35 +692,18 @@ static HRESULT DP_IF_Close( IDirectPlay2Impl* This, BOOL bAnsi )
DPSP_CLOSEDATA data; DPSP_CLOSEDATA data;
TRACE( "Calling SP CloseEx\n" ); TRACE( "Calling SP CloseEx\n" );
data.lpISP = This->dp2->spData.lpISP; data.lpISP = This->dp2->spData.lpISP;
hr = (*This->dp2->spData.lpCB->CloseEx)( &data ); hr = (*This->dp2->spData.lpCB->CloseEx)( &data );
} }
else if ( This->dp2->spData.lpCB->Close ) /* Try obsolete version */ else if ( This->dp2->spData.lpCB->Close ) /* Try obsolete version */
{ {
TRACE( "Calling SP Close (obsolete interface)\n" ); TRACE( "Calling SP Close (obsolete interface)\n" );
hr = (*This->dp2->spData.lpCB->Close)(); hr = (*This->dp2->spData.lpCB->Close)();
} }
return hr; return hr;
} }
static HRESULT WINAPI IDirectPlay4AImpl_Close( IDirectPlay4A *iface )
{
IDirectPlayImpl *This = impl_from_IDirectPlay4A( iface );
return DP_IF_Close( This, TRUE );
}
static HRESULT WINAPI DirectPlay2WImpl_Close
( LPDIRECTPLAY2 iface )
{
IDirectPlay2Impl *This = (IDirectPlay2Impl *)iface;
return DP_IF_Close( This, FALSE );
}
static static
lpGroupData DP_CreateGroup( IDirectPlay2AImpl* This, const DPID *lpid, lpGroupData DP_CreateGroup( IDirectPlay2AImpl* This, const DPID *lpid,
const DPNAME *lpName, DWORD dwFlags, const DPNAME *lpName, DWORD dwFlags,
@ -4596,7 +4585,7 @@ static const IDirectPlay4Vtbl dp4_vt =
IDirectPlay4Impl_Release, IDirectPlay4Impl_Release,
XCAST(AddPlayerToGroup)DirectPlay2WImpl_AddPlayerToGroup, XCAST(AddPlayerToGroup)DirectPlay2WImpl_AddPlayerToGroup,
XCAST(Close)DirectPlay2WImpl_Close, IDirectPlay4Impl_Close,
XCAST(CreateGroup)DirectPlay2WImpl_CreateGroup, XCAST(CreateGroup)DirectPlay2WImpl_CreateGroup,
XCAST(CreatePlayer)DirectPlay2WImpl_CreatePlayer, XCAST(CreatePlayer)DirectPlay2WImpl_CreatePlayer,
XCAST(DeletePlayerFromGroup)DirectPlay2WImpl_DeletePlayerFromGroup, XCAST(DeletePlayerFromGroup)DirectPlay2WImpl_DeletePlayerFromGroup,