diff --git a/dlls/dplayx/dplay.c b/dlls/dplayx/dplay.c index 32fbd35df50..3a4b7e958b6 100644 --- a/dlls/dplayx/dplay.c +++ b/dlls/dplayx/dplay.c @@ -4953,19 +4953,22 @@ static HRESULT DP_IF_EnumGroupsInGroup( IDirectPlayImpl *This, DPID group, GUID if ( ( gdata = DP_FindAnyGroup(This, group ) ) == NULL ) return DPERR_INVALIDGROUP; - if ( DPQ_IS_EMPTY( gdata->groups ) ) - return DP_OK; - - - for( glist = DPQ_FIRST( gdata->groups ); ; glist = DPQ_NEXT( glist->groups ) ) + for( glist = DPQ_FIRST( gdata->groups ); glist; glist = DPQ_NEXT( glist->groups ) ) { - /* FIXME: Should check flags for match here */ - if ( !(*enumplayercb)( glist->lpGData->dpid, DPPLAYERTYPE_GROUP, - ansi ? glist->lpGData->nameA : glist->lpGData->name, flags, context ) ) - return DP_OK; /* User requested break */ + DWORD groupFlags; - if ( DPQ_IS_ENDOFLIST( glist->groups ) ) - break; + if ( (glist->lpGData->dwFlags & flags) != (flags & ~DPENUMGROUPS_REMOTE) ) + continue; + if ( (glist->lpGData->dwFlags & DPENUMGROUPS_LOCAL) && (flags & DPENUMGROUPS_REMOTE) ) + continue; + + groupFlags = glist->lpGData->dwFlags; + groupFlags &= ~(DPENUMGROUPS_LOCAL | DPLAYI_GROUP_DPLAYOWNS); + groupFlags |= flags; + + if ( !(*enumplayercb)( glist->lpGData->dpid, DPPLAYERTYPE_GROUP, + ansi ? glist->lpGData->nameA : glist->lpGData->name, groupFlags, context ) ) + return DP_OK; /* User requested break */ } return DP_OK; diff --git a/dlls/dplayx/tests/dplayx.c b/dlls/dplayx/tests/dplayx.c index c589ab4e8b7..d415e5996ad 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 ) - todo_wine ok_( __FILE__, data->line )( 0, "duplicate player dpid %#lx.\n", dpid ); + 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,8 +2853,7 @@ 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 ) ); } - todo_wine_if( playerType == DPPLAYERTYPE_GROUP && flags == DPENUMPLAYERS_LOCAL ) - ok_( __FILE__, data->line )( flags == player->expectedFlags, "got flags %#lx.\n", flags ); + ok_( __FILE__, data->line )( flags == player->expectedFlags, "got flags %#lx.\n", flags ); memset( &playerData, 0xcc, sizeof( playerData ) ); playerDataSize = sizeof( playerData ); @@ -2993,8 +2992,8 @@ static void checkGroupList_( int line, IDirectPlay4 *dp, ExpectedPlayer *expecte hr = IDirectPlayX_EnumGroups( dp, NULL, checkPlayerListCallback, &data, DPENUMGROUPS_REMOTE ); ok_( __FILE__, line )( hr == DP_OK, "EnumGroups() returned %#lx.\n", hr ); - todo_wine ok_( __FILE__, line )( data.actualPlayerCount == data.expectedPlayerCount, "got group count %d.\n", - data.actualPlayerCount ); + ok_( __FILE__, line )( data.actualPlayerCount == data.expectedPlayerCount, "got group count %d.\n", + data.actualPlayerCount ); } #define checkPlayerExists( dp, expectedDpid, expectedPlayerType, expectedShortName, expectedLongName, expectedFlags, \