dsound: Fixup IDirectSoundCaptureBuffer_QueryInterface.

Signed-off-by: Andrew Eikum <aeikum@codeweavers.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
This commit is contained in:
Maarten Lankhorst 2016-05-16 09:55:43 -05:00 committed by Alexandre Julliard
parent a330b01143
commit 0adf2af7ff
1 changed files with 6 additions and 3 deletions

View File

@ -50,7 +50,7 @@ typedef struct IDirectSoundCaptureBufferImpl
IDirectSoundCaptureBuffer8 IDirectSoundCaptureBuffer8_iface; IDirectSoundCaptureBuffer8 IDirectSoundCaptureBuffer8_iface;
IDirectSoundNotify IDirectSoundNotify_iface; IDirectSoundNotify IDirectSoundNotify_iface;
LONG numIfaces; /* "in use interfaces" refcount */ LONG numIfaces; /* "in use interfaces" refcount */
LONG ref, refn; LONG ref, refn, has_dsc8;
/* IDirectSoundCaptureBuffer fields */ /* IDirectSoundCaptureBuffer fields */
DirectSoundCaptureDevice *device; DirectSoundCaptureDevice *device;
DSCBUFFERDESC *pdscbd; DSCBUFFERDESC *pdscbd;
@ -240,8 +240,9 @@ static HRESULT WINAPI IDirectSoundCaptureBufferImpl_QueryInterface(IDirectSoundC
*ppobj = NULL; *ppobj = NULL;
if ( IsEqualGUID( &IID_IDirectSoundCaptureBuffer, riid ) || if ( IsEqualIID( &IID_IUnknown, riid ) ||
IsEqualGUID( &IID_IDirectSoundCaptureBuffer8, riid ) ) { IsEqualIID( &IID_IDirectSoundCaptureBuffer, riid ) ||
(This->has_dsc8 && IsEqualIID( &IID_IDirectSoundCaptureBuffer8, riid )) ) {
IDirectSoundCaptureBuffer8_AddRef(iface); IDirectSoundCaptureBuffer8_AddRef(iface);
*ppobj = iface; *ppobj = iface;
return S_OK; return S_OK;
@ -1233,6 +1234,8 @@ static HRESULT WINAPI IDirectSoundCaptureImpl_CreateCaptureBuffer(IDirectSoundCa
if (hr != DS_OK) if (hr != DS_OK)
WARN("IDirectSoundCaptureBufferImpl_Create failed\n"); WARN("IDirectSoundCaptureBufferImpl_Create failed\n");
else
This->device->capture_buffer->has_dsc8 = This->has_dsc8;
return hr; return hr;
} }