dplayx: Add group players from SUPERENUMPLAYERSREPLY to the group.

This commit is contained in:
Anton Baskanov 2024-11-17 18:39:32 +07:00 committed by Alexandre Julliard
parent 91e5057906
commit 7ec576a7bd
Notes: Alexandre Julliard 2024-11-19 23:21:50 +01:00
Approved-by: Alistair Leslie-Hughes (@alesliehughes)
Approved-by: Alexandre Julliard (@julliard)
Merge-Request: https://gitlab.winehq.org/wine/wine/merge_requests/6844
4 changed files with 16 additions and 3 deletions

View file

@ -1132,7 +1132,7 @@ static HRESULT WINAPI IDirectPlay4AImpl_AddPlayerToGroup( IDirectPlay4A *iface,
return IDirectPlayX_AddPlayerToGroup( &This->IDirectPlay4_iface, group, player );
}
static HRESULT DP_AddPlayerToGroup( IDirectPlayImpl *This, DPID group, DPID player )
HRESULT DP_AddPlayerToGroup( IDirectPlayImpl *This, DPID group, DPID player )
{
lpGroupData gdata;
lpPlayerList plist;

View file

@ -221,6 +221,7 @@ HRESULT DP_CreatePlayer( IDirectPlayImpl *This, void *msgHeader, DPID *lpid, DPN
HRESULT DP_CreateGroup( IDirectPlayImpl *This, void *msgHeader, const DPID *lpid,
const DPNAME *lpName, void *data, DWORD dataSize, DWORD dwFlags,
DPID idParent, BOOL bAnsi );
HRESULT DP_AddPlayerToGroup( IDirectPlayImpl *This, DPID group, DPID player );
/* DP SP external interfaces into DirectPlay */
extern HRESULT DP_GetSPPlayerData( IDirectPlayImpl *lpDP, DPID idPlayer, void **lplpData );

View file

@ -679,6 +679,7 @@ HRESULT DP_MSG_ForwardPlayerCreation( IDirectPlayImpl *This, DPID dpidServer, WC
for( i = 0; i < enumPlayersReply->groupCount; ++i )
{
DPPLAYERINFO playerInfo;
int j;
hr = DP_MSG_ReadSuperPackedPlayer( (char *) enumPlayersReply, &offset, dwMsgSize,
&playerInfo );
@ -699,6 +700,17 @@ HRESULT DP_MSG_ForwardPlayerCreation( IDirectPlayImpl *This, DPID dpidServer, WC
free( lpMsg );
return hr;
}
for( j = 0; j < playerInfo.playerCount; ++j )
{
hr = DP_AddPlayerToGroup( This, playerInfo.id, playerInfo.playerIds[ j ] );
if( FAILED( hr ) )
{
free( msgHeader );
free( lpMsg );
return hr;
}
}
}
}
else if( envelope->wCommandId == DPMSGCMD_GETNAMETABLEREPLY )

View file

@ -2969,8 +2969,8 @@ static void checkGroupPlayerList_( int line, DPID group, IDirectPlay4 *dp, Expec
hr = IDirectPlayX_EnumGroupPlayers( dp, group, NULL, checkPlayerListCallback, &data, DPENUMPLAYERS_REMOTE );
ok_( __FILE__, line )( hr == DP_OK, "EnumGroupPlayers() returned %#lx.\n", hr );
todo_wine ok_( __FILE__, line )( data.actualPlayerCount == data.expectedPlayerCount, "got player count %d.\n",
data.actualPlayerCount );
ok_( __FILE__, line )( data.actualPlayerCount == data.expectedPlayerCount, "got player count %d.\n",
data.actualPlayerCount );
}
#define checkGroupList( dp, expectedGroups, expectedGroupCount ) \