[PATCH 4/4 v2] dsound: Fail to create a version 8 3d buffer with DSBCAPS_CTRLPAN
Michael Stefaniuc
mstefani at redhat.de
Tue Dec 1 07:49:45 CST 2015
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-patches
mailing list