3 * Copyright 1998 Marcus Meissner
4 * Copyright 1998 Rob Riggs
5 * Copyright 2000-2002 TransGaming Technologies, Inc.
7 * This library is free software; you can redistribute it and/or
8 * modify it under the terms of the GNU Lesser General Public
9 * License as published by the Free Software Foundation; either
10 * version 2.1 of the License, or (at your option) any later version.
12 * This library is distributed in the hope that it will be useful,
13 * but WITHOUT ANY WARRANTY; without even the implied warranty of
14 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
15 * Lesser General Public License for more details.
17 * You should have received a copy of the GNU Lesser General Public
18 * License along with this library; if not, write to the Free Software
19 * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA
33 #include "wine/debug.h"
36 #include "dsound_private.h"
39 #ifdef NONAMELESSSTRUCT
45 WINE_DEFAULT_DEBUG_CHANNEL(dsound
);
47 typedef struct IKsPrivatePropertySetImpl
49 IKsPropertySet IKsPropertySet_iface
;
51 } IKsPrivatePropertySetImpl
;
53 static IKsPrivatePropertySetImpl
*impl_from_IKsPropertySet(IKsPropertySet
*iface
)
55 return CONTAINING_RECORD(iface
, IKsPrivatePropertySetImpl
, IKsPropertySet_iface
);
58 /*******************************************************************************
59 * IKsPrivatePropertySet
62 /* IUnknown methods */
63 static HRESULT WINAPI
IKsPrivatePropertySetImpl_QueryInterface(
64 LPKSPROPERTYSET iface
,
68 IKsPrivatePropertySetImpl
*This
= impl_from_IKsPropertySet(iface
);
69 TRACE("(%p,%s,%p)\n",This
,debugstr_guid(riid
),ppobj
);
71 if (IsEqualIID(riid
, &IID_IUnknown
) ||
72 IsEqualIID(riid
, &IID_IKsPropertySet
)) {
74 IUnknown_AddRef(iface
);
81 static ULONG WINAPI
IKsPrivatePropertySetImpl_AddRef(LPKSPROPERTYSET iface
)
83 IKsPrivatePropertySetImpl
*This
= impl_from_IKsPropertySet(iface
);
84 ULONG ref
= InterlockedIncrement(&(This
->ref
));
85 TRACE("(%p) ref was %d\n", This
, ref
- 1);
89 static ULONG WINAPI
IKsPrivatePropertySetImpl_Release(LPKSPROPERTYSET iface
)
91 IKsPrivatePropertySetImpl
*This
= impl_from_IKsPropertySet(iface
);
92 ULONG ref
= InterlockedDecrement(&(This
->ref
));
93 TRACE("(%p) ref was %d\n", This
, ref
+ 1);
96 HeapFree(GetProcessHeap(), 0, This
);
97 TRACE("(%p) released\n", This
);
102 static HRESULT
DSPROPERTY_WaveDeviceMappingW(
107 HRESULT hr
= DSERR_INVALIDPARAM
;
108 PDSPROPERTY_DIRECTSOUNDDEVICE_WAVEDEVICEMAPPING_W_DATA ppd
;
109 TRACE("(pPropData=%p,cbPropData=%d,pcbReturned=%p)\n",
110 pPropData
,cbPropData
,pcbReturned
);
115 WARN("invalid parameter: pPropData\n");
116 return DSERR_INVALIDPARAM
;
119 if (ppd
->DataFlow
== DIRECTSOUNDDEVICE_DATAFLOW_RENDER
) {
122 TRACE("DataFlow=DIRECTSOUNDDEVICE_DATAFLOW_RENDER\n");
123 wodn
= waveOutGetNumDevs();
124 for (wod
= 0; wod
< wodn
; wod
++) {
127 res
= waveOutGetDevCapsW(wod
, &capsW
, sizeof(capsW
));
128 if (res
== MMSYSERR_NOERROR
) {
129 if (lstrcmpW(capsW
.szPname
, ppd
->DeviceName
) == 0) {
130 ppd
->DeviceId
= DSOUND_renderer_guids
[wod
];
132 TRACE("found %s for %s\n", debugstr_guid(&ppd
->DeviceId
),
133 debugstr_w(ppd
->DeviceName
));
138 } else if (ppd
->DataFlow
== DIRECTSOUNDDEVICE_DATAFLOW_CAPTURE
) {
141 TRACE("DataFlow=DIRECTSOUNDDEVICE_DATAFLOW_CAPTURE\n");
142 widn
= waveInGetNumDevs();
143 for (wid
= 0; wid
< widn
; wid
++) {
146 res
= waveInGetDevCapsW(wid
, &capsW
, sizeof(capsW
));
147 if (res
== MMSYSERR_NOERROR
) {
148 if (lstrcmpW(capsW
.szPname
, ppd
->DeviceName
) == 0) {
149 ppd
->DeviceId
= DSOUND_capture_guids
[wid
];
151 TRACE("found %s for %s\n", debugstr_guid(&ppd
->DeviceId
),
152 debugstr_w(ppd
->DeviceName
));
160 *pcbReturned
= cbPropData
;
165 static HRESULT
DSPROPERTY_WaveDeviceMappingA(
170 DSPROPERTY_DIRECTSOUNDDEVICE_WAVEDEVICEMAPPING_A_DATA
*ppd
= pPropData
;
171 DSPROPERTY_DIRECTSOUNDDEVICE_WAVEDEVICEMAPPING_W_DATA data
;
175 TRACE("(pPropData=%p,cbPropData=%d,pcbReturned=%p)\n",
176 pPropData
,cbPropData
,pcbReturned
);
178 if (!ppd
|| !ppd
->DeviceName
) {
179 WARN("invalid parameter: ppd=%p\n", ppd
);
180 return DSERR_INVALIDPARAM
;
183 data
.DataFlow
= ppd
->DataFlow
;
184 len
= MultiByteToWideChar(CP_ACP
, 0, ppd
->DeviceName
, -1, NULL
, 0);
185 data
.DeviceName
= HeapAlloc(GetProcessHeap(), 0, len
* sizeof(WCHAR
));
186 if (!data
.DeviceName
)
187 return E_OUTOFMEMORY
;
188 MultiByteToWideChar(CP_ACP
, 0, ppd
->DeviceName
, -1, data
.DeviceName
, len
);
190 hr
= DSPROPERTY_WaveDeviceMappingW(&data
, cbPropData
, pcbReturned
);
191 HeapFree(GetProcessHeap(), 0, data
.DeviceName
);
192 ppd
->DeviceId
= data
.DeviceId
;
195 *pcbReturned
= cbPropData
;
200 static HRESULT
DSPROPERTY_DescriptionW(
205 PDSPROPERTY_DIRECTSOUNDDEVICE_DESCRIPTION_W_DATA ppd
= pPropData
;
208 ULONG wod
, wid
, wodn
, widn
;
211 TRACE("pPropData=%p,cbPropData=%d,pcbReturned=%p)\n",
212 pPropData
,cbPropData
,pcbReturned
);
214 TRACE("DeviceId=%s\n",debugstr_guid(&ppd
->DeviceId
));
215 if ( IsEqualGUID( &ppd
->DeviceId
, &GUID_NULL
) ) {
216 /* default device of type specified by ppd->DataFlow */
217 if (ppd
->DataFlow
== DIRECTSOUNDDEVICE_DATAFLOW_CAPTURE
) {
218 TRACE("DataFlow=DIRECTSOUNDDEVICE_DATAFLOW_CAPTURE\n");
219 ppd
->DeviceId
= DSDEVID_DefaultCapture
;
220 } else if (ppd
->DataFlow
== DIRECTSOUNDDEVICE_DATAFLOW_RENDER
) {
221 TRACE("DataFlow=DIRECTSOUNDDEVICE_DATAFLOW_RENDER\n");
222 ppd
->DeviceId
= DSDEVID_DefaultPlayback
;
224 WARN("DataFlow=Unknown(%d)\n", ppd
->DataFlow
);
225 return E_PROP_ID_UNSUPPORTED
;
229 setup_dsound_options();
231 GetDeviceID(&ppd
->DeviceId
, &dev_guid
);
233 wodn
= waveOutGetNumDevs();
234 widn
= waveInGetNumDevs();
235 wid
= wod
= dev_guid
.Data4
[7];
236 if (!memcmp(&dev_guid
, &DSOUND_renderer_guids
[0], sizeof(GUID
)-1)
239 ppd
->DataFlow
= DIRECTSOUNDDEVICE_DATAFLOW_RENDER
;
240 ppd
->WaveDeviceId
= wod
;
242 else if (!memcmp(&dev_guid
, &DSOUND_capture_guids
[0], sizeof(GUID
)-1)
245 ppd
->DataFlow
= DIRECTSOUNDDEVICE_DATAFLOW_CAPTURE
;
246 ppd
->WaveDeviceId
= wid
;
250 WARN("Device not found\n");
251 return E_PROP_ID_UNSUPPORTED
;
254 if (ppd
->DataFlow
== DIRECTSOUNDDEVICE_DATAFLOW_RENDER
)
255 err
= waveOutMessage(UlongToHandle(wod
),DRV_QUERYDSOUNDDESC
,(DWORD_PTR
)&desc
,ds_hw_accel
);
257 err
= waveInMessage(UlongToHandle(wod
),DRV_QUERYDSOUNDDESC
,(DWORD_PTR
)&desc
,ds_hw_accel
);
259 if (err
!= MMSYSERR_NOERROR
)
261 WARN("waveMessage(DRV_QUERYDSOUNDDESC) failed!\n");
262 return E_PROP_ID_UNSUPPORTED
;
266 /* FIXME: Still a memory leak.. */
268 static WCHAR wInterface
[] = { 'I','n','t','e','r','f','a','c','e',0 };
270 modlen
= MultiByteToWideChar( CP_ACP
, 0, desc
.szDrvname
, -1, NULL
, 0 );
271 desclen
= MultiByteToWideChar( CP_ACP
, 0, desc
.szDesc
, -1, NULL
, 0 );
272 ppd
->Module
= HeapAlloc(GetProcessHeap(),0,modlen
*sizeof(WCHAR
));
273 ppd
->Description
= HeapAlloc(GetProcessHeap(),0,desclen
*sizeof(WCHAR
));
274 ppd
->Interface
= wInterface
;
275 if (!ppd
->Description
|| !ppd
->Module
)
277 WARN("Out of memory\n");
278 HeapFree(GetProcessHeap(), 0, ppd
->Description
);
279 HeapFree(GetProcessHeap(), 0, ppd
->Module
);
280 ppd
->Description
= ppd
->Module
= NULL
;
281 return E_OUTOFMEMORY
;
284 MultiByteToWideChar( CP_ACP
, 0, desc
.szDrvname
, -1, ppd
->Module
, modlen
);
285 MultiByteToWideChar( CP_ACP
, 0, desc
.szDesc
, -1, ppd
->Description
, desclen
);
288 ppd
->Type
= DIRECTSOUNDDEVICE_TYPE_VXD
;
291 *pcbReturned
= sizeof(*ppd
);
292 TRACE("*pcbReturned=%d\n", *pcbReturned
);
298 static HRESULT
DSPROPERTY_EnumerateW(
303 PDSPROPERTY_DIRECTSOUNDDEVICE_ENUMERATE_W_DATA ppd
= pPropData
;
304 DSPROPERTY_DIRECTSOUNDDEVICE_DESCRIPTION_W_DATA data
;
307 TRACE("(pPropData=%p,cbPropData=%d,pcbReturned=%p)\n",
308 pPropData
,cbPropData
,pcbReturned
);
313 if (!ppd
|| !ppd
->Callback
)
315 WARN("Invalid ppd %p\n", ppd
);
316 return E_PROP_ID_UNSUPPORTED
;
319 wodn
= waveOutGetNumDevs();
320 widn
= waveInGetNumDevs();
322 data
.DeviceId
= DSOUND_renderer_guids
[0];
323 for (i
= 0; i
< wodn
; ++i
)
326 data
.DeviceId
.Data4
[7] = i
;
327 hr
= DSPROPERTY_DescriptionW(&data
, sizeof(data
), NULL
);
330 ERR("DescriptionW failed!\n");
333 ret
= ppd
->Callback(&data
, ppd
->Context
);
334 HeapFree(GetProcessHeap(), 0, data
.Module
);
335 HeapFree(GetProcessHeap(), 0, data
.Description
);
340 data
.DeviceId
= DSOUND_capture_guids
[0];
341 for (i
= 0; i
< widn
; ++i
)
344 data
.DeviceId
.Data4
[7] = i
;
345 hr
= DSPROPERTY_DescriptionW(&data
, sizeof(data
), NULL
);
348 ERR("DescriptionW failed!\n");
351 ret
= ppd
->Callback(&data
, ppd
->Context
);
352 HeapFree(GetProcessHeap(), 0, data
.Module
);
353 HeapFree(GetProcessHeap(), 0, data
.Description
);
360 static BOOL
DSPROPERTY_descWtoA(const DSPROPERTY_DIRECTSOUNDDEVICE_DESCRIPTION_W_DATA
*dataW
,
361 DSPROPERTY_DIRECTSOUNDDEVICE_DESCRIPTION_A_DATA
*dataA
)
363 DWORD modlen
, desclen
;
364 static char Interface
[] = "Interface";
366 modlen
= WideCharToMultiByte(CP_ACP
, 0, dataW
->Module
, -1, NULL
, 0, NULL
, NULL
);
367 desclen
= WideCharToMultiByte(CP_ACP
, 0, dataW
->Description
, -1, NULL
, 0, NULL
, NULL
);
368 dataA
->Type
= dataW
->Type
;
369 dataA
->DataFlow
= dataW
->DataFlow
;
370 dataA
->DeviceId
= dataW
->DeviceId
;
371 dataA
->WaveDeviceId
= dataW
->WaveDeviceId
;
372 dataA
->Interface
= Interface
;
373 dataA
->Module
= HeapAlloc(GetProcessHeap(), 0, modlen
);
374 dataA
->Description
= HeapAlloc(GetProcessHeap(), 0, desclen
);
375 if (!dataA
->Module
|| !dataA
->Description
)
377 HeapFree(GetProcessHeap(), 0, dataA
->Module
);
378 HeapFree(GetProcessHeap(), 0, dataA
->Description
);
379 dataA
->Module
= dataA
->Description
= NULL
;
383 WideCharToMultiByte(CP_ACP
, 0, dataW
->Module
, -1, dataA
->Module
, modlen
, NULL
, NULL
);
384 WideCharToMultiByte(CP_ACP
, 0, dataW
->Description
, -1, dataA
->Description
, desclen
, NULL
, NULL
);
388 static void DSPROPERTY_descWto1(const DSPROPERTY_DIRECTSOUNDDEVICE_DESCRIPTION_W_DATA
*dataW
,
389 DSPROPERTY_DIRECTSOUNDDEVICE_DESCRIPTION_1_DATA
*data1
)
391 data1
->DeviceId
= dataW
->DeviceId
;
392 lstrcpynW(data1
->ModuleW
, dataW
->Module
, sizeof(data1
->ModuleW
)/sizeof(*data1
->ModuleW
));
393 lstrcpynW(data1
->DescriptionW
, dataW
->Description
, sizeof(data1
->DescriptionW
)/sizeof(*data1
->DescriptionW
));
394 WideCharToMultiByte(CP_ACP
, 0, data1
->DescriptionW
, -1, data1
->DescriptionA
, sizeof(data1
->DescriptionA
)-1, NULL
, NULL
);
395 WideCharToMultiByte(CP_ACP
, 0, data1
->ModuleW
, -1, data1
->ModuleA
, sizeof(data1
->ModuleA
)-1, NULL
, NULL
);
396 data1
->DescriptionA
[sizeof(data1
->DescriptionA
)-1] = 0;
397 data1
->ModuleA
[sizeof(data1
->ModuleA
)-1] = 0;
398 data1
->Type
= dataW
->Type
;
399 data1
->DataFlow
= dataW
->DataFlow
;
400 data1
->WaveDeviceId
= data1
->Devnode
= dataW
->WaveDeviceId
;
403 static BOOL CALLBACK
DSPROPERTY_enumWtoA(DSPROPERTY_DIRECTSOUNDDEVICE_DESCRIPTION_W_DATA
*descW
, void *data
)
405 DSPROPERTY_DIRECTSOUNDDEVICE_DESCRIPTION_A_DATA descA
;
406 DSPROPERTY_DIRECTSOUNDDEVICE_ENUMERATE_A_DATA
*ppd
= data
;
409 ret
= DSPROPERTY_descWtoA(descW
, &descA
);
412 ret
= ppd
->Callback(&descA
, ppd
->Context
);
413 HeapFree(GetProcessHeap(), 0, descA
.Module
);
414 HeapFree(GetProcessHeap(), 0, descA
.Description
);
418 static HRESULT
DSPROPERTY_EnumerateA(
423 DSPROPERTY_DIRECTSOUNDDEVICE_ENUMERATE_A_DATA
*ppd
= pPropData
;
424 DSPROPERTY_DIRECTSOUNDDEVICE_ENUMERATE_W_DATA data
;
426 if (!ppd
|| !ppd
->Callback
)
428 WARN("Invalid ppd %p\n", ppd
);
429 return E_PROP_ID_UNSUPPORTED
;
432 data
.Callback
= DSPROPERTY_enumWtoA
;
435 return DSPROPERTY_EnumerateW(&data
, cbPropData
, pcbReturned
);
438 static BOOL CALLBACK
DSPROPERTY_enumWto1(DSPROPERTY_DIRECTSOUNDDEVICE_DESCRIPTION_W_DATA
*descW
, void *data
)
440 DSPROPERTY_DIRECTSOUNDDEVICE_DESCRIPTION_1_DATA desc1
;
441 DSPROPERTY_DIRECTSOUNDDEVICE_ENUMERATE_1_DATA
*ppd
= data
;
444 DSPROPERTY_descWto1(descW
, &desc1
);
445 ret
= ppd
->Callback(&desc1
, ppd
->Context
);
449 static HRESULT
DSPROPERTY_Enumerate1(
454 DSPROPERTY_DIRECTSOUNDDEVICE_ENUMERATE_1_DATA
*ppd
= pPropData
;
455 DSPROPERTY_DIRECTSOUNDDEVICE_ENUMERATE_W_DATA data
;
457 if (!ppd
|| !ppd
->Callback
)
459 WARN("Invalid ppd %p\n", ppd
);
460 return E_PROP_ID_UNSUPPORTED
;
463 data
.Callback
= DSPROPERTY_enumWto1
;
466 return DSPROPERTY_EnumerateW(&data
, cbPropData
, pcbReturned
);
469 static HRESULT
DSPROPERTY_DescriptionA(
474 DSPROPERTY_DIRECTSOUNDDEVICE_DESCRIPTION_W_DATA data
;
475 DSPROPERTY_DIRECTSOUNDDEVICE_DESCRIPTION_A_DATA
*ppd
= pPropData
;
479 *pcbReturned
= sizeof(*ppd
);
483 data
.DeviceId
= ppd
->DeviceId
;
484 data
.DataFlow
= ppd
->DataFlow
;
485 hr
= DSPROPERTY_DescriptionW(&data
, sizeof(data
), NULL
);
488 if (!DSPROPERTY_descWtoA(&data
, ppd
))
490 HeapFree(GetProcessHeap(), 0, data
.Module
);
491 HeapFree(GetProcessHeap(), 0, data
.Interface
);
495 static HRESULT
DSPROPERTY_Description1(
500 DSPROPERTY_DIRECTSOUNDDEVICE_DESCRIPTION_W_DATA data
;
501 DSPROPERTY_DIRECTSOUNDDEVICE_DESCRIPTION_1_DATA
*ppd
= pPropData
;
505 *pcbReturned
= sizeof(*ppd
);
509 data
.DeviceId
= ppd
->DeviceId
;
510 data
.DataFlow
= ppd
->DataFlow
;
511 hr
= DSPROPERTY_DescriptionW(&data
, sizeof(data
), NULL
);
514 DSPROPERTY_descWto1(&data
, ppd
);
515 HeapFree(GetProcessHeap(), 0, data
.Module
);
516 HeapFree(GetProcessHeap(), 0, data
.Interface
);
520 static HRESULT WINAPI
IKsPrivatePropertySetImpl_Get(
521 LPKSPROPERTYSET iface
,
524 LPVOID pInstanceData
,
525 ULONG cbInstanceData
,
530 IKsPrivatePropertySetImpl
*This
= impl_from_IKsPropertySet(iface
);
531 TRACE("(iface=%p,guidPropSet=%s,dwPropID=%d,pInstanceData=%p,cbInstanceData=%d,pPropData=%p,cbPropData=%d,pcbReturned=%p)\n",
532 This
,debugstr_guid(guidPropSet
),dwPropID
,pInstanceData
,cbInstanceData
,pPropData
,cbPropData
,pcbReturned
);
534 if ( IsEqualGUID( &DSPROPSETID_DirectSoundDevice
, guidPropSet
) ) {
536 case DSPROPERTY_DIRECTSOUNDDEVICE_WAVEDEVICEMAPPING_A
:
537 return DSPROPERTY_WaveDeviceMappingA(pPropData
,cbPropData
,pcbReturned
);
538 case DSPROPERTY_DIRECTSOUNDDEVICE_DESCRIPTION_1
:
539 return DSPROPERTY_Description1(pPropData
,cbPropData
,pcbReturned
);
540 case DSPROPERTY_DIRECTSOUNDDEVICE_ENUMERATE_1
:
541 return DSPROPERTY_Enumerate1(pPropData
,cbPropData
,pcbReturned
);
542 case DSPROPERTY_DIRECTSOUNDDEVICE_WAVEDEVICEMAPPING_W
:
543 return DSPROPERTY_WaveDeviceMappingW(pPropData
,cbPropData
,pcbReturned
);
544 case DSPROPERTY_DIRECTSOUNDDEVICE_DESCRIPTION_A
:
545 return DSPROPERTY_DescriptionA(pPropData
,cbPropData
,pcbReturned
);
546 case DSPROPERTY_DIRECTSOUNDDEVICE_DESCRIPTION_W
:
547 return DSPROPERTY_DescriptionW(pPropData
,cbPropData
,pcbReturned
);
548 case DSPROPERTY_DIRECTSOUNDDEVICE_ENUMERATE_A
:
549 return DSPROPERTY_EnumerateA(pPropData
,cbPropData
,pcbReturned
);
550 case DSPROPERTY_DIRECTSOUNDDEVICE_ENUMERATE_W
:
551 return DSPROPERTY_EnumerateW(pPropData
,cbPropData
,pcbReturned
);
553 FIXME("unsupported ID: %d\n",dwPropID
);
557 FIXME("unsupported property: %s\n",debugstr_guid(guidPropSet
));
562 FIXME("*pcbReturned=%d\n", *pcbReturned
);
565 return E_PROP_ID_UNSUPPORTED
;
568 static HRESULT WINAPI
IKsPrivatePropertySetImpl_Set(
569 LPKSPROPERTYSET iface
,
572 LPVOID pInstanceData
,
573 ULONG cbInstanceData
,
577 IKsPrivatePropertySetImpl
*This
= impl_from_IKsPropertySet(iface
);
579 FIXME("(%p,%s,%d,%p,%d,%p,%d), stub!\n",This
,debugstr_guid(guidPropSet
),dwPropID
,pInstanceData
,cbInstanceData
,pPropData
,cbPropData
);
580 return E_PROP_ID_UNSUPPORTED
;
583 static HRESULT WINAPI
IKsPrivatePropertySetImpl_QuerySupport(
584 LPKSPROPERTYSET iface
,
587 PULONG pTypeSupport
)
589 IKsPrivatePropertySetImpl
*This
= impl_from_IKsPropertySet(iface
);
590 TRACE("(%p,%s,%d,%p)\n",This
,debugstr_guid(guidPropSet
),dwPropID
,pTypeSupport
);
592 if ( IsEqualGUID( &DSPROPSETID_DirectSoundDevice
, guidPropSet
) ) {
594 case DSPROPERTY_DIRECTSOUNDDEVICE_WAVEDEVICEMAPPING_A
:
595 *pTypeSupport
= KSPROPERTY_SUPPORT_GET
;
597 case DSPROPERTY_DIRECTSOUNDDEVICE_DESCRIPTION_1
:
598 *pTypeSupport
= KSPROPERTY_SUPPORT_GET
;
600 case DSPROPERTY_DIRECTSOUNDDEVICE_ENUMERATE_1
:
601 *pTypeSupport
= KSPROPERTY_SUPPORT_GET
;
603 case DSPROPERTY_DIRECTSOUNDDEVICE_WAVEDEVICEMAPPING_W
:
604 *pTypeSupport
= KSPROPERTY_SUPPORT_GET
;
606 case DSPROPERTY_DIRECTSOUNDDEVICE_DESCRIPTION_A
:
607 *pTypeSupport
= KSPROPERTY_SUPPORT_GET
;
609 case DSPROPERTY_DIRECTSOUNDDEVICE_DESCRIPTION_W
:
610 *pTypeSupport
= KSPROPERTY_SUPPORT_GET
;
612 case DSPROPERTY_DIRECTSOUNDDEVICE_ENUMERATE_A
:
613 *pTypeSupport
= KSPROPERTY_SUPPORT_GET
;
615 case DSPROPERTY_DIRECTSOUNDDEVICE_ENUMERATE_W
:
616 *pTypeSupport
= KSPROPERTY_SUPPORT_GET
;
619 FIXME("unsupported ID: %d\n",dwPropID
);
623 FIXME("unsupported property: %s\n",debugstr_guid(guidPropSet
));
626 return E_PROP_ID_UNSUPPORTED
;
629 static const IKsPropertySetVtbl ikspvt
= {
630 IKsPrivatePropertySetImpl_QueryInterface
,
631 IKsPrivatePropertySetImpl_AddRef
,
632 IKsPrivatePropertySetImpl_Release
,
633 IKsPrivatePropertySetImpl_Get
,
634 IKsPrivatePropertySetImpl_Set
,
635 IKsPrivatePropertySetImpl_QuerySupport
638 HRESULT
IKsPrivatePropertySetImpl_Create(
640 IKsPropertySet
**piks
)
642 IKsPrivatePropertySetImpl
*iks
;
643 TRACE("(%s, %p)\n", debugstr_guid(riid
), piks
);
645 if (!IsEqualIID(riid
, &IID_IUnknown
) &&
646 !IsEqualIID(riid
, &IID_IKsPropertySet
)) {
648 return E_NOINTERFACE
;
651 iks
= HeapAlloc(GetProcessHeap(),0,sizeof(*iks
));
653 iks
->IKsPropertySet_iface
.lpVtbl
= &ikspvt
;
655 *piks
= &iks
->IKsPropertySet_iface
;