dplayx: Respect enumeration flags in EnumGroups().

This commit is contained in:
Anton Baskanov 2024-11-17 18:05:58 +07:00 committed by Alexandre Julliard
parent 30c7900c40
commit 924a8e0d69
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
2 changed files with 18 additions and 16 deletions

View file

@ -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;

View file

@ -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,7 +2853,6 @@ 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 );
memset( &playerData, 0xcc, sizeof( playerData ) );
@ -2993,7 +2992,7 @@ 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",
ok_( __FILE__, line )( data.actualPlayerCount == data.expectedPlayerCount, "got group count %d.\n",
data.actualPlayerCount );
}