Always create a property set for secondary buffers.
This commit is contained in:
parent
74d32620eb
commit
373ab78519
|
@ -986,17 +986,12 @@ static HRESULT WINAPI IDirectSoundBufferImpl_QueryInterface(
|
||||||
}
|
}
|
||||||
|
|
||||||
if ( IsEqualGUID( &IID_IKsPropertySet, riid ) ) {
|
if ( IsEqualGUID( &IID_IKsPropertySet, riid ) ) {
|
||||||
/* only supported on hardware 3D secondary buffers */
|
if (!This->iks)
|
||||||
if (!(This->dsbd.dwFlags & DSBCAPS_PRIMARYBUFFER) &&
|
IKsBufferPropertySetImpl_Create(This, &(This->iks));
|
||||||
(This->dsbd.dwFlags & DSBCAPS_CTRL3D) &&
|
if (This->iks) {
|
||||||
(This->hwbuf != NULL) ) {
|
IKsPropertySet_AddRef((LPKSPROPERTYSET)This->iks);
|
||||||
if (!This->iks)
|
*ppobj = This->iks;
|
||||||
IKsBufferPropertySetImpl_Create(This, &(This->iks));
|
return S_OK;
|
||||||
if (This->iks) {
|
|
||||||
IKsPropertySet_AddRef((LPKSPROPERTYSET)*ppobj);
|
|
||||||
*ppobj = This->iks;
|
|
||||||
return S_OK;
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
WARN("IID_IKsPropertySet\n");
|
WARN("IID_IKsPropertySet\n");
|
||||||
return E_NOINTERFACE;
|
return E_NOINTERFACE;
|
||||||
|
|
|
@ -109,22 +109,24 @@ static HRESULT WINAPI IKsBufferPropertySetImpl_Get(
|
||||||
TRACE("(iface=%p,guidPropSet=%s,dwPropID=%ld,pInstanceData=%p,cbInstanceData=%ld,pPropData=%p,cbPropData=%ld,pcbReturned=%p)\n",
|
TRACE("(iface=%p,guidPropSet=%s,dwPropID=%ld,pInstanceData=%p,cbInstanceData=%ld,pPropData=%p,cbPropData=%ld,pcbReturned=%p)\n",
|
||||||
This,debugstr_guid(guidPropSet),dwPropID,pInstanceData,cbInstanceData,pPropData,cbPropData,pcbReturned);
|
This,debugstr_guid(guidPropSet),dwPropID,pInstanceData,cbInstanceData,pPropData,cbPropData,pcbReturned);
|
||||||
|
|
||||||
IDsDriver_QueryInterface(This->dsb->hwbuf, &IID_IDsDriverPropertySet, (void **)&ps);
|
if (This->dsb->hwbuf) {
|
||||||
|
IDsDriver_QueryInterface(This->dsb->hwbuf, &IID_IDsDriverPropertySet, (void **)&ps);
|
||||||
|
|
||||||
if (ps) {
|
if (ps) {
|
||||||
DSPROPERTY prop;
|
DSPROPERTY prop;
|
||||||
HRESULT hres;
|
HRESULT hres;
|
||||||
|
|
||||||
prop.s.Set = *guidPropSet;
|
prop.s.Set = *guidPropSet;
|
||||||
prop.s.Id = dwPropID;
|
prop.s.Id = dwPropID;
|
||||||
prop.s.Flags = 0; /* unused */
|
prop.s.Flags = 0; /* unused */
|
||||||
prop.s.InstanceId = (ULONG)This->dsb->dsound;
|
prop.s.InstanceId = (ULONG)This->dsb->dsound;
|
||||||
|
|
||||||
hres = IDsDriverPropertySet_Get(ps, &prop, pInstanceData, cbInstanceData, pPropData, cbPropData, pcbReturned);
|
hres = IDsDriverPropertySet_Get(ps, &prop, pInstanceData, cbInstanceData, pPropData, cbPropData, pcbReturned);
|
||||||
|
|
||||||
IDsDriverPropertySet_Release(ps);
|
IDsDriverPropertySet_Release(ps);
|
||||||
|
|
||||||
return hres;
|
return hres;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
return E_PROP_ID_UNSUPPORTED;
|
return E_PROP_ID_UNSUPPORTED;
|
||||||
|
@ -143,21 +145,23 @@ static HRESULT WINAPI IKsBufferPropertySetImpl_Set(
|
||||||
PIDSDRIVERPROPERTYSET ps;
|
PIDSDRIVERPROPERTYSET ps;
|
||||||
TRACE("(%p,%s,%ld,%p,%ld,%p,%ld)\n",This,debugstr_guid(guidPropSet),dwPropID,pInstanceData,cbInstanceData,pPropData,cbPropData);
|
TRACE("(%p,%s,%ld,%p,%ld,%p,%ld)\n",This,debugstr_guid(guidPropSet),dwPropID,pInstanceData,cbInstanceData,pPropData,cbPropData);
|
||||||
|
|
||||||
IDsDriver_QueryInterface(This->dsb->hwbuf, &IID_IDsDriverPropertySet, (void **)&ps);
|
if (This->dsb->hwbuf) {
|
||||||
|
IDsDriver_QueryInterface(This->dsb->hwbuf, &IID_IDsDriverPropertySet, (void **)&ps);
|
||||||
|
|
||||||
if (ps) {
|
if (ps) {
|
||||||
DSPROPERTY prop;
|
DSPROPERTY prop;
|
||||||
HRESULT hres;
|
HRESULT hres;
|
||||||
|
|
||||||
prop.s.Set = *guidPropSet;
|
prop.s.Set = *guidPropSet;
|
||||||
prop.s.Id = dwPropID;
|
prop.s.Id = dwPropID;
|
||||||
prop.s.Flags = 0; /* unused */
|
prop.s.Flags = 0; /* unused */
|
||||||
prop.s.InstanceId = (ULONG)This->dsb->dsound;
|
prop.s.InstanceId = (ULONG)This->dsb->dsound;
|
||||||
hres = IDsDriverPropertySet_Set(ps,&prop,pInstanceData,cbInstanceData,pPropData,cbPropData);
|
hres = IDsDriverPropertySet_Set(ps,&prop,pInstanceData,cbInstanceData,pPropData,cbPropData);
|
||||||
|
|
||||||
IDsDriverPropertySet_Release(ps);
|
IDsDriverPropertySet_Release(ps);
|
||||||
|
|
||||||
return hres;
|
return hres;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
return E_PROP_ID_UNSUPPORTED;
|
return E_PROP_ID_UNSUPPORTED;
|
||||||
|
@ -173,16 +177,18 @@ static HRESULT WINAPI IKsBufferPropertySetImpl_QuerySupport(
|
||||||
PIDSDRIVERPROPERTYSET ps;
|
PIDSDRIVERPROPERTYSET ps;
|
||||||
TRACE("(%p,%s,%ld,%p)\n",This,debugstr_guid(guidPropSet),dwPropID,pTypeSupport);
|
TRACE("(%p,%s,%ld,%p)\n",This,debugstr_guid(guidPropSet),dwPropID,pTypeSupport);
|
||||||
|
|
||||||
IDsDriver_QueryInterface(This->dsb->hwbuf, &IID_IDsDriverPropertySet, (void **)&ps);
|
if (This->dsb->hwbuf) {
|
||||||
|
IDsDriver_QueryInterface(This->dsb->hwbuf, &IID_IDsDriverPropertySet, (void **)&ps);
|
||||||
|
|
||||||
if (ps) {
|
if (ps) {
|
||||||
HRESULT hres;
|
HRESULT hres;
|
||||||
|
|
||||||
hres = IDsDriverPropertySet_QuerySupport(ps,guidPropSet, dwPropID,pTypeSupport);
|
hres = IDsDriverPropertySet_QuerySupport(ps,guidPropSet, dwPropID,pTypeSupport);
|
||||||
|
|
||||||
IDsDriverPropertySet_Release(ps);
|
IDsDriverPropertySet_Release(ps);
|
||||||
|
|
||||||
return hres;
|
return hres;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
return E_PROP_ID_UNSUPPORTED;
|
return E_PROP_ID_UNSUPPORTED;
|
||||||
|
@ -205,6 +211,12 @@ HRESULT WINAPI IKsBufferPropertySetImpl_Create(
|
||||||
TRACE("(%p,%p)\n",dsb,piks);
|
TRACE("(%p,%p)\n",dsb,piks);
|
||||||
|
|
||||||
iks = HeapAlloc(GetProcessHeap(),HEAP_ZERO_MEMORY,sizeof(*iks));
|
iks = HeapAlloc(GetProcessHeap(),HEAP_ZERO_MEMORY,sizeof(*iks));
|
||||||
|
if (iks == 0) {
|
||||||
|
WARN("out of memory\n");
|
||||||
|
*piks = NULL;
|
||||||
|
return DSERR_OUTOFMEMORY;
|
||||||
|
}
|
||||||
|
|
||||||
iks->ref = 0;
|
iks->ref = 0;
|
||||||
iks->dsb = dsb;
|
iks->dsb = dsb;
|
||||||
dsb->iks = iks;
|
dsb->iks = iks;
|
||||||
|
|
Loading…
Reference in New Issue