Commit 3ec0b056 authored by Michael Stefaniuc's avatar Michael Stefaniuc Committed by Alexandre Julliard

dsound: Support IKsPropertySet in the primary buffer too.

parent 48ca5924
......@@ -1159,8 +1159,12 @@ static ULONG WINAPI IKsPropertySetImpl_Release(IKsPropertySet *iface)
TRACE("(%p) ref was %d\n", This, ref + 1);
if (!ref && !InterlockedDecrement(&This->numIfaces))
if (!ref && !InterlockedDecrement(&This->numIfaces)) {
if (is_primary_buffer(This))
primarybuffer_destroy(This);
else
secondarybuffer_destroy(This);
}
return ref;
}
......
......@@ -1165,8 +1165,9 @@ static HRESULT WINAPI PrimaryBufferImpl_QueryInterface(IDirectSoundBuffer *iface
}
if ( IsEqualGUID( &IID_IKsPropertySet, riid ) ) {
FIXME("app requested IKsPropertySet on primary buffer\n");
return E_NOINTERFACE;
*ppobj = &This->IKsPropertySet_iface;
IKsPropertySet_AddRef(&This->IKsPropertySet_iface);
return S_OK;
}
FIXME( "Unknown IID %s\n", debugstr_guid( riid ) );
......@@ -1220,10 +1221,12 @@ HRESULT primarybuffer_create(DirectSoundDevice *device, IDirectSoundBufferImpl *
dsb->ref = 0;
dsb->ref3D = 0;
dsb->refiks = 0;
dsb->numIfaces = 0;
dsb->device = device;
dsb->IDirectSoundBuffer8_iface.lpVtbl = (IDirectSoundBuffer8Vtbl *)&dspbvt;
dsb->IDirectSound3DListener_iface.lpVtbl = &ds3dlvt;
dsb->IKsPropertySet_iface.lpVtbl = &iksbvt;
dsb->dsbd = *dsbd;
/* IDirectSound3DListener */
......
......@@ -1213,16 +1213,14 @@ static HRESULT test_primary_3d_with_listener(LPGUID lpGuid)
!(dscaps.dwFlags & DSCAPS_EMULDRIVER),1.0,0,
listener,0,0,FALSE,0);
todo_wine {
temp_buffer = NULL;
rc=IDirectSound3DListener_QueryInterface(listener,
&IID_IKsPropertySet,(LPVOID *)&temp_buffer);
rc = IDirectSound3DListener_QueryInterface(listener, &IID_IKsPropertySet,
(void **)&temp_buffer);
ok(rc==DS_OK && temp_buffer!=NULL,
"IDirectSound3DListener_QueryInterface didn't handle IKsPropertySet: ret = %08x\n", rc);
if(temp_buffer)
IKsPropertySet_Release(temp_buffer);
}
}
/* Testing the reference counting */
ref=IDirectSound3DListener_Release(listener);
......@@ -1230,15 +1228,12 @@ static HRESULT test_primary_3d_with_listener(LPGUID lpGuid)
"references, should have 0\n",ref);
}
todo_wine {
temp_buffer = NULL;
rc=IDirectSoundBuffer_QueryInterface(primary,
&IID_IKsPropertySet,(LPVOID *)&temp_buffer);
rc = IDirectSoundBuffer_QueryInterface(primary, &IID_IKsPropertySet, (void **)&temp_buffer);
ok(rc==DS_OK && temp_buffer!=NULL,
"IDirectSoundBuffer_QueryInterface didn't handle IKsPropertySet on primary buffer: ret = %08x\n", rc);
if(temp_buffer)
IKsPropertySet_Release(temp_buffer);
}
/* Testing the reference counting */
ref=IDirectSoundBuffer_Release(primary);
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment