Commit 2e2226dd authored by Michael Stefaniuc's avatar Michael Stefaniuc Committed by Alexandre Julliard

dplayx: Merge the IDirectPlay4_SetPlayerData helper.

parent 1d43acf5
...@@ -95,9 +95,6 @@ static HRESULT DP_IF_GetPlayerName ...@@ -95,9 +95,6 @@ static HRESULT DP_IF_GetPlayerName
static HRESULT DP_IF_SetGroupName static HRESULT DP_IF_SetGroupName
( IDirectPlay2Impl* This, DPID idGroup, LPDPNAME lpGroupName, ( IDirectPlay2Impl* This, DPID idGroup, LPDPNAME lpGroupName,
DWORD dwFlags, BOOL bAnsi ); DWORD dwFlags, BOOL bAnsi );
static HRESULT DP_IF_SetPlayerData
( IDirectPlay2Impl* This, DPID idPlayer, LPVOID lpData,
DWORD dwDataSize, DWORD dwFlags, BOOL bAnsi );
static HRESULT DP_IF_SetPlayerName static HRESULT DP_IF_SetPlayerName
( IDirectPlay2Impl* This, DPID idPlayer, LPDPNAME lpPlayerName, ( IDirectPlay2Impl* This, DPID idPlayer, LPDPNAME lpPlayerName,
DWORD dwFlags, BOOL bAnsi ); DWORD dwFlags, BOOL bAnsi );
...@@ -2724,67 +2721,46 @@ static HRESULT WINAPI DirectPlay2WImpl_SetGroupName ...@@ -2724,67 +2721,46 @@ static HRESULT WINAPI DirectPlay2WImpl_SetGroupName
return DP_IF_SetGroupName( This, idGroup, lpGroupName, dwFlags, FALSE ); return DP_IF_SetGroupName( This, idGroup, lpGroupName, dwFlags, FALSE );
} }
static HRESULT DP_IF_SetPlayerData static HRESULT WINAPI IDirectPlay4AImpl_SetPlayerData( IDirectPlay4A *iface, DPID player,
( IDirectPlay2Impl* This, DPID idPlayer, LPVOID lpData, void *data, DWORD size, DWORD flags )
DWORD dwDataSize, DWORD dwFlags, BOOL bAnsi )
{ {
lpPlayerList lpPList; IDirectPlayImpl *This = impl_from_IDirectPlay4A( iface );
return IDirectPlayX_SetPlayerData( &This->IDirectPlay4_iface, player, data, size, flags );
TRACE( "(%p)->(0x%08x,%p,0x%08x,0x%08x,%u)\n", }
This, idPlayer, lpData, dwDataSize, dwFlags, bAnsi );
if( This->dp2->connectionInitialized == NO_PROVIDER ) static HRESULT WINAPI IDirectPlay4Impl_SetPlayerData( IDirectPlay4 *iface, DPID player,
{ void *data, DWORD size, DWORD flags )
return DPERR_UNINITIALIZED; {
} IDirectPlayImpl *This = impl_from_IDirectPlay4( iface );
lpPlayerList plist;
/* Parameter check */ TRACE( "(%p)->(0x%08x,%p,0x%08x,0x%08x)\n", This, player, data, size, flags );
if( ( lpData == NULL ) &&
( dwDataSize != 0 )
)
{
return DPERR_INVALIDPARAMS;
}
/* Find the pointer to the data for this player */ if ( This->dp2->connectionInitialized == NO_PROVIDER )
if( ( lpPList = DP_FindPlayer( This, idPlayer ) ) == NULL ) return DPERR_UNINITIALIZED;
{
return DPERR_INVALIDPLAYER;
}
if( !(dwFlags & DPSET_LOCAL) ) /* Parameter check */
{ if ( !data && size )
FIXME( "Was this group created by this interface?\n" ); return DPERR_INVALIDPARAMS;
/* FIXME: If this is a remote update need to allow it but not
* send a message.
*/
}
DP_SetPlayerData( lpPList->lpPData, dwFlags, lpData, dwDataSize ); /* Find the pointer to the data for this player */
if ( (plist = DP_FindPlayer( This, player )) == NULL )
return DPERR_INVALIDPLAYER;
if( !(dwFlags & DPSET_LOCAL) ) if ( !(flags & DPSET_LOCAL) )
{ {
FIXME( "Send msg?\n" ); FIXME( "Was this group created by this interface?\n" );
} /* FIXME: If this is a remote update need to allow it but not
* send a message.
*/
}
return DP_OK; DP_SetPlayerData( plist->lpPData, flags, data, size );
}
static HRESULT WINAPI IDirectPlay4AImpl_SetPlayerData( IDirectPlay4A *iface, DPID idPlayer, if ( !(flags & DPSET_LOCAL) )
void *lpData, DWORD dwDataSize, DWORD dwFlags ) FIXME( "Send msg?\n" );
{
IDirectPlayImpl *This = impl_from_IDirectPlay4A( iface );
return DP_IF_SetPlayerData( This, idPlayer, lpData, dwDataSize,
dwFlags, TRUE );
}
static HRESULT WINAPI DirectPlay2WImpl_SetPlayerData return DP_OK;
( LPDIRECTPLAY2 iface, DPID idPlayer, LPVOID lpData,
DWORD dwDataSize, DWORD dwFlags )
{
IDirectPlay2Impl *This = (IDirectPlay2Impl *)iface;
return DP_IF_SetPlayerData( This, idPlayer, lpData, dwDataSize,
dwFlags, FALSE );
} }
static HRESULT DP_IF_SetPlayerName static HRESULT DP_IF_SetPlayerName
...@@ -4457,7 +4433,7 @@ static const IDirectPlay4Vtbl dp4_vt = ...@@ -4457,7 +4433,7 @@ static const IDirectPlay4Vtbl dp4_vt =
IDirectPlay4Impl_Send, IDirectPlay4Impl_Send,
IDirectPlay4Impl_SetGroupData, IDirectPlay4Impl_SetGroupData,
XCAST(SetGroupName)DirectPlay2WImpl_SetGroupName, XCAST(SetGroupName)DirectPlay2WImpl_SetGroupName,
XCAST(SetPlayerData)DirectPlay2WImpl_SetPlayerData, IDirectPlay4Impl_SetPlayerData,
XCAST(SetPlayerName)DirectPlay2WImpl_SetPlayerName, XCAST(SetPlayerName)DirectPlay2WImpl_SetPlayerName,
XCAST(SetSessionDesc)DirectPlay2WImpl_SetSessionDesc, XCAST(SetSessionDesc)DirectPlay2WImpl_SetSessionDesc,
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment