diff --git a/dlls/dplayx/dplay.c b/dlls/dplayx/dplay.c index 0581b0c8cdf..32fbd35df50 100644 --- a/dlls/dplayx/dplay.c +++ b/dlls/dplayx/dplay.c @@ -1281,7 +1281,7 @@ static HRESULT WINAPI IDirectPlay4Impl_Close( IDirectPlay4 *iface ) return hr; } -static HRESULT DP_CreateGroup( IDirectPlayImpl *This, void *msgHeader, const DPID *lpid, +HRESULT DP_CreateGroup( IDirectPlayImpl *This, void *msgHeader, const DPID *lpid, const DPNAME *lpName, void *data, DWORD dataSize, DWORD dwFlags, DPID idParent, BOOL bAnsi ) { diff --git a/dlls/dplayx/dplay_global.h b/dlls/dplayx/dplay_global.h index 902396f52c4..392e0d3232d 100644 --- a/dlls/dplayx/dplay_global.h +++ b/dlls/dplayx/dplay_global.h @@ -218,6 +218,9 @@ HRESULT DP_HandleGameMessage( IDirectPlayImpl *This, void *messageBody, DWORD me HRESULT DP_CreatePlayer( IDirectPlayImpl *This, void *msgHeader, DPID *lpid, DPNAME *lpName, void *data, DWORD dataSize, void *spData, DWORD spDataSize, DWORD dwFlags, HANDLE hEvent, struct PlayerData **playerData, BOOL bAnsi ); +HRESULT DP_CreateGroup( IDirectPlayImpl *This, void *msgHeader, const DPID *lpid, + const DPNAME *lpName, void *data, DWORD dataSize, DWORD dwFlags, + DPID idParent, BOOL bAnsi ); /* DP SP external interfaces into DirectPlay */ extern HRESULT DP_GetSPPlayerData( IDirectPlayImpl *lpDP, DPID idPlayer, void **lplpData ); diff --git a/dlls/dplayx/dplayx_messages.c b/dlls/dplayx/dplayx_messages.c index 3eeb8c23508..93a80283b69 100644 --- a/dlls/dplayx/dplayx_messages.c +++ b/dlls/dplayx/dplayx_messages.c @@ -676,6 +676,30 @@ HRESULT DP_MSG_ForwardPlayerCreation( IDirectPlayImpl *This, DPID dpidServer, WC return hr; } } + for( i = 0; i < enumPlayersReply->groupCount; ++i ) + { + DPPLAYERINFO playerInfo; + + hr = DP_MSG_ReadSuperPackedPlayer( (char *) enumPlayersReply, &offset, dwMsgSize, + &playerInfo ); + if( FAILED( hr ) ) + { + free( msgHeader ); + free( lpMsg ); + return hr; + } + + hr = DP_CreateGroup( This, msgHeader, &playerInfo.id, &playerInfo.name, + playerInfo.playerData, playerInfo.playerDataLength, + playerInfo.flags & ~DPLAYI_PLAYER_PLAYERLOCAL, playerInfo.parentId, + FALSE ); + if( FAILED( hr ) ) + { + free( msgHeader ); + free( lpMsg ); + return hr; + } + } } else if( envelope->wCommandId == DPMSGCMD_GETNAMETABLEREPLY ) { diff --git a/dlls/dplayx/tests/dplayx.c b/dlls/dplayx/tests/dplayx.c index 6f65f9271c2..c589ab4e8b7 100644 --- a/dlls/dplayx/tests/dplayx.c +++ b/dlls/dplayx/tests/dplayx.c @@ -2830,7 +2830,7 @@ static BOOL CALLBACK checkPlayerListCallback( DPID dpid, DWORD playerType, const HRESULT hr; if ( player->actualCount ) - ok_( __FILE__, data->line )( 0, "duplicate player dpid %#lx.\n", dpid ); + todo_wine ok_( __FILE__, data->line )( 0, "duplicate player dpid %#lx.\n", dpid ); ok_( __FILE__, data->line )( playerType == player->expectedPlayerType, "got player type %lu.\n", playerType ); if ( player->expectedShortName ) @@ -2853,7 +2853,8 @@ static BOOL CALLBACK checkPlayerListCallback( DPID dpid, DWORD playerType, const ok_( __FILE__, data->line )( !name->lpszLongNameA, "got long name %s.\n", wine_dbgstr_a( name->lpszLongNameA ) ); } - ok_( __FILE__, data->line )( flags == player->expectedFlags, "got flags %#lx.\n", flags ); + todo_wine_if( playerType == DPPLAYERTYPE_GROUP && flags == DPENUMPLAYERS_LOCAL ) + ok_( __FILE__, data->line )( flags == player->expectedFlags, "got flags %#lx.\n", flags ); memset( &playerData, 0xcc, sizeof( playerData ) ); playerDataSize = sizeof( playerData ); @@ -2862,8 +2863,9 @@ static BOOL CALLBACK checkPlayerListCallback( DPID dpid, DWORD playerType, const else hr = IDirectPlayX_GetGroupData( data->dp, dpid, playerData, &playerDataSize, DPGET_REMOTE ); ok_( __FILE__, data->line )( hr == DP_OK, "GetPlayerData() returned %#lx.\n", hr ); - ok_( __FILE__, data->line )( playerDataSize == player->expectedPlayerDataSize, - "got player data size %lu.\n", playerDataSize ); + todo_wine_if( playerType == DPPLAYERTYPE_GROUP ) + ok_( __FILE__, data->line )( playerDataSize == player->expectedPlayerDataSize, + "got player data size %lu.\n", playerDataSize ); ok_( __FILE__, data->line )( !memcmp( playerData, player->expectedPlayerData, player->expectedPlayerDataSize ), "player data doesn't match.\n" ); @@ -2964,10 +2966,10 @@ static void checkGroupPlayerList_( int line, DPID group, IDirectPlay4 *dp, Expec HRESULT hr; hr = IDirectPlayX_EnumGroupPlayers( dp, group, NULL, checkPlayerListCallback, &data, DPENUMPLAYERS_LOCAL ); - todo_wine ok_( __FILE__, line )( hr == DP_OK, "EnumGroupPlayers() returned %#lx.\n", hr ); + ok_( __FILE__, line )( hr == DP_OK, "EnumGroupPlayers() returned %#lx.\n", hr ); hr = IDirectPlayX_EnumGroupPlayers( dp, group, NULL, checkPlayerListCallback, &data, DPENUMPLAYERS_REMOTE ); - todo_wine ok_( __FILE__, line )( hr == DP_OK, "EnumGroupPlayers() returned %#lx.\n", hr ); + 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 );