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) ...@@ -1159,8 +1159,12 @@ static ULONG WINAPI IKsPropertySetImpl_Release(IKsPropertySet *iface)
TRACE("(%p) ref was %d\n", This, ref + 1); TRACE("(%p) ref was %d\n", This, ref + 1);
if (!ref && !InterlockedDecrement(&This->numIfaces)) if (!ref && !InterlockedDecrement(&This->numIfaces)) {
secondarybuffer_destroy(This); if (is_primary_buffer(This))
primarybuffer_destroy(This);
else
secondarybuffer_destroy(This);
}
return ref; return ref;
} }
......
...@@ -1165,8 +1165,9 @@ static HRESULT WINAPI PrimaryBufferImpl_QueryInterface(IDirectSoundBuffer *iface ...@@ -1165,8 +1165,9 @@ static HRESULT WINAPI PrimaryBufferImpl_QueryInterface(IDirectSoundBuffer *iface
} }
if ( IsEqualGUID( &IID_IKsPropertySet, riid ) ) { if ( IsEqualGUID( &IID_IKsPropertySet, riid ) ) {
FIXME("app requested IKsPropertySet on primary buffer\n"); *ppobj = &This->IKsPropertySet_iface;
return E_NOINTERFACE; IKsPropertySet_AddRef(&This->IKsPropertySet_iface);
return S_OK;
} }
FIXME( "Unknown IID %s\n", debugstr_guid( riid ) ); FIXME( "Unknown IID %s\n", debugstr_guid( riid ) );
...@@ -1220,10 +1221,12 @@ HRESULT primarybuffer_create(DirectSoundDevice *device, IDirectSoundBufferImpl * ...@@ -1220,10 +1221,12 @@ HRESULT primarybuffer_create(DirectSoundDevice *device, IDirectSoundBufferImpl *
dsb->ref = 0; dsb->ref = 0;
dsb->ref3D = 0; dsb->ref3D = 0;
dsb->refiks = 0;
dsb->numIfaces = 0; dsb->numIfaces = 0;
dsb->device = device; dsb->device = device;
dsb->IDirectSoundBuffer8_iface.lpVtbl = (IDirectSoundBuffer8Vtbl *)&dspbvt; dsb->IDirectSoundBuffer8_iface.lpVtbl = (IDirectSoundBuffer8Vtbl *)&dspbvt;
dsb->IDirectSound3DListener_iface.lpVtbl = &ds3dlvt; dsb->IDirectSound3DListener_iface.lpVtbl = &ds3dlvt;
dsb->IKsPropertySet_iface.lpVtbl = &iksbvt;
dsb->dsbd = *dsbd; dsb->dsbd = *dsbd;
/* IDirectSound3DListener */ /* IDirectSound3DListener */
......
...@@ -1213,15 +1213,13 @@ static HRESULT test_primary_3d_with_listener(LPGUID lpGuid) ...@@ -1213,15 +1213,13 @@ static HRESULT test_primary_3d_with_listener(LPGUID lpGuid)
!(dscaps.dwFlags & DSCAPS_EMULDRIVER),1.0,0, !(dscaps.dwFlags & DSCAPS_EMULDRIVER),1.0,0,
listener,0,0,FALSE,0); listener,0,0,FALSE,0);
todo_wine { temp_buffer = NULL;
temp_buffer = NULL; rc = IDirectSound3DListener_QueryInterface(listener, &IID_IKsPropertySet,
rc=IDirectSound3DListener_QueryInterface(listener, (void **)&temp_buffer);
&IID_IKsPropertySet,(LPVOID *)&temp_buffer); ok(rc==DS_OK && temp_buffer!=NULL,
ok(rc==DS_OK && temp_buffer!=NULL, "IDirectSound3DListener_QueryInterface didn't handle IKsPropertySet: ret = %08x\n", rc);
"IDirectSound3DListener_QueryInterface didn't handle IKsPropertySet: ret = %08x\n", rc); if(temp_buffer)
if(temp_buffer) IKsPropertySet_Release(temp_buffer);
IKsPropertySet_Release(temp_buffer);
}
} }
/* Testing the reference counting */ /* Testing the reference counting */
...@@ -1230,15 +1228,12 @@ static HRESULT test_primary_3d_with_listener(LPGUID lpGuid) ...@@ -1230,15 +1228,12 @@ static HRESULT test_primary_3d_with_listener(LPGUID lpGuid)
"references, should have 0\n",ref); "references, should have 0\n",ref);
} }
todo_wine { temp_buffer = NULL;
temp_buffer = NULL; rc = IDirectSoundBuffer_QueryInterface(primary, &IID_IKsPropertySet, (void **)&temp_buffer);
rc=IDirectSoundBuffer_QueryInterface(primary, ok(rc==DS_OK && temp_buffer!=NULL,
&IID_IKsPropertySet,(LPVOID *)&temp_buffer); "IDirectSoundBuffer_QueryInterface didn't handle IKsPropertySet on primary buffer: ret = %08x\n", rc);
ok(rc==DS_OK && temp_buffer!=NULL, if(temp_buffer)
"IDirectSoundBuffer_QueryInterface didn't handle IKsPropertySet on primary buffer: ret = %08x\n", rc); IKsPropertySet_Release(temp_buffer);
if(temp_buffer)
IKsPropertySet_Release(temp_buffer);
}
/* Testing the reference counting */ /* Testing the reference counting */
ref=IDirectSoundBuffer_Release(primary); 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