winehq.org
Sign In
Sign Up
Sign In
Sign Up
Manage this list
×
Keyboard Shortcuts
Thread View
j
: Next unread message
k
: Previous unread message
j a
: Jump to all threads
j l
: Jump to MailingList overview
2025
February
January
2024
December
November
October
September
August
July
June
May
April
March
February
January
2023
December
November
October
September
August
July
June
May
April
March
February
January
2022
December
November
October
September
August
July
June
May
April
March
February
January
2021
December
November
October
September
August
July
June
May
April
March
February
January
2020
December
November
October
September
August
July
June
May
April
March
February
January
2019
December
November
October
September
August
July
June
May
April
March
February
January
2018
December
November
October
September
August
July
June
May
April
March
February
January
2017
December
November
October
September
August
July
June
May
April
March
February
January
2016
December
November
October
September
August
July
June
May
April
March
February
January
2015
December
November
October
September
August
July
June
May
April
March
February
January
2014
December
November
October
September
August
July
June
May
April
March
February
January
2013
December
November
October
September
August
July
June
May
April
March
February
January
2012
December
November
October
September
August
July
June
May
April
March
February
January
2011
December
November
October
September
August
July
June
May
April
March
February
January
2010
December
November
October
September
August
July
June
May
April
March
February
January
2009
December
November
October
September
August
July
June
May
April
March
February
January
2008
December
November
October
September
August
July
June
May
April
March
February
January
2007
December
November
October
September
August
July
June
May
April
March
February
January
2006
December
November
October
September
August
July
June
May
April
March
February
January
2005
December
November
October
September
August
July
June
May
April
March
February
January
2004
December
November
October
September
August
July
June
May
April
March
February
January
2003
December
November
October
September
August
July
June
May
April
March
February
January
2002
December
November
October
September
August
July
June
May
April
March
February
January
2001
December
November
October
September
August
July
June
May
April
March
February
List overview
wine-commits
April 2013
----- 2025 -----
February 2025
January 2025
----- 2024 -----
December 2024
November 2024
October 2024
September 2024
August 2024
July 2024
June 2024
May 2024
April 2024
March 2024
February 2024
January 2024
----- 2023 -----
December 2023
November 2023
October 2023
September 2023
August 2023
July 2023
June 2023
May 2023
April 2023
March 2023
February 2023
January 2023
----- 2022 -----
December 2022
November 2022
October 2022
September 2022
August 2022
July 2022
June 2022
May 2022
April 2022
March 2022
February 2022
January 2022
----- 2021 -----
December 2021
November 2021
October 2021
September 2021
August 2021
July 2021
June 2021
May 2021
April 2021
March 2021
February 2021
January 2021
----- 2020 -----
December 2020
November 2020
October 2020
September 2020
August 2020
July 2020
June 2020
May 2020
April 2020
March 2020
February 2020
January 2020
----- 2019 -----
December 2019
November 2019
October 2019
September 2019
August 2019
July 2019
June 2019
May 2019
April 2019
March 2019
February 2019
January 2019
----- 2018 -----
December 2018
November 2018
October 2018
September 2018
August 2018
July 2018
June 2018
May 2018
April 2018
March 2018
February 2018
January 2018
----- 2017 -----
December 2017
November 2017
October 2017
September 2017
August 2017
July 2017
June 2017
May 2017
April 2017
March 2017
February 2017
January 2017
----- 2016 -----
December 2016
November 2016
October 2016
September 2016
August 2016
July 2016
June 2016
May 2016
April 2016
March 2016
February 2016
January 2016
----- 2015 -----
December 2015
November 2015
October 2015
September 2015
August 2015
July 2015
June 2015
May 2015
April 2015
March 2015
February 2015
January 2015
----- 2014 -----
December 2014
November 2014
October 2014
September 2014
August 2014
July 2014
June 2014
May 2014
April 2014
March 2014
February 2014
January 2014
----- 2013 -----
December 2013
November 2013
October 2013
September 2013
August 2013
July 2013
June 2013
May 2013
April 2013
March 2013
February 2013
January 2013
----- 2012 -----
December 2012
November 2012
October 2012
September 2012
August 2012
July 2012
June 2012
May 2012
April 2012
March 2012
February 2012
January 2012
----- 2011 -----
December 2011
November 2011
October 2011
September 2011
August 2011
July 2011
June 2011
May 2011
April 2011
March 2011
February 2011
January 2011
----- 2010 -----
December 2010
November 2010
October 2010
September 2010
August 2010
July 2010
June 2010
May 2010
April 2010
March 2010
February 2010
January 2010
----- 2009 -----
December 2009
November 2009
October 2009
September 2009
August 2009
July 2009
June 2009
May 2009
April 2009
March 2009
February 2009
January 2009
----- 2008 -----
December 2008
November 2008
October 2008
September 2008
August 2008
July 2008
June 2008
May 2008
April 2008
March 2008
February 2008
January 2008
----- 2007 -----
December 2007
November 2007
October 2007
September 2007
August 2007
July 2007
June 2007
May 2007
April 2007
March 2007
February 2007
January 2007
----- 2006 -----
December 2006
November 2006
October 2006
September 2006
August 2006
July 2006
June 2006
May 2006
April 2006
March 2006
February 2006
January 2006
----- 2005 -----
December 2005
November 2005
October 2005
September 2005
August 2005
July 2005
June 2005
May 2005
April 2005
March 2005
February 2005
January 2005
----- 2004 -----
December 2004
November 2004
October 2004
September 2004
August 2004
July 2004
June 2004
May 2004
April 2004
March 2004
February 2004
January 2004
----- 2003 -----
December 2003
November 2003
October 2003
September 2003
August 2003
July 2003
June 2003
May 2003
April 2003
March 2003
February 2003
January 2003
----- 2002 -----
December 2002
November 2002
October 2002
September 2002
August 2002
July 2002
June 2002
May 2002
April 2002
March 2002
February 2002
January 2002
----- 2001 -----
December 2001
November 2001
October 2001
September 2001
August 2001
July 2001
June 2001
May 2001
April 2001
March 2001
February 2001
wine-commits@winehq.org
2 participants
579 discussions
Start a n
N
ew thread
Michael Stefaniuc : dplayx: Merge the IDirectPlay4_SetPlayerData helper.
by Alexandre Julliard
02 Apr '13
02 Apr '13
Module: wine Branch: master Commit: 2e2226dd76a2e41f68c83e68711d9c4222247c09 URL:
http://source.winehq.org/git/wine.git/?a=commit;h=2e2226dd76a2e41f68c83e687…
Author: Michael Stefaniuc <mstefani(a)redhat.de> Date: Fri Mar 29 16:57:33 2013 +0100 dplayx: Merge the IDirectPlay4_SetPlayerData helper. --- dlls/dplayx/dplay.c | 86 ++++++++++++++++++-------------------------------- 1 files changed, 31 insertions(+), 55 deletions(-) diff --git a/dlls/dplayx/dplay.c b/dlls/dplayx/dplay.c index ef16b57..6372a1e 100644 --- a/dlls/dplayx/dplay.c +++ b/dlls/dplayx/dplay.c @@ -95,9 +95,6 @@ static HRESULT DP_IF_GetPlayerName static HRESULT DP_IF_SetGroupName ( IDirectPlay2Impl* This, DPID idGroup, LPDPNAME lpGroupName, 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 ( IDirectPlay2Impl* This, DPID idPlayer, LPDPNAME lpPlayerName, DWORD dwFlags, BOOL bAnsi ); @@ -2724,67 +2721,46 @@ static HRESULT WINAPI DirectPlay2WImpl_SetGroupName return DP_IF_SetGroupName( This, idGroup, lpGroupName, dwFlags, FALSE ); } -static HRESULT DP_IF_SetPlayerData - ( IDirectPlay2Impl* This, DPID idPlayer, LPVOID lpData, - DWORD dwDataSize, DWORD dwFlags, BOOL bAnsi ) +static HRESULT WINAPI IDirectPlay4AImpl_SetPlayerData( IDirectPlay4A *iface, DPID player, + void *data, DWORD size, DWORD flags ) { - lpPlayerList lpPList; - - TRACE( "(%p)->(0x%08x,%p,0x%08x,0x%08x,%u)\n", - This, idPlayer, lpData, dwDataSize, dwFlags, bAnsi ); + IDirectPlayImpl *This = impl_from_IDirectPlay4A( iface ); + return IDirectPlayX_SetPlayerData( &This->IDirectPlay4_iface, player, data, size, flags ); +} - if( This->dp2->connectionInitialized == NO_PROVIDER ) - { - return DPERR_UNINITIALIZED; - } +static HRESULT WINAPI IDirectPlay4Impl_SetPlayerData( IDirectPlay4 *iface, DPID player, + void *data, DWORD size, DWORD flags ) +{ + IDirectPlayImpl *This = impl_from_IDirectPlay4( iface ); + lpPlayerList plist; - /* Parameter check */ - if( ( lpData == NULL ) && - ( dwDataSize != 0 ) - ) - { - return DPERR_INVALIDPARAMS; - } + TRACE( "(%p)->(0x%08x,%p,0x%08x,0x%08x)\n", This, player, data, size, flags ); - /* Find the pointer to the data for this player */ - if( ( lpPList = DP_FindPlayer( This, idPlayer ) ) == NULL ) - { - return DPERR_INVALIDPLAYER; - } + if ( This->dp2->connectionInitialized == NO_PROVIDER ) + return DPERR_UNINITIALIZED; - if( !(dwFlags & DPSET_LOCAL) ) - { - 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. - */ - } + /* Parameter check */ + if ( !data && size ) + return DPERR_INVALIDPARAMS; - 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) ) - { - FIXME( "Send msg?\n" ); - } + if ( !(flags & DPSET_LOCAL) ) + { + 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, - void *lpData, DWORD dwDataSize, DWORD dwFlags ) -{ - IDirectPlayImpl *This = impl_from_IDirectPlay4A( iface ); - return DP_IF_SetPlayerData( This, idPlayer, lpData, dwDataSize, - dwFlags, TRUE ); -} + if ( !(flags & DPSET_LOCAL) ) + FIXME( "Send msg?\n" ); -static HRESULT WINAPI DirectPlay2WImpl_SetPlayerData - ( LPDIRECTPLAY2 iface, DPID idPlayer, LPVOID lpData, - DWORD dwDataSize, DWORD dwFlags ) -{ - IDirectPlay2Impl *This = (IDirectPlay2Impl *)iface; - return DP_IF_SetPlayerData( This, idPlayer, lpData, dwDataSize, - dwFlags, FALSE ); + return DP_OK; } static HRESULT DP_IF_SetPlayerName @@ -4457,7 +4433,7 @@ static const IDirectPlay4Vtbl dp4_vt = IDirectPlay4Impl_Send, IDirectPlay4Impl_SetGroupData, XCAST(SetGroupName)DirectPlay2WImpl_SetGroupName, - XCAST(SetPlayerData)DirectPlay2WImpl_SetPlayerData, + IDirectPlay4Impl_SetPlayerData, XCAST(SetPlayerName)DirectPlay2WImpl_SetPlayerName, XCAST(SetSessionDesc)DirectPlay2WImpl_SetSessionDesc,
1
0
0
0
Michael Stefaniuc : dplayx: Merge the IDirectPlay4_SetGroupData helper.
by Alexandre Julliard
02 Apr '13
02 Apr '13
Module: wine Branch: master Commit: 1d43acf5f9e0af7a68398e53b87de41d17643700 URL:
http://source.winehq.org/git/wine.git/?a=commit;h=1d43acf5f9e0af7a68398e53b…
Author: Michael Stefaniuc <mstefani(a)redhat.de> Date: Fri Mar 29 16:56:47 2013 +0100 dplayx: Merge the IDirectPlay4_SetGroupData helper. --- dlls/dplayx/dplay.c | 84 +++++++++++++++++++------------------------------- 1 files changed, 32 insertions(+), 52 deletions(-) diff --git a/dlls/dplayx/dplay.c b/dlls/dplayx/dplay.c index 9e27ab7..ef16b57 100644 --- a/dlls/dplayx/dplay.c +++ b/dlls/dplayx/dplay.c @@ -137,9 +137,6 @@ static HRESULT DP_SP_SendEx ( IDirectPlay2Impl* This, DWORD dwFlags, LPVOID lpData, DWORD dwDataSize, DWORD dwPriority, DWORD dwTimeout, LPVOID lpContext, LPDWORD lpdwMsgID ); -static HRESULT DP_IF_SetGroupData - ( IDirectPlay2Impl* This, DPID idGroup, LPVOID lpData, - DWORD dwDataSize, DWORD dwFlags, BOOL bAnsi ); static HRESULT DP_IF_CancelMessage ( IDirectPlay4Impl* This, DWORD dwMsgID, DWORD dwFlags, DWORD dwMinPriority, DWORD dwMaxPriority, BOOL bAnsi ); @@ -2648,63 +2645,46 @@ static HRESULT WINAPI IDirectPlay4Impl_Send( IDirectPlay4 *iface, DPID from, DPI return IDirectPlayX_SendEx( iface, from, to, flags, data, size, 0, 0, NULL, NULL ); } -static HRESULT DP_IF_SetGroupData - ( IDirectPlay2Impl* This, DPID idGroup, LPVOID lpData, - DWORD dwDataSize, DWORD dwFlags, BOOL bAnsi ) +static HRESULT WINAPI IDirectPlay4AImpl_SetGroupData( IDirectPlay4A *iface, DPID group, void *data, + DWORD size, DWORD flags ) { - lpGroupData lpGData; + IDirectPlayImpl *This = impl_from_IDirectPlay4A( iface ); + return IDirectPlayX_SetGroupData( &This->IDirectPlay4_iface, group, data, size, flags ); +} - TRACE( "(%p)->(0x%08x,%p,0x%08x,0x%08x,%u)\n", - This, idGroup, lpData, dwDataSize, dwFlags, bAnsi ); +static HRESULT WINAPI IDirectPlay4Impl_SetGroupData( IDirectPlay4 *iface, DPID group, void *data, + DWORD size, DWORD flags ) +{ + IDirectPlayImpl *This = impl_from_IDirectPlay4( iface ); + lpGroupData gdata; - /* Parameter check */ - if( ( lpData == NULL ) && - ( dwDataSize != 0 ) - ) - { - return DPERR_INVALIDPARAMS; - } + TRACE( "(%p)->(0x%08x,%p,0x%08x,0x%08x)\n", This, group, data, size, flags ); - /* Find the pointer to the data for this player */ - if( ( lpGData = DP_FindAnyGroup( This, idGroup ) ) == NULL ) - { - return DPERR_INVALIDOBJECT; - } + /* Parameter check */ + if ( !data && size ) + return DPERR_INVALIDPARAMS; - if( !(dwFlags & DPSET_LOCAL) ) - { - 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. - */ - } + /* Find the pointer to the data for this player */ + if ( ( gdata = DP_FindAnyGroup( This, group ) ) == NULL ) + return DPERR_INVALIDOBJECT; - DP_SetGroupData( lpGData, dwFlags, lpData, dwDataSize ); + if ( !(flags & DPSET_LOCAL) ) + { + 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. + */ + } - /* FIXME: Only send a message if this group is local to the session otherwise - * it will have been rejected above - */ - if( !(dwFlags & DPSET_LOCAL) ) - { - FIXME( "Send msg?\n" ); - } + DP_SetGroupData( gdata, flags, data, size ); - return DP_OK; -} - -static HRESULT WINAPI IDirectPlay4AImpl_SetGroupData( IDirectPlay4A *iface, DPID idGroup, - void *lpData, DWORD dwDataSize, DWORD dwFlags ) -{ - IDirectPlayImpl *This = impl_from_IDirectPlay4A( iface ); - return DP_IF_SetGroupData( This, idGroup, lpData, dwDataSize, dwFlags, TRUE ); -} + /* FIXME: Only send a message if this group is local to the session otherwise + * it will have been rejected above + */ + if ( !(flags & DPSET_LOCAL) ) + FIXME( "Send msg?\n" ); -static HRESULT WINAPI DirectPlay2WImpl_SetGroupData - ( LPDIRECTPLAY2 iface, DPID idGroup, LPVOID lpData, - DWORD dwDataSize, DWORD dwFlags ) -{ - IDirectPlay2Impl *This = (IDirectPlay2Impl *)iface; - return DP_IF_SetGroupData( This, idGroup, lpData, dwDataSize, dwFlags, FALSE ); + return DP_OK; } static HRESULT DP_IF_SetGroupName @@ -4475,7 +4455,7 @@ static const IDirectPlay4Vtbl dp4_vt = IDirectPlay4Impl_Open, XCAST(Receive)DirectPlay2WImpl_Receive, IDirectPlay4Impl_Send, - XCAST(SetGroupData)DirectPlay2WImpl_SetGroupData, + IDirectPlay4Impl_SetGroupData, XCAST(SetGroupName)DirectPlay2WImpl_SetGroupName, XCAST(SetPlayerData)DirectPlay2WImpl_SetPlayerData, XCAST(SetPlayerName)DirectPlay2WImpl_SetPlayerName,
1
0
0
0
Michael Stefaniuc : dplayx: Merge the IDirectPlay4_GetPlayerData helper.
by Alexandre Julliard
02 Apr '13
02 Apr '13
Module: wine Branch: master Commit: 0dd3f041f426f3d786ac6c178f764a2298b0c0ff URL:
http://source.winehq.org/git/wine.git/?a=commit;h=0dd3f041f426f3d786ac6c178…
Author: Michael Stefaniuc <mstefani(a)redhat.de> Date: Fri Mar 29 16:55:48 2013 +0100 dplayx: Merge the IDirectPlay4_GetPlayerData helper. --- dlls/dplayx/dplay.c | 93 ++++++++++++++++++++------------------------------- 1 files changed, 36 insertions(+), 57 deletions(-) diff --git a/dlls/dplayx/dplay.c b/dlls/dplayx/dplay.c index 609d6ad..9e27ab7 100644 --- a/dlls/dplayx/dplay.c +++ b/dlls/dplayx/dplay.c @@ -89,9 +89,6 @@ static HRESULT DP_IF_DestroyPlayer static HRESULT DP_IF_GetGroupName ( IDirectPlay2Impl* This, DPID idGroup, LPVOID lpData, LPDWORD lpdwDataSize, BOOL bAnsi ); -static HRESULT DP_IF_GetPlayerData - ( IDirectPlay2Impl* This, DPID idPlayer, LPVOID lpData, - LPDWORD lpdwDataSize, DWORD dwFlags, BOOL bAnsi ); static HRESULT DP_IF_GetPlayerName ( IDirectPlay2Impl* This, DPID idPlayer, LPVOID lpData, LPDWORD lpdwDataSize, BOOL bAnsi ); @@ -2249,68 +2246,50 @@ static HRESULT WINAPI IDirectPlay4Impl_GetPlayerCaps( IDirectPlay4 *iface, DPID return (*This->dp2->spData.lpCB->GetCaps)( &data ); } -static HRESULT DP_IF_GetPlayerData - ( IDirectPlay2Impl* This, DPID idPlayer, LPVOID lpData, - LPDWORD lpdwDataSize, DWORD dwFlags, BOOL bAnsi ) +static HRESULT WINAPI IDirectPlay4AImpl_GetPlayerData( IDirectPlay4A *iface, DPID player, + void *data, DWORD *size, DWORD flags ) { - lpPlayerList lpPList; - DWORD dwRequiredBufferSize; - LPVOID lpCopyDataFrom; - - TRACE( "(%p)->(0x%08x,%p,%p,0x%08x,%u)\n", - This, idPlayer, lpData, lpdwDataSize, dwFlags, bAnsi ); + IDirectPlayImpl *This = impl_from_IDirectPlay4A( iface ); + return IDirectPlayX_GetPlayerData( &This->IDirectPlay4_iface, player, data, size, flags ); +} - if( This->dp2->connectionInitialized == NO_PROVIDER ) - { - return DPERR_UNINITIALIZED; - } +static HRESULT WINAPI IDirectPlay4Impl_GetPlayerData( IDirectPlay4 *iface, DPID player, + void *data, DWORD *size, DWORD flags ) +{ + IDirectPlayImpl *This = impl_from_IDirectPlay4( iface ); + lpPlayerList plist; + DWORD bufsize; + void *src; - if( ( lpPList = DP_FindPlayer( This, idPlayer ) ) == NULL ) - { - return DPERR_INVALIDPLAYER; - } + TRACE( "(%p)->(0x%08x,%p,%p,0x%08x)\n", This, player, data, size, flags ); - /* How much buffer is required? */ - if( dwFlags & DPSET_LOCAL ) - { - dwRequiredBufferSize = lpPList->lpPData->dwLocalDataSize; - lpCopyDataFrom = lpPList->lpPData->lpLocalData; - } - else - { - dwRequiredBufferSize = lpPList->lpPData->dwRemoteDataSize; - lpCopyDataFrom = lpPList->lpPData->lpRemoteData; - } + if ( This->dp2->connectionInitialized == NO_PROVIDER ) + return DPERR_UNINITIALIZED; - /* Is the user requesting to know how big a buffer is required? */ - if( ( lpData == NULL ) || - ( *lpdwDataSize < dwRequiredBufferSize ) - ) - { - *lpdwDataSize = dwRequiredBufferSize; - return DPERR_BUFFERTOOSMALL; - } + if ( ( plist = DP_FindPlayer( This, player ) ) == NULL ) + return DPERR_INVALIDPLAYER; - CopyMemory( lpData, lpCopyDataFrom, dwRequiredBufferSize ); + if ( flags & DPSET_LOCAL ) + { + bufsize = plist->lpPData->dwLocalDataSize; + src = plist->lpPData->lpLocalData; + } + else + { + bufsize = plist->lpPData->dwRemoteDataSize; + src = plist->lpPData->lpRemoteData; + } - return DP_OK; -} + /* Is the user requesting to know how big a buffer is required? */ + if ( !data || *size < bufsize ) + { + *size = bufsize; + return DPERR_BUFFERTOOSMALL; + } -static HRESULT WINAPI IDirectPlay4AImpl_GetPlayerData( IDirectPlay4A *iface, DPID idPlayer, - void *lpData, DWORD *lpdwDataSize, DWORD dwFlags ) -{ - IDirectPlayImpl *This = impl_from_IDirectPlay4A( iface ); - return DP_IF_GetPlayerData( This, idPlayer, lpData, lpdwDataSize, - dwFlags, TRUE ); -} + CopyMemory( data, src, bufsize ); -static HRESULT WINAPI DirectPlay2WImpl_GetPlayerData - ( LPDIRECTPLAY2 iface, DPID idPlayer, LPVOID lpData, - LPDWORD lpdwDataSize, DWORD dwFlags ) -{ - IDirectPlay2Impl *This = (IDirectPlay2Impl *)iface; - return DP_IF_GetPlayerData( This, idPlayer, lpData, lpdwDataSize, - dwFlags, FALSE ); + return DP_OK; } static HRESULT DP_IF_GetPlayerName @@ -4489,7 +4468,7 @@ static const IDirectPlay4Vtbl dp4_vt = IDirectPlay4Impl_GetMessageCount, IDirectPlay4Impl_GetPlayerAddress, IDirectPlay4Impl_GetPlayerCaps, - XCAST(GetPlayerData)DirectPlay2WImpl_GetPlayerData, + IDirectPlay4Impl_GetPlayerData, XCAST(GetPlayerName)DirectPlay2WImpl_GetPlayerName, XCAST(GetSessionDesc)DirectPlay2WImpl_GetSessionDesc, IDirectPlay4Impl_Initialize,
1
0
0
0
Michael Stefaniuc : dplayx: Merge the IDirectPlay4_GetPlayerCaps helper.
by Alexandre Julliard
02 Apr '13
02 Apr '13
Module: wine Branch: master Commit: a784e23917a3ca8055b7efeb51b3356ee636eb47 URL:
http://source.winehq.org/git/wine.git/?a=commit;h=a784e23917a3ca8055b7efeb5…
Author: Michael Stefaniuc <mstefani(a)redhat.de> Date: Fri Mar 29 16:55:04 2013 +0100 dplayx: Merge the IDirectPlay4_GetPlayerCaps helper. --- dlls/dplayx/dplay.c | 57 +++++++++++++++++++------------------------------- 1 files changed, 22 insertions(+), 35 deletions(-) diff --git a/dlls/dplayx/dplay.c b/dlls/dplayx/dplay.c index bc34f03..609d6ad 100644 --- a/dlls/dplayx/dplay.c +++ b/dlls/dplayx/dplay.c @@ -143,9 +143,6 @@ static HRESULT DP_SP_SendEx static HRESULT DP_IF_SetGroupData ( IDirectPlay2Impl* This, DPID idGroup, LPVOID lpData, DWORD dwDataSize, DWORD dwFlags, BOOL bAnsi ); -static HRESULT DP_IF_GetPlayerCaps - ( IDirectPlay2Impl* This, DPID idPlayer, LPDPCAPS lpDPCaps, - DWORD dwFlags ); static HRESULT DP_IF_CancelMessage ( IDirectPlay4Impl* This, DWORD dwMsgID, DWORD dwFlags, DWORD dwMinPriority, DWORD dwMaxPriority, BOOL bAnsi ); @@ -2066,28 +2063,6 @@ static HRESULT WINAPI DirectPlay2WImpl_EnumSessions lpContext, dwFlags, FALSE ); } -static HRESULT DP_IF_GetPlayerCaps - ( IDirectPlay2Impl* This, DPID idPlayer, LPDPCAPS lpDPCaps, - DWORD dwFlags ) -{ - DPSP_GETCAPSDATA data; - - TRACE("(%p)->(0x%08x,%p,0x%08x)\n", This, idPlayer, lpDPCaps, dwFlags); - - if ( This->dp2->connectionInitialized == NO_PROVIDER ) - { - return DPERR_UNINITIALIZED; - } - - /* Query the service provider */ - data.idPlayer = idPlayer; - data.dwFlags = dwFlags; - data.lpCaps = lpDPCaps; - data.lpISP = This->dp2->spData.lpISP; - - return (*This->dp2->spData.lpCB->GetCaps)( &data ); -} - static HRESULT WINAPI IDirectPlay4AImpl_GetCaps( IDirectPlay4A *iface, DPCAPS *caps, DWORD flags ) { return IDirectPlayX_GetPlayerCaps( iface, DPID_ALLPLAYERS, caps, flags ); @@ -2247,19 +2222,31 @@ static HRESULT WINAPI IDirectPlay4Impl_GetPlayerAddress( IDirectPlay4 *iface, DP return DP_OK; } -static HRESULT WINAPI IDirectPlay4AImpl_GetPlayerCaps( IDirectPlay4A *iface, DPID idPlayer, - DPCAPS *lpPlayerCaps, DWORD dwFlags ) +static HRESULT WINAPI IDirectPlay4AImpl_GetPlayerCaps( IDirectPlay4A *iface, DPID player, + DPCAPS *caps, DWORD flags ) { - IDirectPlayImpl *This = impl_from_IDirectPlay4A( iface ); - return DP_IF_GetPlayerCaps( This, idPlayer, lpPlayerCaps, dwFlags ); + IDirectPlayImpl *This = impl_from_IDirectPlay4A( iface ); + return IDirectPlayX_GetPlayerCaps( &This->IDirectPlay4_iface, player, caps, flags ); } -static HRESULT WINAPI DirectPlay2WImpl_GetPlayerCaps - ( LPDIRECTPLAY2 iface, DPID idPlayer, LPDPCAPS lpPlayerCaps, - DWORD dwFlags ) +static HRESULT WINAPI IDirectPlay4Impl_GetPlayerCaps( IDirectPlay4 *iface, DPID player, + DPCAPS *caps, DWORD flags ) { - IDirectPlay2Impl *This = (IDirectPlay2Impl *)iface; - return DP_IF_GetPlayerCaps( This, idPlayer, lpPlayerCaps, dwFlags ); + IDirectPlayImpl *This = impl_from_IDirectPlay4( iface ); + DPSP_GETCAPSDATA data; + + TRACE( "(%p)->(0x%08x,%p,0x%08x)\n", This, player, caps, flags); + + if ( This->dp2->connectionInitialized == NO_PROVIDER ) + return DPERR_UNINITIALIZED; + + /* Query the service provider */ + data.idPlayer = player; + data.dwFlags = flags; + data.lpCaps = caps; + data.lpISP = This->dp2->spData.lpISP; + + return (*This->dp2->spData.lpCB->GetCaps)( &data ); } static HRESULT DP_IF_GetPlayerData @@ -4501,7 +4488,7 @@ static const IDirectPlay4Vtbl dp4_vt = XCAST(GetGroupName)DirectPlay2WImpl_GetGroupName, IDirectPlay4Impl_GetMessageCount, IDirectPlay4Impl_GetPlayerAddress, - XCAST(GetPlayerCaps)DirectPlay2WImpl_GetPlayerCaps, + IDirectPlay4Impl_GetPlayerCaps, XCAST(GetPlayerData)DirectPlay2WImpl_GetPlayerData, XCAST(GetPlayerName)DirectPlay2WImpl_GetPlayerName, XCAST(GetSessionDesc)DirectPlay2WImpl_GetSessionDesc,
1
0
0
0
Michael Stefaniuc : dplayx: Forward IDirectPlay::GetCaps to ::GetPlayerCaps .
by Alexandre Julliard
02 Apr '13
02 Apr '13
Module: wine Branch: master Commit: 47cde46c43f2fd0f9c03f69fc4c0e3a819026355 URL:
http://source.winehq.org/git/wine.git/?a=commit;h=47cde46c43f2fd0f9c03f69fc…
Author: Michael Stefaniuc <mstefani(a)redhat.de> Date: Fri Mar 29 16:54:37 2013 +0100 dplayx: Forward IDirectPlay::GetCaps to ::GetPlayerCaps. --- dlls/dplayx/dplay.c | 24 ++++++------------------ 1 files changed, 6 insertions(+), 18 deletions(-) diff --git a/dlls/dplayx/dplay.c b/dlls/dplayx/dplay.c index 3bc5402..bc34f03 100644 --- a/dlls/dplayx/dplay.c +++ b/dlls/dplayx/dplay.c @@ -156,8 +156,6 @@ static HRESULT DP_IF_EnumGroupsInGroup static HRESULT DP_IF_GetGroupParent ( IDirectPlay3AImpl* This, DPID idGroup, LPDPID lpidGroup, BOOL bAnsi ); -static HRESULT DP_IF_GetCaps - ( IDirectPlay2Impl* This, LPDPCAPS lpDPCaps, DWORD dwFlags ); static HRESULT DP_IF_EnumSessions ( IDirectPlay2Impl* This, LPDPSESSIONDESC2 lpsd, DWORD dwTimeout, LPDPENUMSESSIONSCALLBACK2 lpEnumSessionsCallback2, @@ -1953,7 +1951,7 @@ static HRESULT DP_IF_EnumSessions DPCAPS spCaps; spCaps.dwSize = sizeof( spCaps ); - DP_IF_GetCaps( This, &spCaps, 0 ); + IDirectPlayX_GetCaps( &This->IDirectPlay4_iface, &spCaps, 0 ); dwTimeout = spCaps.dwTimeout; /* The service provider doesn't provide one either! */ @@ -2090,24 +2088,14 @@ static HRESULT DP_IF_GetPlayerCaps return (*This->dp2->spData.lpCB->GetCaps)( &data ); } -static HRESULT DP_IF_GetCaps - ( IDirectPlay2Impl* This, LPDPCAPS lpDPCaps, DWORD dwFlags ) +static HRESULT WINAPI IDirectPlay4AImpl_GetCaps( IDirectPlay4A *iface, DPCAPS *caps, DWORD flags ) { - return DP_IF_GetPlayerCaps( This, DPID_ALLPLAYERS, lpDPCaps, dwFlags ); + return IDirectPlayX_GetPlayerCaps( iface, DPID_ALLPLAYERS, caps, flags ); } -static HRESULT WINAPI IDirectPlay4AImpl_GetCaps( IDirectPlay4A *iface, DPCAPS *lpDPCaps, - DWORD dwFlags ) -{ - IDirectPlayImpl *This = impl_from_IDirectPlay4A( iface ); - return DP_IF_GetCaps( This, lpDPCaps, dwFlags ); -} - -static HRESULT WINAPI DirectPlay2WImpl_GetCaps - ( LPDIRECTPLAY2 iface, LPDPCAPS lpDPCaps, DWORD dwFlags ) +static HRESULT WINAPI IDirectPlay4Impl_GetCaps( IDirectPlay4 *iface, DPCAPS *caps, DWORD flags ) { - IDirectPlay2Impl *This = (IDirectPlay2Impl *)iface; - return DP_IF_GetCaps( This, lpDPCaps, dwFlags ); + return IDirectPlayX_GetPlayerCaps( iface, DPID_ALLPLAYERS, caps, flags ); } static HRESULT WINAPI IDirectPlay4AImpl_GetGroupData( IDirectPlay4A *iface, DPID group, @@ -4508,7 +4496,7 @@ static const IDirectPlay4Vtbl dp4_vt = IDirectPlay4Impl_EnumGroups, IDirectPlay4Impl_EnumPlayers, XCAST(EnumSessions)DirectPlay2WImpl_EnumSessions, - XCAST(GetCaps)DirectPlay2WImpl_GetCaps, + IDirectPlay4Impl_GetCaps, IDirectPlay4Impl_GetGroupData, XCAST(GetGroupName)DirectPlay2WImpl_GetGroupName, IDirectPlay4Impl_GetMessageCount,
1
0
0
0
Michael Stefaniuc : dplayx: Merge the IDirectPlay4_GetGroupData helper.
by Alexandre Julliard
02 Apr '13
02 Apr '13
Module: wine Branch: master Commit: 4ccd8720d516302dca204fe9a46bf0f8f5292e01 URL:
http://source.winehq.org/git/wine.git/?a=commit;h=4ccd8720d516302dca204fe9a…
Author: Michael Stefaniuc <mstefani(a)redhat.de> Date: Fri Mar 29 16:54:00 2013 +0100 dplayx: Merge the IDirectPlay4_GetGroupData helper. --- dlls/dplayx/dplay.c | 88 ++++++++++++++++++++------------------------------ 1 files changed, 35 insertions(+), 53 deletions(-) diff --git a/dlls/dplayx/dplay.c b/dlls/dplayx/dplay.c index d21ac89..3bc5402 100644 --- a/dlls/dplayx/dplay.c +++ b/dlls/dplayx/dplay.c @@ -86,9 +86,6 @@ static HRESULT DP_IF_DestroyGroup ( IDirectPlay2Impl* This, LPVOID lpMsgHdr, DPID idGroup, BOOL bAnsi ); static HRESULT DP_IF_DestroyPlayer ( IDirectPlay2Impl* This, LPVOID lpMsgHdr, DPID idPlayer, BOOL bAnsi ); -static HRESULT DP_IF_GetGroupData - ( IDirectPlay2Impl* This, DPID idGroup, LPVOID lpData, - LPDWORD lpdwDataSize, DWORD dwFlags, BOOL bAnsi ); static HRESULT DP_IF_GetGroupName ( IDirectPlay2Impl* This, DPID idGroup, LPVOID lpData, LPDWORD lpdwDataSize, BOOL bAnsi ); @@ -2113,63 +2110,48 @@ static HRESULT WINAPI DirectPlay2WImpl_GetCaps return DP_IF_GetCaps( This, lpDPCaps, dwFlags ); } -static HRESULT DP_IF_GetGroupData - ( IDirectPlay2Impl* This, DPID idGroup, LPVOID lpData, - LPDWORD lpdwDataSize, DWORD dwFlags, BOOL bAnsi ) +static HRESULT WINAPI IDirectPlay4AImpl_GetGroupData( IDirectPlay4A *iface, DPID group, + void *data, DWORD *size, DWORD flags ) { - lpGroupData lpGData; - DWORD dwRequiredBufferSize; - LPVOID lpCopyDataFrom; - - TRACE( "(%p)->(0x%08x,%p,%p,0x%08x,%u)\n", - This, idGroup, lpData, lpdwDataSize, dwFlags, bAnsi ); + IDirectPlayImpl *This = impl_from_IDirectPlay4A( iface ); + return IDirectPlayX_GetGroupData( &This->IDirectPlay4_iface, group, data, size, flags ); +} - if( ( lpGData = DP_FindAnyGroup( This, idGroup ) ) == NULL ) - { - return DPERR_INVALIDGROUP; - } +static HRESULT WINAPI IDirectPlay4Impl_GetGroupData( IDirectPlay4 *iface, DPID group, + void *data, DWORD *size, DWORD flags ) +{ + IDirectPlayImpl *This = impl_from_IDirectPlay4( iface ); + lpGroupData gdata; + DWORD bufsize; + void *src; - /* How much buffer is required? */ - if( dwFlags & DPSET_LOCAL ) - { - dwRequiredBufferSize = lpGData->dwLocalDataSize; - lpCopyDataFrom = lpGData->lpLocalData; - } - else - { - dwRequiredBufferSize = lpGData->dwRemoteDataSize; - lpCopyDataFrom = lpGData->lpRemoteData; - } + TRACE( "(%p)->(0x%08x,%p,%p,0x%08x)\n", This, group, data, size, flags ); - /* Is the user requesting to know how big a buffer is required? */ - if( ( lpData == NULL ) || - ( *lpdwDataSize < dwRequiredBufferSize ) - ) - { - *lpdwDataSize = dwRequiredBufferSize; - return DPERR_BUFFERTOOSMALL; - } + if ( ( gdata = DP_FindAnyGroup( This, group ) ) == NULL ) + return DPERR_INVALIDGROUP; - CopyMemory( lpData, lpCopyDataFrom, dwRequiredBufferSize ); + /* How much buffer is required? */ + if ( flags & DPSET_LOCAL ) + { + bufsize = gdata->dwLocalDataSize; + src = gdata->lpLocalData; + } + else + { + bufsize = gdata->dwRemoteDataSize; + src = gdata->lpRemoteData; + } - return DP_OK; -} + /* Is the user requesting to know how big a buffer is required? */ + if ( !data || *size < bufsize ) + { + *size = bufsize; + return DPERR_BUFFERTOOSMALL; + } -static HRESULT WINAPI IDirectPlay4AImpl_GetGroupData( IDirectPlay4A *iface, DPID idGroup, - void *lpData, DWORD *lpdwDataSize, DWORD dwFlags ) -{ - IDirectPlayImpl *This = impl_from_IDirectPlay4A( iface ); - return DP_IF_GetGroupData( This, idGroup, lpData, lpdwDataSize, - dwFlags, TRUE ); -} + CopyMemory( data, src, bufsize ); -static HRESULT WINAPI DirectPlay2WImpl_GetGroupData - ( LPDIRECTPLAY2 iface, DPID idGroup, LPVOID lpData, - LPDWORD lpdwDataSize, DWORD dwFlags ) -{ - IDirectPlay2Impl *This = (IDirectPlay2Impl *)iface; - return DP_IF_GetGroupData( This, idGroup, lpData, lpdwDataSize, - dwFlags, FALSE ); + return DP_OK; } static HRESULT DP_IF_GetGroupName @@ -4527,7 +4509,7 @@ static const IDirectPlay4Vtbl dp4_vt = IDirectPlay4Impl_EnumPlayers, XCAST(EnumSessions)DirectPlay2WImpl_EnumSessions, XCAST(GetCaps)DirectPlay2WImpl_GetCaps, - XCAST(GetGroupData)DirectPlay2WImpl_GetGroupData, + IDirectPlay4Impl_GetGroupData, XCAST(GetGroupName)DirectPlay2WImpl_GetGroupName, IDirectPlay4Impl_GetMessageCount, IDirectPlay4Impl_GetPlayerAddress,
1
0
0
0
Michael Stefaniuc : dplayx: Merge the IDirectPlay4_EnumGroupPlayers helper.
by Alexandre Julliard
02 Apr '13
02 Apr '13
Module: wine Branch: master Commit: 7cd17803d52c15860e70f3cc7dd14e66c5a5772b URL:
http://source.winehq.org/git/wine.git/?a=commit;h=7cd17803d52c15860e70f3cc7…
Author: Michael Stefaniuc <mstefani(a)redhat.de> Date: Fri Mar 29 16:53:07 2013 +0100 dplayx: Merge the IDirectPlay4_EnumGroupPlayers helper. --- dlls/dplayx/dplay.c | 122 +++++++++++++++++---------------------------------- 1 files changed, 41 insertions(+), 81 deletions(-) diff --git a/dlls/dplayx/dplay.c b/dlls/dplayx/dplay.c index ddbba48..d21ac89 100644 --- a/dlls/dplayx/dplay.c +++ b/dlls/dplayx/dplay.c @@ -86,10 +86,6 @@ static HRESULT DP_IF_DestroyGroup ( IDirectPlay2Impl* This, LPVOID lpMsgHdr, DPID idGroup, BOOL bAnsi ); static HRESULT DP_IF_DestroyPlayer ( IDirectPlay2Impl* This, LPVOID lpMsgHdr, DPID idPlayer, BOOL bAnsi ); -static HRESULT DP_IF_EnumGroupPlayers - ( IDirectPlay2Impl* This, DPID idGroup, LPGUID lpguidInstance, - LPDPENUMPLAYERSCALLBACK2 lpEnumPlayersCallback2, - LPVOID lpContext, DWORD dwFlags, BOOL bAnsi ); static HRESULT DP_IF_GetGroupData ( IDirectPlay2Impl* This, DPID idGroup, LPVOID lpData, LPDWORD lpdwDataSize, DWORD dwFlags, BOOL bAnsi ); @@ -1559,8 +1555,8 @@ static HRESULT DP_IF_DestroyGroup context.idGroup = idGroup; /* Remove all players that this group has */ - DP_IF_EnumGroupPlayers( This, idGroup, NULL, - cbRemoveGroupOrPlayer, &context, 0, bAnsi ); + IDirectPlayX_EnumGroupPlayers( &This->IDirectPlay4_iface, idGroup, NULL, cbRemoveGroupOrPlayer, + &context, 0 ); /* Remove all links to groups that this group has since this is dp3 */ DP_IF_EnumGroupsInGroup( (IDirectPlay3Impl*)This, idGroup, NULL, @@ -1713,90 +1709,54 @@ static HRESULT WINAPI DirectPlay2WImpl_DestroyPlayer return DP_IF_DestroyPlayer( This, NULL, idPlayer, FALSE ); } -static HRESULT DP_IF_EnumGroupPlayers - ( IDirectPlay2Impl* This, DPID idGroup, LPGUID lpguidInstance, - LPDPENUMPLAYERSCALLBACK2 lpEnumPlayersCallback2, - LPVOID lpContext, DWORD dwFlags, BOOL bAnsi ) +static HRESULT WINAPI IDirectPlay4AImpl_EnumGroupPlayers( IDirectPlay4A *iface, DPID group, + GUID *instance, LPDPENUMPLAYERSCALLBACK2 enumplayercb, void *context, DWORD flags ) { - lpGroupData lpGData; - lpPlayerList lpPList; - - FIXME("(%p)->(0x%08x,%p,%p,%p,0x%08x,%u): semi stub\n", - This, idGroup, lpguidInstance, lpEnumPlayersCallback2, - lpContext, dwFlags, bAnsi ); - - if( This->dp2->connectionInitialized == NO_PROVIDER ) - { - return DPERR_UNINITIALIZED; - } - - /* Find the group */ - if( ( lpGData = DP_FindAnyGroup( This, idGroup ) ) == NULL ) - { - return DPERR_INVALIDGROUP; - } + IDirectPlayImpl *This = impl_from_IDirectPlay4A( iface ); + return IDirectPlayX_EnumGroupPlayers( &This->IDirectPlay4_iface, group, instance, enumplayercb, + context, flags ); +} - if( DPQ_IS_EMPTY( lpGData->players ) ) - { - return DP_OK; - } +static HRESULT WINAPI IDirectPlay4Impl_EnumGroupPlayers( IDirectPlay4 *iface, DPID group, + GUID *instance, LPDPENUMPLAYERSCALLBACK2 enumplayercb, void *context, DWORD flags ) +{ + IDirectPlayImpl *This = impl_from_IDirectPlay4( iface ); + lpGroupData gdata; + lpPlayerList plist; - lpPList = DPQ_FIRST( lpGData->players ); + FIXME( "(%p)->(0x%08x,%p,%p,%p,0x%08x): semi stub\n", This, group, instance, enumplayercb, + context, flags ); - /* Walk the players in this group */ - for( ;; ) - { - /* We do not enum the name server or app server as they are of no - * consequence to the end user. - */ - if( ( lpPList->lpPData->dpid != DPID_NAME_SERVER ) && - ( lpPList->lpPData->dpid != DPID_SERVERPLAYER ) - ) - { + if ( This->dp2->connectionInitialized == NO_PROVIDER ) + return DPERR_UNINITIALIZED; - /* FIXME: Need to add stuff for dwFlags checking */ + /* Find the group */ + if ( ( gdata = DP_FindAnyGroup( This, group ) ) == NULL ) + return DPERR_INVALIDGROUP; - if( !lpEnumPlayersCallback2( lpPList->lpPData->dpid, DPPLAYERTYPE_PLAYER, - &lpPList->lpPData->name, - lpPList->lpPData->dwFlags, - lpContext ) - ) - { - /* User requested break */ + if ( DPQ_IS_EMPTY( gdata->players ) ) return DP_OK; - } - } - if( DPQ_IS_ENDOFLIST( lpPList->players ) ) + /* Walk the players in this group */ + for( plist = DPQ_FIRST( gdata->players ); ; plist = DPQ_NEXT( plist->players ) ) { - break; - } - - lpPList = DPQ_NEXT( lpPList->players ); - } - - return DP_OK; -} - -static HRESULT WINAPI IDirectPlay4AImpl_EnumGroupPlayers( IDirectPlay4A *iface, DPID idGroup, - GUID *lpguidInstance, LPDPENUMPLAYERSCALLBACK2 lpEnumPlayersCallback2, - void *lpContext, DWORD dwFlags ) -{ - IDirectPlayImpl *This = impl_from_IDirectPlay4A( iface ); - return DP_IF_EnumGroupPlayers( This, idGroup, lpguidInstance, - lpEnumPlayersCallback2, lpContext, - dwFlags, TRUE ); -} + /* We do not enum the name server or app server as they are of no + * consequence to the end user. + */ + if ( ( plist->lpPData->dpid != DPID_NAME_SERVER ) && + ( plist->lpPData->dpid != DPID_SERVERPLAYER ) ) + { + /* FIXME: Need to add stuff for flags checking */ + if ( !enumplayercb( plist->lpPData->dpid, DPPLAYERTYPE_PLAYER, + &plist->lpPData->name, plist->lpPData->dwFlags, context ) ) + /* User requested break */ + return DP_OK; + } -static HRESULT WINAPI DirectPlay2WImpl_EnumGroupPlayers - ( LPDIRECTPLAY2 iface, DPID idGroup, LPGUID lpguidInstance, - LPDPENUMPLAYERSCALLBACK2 lpEnumPlayersCallback2, - LPVOID lpContext, DWORD dwFlags ) -{ - IDirectPlay2Impl *This = (IDirectPlay2Impl *)iface; - return DP_IF_EnumGroupPlayers( This, idGroup, lpguidInstance, - lpEnumPlayersCallback2, lpContext, - dwFlags, FALSE ); + if ( DPQ_IS_ENDOFLIST( plist->players ) ) + break; + } + return DP_OK; } /* NOTE: This only enumerates top level groups (created with CreateGroup) */ @@ -4562,7 +4522,7 @@ static const IDirectPlay4Vtbl dp4_vt = IDirectPlay4Impl_DeletePlayerFromGroup, XCAST(DestroyGroup)DirectPlay2WImpl_DestroyGroup, XCAST(DestroyPlayer)DirectPlay2WImpl_DestroyPlayer, - XCAST(EnumGroupPlayers)DirectPlay2WImpl_EnumGroupPlayers, + IDirectPlay4Impl_EnumGroupPlayers, IDirectPlay4Impl_EnumGroups, IDirectPlay4Impl_EnumPlayers, XCAST(EnumSessions)DirectPlay2WImpl_EnumSessions,
1
0
0
0
Michael Stefaniuc : dplayx: Merge the IDirectPlay4_DeletePlayerFromGroup helper.
by Alexandre Julliard
02 Apr '13
02 Apr '13
Module: wine Branch: master Commit: dfe8563d92af1528c1f86b6e73f956e8ad59d45f URL:
http://source.winehq.org/git/wine.git/?a=commit;h=dfe8563d92af1528c1f86b6e7…
Author: Michael Stefaniuc <mstefani(a)redhat.de> Date: Fri Mar 29 16:52:30 2013 +0100 dplayx: Merge the IDirectPlay4_DeletePlayerFromGroup helper. --- dlls/dplayx/dplay.c | 119 +++++++++++++++++++------------------------------- 1 files changed, 45 insertions(+), 74 deletions(-) diff --git a/dlls/dplayx/dplay.c b/dlls/dplayx/dplay.c index ffaee2d..ddbba48 100644 --- a/dlls/dplayx/dplay.c +++ b/dlls/dplayx/dplay.c @@ -78,9 +78,6 @@ static BOOL CALLBACK cbRemoveGroupOrPlayer( DPID dpId, DWORD dwPlayerType, static void DP_DeleteGroup( IDirectPlay2Impl* This, DPID dpid ); /* Helper methods for player/group interfaces */ -static HRESULT DP_IF_DeletePlayerFromGroup - ( IDirectPlay2Impl* This, LPVOID lpMsgHdr, DPID idGroup, - DPID idPlayer, BOOL bAnsi ); static HRESULT DP_IF_CreatePlayer ( IDirectPlay2Impl* This, LPVOID lpMsgHdr, LPDPID lpidPlayer, LPDPNAME lpPlayerName, HANDLE hEvent, LPVOID lpData, @@ -1448,76 +1445,60 @@ static DPID DP_GetRemoteNextObjectId(void) return DP_NextObjectId(); } -static HRESULT DP_IF_DeletePlayerFromGroup - ( IDirectPlay2Impl* This, LPVOID lpMsgHdr, DPID idGroup, - DPID idPlayer, BOOL bAnsi ) +static HRESULT WINAPI IDirectPlay4AImpl_DeletePlayerFromGroup( IDirectPlay4A *iface, DPID group, + DPID player ) { - HRESULT hr = DP_OK; - - lpGroupData lpGData; - lpPlayerList lpPList; - - TRACE( "(%p)->(%p,0x%08x,0x%08x,%u)\n", - This, lpMsgHdr, idGroup, idPlayer, bAnsi ); - - /* Find the group */ - if( ( lpGData = DP_FindAnyGroup( This, idGroup ) ) == NULL ) - { - return DPERR_INVALIDGROUP; - } + IDirectPlayImpl *This = impl_from_IDirectPlay4A( iface ); + return IDirectPlayX_DeletePlayerFromGroup( &This->IDirectPlay4_iface, group, player ); +} - /* Find the player */ - if( ( lpPList = DP_FindPlayer( This, idPlayer ) ) == NULL ) - { - return DPERR_INVALIDPLAYER; - } +static HRESULT WINAPI IDirectPlay4Impl_DeletePlayerFromGroup( IDirectPlay4 *iface, DPID group, + DPID player ) +{ + IDirectPlayImpl *This = impl_from_IDirectPlay4( iface ); + HRESULT hr = DP_OK; - /* Remove the player shortcut from the group */ - DPQ_REMOVE_ENTRY( lpGData->players, players, lpPData->dpid, ==, idPlayer, lpPList ); + lpGroupData gdata; + lpPlayerList plist; - if( lpPList == NULL ) - { - return DPERR_INVALIDPLAYER; - } + TRACE( "(%p)->(0x%08x,0x%08x)\n", This, group, player ); - /* One less reference */ - lpPList->lpPData->uRef--; + /* Find the group */ + if ( ( gdata = DP_FindAnyGroup( This, group ) ) == NULL ) + return DPERR_INVALIDGROUP; - /* Delete the Player List element */ - HeapFree( GetProcessHeap(), 0, lpPList ); + /* Find the player */ + if ( ( plist = DP_FindPlayer( This, player ) ) == NULL ) + return DPERR_INVALIDPLAYER; - /* Inform the SP if they care */ - if( This->dp2->spData.lpCB->RemovePlayerFromGroup ) - { - DPSP_REMOVEPLAYERFROMGROUPDATA data; + /* Remove the player shortcut from the group */ + DPQ_REMOVE_ENTRY( gdata->players, players, lpPData->dpid, ==, player, plist ); - TRACE( "Calling SP RemovePlayerFromGroup\n" ); + if ( !plist ) + return DPERR_INVALIDPLAYER; - data.idPlayer = idPlayer; - data.idGroup = idGroup; - data.lpISP = This->dp2->spData.lpISP; + /* One less reference */ + plist->lpPData->uRef--; - hr = (*This->dp2->spData.lpCB->RemovePlayerFromGroup)( &data ); - } + /* Delete the Player List element */ + HeapFree( GetProcessHeap(), 0, plist ); - /* Need to send a DELETEPLAYERFROMGROUP message */ - FIXME( "Need to send a message\n" ); + /* Inform the SP if they care */ + if ( This->dp2->spData.lpCB->RemovePlayerFromGroup ) + { + DPSP_REMOVEPLAYERFROMGROUPDATA data; - return hr; -} + TRACE( "Calling SP RemovePlayerFromGroup\n" ); + data.idPlayer = player; + data.idGroup = group; + data.lpISP = This->dp2->spData.lpISP; + hr = (*This->dp2->spData.lpCB->RemovePlayerFromGroup)( &data ); + } -static HRESULT WINAPI IDirectPlay4AImpl_DeletePlayerFromGroup( IDirectPlay4A *iface, DPID idGroup, - DPID idPlayer ) -{ - IDirectPlayImpl *This = impl_from_IDirectPlay4A( iface ); - return DP_IF_DeletePlayerFromGroup( This, NULL, idGroup, idPlayer, TRUE ); -} + /* Need to send a DELETEPLAYERFROMGROUP message */ + FIXME( "Need to send a message\n" ); -static HRESULT WINAPI DirectPlay2WImpl_DeletePlayerFromGroup - ( LPDIRECTPLAY2 iface, DPID idGroup, DPID idPlayer ) -{ - IDirectPlay2Impl *This = (IDirectPlay2Impl *)iface; - return DP_IF_DeletePlayerFromGroup( This, NULL, idGroup, idPlayer, FALSE ); + return hr; } typedef struct _DPRGOPContext @@ -1551,18 +1532,9 @@ cbRemoveGroupOrPlayer( dpId, lpCtxt->idGroup ); } } - else - { - if( FAILED( DP_IF_DeletePlayerFromGroup( (IDirectPlay2Impl*)lpCtxt->This, - NULL, lpCtxt->idGroup, - dpId, lpCtxt->bAnsi ) - ) - ) - { - ERR( "Unable to delete player 0x%08x from grp 0x%08x\n", - dpId, lpCtxt->idGroup ); - } - } + else if ( FAILED( IDirectPlayX_DeletePlayerFromGroup( &lpCtxt->This->IDirectPlay4_iface, + lpCtxt->idGroup, dpId ) ) ) + ERR( "Unable to delete player 0x%08x from grp 0x%08x\n", dpId, lpCtxt->idGroup ); return TRUE; /* Continue enumeration */ } @@ -1708,8 +1680,7 @@ cbDeletePlayerFromAllGroups( if( dwPlayerType == DPPLAYERTYPE_GROUP ) { - DP_IF_DeletePlayerFromGroup( lpCtxt->This, NULL, dpId, lpCtxt->idPlayer, - lpCtxt->bAnsi ); + IDirectPlayX_DeletePlayerFromGroup( &lpCtxt->This->IDirectPlay4_iface, dpId, lpCtxt->idPlayer ); /* Enumerate all groups in this group since this will normally only * be called for top level groups @@ -4588,7 +4559,7 @@ static const IDirectPlay4Vtbl dp4_vt = IDirectPlay4Impl_Close, XCAST(CreateGroup)DirectPlay2WImpl_CreateGroup, XCAST(CreatePlayer)DirectPlay2WImpl_CreatePlayer, - XCAST(DeletePlayerFromGroup)DirectPlay2WImpl_DeletePlayerFromGroup, + IDirectPlay4Impl_DeletePlayerFromGroup, XCAST(DestroyGroup)DirectPlay2WImpl_DestroyGroup, XCAST(DestroyPlayer)DirectPlay2WImpl_DestroyPlayer, XCAST(EnumGroupPlayers)DirectPlay2WImpl_EnumGroupPlayers,
1
0
0
0
Michael Stefaniuc : dplayx: Merge the IDirectPlay4_Close helper.
by Alexandre Julliard
02 Apr '13
02 Apr '13
Module: wine Branch: master Commit: 878a6a5a06908ebc97c51c7178756f70c6fb66d9 URL:
http://source.winehq.org/git/wine.git/?a=commit;h=878a6a5a06908ebc97c51c717…
Author: Michael Stefaniuc <mstefani(a)redhat.de> Date: Fri Mar 29 16:52:03 2013 +0100 dplayx: Merge the IDirectPlay4_Close helper. --- dlls/dplayx/dplay.c | 65 +++++++++++++++++++++----------------------------- 1 files changed, 27 insertions(+), 38 deletions(-) diff --git a/dlls/dplayx/dplay.c b/dlls/dplayx/dplay.c index 1f69866..ffaee2d 100644 --- a/dlls/dplayx/dplay.c +++ b/dlls/dplayx/dplay.c @@ -156,7 +156,6 @@ static HRESULT DP_IF_SetGroupData static HRESULT DP_IF_GetPlayerCaps ( IDirectPlay2Impl* This, DPID idPlayer, LPDPCAPS lpDPCaps, DWORD dwFlags ); -static HRESULT DP_IF_Close( IDirectPlay2Impl* This, BOOL bAnsi ); static HRESULT DP_IF_CancelMessage ( IDirectPlay4Impl* This, DWORD dwMsgID, DWORD dwFlags, DWORD dwMinPriority, DWORD dwMaxPriority, BOOL bAnsi ); @@ -670,49 +669,39 @@ static HRESULT WINAPI DirectPlay2WImpl_AddPlayerToGroup 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 ) { - HRESULT hr = DP_OK; - - TRACE("(%p)->(%u)\n", This, bAnsi ); - - /* FIXME: Need to find a new host I assume (how?) */ - /* FIXME: Need to destroy all local groups */ - /* FIXME: Need to migrate all remotely visible players to the new host */ - - /* Invoke the SP callback to inform of session close */ - if( This->dp2->spData.lpCB->CloseEx ) - { - DPSP_CLOSEDATA data; - - TRACE( "Calling SP CloseEx\n" ); + IDirectPlayImpl *This = impl_from_IDirectPlay4A( iface ); + return IDirectPlayX_Close( &This->IDirectPlay4_iface); +} - data.lpISP = This->dp2->spData.lpISP; +static HRESULT WINAPI IDirectPlay4Impl_Close( IDirectPlay4 *iface ) +{ + IDirectPlayImpl *This = impl_from_IDirectPlay4( iface ); + HRESULT hr = DP_OK; - hr = (*This->dp2->spData.lpCB->CloseEx)( &data ); + TRACE( "(%p)", This ); - } - else if ( This->dp2->spData.lpCB->Close ) /* Try obsolete version */ - { - TRACE( "Calling SP Close (obsolete interface)\n" ); + /* FIXME: Need to find a new host I assume (how?) */ + /* FIXME: Need to destroy all local groups */ + /* FIXME: Need to migrate all remotely visible players to the new host */ - hr = (*This->dp2->spData.lpCB->Close)(); - } - - return hr; -} + /* Invoke the SP callback to inform of session close */ + if( This->dp2->spData.lpCB->CloseEx ) + { + DPSP_CLOSEDATA data; -static HRESULT WINAPI IDirectPlay4AImpl_Close( IDirectPlay4A *iface ) -{ - IDirectPlayImpl *This = impl_from_IDirectPlay4A( iface ); - return DP_IF_Close( This, TRUE ); -} + TRACE( "Calling SP CloseEx\n" ); + data.lpISP = This->dp2->spData.lpISP; + hr = (*This->dp2->spData.lpCB->CloseEx)( &data ); + } + else if ( This->dp2->spData.lpCB->Close ) /* Try obsolete version */ + { + TRACE( "Calling SP Close (obsolete interface)\n" ); + hr = (*This->dp2->spData.lpCB->Close)(); + } -static HRESULT WINAPI DirectPlay2WImpl_Close - ( LPDIRECTPLAY2 iface ) -{ - IDirectPlay2Impl *This = (IDirectPlay2Impl *)iface; - return DP_IF_Close( This, FALSE ); + return hr; } static @@ -4596,7 +4585,7 @@ static const IDirectPlay4Vtbl dp4_vt = IDirectPlay4Impl_Release, XCAST(AddPlayerToGroup)DirectPlay2WImpl_AddPlayerToGroup, - XCAST(Close)DirectPlay2WImpl_Close, + IDirectPlay4Impl_Close, XCAST(CreateGroup)DirectPlay2WImpl_CreateGroup, XCAST(CreatePlayer)DirectPlay2WImpl_CreatePlayer, XCAST(DeletePlayerFromGroup)DirectPlay2WImpl_DeletePlayerFromGroup,
1
0
0
0
Michael Stefaniuc : dplayx: Assimilate the inherited stub methods into IDirectPlay4.
by Alexandre Julliard
02 Apr '13
02 Apr '13
Module: wine Branch: master Commit: 5e0da57087e9e89366930a2b529dafe6ff599638 URL:
http://source.winehq.org/git/wine.git/?a=commit;h=5e0da57087e9e89366930a2b5…
Author: Michael Stefaniuc <mstefani(a)redhat.de> Date: Fri Mar 29 16:51:46 2013 +0100 dplayx: Assimilate the inherited stub methods into IDirectPlay4. --- dlls/dplayx/dplay.c | 144 +++++++++++++++++++++++++-------------------------- 1 files changed, 70 insertions(+), 74 deletions(-) Diff:
http://source.winehq.org/git/wine.git/?a=commitdiff;h=5e0da57087e9e89366930…
1
0
0
0
← Newer
1
...
48
49
50
51
52
53
54
...
58
Older →
Jump to page:
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
Results per page:
10
25
50
100
200