*
* You should have received a copy of the GNU Lesser General Public
* License along with this library; if not, write to the Free Software
- * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
+ * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA
*/
+#define COBJMACROS
#include <stdarg.h>
#include "windef.h"
#include "winbase.h"
+#include "winuser.h"
#include "mmsystem.h"
-#include "winreg.h"
#include "winternl.h"
#include "winnls.h"
#include "vfwmsgs.h"
#include "dsound.h"
#include "dsdriver.h"
#include "dsound_private.h"
-#include "initguid.h"
#include "dsconf.h"
#ifdef NONAMELESSSTRUCT
{
IKsBufferPropertySetImpl *This = (IKsBufferPropertySetImpl *)iface;
ULONG ref = InterlockedIncrement(&(This->ref));
- TRACE("(%p) ref was %ld\n", This, ref - 1);
+ TRACE("(%p) ref was %d\n", This, ref - 1);
return ref;
}
{
IKsBufferPropertySetImpl *This = (IKsBufferPropertySetImpl *)iface;
ULONG ref = InterlockedDecrement(&(This->ref));
- TRACE("(%p) ref was %ld\n", This, ref + 1);
+ TRACE("(%p) ref was %d\n", This, ref + 1);
if (!ref) {
This->dsb->iks = 0;
{
IKsBufferPropertySetImpl *This = (IKsBufferPropertySetImpl *)iface;
PIDSDRIVERPROPERTYSET ps;
- TRACE("(iface=%p,guidPropSet=%s,dwPropID=%ld,pInstanceData=%p,cbInstanceData=%ld,pPropData=%p,cbPropData=%ld,pcbReturned=%p)\n",
+ TRACE("(iface=%p,guidPropSet=%s,dwPropID=%d,pInstanceData=%p,cbInstanceData=%d,pPropData=%p,cbPropData=%d,pcbReturned=%p)\n",
This,debugstr_guid(guidPropSet),dwPropID,pInstanceData,cbInstanceData,pPropData,cbPropData,pcbReturned);
if (This->dsb->hwbuf) {
S(prop).Set = *guidPropSet;
S(prop).Id = dwPropID;
S(prop).Flags = 0; /* unused */
- S(prop).InstanceId = (ULONG)This->dsb->dsound;
+ S(prop).InstanceId = (ULONG)This->dsb->device;
hres = IDsDriverPropertySet_Get(ps, &prop, pInstanceData, cbInstanceData, pPropData, cbPropData, pcbReturned);
{
IKsBufferPropertySetImpl *This = (IKsBufferPropertySetImpl *)iface;
PIDSDRIVERPROPERTYSET ps;
- TRACE("(%p,%s,%ld,%p,%ld,%p,%ld)\n",This,debugstr_guid(guidPropSet),dwPropID,pInstanceData,cbInstanceData,pPropData,cbPropData);
+ TRACE("(%p,%s,%d,%p,%d,%p,%d)\n",This,debugstr_guid(guidPropSet),dwPropID,pInstanceData,cbInstanceData,pPropData,cbPropData);
if (This->dsb->hwbuf) {
IDsDriver_QueryInterface(This->dsb->hwbuf, &IID_IDsDriverPropertySet, (void **)&ps);
S(prop).Set = *guidPropSet;
S(prop).Id = dwPropID;
S(prop).Flags = 0; /* unused */
- S(prop).InstanceId = (ULONG)This->dsb->dsound;
+ S(prop).InstanceId = (ULONG)This->dsb->device;
hres = IDsDriverPropertySet_Set(ps,&prop,pInstanceData,cbInstanceData,pPropData,cbPropData);
IDsDriverPropertySet_Release(ps);
{
IKsBufferPropertySetImpl *This = (IKsBufferPropertySetImpl *)iface;
PIDSDRIVERPROPERTYSET ps;
- TRACE("(%p,%s,%ld,%p)\n",This,debugstr_guid(guidPropSet),dwPropID,pTypeSupport);
+ TRACE("(%p,%s,%d,%p)\n",This,debugstr_guid(guidPropSet),dwPropID,pTypeSupport);
if (This->dsb->hwbuf) {
IDsDriver_QueryInterface(This->dsb->hwbuf, &IID_IDsDriverPropertySet, (void **)&ps);
IKsBufferPropertySetImpl_QuerySupport
};
-HRESULT WINAPI IKsBufferPropertySetImpl_Create(
+HRESULT IKsBufferPropertySetImpl_Create(
IDirectSoundBufferImpl *dsb,
IKsBufferPropertySetImpl **piks)
{
IKsBufferPropertySetImpl *iks;
TRACE("(%p,%p)\n",dsb,piks);
+ *piks = NULL;
iks = HeapAlloc(GetProcessHeap(),HEAP_ZERO_MEMORY,sizeof(*iks));
if (iks == 0) {
return S_OK;
}
-HRESULT WINAPI IKsBufferPropertySetImpl_Destroy(
+HRESULT IKsBufferPropertySetImpl_Destroy(
IKsBufferPropertySetImpl *piks)
{
TRACE("(%p)\n",piks);
IKsPrivatePropertySetImpl *This = (IKsPrivatePropertySetImpl *)iface;
TRACE("(%p,%s,%p)\n",This,debugstr_guid(riid),ppobj);
+ if (IsEqualIID(riid, &IID_IUnknown) ||
+ IsEqualIID(riid, &IID_IKsPropertySet)) {
+ *ppobj = iface;
+ IUnknown_AddRef(iface);
+ return S_OK;
+ }
*ppobj = NULL;
- return DSERR_INVALIDPARAM;
+ return E_NOINTERFACE;
}
static ULONG WINAPI IKsPrivatePropertySetImpl_AddRef(LPKSPROPERTYSET iface)
{
IKsPrivatePropertySetImpl *This = (IKsPrivatePropertySetImpl *)iface;
ULONG ref = InterlockedIncrement(&(This->ref));
- TRACE("(%p) ref was %ld\n", This, ref - 1);
+ TRACE("(%p) ref was %d\n", This, ref - 1);
return ref;
}
{
IKsPrivatePropertySetImpl *This = (IKsPrivatePropertySetImpl *)iface;
ULONG ref = InterlockedDecrement(&(This->ref));
- TRACE("(%p) ref was %ld\n", This, ref + 1);
+ TRACE("(%p) ref was %d\n", This, ref + 1);
if (!ref) {
HeapFree(GetProcessHeap(), 0, This);
return ref;
}
-static HRESULT WINAPI DSPROPERTY_WaveDeviceMappingA(
- REFGUID guidPropSet,
+static HRESULT DSPROPERTY_WaveDeviceMappingA(
LPVOID pPropData,
ULONG cbPropData,
PULONG pcbReturned )
{
HRESULT hr = DSERR_INVALIDPARAM;
PDSPROPERTY_DIRECTSOUNDDEVICE_WAVEDEVICEMAPPING_A_DATA ppd;
- TRACE("(guidPropSet=%s,pPropData=%p,cbPropData=%ld,pcbReturned=%p) not implemented!\n",
- debugstr_guid(guidPropSet),pPropData,cbPropData,pcbReturned);
+ TRACE("(pPropData=%p,cbPropData=%d,pcbReturned=%p)\n",
+ pPropData,cbPropData,pcbReturned);
- ppd = (PDSPROPERTY_DIRECTSOUNDDEVICE_WAVEDEVICEMAPPING_A_DATA) pPropData;
+ ppd = pPropData;
if (!ppd) {
WARN("invalid parameter: pPropData\n");
return hr;
}
-static HRESULT WINAPI DSPROPERTY_WaveDeviceMappingW(
- REFGUID guidPropSet,
+static HRESULT DSPROPERTY_WaveDeviceMappingW(
LPVOID pPropData,
ULONG cbPropData,
PULONG pcbReturned )
{
HRESULT hr = DSERR_INVALIDPARAM;
PDSPROPERTY_DIRECTSOUNDDEVICE_WAVEDEVICEMAPPING_W_DATA ppd;
- TRACE("(guidPropSet=%s,pPropData=%p,cbPropData=%ld,pcbReturned=%p)\n",
- debugstr_guid(guidPropSet),pPropData,cbPropData,pcbReturned);
+ TRACE("(pPropData=%p,cbPropData=%d,pcbReturned=%p)\n",
+ pPropData,cbPropData,pcbReturned);
- ppd = (PDSPROPERTY_DIRECTSOUNDDEVICE_WAVEDEVICEMAPPING_W_DATA) pPropData;
+ ppd = pPropData;
if (!ppd) {
WARN("invalid parameter: pPropData\n");
return hr;
}
-static HRESULT WINAPI DSPROPERTY_Description1(
- REFGUID guidPropSet,
+static HRESULT DSPROPERTY_Description1(
LPVOID pPropData,
ULONG cbPropData,
PULONG pcbReturned )
{
HRESULT err;
- GUID guid, dev_guid;
+ GUID dev_guid;
PDSPROPERTY_DIRECTSOUNDDEVICE_DESCRIPTION_1_DATA ppd;
- TRACE("(guidPropSet=%s,pPropData=%p,cbPropData=%ld,pcbReturned=%p)\n",
- debugstr_guid(guidPropSet),pPropData,cbPropData,pcbReturned);
+ TRACE("(pPropData=%p,cbPropData=%d,pcbReturned=%p)\n",
+ pPropData,cbPropData,pcbReturned);
ppd = (PDSPROPERTY_DIRECTSOUNDDEVICE_DESCRIPTION_1_DATA) pPropData;
} else {
TRACE("DataFlow=Unknown(%d)\n", ppd->DataFlow);
}
- FIXME("(guidPropSet=%s,pPropData=%p,cbPropData=%ld,pcbReturned=%p) GUID_NULL not implemented!\n",
- debugstr_guid(guidPropSet),pPropData,cbPropData,pcbReturned);
+ FIXME("(pPropData=%p,cbPropData=%d,pcbReturned=%p) GUID_NULL not implemented!\n",
+ pPropData,cbPropData,pcbReturned);
return E_PROP_ID_UNSUPPORTED;
}
DSDRIVERDESC desc;
ppd->WaveDeviceId = wod;
ppd->Devnode = wod;
- err = mmErr(waveOutMessage((HWAVEOUT)wod,DRV_QUERYDSOUNDDESC,(DWORD)&(desc),0));
+ err = mmErr(waveOutMessage(UlongToHandle(wod),DRV_QUERYDSOUNDDESC,(DWORD_PTR)&desc,0));
if (err == DS_OK) {
PIDSDRIVER drv = NULL;
lstrcpynA(ppd->DescriptionA, desc.szDesc, sizeof(ppd->DescriptionA));
lstrcpynA(ppd->ModuleA, desc.szDrvname, sizeof(ppd->ModuleA));
MultiByteToWideChar( CP_ACP, 0, desc.szDesc, -1, ppd->DescriptionW, sizeof(ppd->DescriptionW)/sizeof(WCHAR) );
MultiByteToWideChar( CP_ACP, 0, desc.szDrvname, -1, ppd->ModuleW, sizeof(ppd->ModuleW)/sizeof(WCHAR) );
- err = mmErr(waveOutMessage((HWAVEOUT)wod, DRV_QUERYDSOUNDIFACE, (DWORD)&drv, 0));
+ err = mmErr(waveOutMessage(UlongToHandle(wod), DRV_QUERYDSOUNDIFACE, (DWORD_PTR)&drv, 0));
if (err == DS_OK && drv)
ppd->Type = DIRECTSOUNDDEVICE_TYPE_VXD;
else
ppd->DataFlow = DIRECTSOUNDDEVICE_DATAFLOW_CAPTURE;
widn = waveInGetNumDevs();
for (wid = 0; wid < widn; wid++) {
- if (IsEqualGUID( &dev_guid, &guid) ) {
+ if (IsEqualGUID( &dev_guid, &DSOUND_capture_guids[wid] ) ) {
DSDRIVERDESC desc;
ppd->WaveDeviceId = wid;
ppd->Devnode = wid;
- err = mmErr(waveInMessage((HWAVEIN)wid,DRV_QUERYDSOUNDDESC,(DWORD)&(desc),0));
+ err = mmErr(waveInMessage(UlongToHandle(wid),DRV_QUERYDSOUNDDESC,(DWORD_PTR)&desc,0));
if (err == DS_OK) {
PIDSCDRIVER drv;
lstrcpynA(ppd->DescriptionA, desc.szDesc, sizeof(ppd->DescriptionA));
lstrcpynA(ppd->ModuleA, desc.szDrvname, sizeof(ppd->ModuleA));
MultiByteToWideChar( CP_ACP, 0, desc.szDesc, -1, ppd->DescriptionW, sizeof(ppd->DescriptionW)/sizeof(WCHAR) );
MultiByteToWideChar( CP_ACP, 0, desc.szDrvname, -1, ppd->ModuleW, sizeof(ppd->ModuleW)/sizeof(WCHAR) );
- err = mmErr(waveInMessage((HWAVEIN)wid,DRV_QUERYDSOUNDIFACE,(DWORD)&drv,0));
+ err = mmErr(waveInMessage(UlongToHandle(wid),DRV_QUERYDSOUNDIFACE,(DWORD_PTR)&drv,0));
if (err == DS_OK && drv)
ppd->Type = DIRECTSOUNDDEVICE_TYPE_VXD;
else
ppd->DataFlow = DIRECTSOUNDDEVICE_DATAFLOW_RENDER;
ppd->WaveDeviceId = wod;
ppd->Devnode = wod;
- err = mmErr(waveOutMessage((HWAVEOUT)wod,DRV_QUERYDSOUNDDESC,(DWORD)&(desc),0));
+ err = mmErr(waveOutMessage(UlongToHandle(wod),DRV_QUERYDSOUNDDESC,(DWORD_PTR)&desc,0));
if (err == DS_OK) {
PIDSDRIVER drv = NULL;
lstrcpynA(ppd->DescriptionA, desc.szDesc, sizeof(ppd->DescriptionA));
lstrcpynA(ppd->ModuleA, desc.szDrvname, sizeof(ppd->ModuleA));
MultiByteToWideChar( CP_ACP, 0, desc.szDesc, -1, ppd->DescriptionW, sizeof(ppd->DescriptionW)/sizeof(WCHAR) );
MultiByteToWideChar( CP_ACP, 0, desc.szDrvname, -1, ppd->ModuleW, sizeof(ppd->ModuleW)/sizeof(WCHAR) );
- err = mmErr(waveOutMessage((HWAVEOUT)wod, DRV_QUERYDSOUNDIFACE, (DWORD)&drv, 0));
+ err = mmErr(waveOutMessage(UlongToHandle(wod), DRV_QUERYDSOUNDIFACE, (DWORD_PTR)&drv, 0));
if (err == DS_OK && drv)
ppd->Type = DIRECTSOUNDDEVICE_TYPE_VXD;
else
ppd->DataFlow = DIRECTSOUNDDEVICE_DATAFLOW_CAPTURE;
ppd->WaveDeviceId = wid;
ppd->Devnode = wid;
- err = mmErr(waveInMessage((HWAVEIN)wod,DRV_QUERYDSOUNDDESC,(DWORD)&(desc),0));
+ err = mmErr(waveInMessage(UlongToHandle(wid),DRV_QUERYDSOUNDDESC,(DWORD_PTR)&desc,0));
if (err == DS_OK) {
PIDSDRIVER drv = NULL;
lstrcpynA(ppd->DescriptionA, desc.szDesc, sizeof(ppd->DescriptionA));
lstrcpynA(ppd->ModuleA, desc.szDrvname, sizeof(ppd->ModuleA));
MultiByteToWideChar( CP_ACP, 0, desc.szDesc, -1, ppd->DescriptionW, sizeof(ppd->DescriptionW)/sizeof(WCHAR) );
MultiByteToWideChar( CP_ACP, 0, desc.szDrvname, -1, ppd->ModuleW, sizeof(ppd->ModuleW)/sizeof(WCHAR) );
- err = mmErr(waveInMessage((HWAVEIN)wod, DRV_QUERYDSOUNDIFACE, (DWORD)&drv, 0));
+ err = mmErr(waveInMessage(UlongToHandle(wid), DRV_QUERYDSOUNDIFACE, (DWORD_PTR)&drv, 0));
if (err == DS_OK && drv)
ppd->Type = DIRECTSOUNDDEVICE_TYPE_VXD;
else
if (pcbReturned) {
*pcbReturned = cbPropData;
- TRACE("*pcbReturned=%ld\n", *pcbReturned);
+ TRACE("*pcbReturned=%d\n", *pcbReturned);
}
return S_OK;
}
-static HRESULT WINAPI DSPROPERTY_DescriptionA(
- REFGUID guidPropSet,
+static HRESULT DSPROPERTY_DescriptionA(
LPVOID pPropData,
ULONG cbPropData,
PULONG pcbReturned )
{
- PDSPROPERTY_DIRECTSOUNDDEVICE_DESCRIPTION_A_DATA ppd = (PDSPROPERTY_DIRECTSOUNDDEVICE_DESCRIPTION_A_DATA) pPropData;
+ PDSPROPERTY_DIRECTSOUNDDEVICE_DESCRIPTION_A_DATA ppd = pPropData;
HRESULT err;
GUID dev_guid;
- TRACE("(guidPropSet=%s,pPropData=%p,cbPropData=%ld,pcbReturned=%p)\n",
- debugstr_guid(guidPropSet),pPropData,cbPropData,pcbReturned);
+ TRACE("(pPropData=%p,cbPropData=%d,pcbReturned=%p)\n",
+ pPropData,cbPropData,pcbReturned);
TRACE("DeviceId=%s\n",debugstr_guid(&ppd->DeviceId));
if ( IsEqualGUID( &ppd->DeviceId , &GUID_NULL) ) {
} else {
TRACE("DataFlow=Unknown(%d)\n", ppd->DataFlow);
}
- FIXME("(guidPropSet=%s,pPropData=%p,cbPropData=%ld,pcbReturned=%p) GUID_NULL not implemented!\n",
- debugstr_guid(guidPropSet),pPropData,cbPropData,pcbReturned);
+ FIXME("(pPropData=%p,cbPropData=%d,pcbReturned=%p) GUID_NULL not implemented!\n",
+ pPropData,cbPropData,pcbReturned);
return E_PROP_ID_UNSUPPORTED;
}
if (IsEqualGUID( &dev_guid, &DSOUND_renderer_guids[wod] ) ) {
DSDRIVERDESC desc;
ppd->WaveDeviceId = wod;
- err = mmErr(waveOutMessage((HWAVEOUT)wod,DRV_QUERYDSOUNDDESC,(DWORD)&(desc),0));
+ err = mmErr(waveOutMessage(UlongToHandle(wod),DRV_QUERYDSOUNDDESC,(DWORD_PTR)&desc,0));
if (err == DS_OK) {
PIDSDRIVER drv = NULL;
/* FIXME: this is a memory leak */
ppd->Description = szDescription;
ppd->Module = szModule;
ppd->Interface = szInterface;
- err = mmErr(waveOutMessage((HWAVEOUT)wod, DRV_QUERYDSOUNDIFACE, (DWORD)&drv, 0));
+ err = mmErr(waveOutMessage(UlongToHandle(wod), DRV_QUERYDSOUNDIFACE, (DWORD_PTR)&drv, 0));
if (err == DS_OK && drv)
ppd->Type = DIRECTSOUNDDEVICE_TYPE_VXD;
else
if (IsEqualGUID( &dev_guid, &DSOUND_capture_guids[wid] ) ) {
DSDRIVERDESC desc;
ppd->WaveDeviceId = wid;
- err = mmErr(waveInMessage((HWAVEIN)wid,DRV_QUERYDSOUNDDESC,(DWORD)&(desc),0));
+ err = mmErr(waveInMessage(UlongToHandle(wid),DRV_QUERYDSOUNDDESC,(DWORD_PTR)&desc,0));
if (err == DS_OK) {
PIDSCDRIVER drv;
/* FIXME: this is a memory leak */
ppd->Description = szDescription;
ppd->Module = szModule;
ppd->Interface = szInterface;
- err = mmErr(waveInMessage((HWAVEIN)wid,DRV_QUERYDSOUNDIFACE,(DWORD)&drv,0));
+ err = mmErr(waveInMessage(UlongToHandle(wid),DRV_QUERYDSOUNDIFACE,(DWORD_PTR)&drv,0));
if (err == DS_OK && drv)
ppd->Type = DIRECTSOUNDDEVICE_TYPE_VXD;
else
- WARN("waveOutMessage(DRV_QUERYDSOUNDIFACE) failed\n");
+ WARN("waveInMessage(DRV_QUERYDSOUNDIFACE) failed\n");
break;
} else {
WARN("no memory\n");
for (wod = 0; wod < wodn; wod++) {
if (IsEqualGUID( &ppd->DeviceId, &DSOUND_renderer_guids[wod] ) ) {
DSDRIVERDESC desc;
- TRACE("DSOUND_renderer_guids[%ld]\n", wod);
+ TRACE("DSOUND_renderer_guids[%d]\n", wod);
ppd->DataFlow = DIRECTSOUNDDEVICE_DATAFLOW_RENDER;
ppd->WaveDeviceId = wod;
- err = mmErr(waveOutMessage((HWAVEOUT)wod,DRV_QUERYDSOUNDDESC,(DWORD)&(desc),0));
+ err = mmErr(waveOutMessage(UlongToHandle(wod),DRV_QUERYDSOUNDDESC,(DWORD_PTR)&desc,0));
if (err == DS_OK) {
PIDSDRIVER drv = NULL;
/* FIXME: this is a memory leak */
ppd->Description = szDescription;
ppd->Module = szModule;
ppd->Interface = szInterface;
- err = mmErr(waveOutMessage((HWAVEOUT)wod, DRV_QUERYDSOUNDIFACE, (DWORD)&drv, 0));
+ err = mmErr(waveOutMessage(UlongToHandle(wod), DRV_QUERYDSOUNDIFACE, (DWORD_PTR)&drv, 0));
if (err == DS_OK && drv)
ppd->Type = DIRECTSOUNDDEVICE_TYPE_VXD;
else
for (wid = 0; wid < widn; wid++) {
if (IsEqualGUID( &ppd->DeviceId, &DSOUND_capture_guids[wid] ) ) {
DSDRIVERDESC desc;
- TRACE("DSOUND_capture_guids[%ld]\n", wid);
+ TRACE("DSOUND_capture_guids[%d]\n", wid);
ppd->WaveDeviceId = wid;
- err = mmErr(waveInMessage((HWAVEIN)wid,DRV_QUERYDSOUNDDESC,(DWORD)&(desc),0));
+ err = mmErr(waveInMessage(UlongToHandle(wid),DRV_QUERYDSOUNDDESC,(DWORD_PTR)&desc,0));
if (err == DS_OK) {
PIDSCDRIVER drv;
/* FIXME: this is a memory leak */
ppd->Description = szDescription;
ppd->Module = szModule;
ppd->Interface = szInterface;
- err = mmErr(waveInMessage((HWAVEIN)wid,DRV_QUERYDSOUNDIFACE,(DWORD)&drv,0));
+ err = mmErr(waveInMessage(UlongToHandle(wid),DRV_QUERYDSOUNDIFACE,(DWORD_PTR)&drv,0));
if (err == DS_OK && drv)
ppd->Type = DIRECTSOUNDDEVICE_TYPE_VXD;
else
- WARN("waveOutMessage(DRV_QUERYDSOUNDIFACE) failed\n");
+ WARN("waveInMessage(DRV_QUERYDSOUNDIFACE) failed\n");
found = TRUE;
break;
} else {
if (pcbReturned) {
*pcbReturned = cbPropData;
- TRACE("*pcbReturned=%ld\n", *pcbReturned);
+ TRACE("*pcbReturned=%d\n", *pcbReturned);
}
return S_OK;
}
-static HRESULT WINAPI DSPROPERTY_DescriptionW(
- REFGUID guidPropSet,
+static HRESULT DSPROPERTY_DescriptionW(
LPVOID pPropData,
ULONG cbPropData,
PULONG pcbReturned )
{
- PDSPROPERTY_DIRECTSOUNDDEVICE_DESCRIPTION_W_DATA ppd = (PDSPROPERTY_DIRECTSOUNDDEVICE_DESCRIPTION_W_DATA) pPropData;
+ PDSPROPERTY_DIRECTSOUNDDEVICE_DESCRIPTION_W_DATA ppd = pPropData;
HRESULT err;
GUID dev_guid;
- TRACE("(guidPropSet=%s,pPropData=%p,cbPropData=%ld,pcbReturned=%p)\n",
- debugstr_guid(guidPropSet),pPropData,cbPropData,pcbReturned);
+ TRACE("pPropData=%p,cbPropData=%d,pcbReturned=%p)\n",
+ pPropData,cbPropData,pcbReturned);
TRACE("DeviceId=%s\n",debugstr_guid(&ppd->DeviceId));
if ( IsEqualGUID( &ppd->DeviceId , &GUID_NULL) ) {
} else {
TRACE("DataFlow=Unknown(%d)\n", ppd->DataFlow);
}
- FIXME("(guidPropSet=%s,pPropData=%p,cbPropData=%ld,pcbReturned=%p) GUID_NULL not implemented!\n",
- debugstr_guid(guidPropSet),pPropData,cbPropData,pcbReturned);
+ FIXME("(pPropData=%p,cbPropData=%d,pcbReturned=%p) GUID_NULL not implemented!\n",
+ pPropData,cbPropData,pcbReturned);
return E_PROP_ID_UNSUPPORTED;
}
for (wod = 0; wod < wodn; wod++) {
if (IsEqualGUID( &dev_guid, &DSOUND_renderer_guids[wod] ) ) {
DSDRIVERDESC desc;
- TRACE("DSOUND_renderer_guids[%ld]\n", wod);
+ TRACE("DSOUND_renderer_guids[%d]\n", wod);
ppd->WaveDeviceId = wod;
- err = mmErr(waveOutMessage((HWAVEOUT)wod,DRV_QUERYDSOUNDDESC,(DWORD)&(desc),0));
+ err = mmErr(waveOutMessage(UlongToHandle(wod),DRV_QUERYDSOUNDDESC,(DWORD_PTR)&desc,0));
if (err == DS_OK) {
PIDSDRIVER drv = NULL;
/* FIXME: this is a memory leak */
ppd->Description = wDescription;
ppd->Module = wModule;
ppd->Interface = wInterface;
- err = mmErr(waveOutMessage((HWAVEOUT)wod, DRV_QUERYDSOUNDIFACE, (DWORD)&drv, 0));
+ err = mmErr(waveOutMessage(UlongToHandle(wod), DRV_QUERYDSOUNDIFACE, (DWORD_PTR)&drv, 0));
if (err == DS_OK && drv)
ppd->Type = DIRECTSOUNDDEVICE_TYPE_VXD;
else
if (IsEqualGUID( &dev_guid, &DSOUND_capture_guids[wid] ) ) {
DSDRIVERDESC desc;
ppd->WaveDeviceId = wid;
- err = mmErr(waveInMessage((HWAVEIN)wid,DRV_QUERYDSOUNDDESC,(DWORD)&(desc),0));
+ err = mmErr(waveInMessage(UlongToHandle(wid),DRV_QUERYDSOUNDDESC,(DWORD_PTR)&desc,0));
if (err == DS_OK) {
PIDSCDRIVER drv;
/* FIXME: this is a memory leak */
ppd->Description = wDescription;
ppd->Module = wModule;
ppd->Interface = wInterface;
- err = mmErr(waveInMessage((HWAVEIN)wid,DRV_QUERYDSOUNDIFACE,(DWORD)&drv,0));
+ err = mmErr(waveInMessage(UlongToHandle(wid),DRV_QUERYDSOUNDIFACE,(DWORD_PTR)&drv,0));
if (err == DS_OK && drv)
ppd->Type = DIRECTSOUNDDEVICE_TYPE_VXD;
else
for (wod = 0; wod < wodn; wod++) {
if (IsEqualGUID( &ppd->DeviceId, &DSOUND_renderer_guids[wod] ) ) {
DSDRIVERDESC desc;
- TRACE("DSOUND_renderer_guids[%ld]\n", wod);
+ TRACE("DSOUND_renderer_guids[%d]\n", wod);
ppd->DataFlow = DIRECTSOUNDDEVICE_DATAFLOW_RENDER;
ppd->WaveDeviceId = wod;
- err = mmErr(waveOutMessage((HWAVEOUT)wod,DRV_QUERYDSOUNDDESC,(DWORD)&(desc),0));
+ err = mmErr(waveOutMessage(UlongToHandle(wod),DRV_QUERYDSOUNDDESC,(DWORD_PTR)&desc,0));
if (err == DS_OK) {
PIDSDRIVER drv = NULL;
/* FIXME: this is a memory leak */
ppd->Description = wDescription;
ppd->Module = wModule;
ppd->Interface = wInterface;
- err = mmErr(waveOutMessage((HWAVEOUT)wod, DRV_QUERYDSOUNDIFACE, (DWORD)&drv, 0));
+ err = mmErr(waveOutMessage(UlongToHandle(wod), DRV_QUERYDSOUNDIFACE, (DWORD_PTR)&drv, 0));
if (err == DS_OK && drv)
ppd->Type = DIRECTSOUNDDEVICE_TYPE_VXD;
else
for (wid = 0; wid < widn; wid++) {
if (IsEqualGUID( &dev_guid, &DSOUND_capture_guids[wid] ) ) {
DSDRIVERDESC desc;
- TRACE("DSOUND_capture_guids[%ld]\n", wid);
+ TRACE("DSOUND_capture_guids[%d]\n", wid);
ppd->WaveDeviceId = wid;
- err = mmErr(waveInMessage((HWAVEIN)wid,DRV_QUERYDSOUNDDESC,(DWORD)&(desc),0));
+ err = mmErr(waveInMessage(UlongToHandle(wid),DRV_QUERYDSOUNDDESC,(DWORD_PTR)&desc,0));
if (err == DS_OK) {
PIDSCDRIVER drv;
/* FIXME: this is a memory leak */
ppd->Description = wDescription;
ppd->Module = wModule;
ppd->Interface = wInterface;
- err = mmErr(waveInMessage((HWAVEIN)wid,DRV_QUERYDSOUNDIFACE,(DWORD)&drv,0));
+ err = mmErr(waveInMessage(UlongToHandle(wid),DRV_QUERYDSOUNDIFACE,(DWORD_PTR)&drv,0));
if (err == DS_OK && drv)
ppd->Type = DIRECTSOUNDDEVICE_TYPE_VXD;
else
}
}
}
- }
+ }
if (found == FALSE) {
WARN("device not found\n");
if (pcbReturned) {
*pcbReturned = cbPropData;
- TRACE("*pcbReturned=%ld\n", *pcbReturned);
+ TRACE("*pcbReturned=%d\n", *pcbReturned);
}
return S_OK;
}
-static HRESULT WINAPI DSPROPERTY_Enumerate1(
- REFGUID guidPropSet,
+static HRESULT DSPROPERTY_Enumerate1(
LPVOID pPropData,
ULONG cbPropData,
PULONG pcbReturned )
{
PDSPROPERTY_DIRECTSOUNDDEVICE_ENUMERATE_1_DATA ppd = (PDSPROPERTY_DIRECTSOUNDDEVICE_ENUMERATE_1_DATA) pPropData;
HRESULT err;
- TRACE("(guidPropSet=%s,pPropData=%p,cbPropData=%ld,pcbReturned=%p)\n",
- debugstr_guid(guidPropSet),pPropData,cbPropData,pcbReturned);
-
- if ( IsEqualGUID( &DSPROPSETID_DirectSoundDevice, guidPropSet) ) {
- if (ppd) {
- if (ppd->Callback) {
- unsigned devs, wod, wid;
- DSDRIVERDESC desc;
- DSPROPERTY_DIRECTSOUNDDEVICE_DESCRIPTION_1_DATA data;
-
- devs = waveOutGetNumDevs();
- for (wod = 0; wod < devs; ++wod) {
- err = mmErr(waveOutMessage((HWAVEOUT)wod,DRV_QUERYDSOUNDDESC,(DWORD)&desc,0));
- if (err == DS_OK) {
- PIDSCDRIVER drv;
- ZeroMemory(&data, sizeof(data));
- data.DataFlow = DIRECTSOUNDDEVICE_DATAFLOW_RENDER;
- data.WaveDeviceId = wod;
- data.DeviceId = DSOUND_renderer_guids[wod];
- lstrcpynA(data.DescriptionA, desc.szDesc, sizeof(data.DescriptionA));
- lstrcpynA(data.ModuleA, desc.szDrvname, sizeof(data.ModuleA));
-
- MultiByteToWideChar( CP_ACP, 0, data.DescriptionA, -1, data.DescriptionW, sizeof(data.DescriptionW) );
- MultiByteToWideChar( CP_ACP, 0, data.ModuleA, -1, data.ModuleW, sizeof(data.ModuleW) );
-
- data.Type = DIRECTSOUNDDEVICE_TYPE_EMULATED;
- err = mmErr(waveOutMessage((HWAVEOUT)wod, DRV_QUERYDSOUNDIFACE, (DWORD)&drv, 0));
- if (err == DS_OK && drv)
- data.Type = DIRECTSOUNDDEVICE_TYPE_VXD;
- else
- WARN("waveOutMessage(DRV_QUERYDSOUNDIFACE) failed\n");
+ TRACE("(pPropData=%p,cbPropData=%d,pcbReturned=%p)\n",
+ pPropData,cbPropData,pcbReturned);
+
+ if (ppd) {
+ if (ppd->Callback) {
+ unsigned devs, wod, wid;
+ DSDRIVERDESC desc;
+ DSPROPERTY_DIRECTSOUNDDEVICE_DESCRIPTION_1_DATA data;
+
+ devs = waveOutGetNumDevs();
+ for (wod = 0; wod < devs; ++wod) {
+ err = mmErr(waveOutMessage(UlongToHandle(wod),DRV_QUERYDSOUNDDESC,(DWORD_PTR)&desc,0));
+ if (err == DS_OK) {
+ PIDSCDRIVER drv;
+ ZeroMemory(&data, sizeof(data));
+ data.DataFlow = DIRECTSOUNDDEVICE_DATAFLOW_RENDER;
+ data.WaveDeviceId = wod;
+ data.DeviceId = DSOUND_renderer_guids[wod];
+ lstrcpynA(data.DescriptionA, desc.szDesc, sizeof(data.DescriptionA));
+ lstrcpynA(data.ModuleA, desc.szDrvname, sizeof(data.ModuleA));
+
+ MultiByteToWideChar( CP_ACP, 0, data.DescriptionA, -1, data.DescriptionW, sizeof(data.DescriptionW)/sizeof(WCHAR) );
+ MultiByteToWideChar( CP_ACP, 0, data.ModuleA, -1, data.ModuleW, sizeof(data.ModuleW)/sizeof(WCHAR) );
+
+ data.Type = DIRECTSOUNDDEVICE_TYPE_EMULATED;
+ err = mmErr(waveOutMessage(UlongToHandle(wod), DRV_QUERYDSOUNDIFACE, (DWORD_PTR)&drv, 0));
+ if (err == DS_OK && drv)
+ data.Type = DIRECTSOUNDDEVICE_TYPE_VXD;
+ else
+ WARN("waveOutMessage(DRV_QUERYDSOUNDIFACE) failed\n");
- TRACE("calling Callback(%p,%p)\n", &data, ppd->Context);
- (ppd->Callback)(&data, ppd->Context);
- }
+ TRACE("calling Callback(%p,%p)\n", &data, ppd->Context);
+ (ppd->Callback)(&data, ppd->Context);
}
+ }
- devs = waveInGetNumDevs();
- for (wid = 0; wid < devs; ++wid) {
- err = mmErr(waveInMessage((HWAVEIN)wid,DRV_QUERYDSOUNDDESC,(DWORD)&desc,0));
- if (err == DS_OK) {
- PIDSCDRIVER drv;
- ZeroMemory(&data, sizeof(data));
- data.DataFlow = DIRECTSOUNDDEVICE_DATAFLOW_CAPTURE;
- data.WaveDeviceId = wid;
- data.DeviceId = DSOUND_capture_guids[wid];
- lstrcpynA(data.DescriptionA, desc.szDesc, sizeof(data.DescriptionA));
- lstrcpynA(data.ModuleA, desc.szDrvname, sizeof(data.ModuleA));
-
- MultiByteToWideChar( CP_ACP, 0, data.DescriptionA, -1, data.DescriptionW, sizeof(data.DescriptionW) );
- MultiByteToWideChar( CP_ACP, 0, data.ModuleA, -1, data.ModuleW, sizeof(data.ModuleW) );
-
- data.Type = DIRECTSOUNDDEVICE_TYPE_EMULATED;
- err = mmErr(waveInMessage((HWAVEIN)wid, DRV_QUERYDSOUNDIFACE, (DWORD)&drv, 0));
- if (err == DS_OK && drv)
- data.Type = DIRECTSOUNDDEVICE_TYPE_VXD;
- else
- WARN("waveInMessage(DRV_QUERYDSOUNDIFACE) failed\n");
+ devs = waveInGetNumDevs();
+ for (wid = 0; wid < devs; ++wid) {
+ err = mmErr(waveInMessage(UlongToHandle(wid),DRV_QUERYDSOUNDDESC,(DWORD_PTR)&desc,0));
+ if (err == DS_OK) {
+ PIDSCDRIVER drv;
+ ZeroMemory(&data, sizeof(data));
+ data.DataFlow = DIRECTSOUNDDEVICE_DATAFLOW_CAPTURE;
+ data.WaveDeviceId = wid;
+ data.DeviceId = DSOUND_capture_guids[wid];
+ lstrcpynA(data.DescriptionA, desc.szDesc, sizeof(data.DescriptionA));
+ lstrcpynA(data.ModuleA, desc.szDrvname, sizeof(data.ModuleA));
+
+ MultiByteToWideChar( CP_ACP, 0, data.DescriptionA, -1, data.DescriptionW, sizeof(data.DescriptionW)/sizeof(WCHAR) );
+ MultiByteToWideChar( CP_ACP, 0, data.ModuleA, -1, data.ModuleW, sizeof(data.ModuleW)/sizeof(WCHAR) );
+
+ data.Type = DIRECTSOUNDDEVICE_TYPE_EMULATED;
+ err = mmErr(waveInMessage(UlongToHandle(wid), DRV_QUERYDSOUNDIFACE, (DWORD_PTR)&drv, 0));
+ if (err == DS_OK && drv)
+ data.Type = DIRECTSOUNDDEVICE_TYPE_VXD;
+ else
+ WARN("waveInMessage(DRV_QUERYDSOUNDIFACE) failed\n");
- TRACE("calling Callback(%p,%p)\n", &data, ppd->Context);
- (ppd->Callback)(&data, ppd->Context);
- }
+ TRACE("calling Callback(%p,%p)\n", &data, ppd->Context);
+ (ppd->Callback)(&data, ppd->Context);
}
-
- return S_OK;
}
+
+ return S_OK;
}
- } else {
- FIXME("unsupported property: %s\n",debugstr_guid(guidPropSet));
}
if (pcbReturned) {
*pcbReturned = 0;
- FIXME("*pcbReturned=%ld\n", *pcbReturned);
+ FIXME("*pcbReturned=%d\n", *pcbReturned);
}
return E_PROP_ID_UNSUPPORTED;
}
-static HRESULT WINAPI DSPROPERTY_EnumerateA(
- REFGUID guidPropSet,
+static HRESULT DSPROPERTY_EnumerateA(
LPVOID pPropData,
ULONG cbPropData,
PULONG pcbReturned )
{
- PDSPROPERTY_DIRECTSOUNDDEVICE_ENUMERATE_A_DATA ppd = (PDSPROPERTY_DIRECTSOUNDDEVICE_ENUMERATE_A_DATA) pPropData;
+ PDSPROPERTY_DIRECTSOUNDDEVICE_ENUMERATE_A_DATA ppd = pPropData;
HRESULT err;
- TRACE("(guidPropSet=%s,pPropData=%p,cbPropData=%ld,pcbReturned=%p)\n",
- debugstr_guid(guidPropSet),pPropData,cbPropData,pcbReturned);
-
- if ( IsEqualGUID( &DSPROPSETID_DirectSoundDevice, guidPropSet) ) {
- if (ppd) {
- if (ppd->Callback) {
- unsigned devs, wod, wid;
- DSDRIVERDESC desc;
- DSPROPERTY_DIRECTSOUNDDEVICE_DESCRIPTION_A_DATA data;
-
- devs = waveOutGetNumDevs();
- for (wod = 0; wod < devs; ++wod) {
- err = mmErr(waveOutMessage((HWAVEOUT)wod,DRV_QUERYDSOUNDDESC,(DWORD)&desc,0));
- if (err == DS_OK) {
- DWORD size;
- err = mmErr(waveOutMessage((HWAVEOUT)wod,DRV_QUERYDEVICEINTERFACESIZE,(DWORD_PTR)&size,0));
- if (err == DS_OK) {
- WCHAR * nameW = HeapAlloc(GetProcessHeap(),0,size);
- if (nameW) {
- err = mmErr(waveOutMessage((HWAVEOUT)wod,DRV_QUERYDEVICEINTERFACE,(DWORD_PTR)nameW,size));
- if (err == DS_OK) {
- CHAR * szInterface = HeapAlloc(GetProcessHeap(),0,size/sizeof(WCHAR));
- if (szInterface) {
- PIDSCDRIVER drv;
- ZeroMemory(&data, sizeof(data));
- data.DataFlow = DIRECTSOUNDDEVICE_DATAFLOW_RENDER;
- data.WaveDeviceId = wod;
- data.DeviceId = DSOUND_renderer_guids[wod];
- data.Description = desc.szDesc;
- data.Module = desc.szDrvname;
- WideCharToMultiByte( CP_ACP, 0, nameW, size/sizeof(WCHAR), szInterface, size/sizeof(WCHAR), NULL, NULL );
- data.Interface = szInterface;
-
- data.Type = DIRECTSOUNDDEVICE_TYPE_EMULATED;
- err = mmErr(waveOutMessage((HWAVEOUT)wod, DRV_QUERYDSOUNDIFACE, (DWORD)&drv, 0));
- if (err == DS_OK && drv)
- data.Type = DIRECTSOUNDDEVICE_TYPE_VXD;
- else
- WARN("waveOutMessage(DRV_QUERYDSOUNDIFACE) failed\n");
-
- TRACE("calling Callback(%p,%p)\n", &data, ppd->Context);
- (ppd->Callback)(&data, ppd->Context);
- }
- HeapFree(GetProcessHeap(),0,szInterface);
+ TRACE("(pPropData=%p,cbPropData=%d,pcbReturned=%p)\n",
+ pPropData,cbPropData,pcbReturned);
+
+ if (ppd) {
+ if (ppd->Callback) {
+ unsigned devs, wod, wid;
+ DSDRIVERDESC desc;
+ DSPROPERTY_DIRECTSOUNDDEVICE_DESCRIPTION_A_DATA data;
+
+ devs = waveOutGetNumDevs();
+ for (wod = 0; wod < devs; ++wod) {
+ err = mmErr(waveOutMessage(UlongToHandle(wod),DRV_QUERYDSOUNDDESC,(DWORD_PTR)&desc,0));
+ if (err == DS_OK) {
+ DWORD size;
+ err = mmErr(waveOutMessage(UlongToHandle(wod),DRV_QUERYDEVICEINTERFACESIZE,(DWORD_PTR)&size,0));
+ if (err == DS_OK) {
+ WCHAR * nameW = HeapAlloc(GetProcessHeap(),0,size);
+ if (nameW) {
+ err = mmErr(waveOutMessage(UlongToHandle(wod),DRV_QUERYDEVICEINTERFACE,(DWORD_PTR)nameW,size));
+ if (err == DS_OK) {
+ CHAR * szInterface = HeapAlloc(GetProcessHeap(),0,size/sizeof(WCHAR));
+ if (szInterface) {
+ PIDSCDRIVER drv;
+ ZeroMemory(&data, sizeof(data));
+ data.DataFlow = DIRECTSOUNDDEVICE_DATAFLOW_RENDER;
+ data.WaveDeviceId = wod;
+ data.DeviceId = DSOUND_renderer_guids[wod];
+ data.Description = desc.szDesc;
+ data.Module = desc.szDrvname;
+ WideCharToMultiByte( CP_ACP, 0, nameW, size/sizeof(WCHAR), szInterface, size/sizeof(WCHAR), NULL, NULL );
+ data.Interface = szInterface;
+
+ data.Type = DIRECTSOUNDDEVICE_TYPE_EMULATED;
+ err = mmErr(waveOutMessage(UlongToHandle(wod), DRV_QUERYDSOUNDIFACE, (DWORD_PTR)&drv, 0));
+ if (err == DS_OK && drv)
+ data.Type = DIRECTSOUNDDEVICE_TYPE_VXD;
+ else
+ WARN("waveOutMessage(DRV_QUERYDSOUNDIFACE) failed\n");
+
+ TRACE("calling Callback(%p,%p)\n", &data, ppd->Context);
+ (ppd->Callback)(&data, ppd->Context);
}
- }
- HeapFree(GetProcessHeap(),0,nameW);
- }
- }
- }
+ HeapFree(GetProcessHeap(),0,szInterface);
+ }
+ }
+ HeapFree(GetProcessHeap(),0,nameW);
+ }
+ }
+ }
- devs = waveInGetNumDevs();
- for (wid = 0; wid < devs; ++wid) {
- err = mmErr(waveInMessage((HWAVEIN)wid,DRV_QUERYDSOUNDDESC,(DWORD)&desc,0));
- if (err == DS_OK) {
- DWORD size;
- err = mmErr(waveInMessage((HWAVEIN)wid,DRV_QUERYDEVICEINTERFACESIZE,(DWORD_PTR)&size,0));
- if (err == DS_OK) {
- WCHAR * nameW = HeapAlloc(GetProcessHeap(),0,size);
- if (nameW) {
- err = mmErr(waveInMessage((HWAVEIN)wid,DRV_QUERYDEVICEINTERFACE,(DWORD_PTR)nameW,size));
- if (err == DS_OK) {
- CHAR * szInterface = HeapAlloc(GetProcessHeap(),0,size/sizeof(WCHAR));
- if (szInterface) {
- PIDSCDRIVER drv;
- ZeroMemory(&data, sizeof(data));
- data.DataFlow = DIRECTSOUNDDEVICE_DATAFLOW_CAPTURE;
- data.WaveDeviceId = wid;
- data.DeviceId = DSOUND_capture_guids[wid];
- data.Description = desc.szDesc;
- data.Module = desc.szDrvname;
- WideCharToMultiByte( CP_ACP, 0, nameW, size/sizeof(WCHAR), szInterface, size/sizeof(WCHAR), NULL, NULL );
- data.Interface = szInterface;
-
- data.Type = DIRECTSOUNDDEVICE_TYPE_EMULATED;
- err = mmErr(waveInMessage((HWAVEIN)wid, DRV_QUERYDSOUNDIFACE, (DWORD)&drv, 0));
- if (err == DS_OK && drv)
- data.Type = DIRECTSOUNDDEVICE_TYPE_VXD;
- else
- WARN("waveInMessage(DRV_QUERYDSOUNDIFACE) failed\n");
-
- TRACE("calling Callback(%p,%p)\n", &data, ppd->Context);
- (ppd->Callback)(&data, ppd->Context);
- }
- HeapFree(GetProcessHeap(),0,szInterface);
+ devs = waveInGetNumDevs();
+ for (wid = 0; wid < devs; ++wid) {
+ err = mmErr(waveInMessage(UlongToHandle(wid),DRV_QUERYDSOUNDDESC,(DWORD_PTR)&desc,0));
+ if (err == DS_OK) {
+ DWORD size;
+ err = mmErr(waveInMessage(UlongToHandle(wid),DRV_QUERYDEVICEINTERFACESIZE,(DWORD_PTR)&size,0));
+ if (err == DS_OK) {
+ WCHAR * nameW = HeapAlloc(GetProcessHeap(),0,size);
+ if (nameW) {
+ err = mmErr(waveInMessage(UlongToHandle(wid),DRV_QUERYDEVICEINTERFACE,(DWORD_PTR)nameW,size));
+ if (err == DS_OK) {
+ CHAR * szInterface = HeapAlloc(GetProcessHeap(),0,size/sizeof(WCHAR));
+ if (szInterface) {
+ PIDSCDRIVER drv;
+ ZeroMemory(&data, sizeof(data));
+ data.DataFlow = DIRECTSOUNDDEVICE_DATAFLOW_CAPTURE;
+ data.WaveDeviceId = wid;
+ data.DeviceId = DSOUND_capture_guids[wid];
+ data.Description = desc.szDesc;
+ data.Module = desc.szDrvname;
+ WideCharToMultiByte( CP_ACP, 0, nameW, size/sizeof(WCHAR), szInterface, size/sizeof(WCHAR), NULL, NULL );
+ data.Interface = szInterface;
+
+ data.Type = DIRECTSOUNDDEVICE_TYPE_EMULATED;
+ err = mmErr(waveInMessage(UlongToHandle(wid), DRV_QUERYDSOUNDIFACE, (DWORD_PTR)&drv, 0));
+ if (err == DS_OK && drv)
+ data.Type = DIRECTSOUNDDEVICE_TYPE_VXD;
+ else
+ WARN("waveInMessage(DRV_QUERYDSOUNDIFACE) failed\n");
+
+ TRACE("calling Callback(%p,%p)\n", &data, ppd->Context);
+ (ppd->Callback)(&data, ppd->Context);
}
- }
- HeapFree(GetProcessHeap(),0,nameW);
- }
- }
- }
+ HeapFree(GetProcessHeap(),0,szInterface);
+ }
+ }
+ HeapFree(GetProcessHeap(),0,nameW);
+ }
+ }
+ }
- return S_OK;
- }
- }
- } else {
- FIXME("unsupported property: %s\n",debugstr_guid(guidPropSet));
+ return S_OK;
+ }
}
if (pcbReturned) {
- *pcbReturned = 0;
- FIXME("*pcbReturned=%ld\n", *pcbReturned);
+ *pcbReturned = 0;
+ FIXME("*pcbReturned=%d\n", *pcbReturned);
}
return E_PROP_ID_UNSUPPORTED;
}
-static HRESULT WINAPI DSPROPERTY_EnumerateW(
- REFGUID guidPropSet,
+static HRESULT DSPROPERTY_EnumerateW(
LPVOID pPropData,
ULONG cbPropData,
PULONG pcbReturned )
{
- PDSPROPERTY_DIRECTSOUNDDEVICE_ENUMERATE_W_DATA ppd = (PDSPROPERTY_DIRECTSOUNDDEVICE_ENUMERATE_W_DATA) pPropData;
+ PDSPROPERTY_DIRECTSOUNDDEVICE_ENUMERATE_W_DATA ppd = pPropData;
HRESULT err;
- TRACE("(guidPropSet=%s,pPropData=%p,cbPropData=%ld,pcbReturned=%p)\n",
- debugstr_guid(guidPropSet),pPropData,cbPropData,pcbReturned);
-
- if ( IsEqualGUID( &DSPROPSETID_DirectSoundDevice, guidPropSet) ) {
- if (ppd) {
- if (ppd->Callback) {
- unsigned devs, wod, wid;
- DSDRIVERDESC desc;
- DSPROPERTY_DIRECTSOUNDDEVICE_DESCRIPTION_W_DATA data;
-
- devs = waveOutGetNumDevs();
- for (wod = 0; wod < devs; ++wod) {
- err = mmErr(waveOutMessage((HWAVEOUT)wod,DRV_QUERYDSOUNDDESC,(DWORD)&desc,0));
- if (err == DS_OK) {
- WCHAR * wDescription = HeapAlloc(GetProcessHeap(),0,0x200);
- WCHAR * wModule = HeapAlloc(GetProcessHeap(),0,0x200);
- if (wDescription && wModule) {
- DWORD size;
- err = mmErr(waveOutMessage((HWAVEOUT)wod,DRV_QUERYDEVICEINTERFACESIZE, (DWORD_PTR)&size, 0));
- if (err == DS_OK) {
- WCHAR * wInterface = HeapAlloc(GetProcessHeap(),0,size);
- if (wInterface) {
- err = mmErr(waveOutMessage((HWAVEOUT)wod, DRV_QUERYDEVICEINTERFACE, (DWORD_PTR)wInterface, size));
- if (err == DS_OK) {
- PIDSCDRIVER drv;
- ZeroMemory(&data, sizeof(data));
- data.DataFlow = DIRECTSOUNDDEVICE_DATAFLOW_RENDER;
- data.WaveDeviceId = wod;
- data.DeviceId = DSOUND_renderer_guids[wod];
-
- MultiByteToWideChar( CP_ACP, 0, desc.szDesc, -1, wDescription, 0x100 );
- MultiByteToWideChar( CP_ACP, 0, desc.szDrvname, -1, wModule, 0x100 );
-
- data.Description = wDescription;
- data.Module = wModule;
- data.Interface = wInterface;
-
- data.Type = DIRECTSOUNDDEVICE_TYPE_EMULATED;
- err = mmErr(waveOutMessage((HWAVEOUT)wod, DRV_QUERYDSOUNDIFACE, (DWORD)&drv, 0));
- if (err == DS_OK && drv)
- data.Type = DIRECTSOUNDDEVICE_TYPE_VXD;
- else
- WARN("waveOutMessage(DRV_QUERYDSOUNDIFACE) failed\n");
-
- TRACE("calling Callback(%p,%p)\n", &data, ppd->Context);
- (ppd->Callback)(&data, ppd->Context);
- }
- }
- HeapFree(GetProcessHeap(),0,wInterface);
- }
- }
- HeapFree(GetProcessHeap(),0,wDescription);
- HeapFree(GetProcessHeap(),0,wModule);
- }
- }
-
- devs = waveInGetNumDevs();
- for (wid = 0; wid < devs; ++wid) {
- err = mmErr(waveInMessage((HWAVEIN)wid,DRV_QUERYDSOUNDDESC,(DWORD)&desc,0));
- if (err == DS_OK) {
- WCHAR * wDescription = HeapAlloc(GetProcessHeap(),0,0x200);
- WCHAR * wModule = HeapAlloc(GetProcessHeap(),0,0x200);
- if (wDescription && wModule) {
- DWORD size;
- err = mmErr(waveInMessage((HWAVEIN)wid,DRV_QUERYDEVICEINTERFACESIZE, (DWORD_PTR)&size, 0));
- if (err == DS_OK) {
- WCHAR * wInterface = HeapAlloc(GetProcessHeap(),0,size);
- if (wInterface) {
- err = mmErr(waveInMessage((HWAVEIN)wid, DRV_QUERYDEVICEINTERFACE, (DWORD_PTR)wInterface, size));
- if (err == DS_OK) {
- PIDSCDRIVER drv;
- ZeroMemory(&data, sizeof(data));
- data.DataFlow = DIRECTSOUNDDEVICE_DATAFLOW_CAPTURE;
- data.WaveDeviceId = wid;
- data.DeviceId = DSOUND_capture_guids[wid];
-
- MultiByteToWideChar( CP_ACP, 0, desc.szDesc, -1, wDescription, 0x100 );
- MultiByteToWideChar( CP_ACP, 0, desc.szDrvname, -1, wModule, 0x100 );
-
- data.Description = wDescription;
- data.Module = wModule;
- data.Interface = wInterface;
- data.Type = DIRECTSOUNDDEVICE_TYPE_EMULATED;
- err = mmErr(waveInMessage((HWAVEIN)wid, DRV_QUERYDSOUNDIFACE, (DWORD)&drv, 0));
- if (err == DS_OK && drv)
- data.Type = DIRECTSOUNDDEVICE_TYPE_VXD;
- else
- WARN("waveInMessage(DRV_QUERYDSOUNDIFACE) failed\n");
-
- TRACE("calling Callback(%p,%p)\n", &data, ppd->Context);
- (ppd->Callback)(&data, ppd->Context);
+ TRACE("(pPropData=%p,cbPropData=%d,pcbReturned=%p)\n",
+ pPropData,cbPropData,pcbReturned);
+
+ if (ppd) {
+ if (ppd->Callback) {
+ unsigned devs, wod, wid;
+ DSDRIVERDESC desc;
+ DSPROPERTY_DIRECTSOUNDDEVICE_DESCRIPTION_W_DATA data;
+
+ devs = waveOutGetNumDevs();
+ for (wod = 0; wod < devs; ++wod) {
+ err = mmErr(waveOutMessage(UlongToHandle(wod),DRV_QUERYDSOUNDDESC,(DWORD_PTR)&desc,0));
+ if (err == DS_OK) {
+ WCHAR * wDescription = HeapAlloc(GetProcessHeap(),0,0x200);
+ WCHAR * wModule = HeapAlloc(GetProcessHeap(),0,0x200);
+ if (wDescription && wModule) {
+ DWORD size;
+ err = mmErr(waveOutMessage(UlongToHandle(wod),DRV_QUERYDEVICEINTERFACESIZE, (DWORD_PTR)&size, 0));
+ if (err == DS_OK) {
+ WCHAR * wInterface = HeapAlloc(GetProcessHeap(),0,size);
+ if (wInterface) {
+ err = mmErr(waveOutMessage(UlongToHandle(wod), DRV_QUERYDEVICEINTERFACE, (DWORD_PTR)wInterface, size));
+ if (err == DS_OK) {
+ PIDSCDRIVER drv;
+ ZeroMemory(&data, sizeof(data));
+ data.DataFlow = DIRECTSOUNDDEVICE_DATAFLOW_RENDER;
+ data.WaveDeviceId = wod;
+ data.DeviceId = DSOUND_renderer_guids[wod];
+
+ MultiByteToWideChar( CP_ACP, 0, desc.szDesc, -1, wDescription, 0x100 );
+ MultiByteToWideChar( CP_ACP, 0, desc.szDrvname, -1, wModule, 0x100 );
+
+ data.Description = wDescription;
+ data.Module = wModule;
+ data.Interface = wInterface;
+
+ data.Type = DIRECTSOUNDDEVICE_TYPE_EMULATED;
+ err = mmErr(waveOutMessage(UlongToHandle(wod), DRV_QUERYDSOUNDIFACE, (DWORD_PTR)&drv, 0));
+ if (err == DS_OK && drv)
+ data.Type = DIRECTSOUNDDEVICE_TYPE_VXD;
+ else
+ WARN("waveOutMessage(DRV_QUERYDSOUNDIFACE) failed\n");
+
+ TRACE("calling Callback(%p,%p)\n", &data, ppd->Context);
+ (ppd->Callback)(&data, ppd->Context);
}
+ }
+ HeapFree(GetProcessHeap(),0,wInterface);
+ }
+ }
+ HeapFree(GetProcessHeap(),0,wDescription);
+ HeapFree(GetProcessHeap(),0,wModule);
+ }
+ }
+
+ devs = waveInGetNumDevs();
+ for (wid = 0; wid < devs; ++wid) {
+ err = mmErr(waveInMessage(UlongToHandle(wid),DRV_QUERYDSOUNDDESC,(DWORD_PTR)&desc,0));
+ if (err == DS_OK) {
+ WCHAR * wDescription = HeapAlloc(GetProcessHeap(),0,0x200);
+ WCHAR * wModule = HeapAlloc(GetProcessHeap(),0,0x200);
+ if (wDescription && wModule) {
+ DWORD size;
+ err = mmErr(waveInMessage(UlongToHandle(wid),DRV_QUERYDEVICEINTERFACESIZE, (DWORD_PTR)&size, 0));
+ if (err == DS_OK) {
+ WCHAR * wInterface = HeapAlloc(GetProcessHeap(),0,size);
+ if (wInterface) {
+ err = mmErr(waveInMessage(UlongToHandle(wid), DRV_QUERYDEVICEINTERFACE, (DWORD_PTR)wInterface, size));
+ if (err == DS_OK) {
+ PIDSCDRIVER drv;
+ ZeroMemory(&data, sizeof(data));
+ data.DataFlow = DIRECTSOUNDDEVICE_DATAFLOW_CAPTURE;
+ data.WaveDeviceId = wid;
+ data.DeviceId = DSOUND_capture_guids[wid];
+
+ MultiByteToWideChar( CP_ACP, 0, desc.szDesc, -1, wDescription, 0x100 );
+ MultiByteToWideChar( CP_ACP, 0, desc.szDrvname, -1, wModule, 0x100 );
+
+ data.Description = wDescription;
+ data.Module = wModule;
+ data.Interface = wInterface;
+ data.Type = DIRECTSOUNDDEVICE_TYPE_EMULATED;
+ err = mmErr(waveInMessage(UlongToHandle(wid), DRV_QUERYDSOUNDIFACE, (DWORD_PTR)&drv, 0));
+ if (err == DS_OK && drv)
+ data.Type = DIRECTSOUNDDEVICE_TYPE_VXD;
+ else
+ WARN("waveInMessage(DRV_QUERYDSOUNDIFACE) failed\n");
+
+ TRACE("calling Callback(%p,%p)\n", &data, ppd->Context);
+ (ppd->Callback)(&data, ppd->Context);
}
- HeapFree(GetProcessHeap(),0,wInterface);
- }
- }
- HeapFree(GetProcessHeap(),0,wDescription);
- HeapFree(GetProcessHeap(),0,wModule);
- }
- }
+ }
+ HeapFree(GetProcessHeap(),0,wInterface);
+ }
+ }
+ HeapFree(GetProcessHeap(),0,wDescription);
+ HeapFree(GetProcessHeap(),0,wModule);
+ }
+ }
- return S_OK;
- }
- }
- } else {
- FIXME("unsupported property: %s\n",debugstr_guid(guidPropSet));
+ return S_OK;
+ }
}
if (pcbReturned) {
- *pcbReturned = 0;
- FIXME("*pcbReturned=%ld\n", *pcbReturned);
+ *pcbReturned = 0;
+ FIXME("*pcbReturned=%d\n", *pcbReturned);
}
return E_PROP_ID_UNSUPPORTED;
PULONG pcbReturned )
{
IKsPrivatePropertySetImpl *This = (IKsPrivatePropertySetImpl *)iface;
- 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);
+ TRACE("(iface=%p,guidPropSet=%s,dwPropID=%d,pInstanceData=%p,cbInstanceData=%d,pPropData=%p,cbPropData=%d,pcbReturned=%p)\n",
+ This,debugstr_guid(guidPropSet),dwPropID,pInstanceData,cbInstanceData,pPropData,cbPropData,pcbReturned);
if ( IsEqualGUID( &DSPROPSETID_DirectSoundDevice, guidPropSet) ) {
- switch (dwPropID) {
- case DSPROPERTY_DIRECTSOUNDDEVICE_WAVEDEVICEMAPPING_A:
- return DSPROPERTY_WaveDeviceMappingA(guidPropSet,pPropData,cbPropData,pcbReturned);
- case DSPROPERTY_DIRECTSOUNDDEVICE_DESCRIPTION_1:
- return DSPROPERTY_Description1(guidPropSet,pPropData,cbPropData,pcbReturned);
- case DSPROPERTY_DIRECTSOUNDDEVICE_ENUMERATE_1:
- return DSPROPERTY_Enumerate1(guidPropSet,pPropData,cbPropData,pcbReturned);
- case DSPROPERTY_DIRECTSOUNDDEVICE_WAVEDEVICEMAPPING_W:
- return DSPROPERTY_WaveDeviceMappingW(guidPropSet,pPropData,cbPropData,pcbReturned);
- case DSPROPERTY_DIRECTSOUNDDEVICE_DESCRIPTION_A:
- return DSPROPERTY_DescriptionA(guidPropSet,pPropData,cbPropData,pcbReturned);
- case DSPROPERTY_DIRECTSOUNDDEVICE_DESCRIPTION_W:
- return DSPROPERTY_DescriptionW(guidPropSet,pPropData,cbPropData,pcbReturned);
- case DSPROPERTY_DIRECTSOUNDDEVICE_ENUMERATE_A:
- return DSPROPERTY_EnumerateA(guidPropSet,pPropData,cbPropData,pcbReturned);
- case DSPROPERTY_DIRECTSOUNDDEVICE_ENUMERATE_W:
- return DSPROPERTY_EnumerateW(guidPropSet,pPropData,cbPropData,pcbReturned);
- default:
- FIXME("unsupported ID: %ld\n",dwPropID);
- break;
- }
+ switch (dwPropID) {
+ case DSPROPERTY_DIRECTSOUNDDEVICE_WAVEDEVICEMAPPING_A:
+ return DSPROPERTY_WaveDeviceMappingA(pPropData,cbPropData,pcbReturned);
+ case DSPROPERTY_DIRECTSOUNDDEVICE_DESCRIPTION_1:
+ return DSPROPERTY_Description1(pPropData,cbPropData,pcbReturned);
+ case DSPROPERTY_DIRECTSOUNDDEVICE_ENUMERATE_1:
+ return DSPROPERTY_Enumerate1(pPropData,cbPropData,pcbReturned);
+ case DSPROPERTY_DIRECTSOUNDDEVICE_WAVEDEVICEMAPPING_W:
+ return DSPROPERTY_WaveDeviceMappingW(pPropData,cbPropData,pcbReturned);
+ case DSPROPERTY_DIRECTSOUNDDEVICE_DESCRIPTION_A:
+ return DSPROPERTY_DescriptionA(pPropData,cbPropData,pcbReturned);
+ case DSPROPERTY_DIRECTSOUNDDEVICE_DESCRIPTION_W:
+ return DSPROPERTY_DescriptionW(pPropData,cbPropData,pcbReturned);
+ case DSPROPERTY_DIRECTSOUNDDEVICE_ENUMERATE_A:
+ return DSPROPERTY_EnumerateA(pPropData,cbPropData,pcbReturned);
+ case DSPROPERTY_DIRECTSOUNDDEVICE_ENUMERATE_W:
+ return DSPROPERTY_EnumerateW(pPropData,cbPropData,pcbReturned);
+ default:
+ FIXME("unsupported ID: %d\n",dwPropID);
+ break;
+ }
} else {
- FIXME("unsupported property: %s\n",debugstr_guid(guidPropSet));
+ FIXME("unsupported property: %s\n",debugstr_guid(guidPropSet));
}
if (pcbReturned) {
- *pcbReturned = 0;
- FIXME("*pcbReturned=%ld\n", *pcbReturned);
+ *pcbReturned = 0;
+ FIXME("*pcbReturned=%d\n", *pcbReturned);
}
return E_PROP_ID_UNSUPPORTED;
{
IKsPrivatePropertySetImpl *This = (IKsPrivatePropertySetImpl *)iface;
- FIXME("(%p,%s,%ld,%p,%ld,%p,%ld), stub!\n",This,debugstr_guid(guidPropSet),dwPropID,pInstanceData,cbInstanceData,pPropData,cbPropData);
+ FIXME("(%p,%s,%d,%p,%d,%p,%d), stub!\n",This,debugstr_guid(guidPropSet),dwPropID,pInstanceData,cbInstanceData,pPropData,cbPropData);
return E_PROP_ID_UNSUPPORTED;
}
PULONG pTypeSupport )
{
IKsPrivatePropertySetImpl *This = (IKsPrivatePropertySetImpl *)iface;
- TRACE("(%p,%s,%ld,%p)\n",This,debugstr_guid(guidPropSet),dwPropID,pTypeSupport);
+ TRACE("(%p,%s,%d,%p)\n",This,debugstr_guid(guidPropSet),dwPropID,pTypeSupport);
if ( IsEqualGUID( &DSPROPSETID_DirectSoundDevice, guidPropSet) ) {
switch (dwPropID) {
*pTypeSupport = KSPROPERTY_SUPPORT_GET;
return S_OK;
default:
- FIXME("unsupported ID: %ld\n",dwPropID);
+ FIXME("unsupported ID: %d\n",dwPropID);
break;
}
} else {
IKsPrivatePropertySetImpl_QuerySupport
};
-HRESULT WINAPI IKsPrivatePropertySetImpl_Create(
+HRESULT IKsPrivatePropertySetImpl_Create(
+ REFIID riid,
IKsPrivatePropertySetImpl **piks)
{
IKsPrivatePropertySetImpl *iks;
+ TRACE("(%s, %p)\n", debugstr_guid(riid), piks);
+
+ if (!IsEqualIID(riid, &IID_IUnknown) &&
+ !IsEqualIID(riid, &IID_IKsPropertySet)) {
+ *piks = 0;
+ return E_NOINTERFACE;
+ }
iks = HeapAlloc(GetProcessHeap(),0,sizeof(*iks));
- iks->ref = 0;
+ iks->ref = 1;
iks->lpVtbl = &ikspvt;
*piks = iks;