Maarten Lankhorst : dsound: Disable property sets if hardware doesn' t support it.

Alexandre Julliard julliard at wine.codeweavers.com
Mon Jun 4 08:14:28 CDT 2007


Module: wine
Branch: master
Commit: 3e1fcc0eb722ba5f19ad410b3a0096744743cd61
URL:    http://source.winehq.org/git/wine.git/?a=commit;h=3e1fcc0eb722ba5f19ad410b3a0096744743cd61

Author: Maarten Lankhorst <m.b.lankhorst at gmail.com>
Date:   Wed May 30 19:21:29 2007 +0200

dsound: Disable property sets if hardware doesn't support it.

---

 dlls/dsound/propset.c |   10 ++++++++++
 1 files changed, 10 insertions(+), 0 deletions(-)

diff --git a/dlls/dsound/propset.c b/dlls/dsound/propset.c
index 7773293..7bb7f4f 100644
--- a/dlls/dsound/propset.c
+++ b/dlls/dsound/propset.c
@@ -197,9 +197,19 @@ HRESULT IKsBufferPropertySetImpl_Create(
     IDirectSoundBufferImpl *dsb,
     IKsBufferPropertySetImpl **piks)
 {
+    PIDSDRIVERPROPERTYSET ps = NULL;
     IKsBufferPropertySetImpl *iks;
     TRACE("(%p,%p)\n",dsb,piks);
 
+    if (!dsb->hwbuf)
+        return DSERR_INVALIDPARAM;
+
+    IDsDriver_QueryInterface(dsb->hwbuf, &IID_IDsDriverPropertySet, (void **)&ps);
+    if (!ps)
+        return DSERR_INVALIDPARAM;
+
+    IUnknown_Release(ps);
+
     iks = HeapAlloc(GetProcessHeap(),HEAP_ZERO_MEMORY,sizeof(*iks));
     if (iks == 0) {
         WARN("out of memory\n");




More information about the wine-cvs mailing list