From bc08f32742f9348457b56a6f709e095e6d6aa34a Mon Sep 17 00:00:00 2001 From: Sami Aario Date: Tue, 30 Dec 2003 21:50:56 +0000 Subject: [PATCH] Fix some return values of dplayx API calls. --- dlls/dplayx/dplay.c | 30 ++++++++++++++++++++++++++++++ 1 file changed, 30 insertions(+) diff --git a/dlls/dplayx/dplay.c b/dlls/dplayx/dplay.c index 04e7a61e8f..7e7d2c1121 100644 --- a/dlls/dplayx/dplay.c +++ b/dlls/dplayx/dplay.c @@ -1853,6 +1853,11 @@ static HRESULT WINAPI DP_IF_DestroyPlayer FIXME( "(%p)->(%p,0x%08lx,%u): semi stub\n", This, lpMsgHdr, idPlayer, bAnsi ); + if( This->dp2->connectionInitialized == NO_PROVIDER ) + { + return DPERR_UNINITIALIZED; + } + if( DP_FindPlayer( This, idPlayer ) == NULL ) { return DPERR_INVALIDPLAYER; @@ -1950,6 +1955,11 @@ static HRESULT WINAPI DP_IF_EnumGroupPlayers This, idGroup, lpguidInstance, lpEnumPlayersCallback2, lpContext, dwFlags, bAnsi ); + if( This->dp2->connectionInitialized == NO_PROVIDER ) + { + return DPERR_UNINITIALIZED; + } + /* Find the group */ if( ( lpGData = DP_FindAnyGroup( This, idGroup ) ) == NULL ) { @@ -2609,6 +2619,11 @@ static HRESULT WINAPI DP_IF_GetPlayerData TRACE( "(%p)->(0x%08lx,%p,%p,0x%08lx,%u)\n", This, idPlayer, lpData, lpdwDataSize, dwFlags, bAnsi ); + if( This->dp2->connectionInitialized == NO_PROVIDER ) + { + return DPERR_UNINITIALIZED; + } + if( ( lpPList = DP_FindPlayer( This, idPlayer ) ) == NULL ) { return DPERR_INVALIDPLAYER; @@ -2750,6 +2765,11 @@ static HRESULT WINAPI DP_GetSessionDesc TRACE( "(%p)->(%p,%p,%u)\n", This, lpData, lpdwDataSize, bAnsi ); + if( This->dp2->connectionInitialized == NO_PROVIDER ) + { + return DPERR_UNINITIALIZED; + } + if( ( lpData == NULL ) && ( lpdwDataSize == NULL ) ) { return DPERR_INVALIDPARAMS; @@ -2930,6 +2950,11 @@ static HRESULT WINAPI DP_IF_Receive FIXME( "(%p)->(%p,%p,0x%08lx,%p,%p,%u): stub\n", This, lpidFrom, lpidTo, dwFlags, lpData, lpdwDataSize, bAnsi ); + if( This->dp2->connectionInitialized == NO_PROVIDER ) + { + return DPERR_UNINITIALIZED; + } + if( dwFlags == 0 ) { dwFlags = DPRECEIVE_ALL; @@ -3213,6 +3238,11 @@ static HRESULT WINAPI DP_SetSessionDesc TRACE( "(%p)->(%p,0x%08lx,%u,%u)\n", This, lpSessDesc, dwFlags, bInitial, bAnsi ); + if( This->dp2->connectionInitialized == NO_PROVIDER ) + { + return DPERR_UNINITIALIZED; + } + if( dwFlags ) { return DPERR_INVALIDPARAMS; -- 2.32.0.93.g670b81a890