[PATCH 4/4 v2] dsound: Fail to create a version 8 3d buffer with DSBCAPS_CTRLPAN

Andrew Eikum aeikum at codeweavers.com
Wed Dec 2 08:41:48 CST 2015


This looks fine, but since it doesn't fix a bug, I think this one
should be deferred. As Michael knows, dsound applications can be
fragile...

Andrew

On Tue, Dec 01, 2015 at 02:49:45PM +0100, Michael Stefaniuc wrote:
> Signed-off-by: Michael Stefaniuc <mstefani at redhat.de>
> ---
>  dlls/dsound/dsound.c      | 5 +++++
>  dlls/dsound/tests/ds3d8.c | 1 -
>  2 files changed, 5 insertions(+), 1 deletion(-)
> 
> diff --git a/dlls/dsound/dsound.c b/dlls/dsound/dsound.c
> index 7b93455..e50ef58 100644
> --- a/dlls/dsound/dsound.c
> +++ b/dlls/dsound/dsound.c
> @@ -542,6 +542,11 @@ static HRESULT DirectSoundDevice_CreateSoundBuffer(
>              return DSERR_INVALIDPARAM;
>          }
>  
> +        if (from8 && (dsbd->dwFlags & DSBCAPS_CTRL3D) && (dsbd->dwFlags & DSBCAPS_CTRLPAN)) {
> +            WARN("invalid parameter: DSBCAPS_CTRL3D and DSBCAPS_CTRLPAN cannot be used together\n");
> +            return DSERR_INVALIDPARAM;
> +        }
> +
>          hres = IDirectSoundBufferImpl_Create(device, &dsb, dsbd);
>          if (dsb) {
>              *ppdsb = (IDirectSoundBuffer*)&dsb->IDirectSoundBuffer8_iface;
> diff --git a/dlls/dsound/tests/ds3d8.c b/dlls/dsound/tests/ds3d8.c
> index 330f590..25eb010 100644
> --- a/dlls/dsound/tests/ds3d8.c
> +++ b/dlls/dsound/tests/ds3d8.c
> @@ -654,7 +654,6 @@ static HRESULT test_secondary8(LPGUID lpGuid, BOOL play,
>              /* Invalid flag combination */
>              bufdesc.dwFlags|=DSBCAPS_CTRLPAN;
>              rc=IDirectSound8_CreateSoundBuffer(dso,&bufdesc,&secondary,NULL);
> -            todo_wine
>              ok(rc==DSERR_INVALIDPARAM,
>                 "IDirectSound8_CreateSoundBuffer(secondary) should have "
>                 "returned DSERR_INVALIDPARAM, returned %08x\n", rc);
> -- 
> 2.1.0
> 
> 



More information about the wine-devel mailing list