dsound: Disable property sets if hardware doesn't support it
Maarten Lankhorst
m.b.lankhorst at gmail.com
Sat Jun 2 09:12:29 CDT 2007
Property sets shouldn't be created if hardware doesn't have support for it.
-------------- next part --------------
>From d9b3df682b97878a1253ddbaa6ba89ab01a81ada Mon Sep 17 00:00:00 2001
From: Maarten Lankhorst <m.b.lankhorst at gmail.com>
Date: Wed, 30 May 2007 19:21:29 +0200
Subject: [PATCH] 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");
--
1.4.4.2
More information about the wine-patches
mailing list