From be022f350d8f2b7130cb49a93675c7bd35f11109 Mon Sep 17 00:00:00 2001 From: Anton Baskanov Date: Sun, 17 Nov 2024 16:13:11 +0700 Subject: [PATCH] dplayx: Set group data in DP_CreateGroup(). --- dlls/dplayx/dplay.c | 14 ++++++-------- 1 file changed, 6 insertions(+), 8 deletions(-) diff --git a/dlls/dplayx/dplay.c b/dlls/dplayx/dplay.c index 4f740ca3e90..4bc4b9cf224 100644 --- a/dlls/dplayx/dplay.c +++ b/dlls/dplayx/dplay.c @@ -1282,7 +1282,7 @@ static HRESULT WINAPI IDirectPlay4Impl_Close( IDirectPlay4 *iface ) } static lpGroupData DP_CreateGroup( IDirectPlayImpl *This, const DPID *lpid, const DPNAME *lpName, - DWORD dwFlags, DPID idParent, BOOL bAnsi ) + void *data, DWORD dataSize, DWORD dwFlags, DPID idParent, BOOL bAnsi ) { struct GroupList *groupList = NULL; struct GroupData *parent = NULL; @@ -1363,6 +1363,8 @@ static lpGroupData DP_CreateGroup( IDirectPlayImpl *This, const DPID *lpid, cons /* Something is now referencing this data */ lpGData->uRef++; + DP_SetGroupData( lpGData, DPSET_REMOTE, data, dataSize ); + TRACE( "Created group id 0x%08lx\n", *lpid ); return lpGData; @@ -1453,7 +1455,7 @@ static HRESULT DP_IF_CreateGroup( IDirectPlayImpl *This, void *lpMsgHdr, DPID *l } } - lpGData = DP_CreateGroup( This, lpidGroup, lpGroupName, dwFlags, + lpGData = DP_CreateGroup( This, lpidGroup, lpGroupName, lpData, dwDataSize, dwFlags, DPID_NOPARENT_GROUP, bAnsi ); if( lpGData == NULL ) @@ -1461,9 +1463,6 @@ static HRESULT DP_IF_CreateGroup( IDirectPlayImpl *This, void *lpMsgHdr, DPID *l return DPERR_CANTADDPLAYER; /* yes player not group */ } - /* Set all the important stuff for the group */ - DP_SetGroupData( lpGData, DPSET_REMOTE, lpData, dwDataSize ); - /* FIXME: We should only create the system group if GetCaps returns * DPCAPS_GROUPOPTIMIZED. */ @@ -4484,15 +4483,14 @@ static HRESULT DP_IF_CreateGroupInGroup( IDirectPlayImpl *This, void *lpMsgHdr, return DPERR_UNINITIALIZED; } - lpGData = DP_CreateGroup(This, lpidGroup, lpGroupName, dwFlags, idParentGroup, bAnsi ); + lpGData = DP_CreateGroup(This, lpidGroup, lpGroupName, lpData, dwDataSize, dwFlags, idParentGroup, + bAnsi ); if( lpGData == NULL ) { return DPERR_CANTADDPLAYER; /* yes player not group */ } - DP_SetGroupData( lpGData, DPSET_REMOTE, lpData, dwDataSize ); - /* Let the SP know that we've created this group */ if( This->dp2->spData.lpCB->CreateGroup ) {