mirror of
https://gitlab.winehq.org/wine/wine.git
synced 2024-11-19 17:06:04 -07:00
dplayx: Return HRESULT from DP_CreateGroup().
This commit is contained in:
parent
be022f350d
commit
18a7362940
Notes:
Alexandre Julliard
2024-11-18 23:18:20 +01:00
Approved-by: Alistair Leslie-Hughes (@alesliehughes) Approved-by: Alexandre Julliard (@julliard) Merge-Request: https://gitlab.winehq.org/wine/wine/merge_requests/6829
1 changed files with 18 additions and 18 deletions
|
@ -1281,7 +1281,7 @@ static HRESULT WINAPI IDirectPlay4Impl_Close( IDirectPlay4 *iface )
|
||||||
return hr;
|
return hr;
|
||||||
}
|
}
|
||||||
|
|
||||||
static lpGroupData DP_CreateGroup( IDirectPlayImpl *This, const DPID *lpid, const DPNAME *lpName,
|
static HRESULT DP_CreateGroup( IDirectPlayImpl *This, const DPID *lpid, const DPNAME *lpName,
|
||||||
void *data, DWORD dataSize, DWORD dwFlags, DPID idParent, BOOL bAnsi )
|
void *data, DWORD dataSize, DWORD dwFlags, DPID idParent, BOOL bAnsi )
|
||||||
{
|
{
|
||||||
struct GroupList *groupList = NULL;
|
struct GroupList *groupList = NULL;
|
||||||
|
@ -1292,7 +1292,7 @@ static lpGroupData DP_CreateGroup( IDirectPlayImpl *This, const DPID *lpid, cons
|
||||||
{
|
{
|
||||||
parent = DP_FindAnyGroup( This, idParent );
|
parent = DP_FindAnyGroup( This, idParent );
|
||||||
if( !parent )
|
if( !parent )
|
||||||
return NULL;
|
return DPERR_INVALIDGROUP;
|
||||||
}
|
}
|
||||||
|
|
||||||
/* Allocate the new space and add to end of high level group list */
|
/* Allocate the new space and add to end of high level group list */
|
||||||
|
@ -1300,7 +1300,7 @@ static lpGroupData DP_CreateGroup( IDirectPlayImpl *This, const DPID *lpid, cons
|
||||||
|
|
||||||
if( lpGData == NULL )
|
if( lpGData == NULL )
|
||||||
{
|
{
|
||||||
return NULL;
|
return DPERR_OUTOFMEMORY;
|
||||||
}
|
}
|
||||||
|
|
||||||
DPQ_INIT(lpGData->groups);
|
DPQ_INIT(lpGData->groups);
|
||||||
|
@ -1313,7 +1313,7 @@ static lpGroupData DP_CreateGroup( IDirectPlayImpl *This, const DPID *lpid, cons
|
||||||
if ( !lpGData->name )
|
if ( !lpGData->name )
|
||||||
{
|
{
|
||||||
free( lpGData );
|
free( lpGData );
|
||||||
return NULL;
|
return DPERR_OUTOFMEMORY;
|
||||||
}
|
}
|
||||||
|
|
||||||
lpGData->nameA = DP_DuplicateName( lpName, TRUE, bAnsi );
|
lpGData->nameA = DP_DuplicateName( lpName, TRUE, bAnsi );
|
||||||
|
@ -1321,7 +1321,7 @@ static lpGroupData DP_CreateGroup( IDirectPlayImpl *This, const DPID *lpid, cons
|
||||||
{
|
{
|
||||||
free( lpGData->name );
|
free( lpGData->name );
|
||||||
free( lpGData );
|
free( lpGData );
|
||||||
return NULL;
|
return DPERR_OUTOFMEMORY;
|
||||||
}
|
}
|
||||||
|
|
||||||
lpGData->parent = idParent;
|
lpGData->parent = idParent;
|
||||||
|
@ -1336,7 +1336,7 @@ static lpGroupData DP_CreateGroup( IDirectPlayImpl *This, const DPID *lpid, cons
|
||||||
free( lpGData->nameA );
|
free( lpGData->nameA );
|
||||||
free( lpGData->name );
|
free( lpGData->name );
|
||||||
free( lpGData );
|
free( lpGData );
|
||||||
return NULL;
|
return DPERR_OUTOFMEMORY;
|
||||||
}
|
}
|
||||||
|
|
||||||
if( DPID_SYSTEM_GROUP == *lpid )
|
if( DPID_SYSTEM_GROUP == *lpid )
|
||||||
|
@ -1353,7 +1353,7 @@ static lpGroupData DP_CreateGroup( IDirectPlayImpl *This, const DPID *lpid, cons
|
||||||
free( lpGData->nameA );
|
free( lpGData->nameA );
|
||||||
free( lpGData->name );
|
free( lpGData->name );
|
||||||
free( lpGData );
|
free( lpGData );
|
||||||
return NULL;
|
return DPERR_OUTOFMEMORY;
|
||||||
}
|
}
|
||||||
groupList->lpGData = lpGData;
|
groupList->lpGData = lpGData;
|
||||||
|
|
||||||
|
@ -1367,7 +1367,7 @@ static lpGroupData DP_CreateGroup( IDirectPlayImpl *This, const DPID *lpid, cons
|
||||||
|
|
||||||
TRACE( "Created group id 0x%08lx\n", *lpid );
|
TRACE( "Created group id 0x%08lx\n", *lpid );
|
||||||
|
|
||||||
return lpGData;
|
return DP_OK;
|
||||||
}
|
}
|
||||||
|
|
||||||
/* This method assumes that all links to it are already deleted */
|
/* This method assumes that all links to it are already deleted */
|
||||||
|
@ -1428,7 +1428,7 @@ static lpGroupData DP_FindAnyGroup( IDirectPlayImpl *This, DPID dpid )
|
||||||
static HRESULT DP_IF_CreateGroup( IDirectPlayImpl *This, void *lpMsgHdr, DPID *lpidGroup,
|
static HRESULT DP_IF_CreateGroup( IDirectPlayImpl *This, void *lpMsgHdr, DPID *lpidGroup,
|
||||||
DPNAME *lpGroupName, void *lpData, DWORD dwDataSize, DWORD dwFlags, BOOL bAnsi )
|
DPNAME *lpGroupName, void *lpData, DWORD dwDataSize, DWORD dwFlags, BOOL bAnsi )
|
||||||
{
|
{
|
||||||
lpGroupData lpGData;
|
HRESULT hr;
|
||||||
|
|
||||||
TRACE( "(%p)->(%p,%p,%p,%p,0x%08lx,0x%08lx,%u)\n",
|
TRACE( "(%p)->(%p,%p,%p,%p,0x%08lx,0x%08lx,%u)\n",
|
||||||
This, lpMsgHdr, lpidGroup, lpGroupName, lpData, dwDataSize,
|
This, lpMsgHdr, lpidGroup, lpGroupName, lpData, dwDataSize,
|
||||||
|
@ -1455,12 +1455,12 @@ static HRESULT DP_IF_CreateGroup( IDirectPlayImpl *This, void *lpMsgHdr, DPID *l
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
lpGData = DP_CreateGroup( This, lpidGroup, lpGroupName, lpData, dwDataSize, dwFlags,
|
hr = DP_CreateGroup( This, lpidGroup, lpGroupName, lpData, dwDataSize, dwFlags,
|
||||||
DPID_NOPARENT_GROUP, bAnsi );
|
DPID_NOPARENT_GROUP, bAnsi );
|
||||||
|
|
||||||
if( lpGData == NULL )
|
if( FAILED( hr ) )
|
||||||
{
|
{
|
||||||
return DPERR_CANTADDPLAYER; /* yes player not group */
|
return hr;
|
||||||
}
|
}
|
||||||
|
|
||||||
/* FIXME: We should only create the system group if GetCaps returns
|
/* FIXME: We should only create the system group if GetCaps returns
|
||||||
|
@ -4472,7 +4472,7 @@ static HRESULT DP_IF_CreateGroupInGroup( IDirectPlayImpl *This, void *lpMsgHdr,
|
||||||
DPID *lpidGroup, DPNAME *lpGroupName, void *lpData, DWORD dwDataSize, DWORD dwFlags,
|
DPID *lpidGroup, DPNAME *lpGroupName, void *lpData, DWORD dwDataSize, DWORD dwFlags,
|
||||||
BOOL bAnsi )
|
BOOL bAnsi )
|
||||||
{
|
{
|
||||||
lpGroupData lpGData;
|
HRESULT hr;
|
||||||
|
|
||||||
TRACE( "(%p)->(0x%08lx,%p,%p,%p,0x%08lx,0x%08lx,%u)\n",
|
TRACE( "(%p)->(0x%08lx,%p,%p,%p,0x%08lx,0x%08lx,%u)\n",
|
||||||
This, idParentGroup, lpidGroup, lpGroupName, lpData,
|
This, idParentGroup, lpidGroup, lpGroupName, lpData,
|
||||||
|
@ -4483,12 +4483,12 @@ static HRESULT DP_IF_CreateGroupInGroup( IDirectPlayImpl *This, void *lpMsgHdr,
|
||||||
return DPERR_UNINITIALIZED;
|
return DPERR_UNINITIALIZED;
|
||||||
}
|
}
|
||||||
|
|
||||||
lpGData = DP_CreateGroup(This, lpidGroup, lpGroupName, lpData, dwDataSize, dwFlags, idParentGroup,
|
hr = DP_CreateGroup(This, lpidGroup, lpGroupName, lpData, dwDataSize, dwFlags, idParentGroup,
|
||||||
bAnsi );
|
bAnsi );
|
||||||
|
|
||||||
if( lpGData == NULL )
|
if( FAILED( hr ) )
|
||||||
{
|
{
|
||||||
return DPERR_CANTADDPLAYER; /* yes player not group */
|
return hr;
|
||||||
}
|
}
|
||||||
|
|
||||||
/* Let the SP know that we've created this group */
|
/* Let the SP know that we've created this group */
|
||||||
|
|
Loading…
Reference in a new issue