From 434b5a148c033e4648536259be7ba8cfdc23cfaa Mon Sep 17 00:00:00 2001 From: Anton Baskanov Date: Sun, 17 Nov 2024 18:08:37 +0700 Subject: [PATCH] dplayx: Always set the data size in GetGroupData(). --- dlls/dplayx/dplay.c | 5 ++--- dlls/dplayx/tests/dplayx.c | 5 ++--- 2 files changed, 4 insertions(+), 6 deletions(-) diff --git a/dlls/dplayx/dplay.c b/dlls/dplayx/dplay.c index 3a4b7e958b6..e4f3fd84366 100644 --- a/dlls/dplayx/dplay.c +++ b/dlls/dplayx/dplay.c @@ -3078,12 +3078,11 @@ static HRESULT WINAPI IDirectPlay4Impl_GetGroupData( IDirectPlay4 *iface, DPID g src = gdata->lpRemoteData; } + *size = bufsize; + /* Is the user requesting to know how big a buffer is required? */ if ( !data || *size < bufsize ) - { - *size = bufsize; return DPERR_BUFFERTOOSMALL; - } CopyMemory( data, src, bufsize ); diff --git a/dlls/dplayx/tests/dplayx.c b/dlls/dplayx/tests/dplayx.c index d415e5996ad..00b5aad6708 100644 --- a/dlls/dplayx/tests/dplayx.c +++ b/dlls/dplayx/tests/dplayx.c @@ -2862,9 +2862,8 @@ 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 ); - todo_wine_if( playerType == DPPLAYERTYPE_GROUP ) - ok_( __FILE__, data->line )( playerDataSize == player->expectedPlayerDataSize, - "got player data size %lu.\n", playerDataSize ); + 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" );