vbscript/tests: Fix first-day-of-week test on mixed locales.
[wine.git] / dlls / dsound / propset.c
blob9ef4ac9fbcf4dc73a96a0b9dc2832a555119d22e
1 /* DirectSound
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
22 #include <stdarg.h>
24 #define COBJMACROS
25 #define NONAMELESSUNION
27 #include "windef.h"
28 #include "winbase.h"
29 #include "winuser.h"
30 #include "mmsystem.h"
31 #include "winternl.h"
32 #include "winnls.h"
33 #include "vfwmsgs.h"
34 #include "mmddk.h"
35 #include "wine/debug.h"
36 #include "dsound.h"
37 #include "dsound_private.h"
38 #include "dsconf.h"
40 #include "ksmedia.h"
41 #include "propkey.h"
42 #include "devpkey.h"
44 WINE_DEFAULT_DEBUG_CHANNEL(dsound);
46 static WCHAR wInterface[] = { 'I','n','t','e','r','f','a','c','e',0 };
48 typedef struct IKsPrivatePropertySetImpl
50 IKsPropertySet IKsPropertySet_iface;
51 LONG ref;
52 } IKsPrivatePropertySetImpl;
54 static IKsPrivatePropertySetImpl *impl_from_IKsPropertySet(IKsPropertySet *iface)
56 return CONTAINING_RECORD(iface, IKsPrivatePropertySetImpl, IKsPropertySet_iface);
59 /*******************************************************************************
60 * IKsPrivatePropertySet
63 /* IUnknown methods */
64 static HRESULT WINAPI IKsPrivatePropertySetImpl_QueryInterface(
65 IKsPropertySet *iface, REFIID riid, void **ppobj)
67 IKsPrivatePropertySetImpl *This = impl_from_IKsPropertySet(iface);
68 TRACE("(%p,%s,%p)\n",This,debugstr_guid(riid),ppobj);
70 if (IsEqualIID(riid, &IID_IUnknown) ||
71 IsEqualIID(riid, &IID_IKsPropertySet)) {
72 *ppobj = iface;
73 IKsPropertySet_AddRef(iface);
74 return S_OK;
76 *ppobj = NULL;
77 return E_NOINTERFACE;
80 static ULONG WINAPI IKsPrivatePropertySetImpl_AddRef(LPKSPROPERTYSET iface)
82 IKsPrivatePropertySetImpl *This = impl_from_IKsPropertySet(iface);
83 ULONG ref = InterlockedIncrement(&(This->ref));
84 TRACE("(%p) ref was %d\n", This, ref - 1);
85 return ref;
88 static ULONG WINAPI IKsPrivatePropertySetImpl_Release(LPKSPROPERTYSET iface)
90 IKsPrivatePropertySetImpl *This = impl_from_IKsPropertySet(iface);
91 ULONG ref = InterlockedDecrement(&(This->ref));
92 TRACE("(%p) ref was %d\n", This, ref + 1);
94 if (!ref) {
95 HeapFree(GetProcessHeap(), 0, This);
96 TRACE("(%p) released\n", This);
98 return ref;
101 struct search_data {
102 const WCHAR *tgt_name;
103 GUID *found_guid;
106 static BOOL CALLBACK search_callback(GUID *guid, const WCHAR *desc,
107 const WCHAR *module, void *user)
109 struct search_data *search = user;
111 if(!lstrcmpW(desc, search->tgt_name)){
112 *search->found_guid = *guid;
113 return FALSE;
116 return TRUE;
119 static HRESULT DSPROPERTY_WaveDeviceMappingW(
120 LPVOID pPropData,
121 ULONG cbPropData,
122 PULONG pcbReturned )
124 HRESULT hr;
125 PDSPROPERTY_DIRECTSOUNDDEVICE_WAVEDEVICEMAPPING_W_DATA ppd = pPropData;
126 struct search_data search;
128 TRACE("(pPropData=%p,cbPropData=%d,pcbReturned=%p)\n",
129 pPropData,cbPropData,pcbReturned);
131 if (!ppd) {
132 WARN("invalid parameter: pPropData\n");
133 return DSERR_INVALIDPARAM;
136 search.tgt_name = ppd->DeviceName;
137 search.found_guid = &ppd->DeviceId;
139 if (ppd->DataFlow == DIRECTSOUNDDEVICE_DATAFLOW_RENDER)
140 hr = enumerate_mmdevices(eRender, DSOUND_renderer_guids,
141 search_callback, &search);
142 else if (ppd->DataFlow == DIRECTSOUNDDEVICE_DATAFLOW_CAPTURE)
143 hr = enumerate_mmdevices(eCapture, DSOUND_capture_guids,
144 search_callback, &search);
145 else
146 return DSERR_INVALIDPARAM;
148 if(hr != S_FALSE)
149 /* device was not found */
150 return DSERR_INVALIDPARAM;
152 if (pcbReturned)
153 *pcbReturned = cbPropData;
155 return DS_OK;
158 static HRESULT DSPROPERTY_WaveDeviceMappingA(
159 LPVOID pPropData,
160 ULONG cbPropData,
161 PULONG pcbReturned )
163 DSPROPERTY_DIRECTSOUNDDEVICE_WAVEDEVICEMAPPING_A_DATA *ppd = pPropData;
164 DSPROPERTY_DIRECTSOUNDDEVICE_WAVEDEVICEMAPPING_W_DATA data;
165 DWORD len;
166 HRESULT hr;
168 TRACE("(pPropData=%p,cbPropData=%d,pcbReturned=%p)\n",
169 pPropData,cbPropData,pcbReturned);
171 if (!ppd || !ppd->DeviceName) {
172 WARN("invalid parameter: ppd=%p\n", ppd);
173 return DSERR_INVALIDPARAM;
176 data.DataFlow = ppd->DataFlow;
177 len = MultiByteToWideChar(CP_ACP, 0, ppd->DeviceName, -1, NULL, 0);
178 data.DeviceName = HeapAlloc(GetProcessHeap(), 0, len * sizeof(WCHAR));
179 if (!data.DeviceName)
180 return E_OUTOFMEMORY;
181 MultiByteToWideChar(CP_ACP, 0, ppd->DeviceName, -1, data.DeviceName, len);
183 hr = DSPROPERTY_WaveDeviceMappingW(&data, cbPropData, pcbReturned);
184 HeapFree(GetProcessHeap(), 0, data.DeviceName);
185 ppd->DeviceId = data.DeviceId;
187 if (pcbReturned)
188 *pcbReturned = cbPropData;
190 return hr;
193 static HRESULT DSPROPERTY_DescriptionW(
194 LPVOID pPropData,
195 ULONG cbPropData,
196 PULONG pcbReturned )
198 PDSPROPERTY_DIRECTSOUNDDEVICE_DESCRIPTION_W_DATA ppd = pPropData;
199 GUID dev_guid;
200 IMMDevice *mmdevice;
201 IPropertyStore *ps;
202 PROPVARIANT pv;
203 HRESULT hr;
205 TRACE("pPropData=%p,cbPropData=%d,pcbReturned=%p)\n",
206 pPropData,cbPropData,pcbReturned);
208 TRACE("DeviceId=%s\n",debugstr_guid(&ppd->DeviceId));
209 if ( IsEqualGUID( &ppd->DeviceId , &GUID_NULL) ) {
210 /* default device of type specified by ppd->DataFlow */
211 if (ppd->DataFlow == DIRECTSOUNDDEVICE_DATAFLOW_CAPTURE) {
212 TRACE("DataFlow=DIRECTSOUNDDEVICE_DATAFLOW_CAPTURE\n");
213 ppd->DeviceId = DSDEVID_DefaultCapture;
214 } else if (ppd->DataFlow == DIRECTSOUNDDEVICE_DATAFLOW_RENDER) {
215 TRACE("DataFlow=DIRECTSOUNDDEVICE_DATAFLOW_RENDER\n");
216 ppd->DeviceId = DSDEVID_DefaultPlayback;
217 } else {
218 WARN("DataFlow=Unknown(%d)\n", ppd->DataFlow);
219 return E_PROP_ID_UNSUPPORTED;
223 setup_dsound_options();
225 GetDeviceID(&ppd->DeviceId, &dev_guid);
227 hr = get_mmdevice(eRender, &dev_guid, &mmdevice);
228 if(FAILED(hr)){
229 hr = get_mmdevice(eCapture, &dev_guid, &mmdevice);
230 if(FAILED(hr))
231 return hr;
234 hr = IMMDevice_OpenPropertyStore(mmdevice, STGM_READ, &ps);
235 if(FAILED(hr)){
236 IMMDevice_Release(mmdevice);
237 WARN("OpenPropertyStore failed: %08x\n", hr);
238 return hr;
241 hr = IPropertyStore_GetValue(ps,
242 (const PROPERTYKEY *)&DEVPKEY_Device_FriendlyName, &pv);
243 if(FAILED(hr)){
244 IPropertyStore_Release(ps);
245 IMMDevice_Release(mmdevice);
246 WARN("GetValue(FriendlyName) failed: %08x\n", hr);
247 return hr;
250 ppd->Description = strdupW(pv.u.pwszVal);
251 ppd->Module = strdupW(wine_vxd_drv);
252 ppd->Interface = strdupW(wInterface);
253 ppd->Type = DIRECTSOUNDDEVICE_TYPE_VXD;
255 PropVariantClear(&pv);
256 IPropertyStore_Release(ps);
257 IMMDevice_Release(mmdevice);
259 if (pcbReturned) {
260 *pcbReturned = sizeof(*ppd);
261 TRACE("*pcbReturned=%d\n", *pcbReturned);
264 return S_OK;
267 static
268 BOOL CALLBACK enum_callback(GUID *guid, const WCHAR *desc, const WCHAR *module,
269 void *user)
271 PDSPROPERTY_DIRECTSOUNDDEVICE_ENUMERATE_W_DATA ppd = user;
272 DSPROPERTY_DIRECTSOUNDDEVICE_DESCRIPTION_W_DATA data;
273 DWORD len;
274 BOOL ret;
276 TRACE("%s %s %s %p\n", wine_dbgstr_guid(guid), wine_dbgstr_w(desc),
277 wine_dbgstr_w(module), user);
279 if(!guid)
280 return TRUE;
282 data.DeviceId = *guid;
284 len = lstrlenW(module) + 1;
285 data.Module = HeapAlloc(GetProcessHeap(), 0, len * sizeof(WCHAR));
286 memcpy(data.Module, module, len * sizeof(WCHAR));
288 len = lstrlenW(desc) + 1;
289 data.Description = HeapAlloc(GetProcessHeap(), 0, len * sizeof(WCHAR));
290 memcpy(data.Description, desc, len * sizeof(WCHAR));
292 data.Interface = wInterface;
294 ret = ppd->Callback(&data, ppd->Context);
296 HeapFree(GetProcessHeap(), 0, data.Module);
297 HeapFree(GetProcessHeap(), 0, data.Description);
299 return ret;
302 static HRESULT DSPROPERTY_EnumerateW(
303 LPVOID pPropData,
304 ULONG cbPropData,
305 PULONG pcbReturned )
307 PDSPROPERTY_DIRECTSOUNDDEVICE_ENUMERATE_W_DATA ppd = pPropData;
308 HRESULT hr;
310 TRACE("(pPropData=%p,cbPropData=%d,pcbReturned=%p)\n",
311 pPropData,cbPropData,pcbReturned);
313 if (pcbReturned)
314 *pcbReturned = 0;
316 if (!ppd || !ppd->Callback)
318 WARN("Invalid ppd %p\n", ppd);
319 return E_PROP_ID_UNSUPPORTED;
322 hr = enumerate_mmdevices(eRender, DSOUND_renderer_guids,
323 enum_callback, ppd);
325 if(hr == S_OK)
326 hr = enumerate_mmdevices(eCapture, DSOUND_capture_guids,
327 enum_callback, ppd);
329 return SUCCEEDED(hr) ? DS_OK : hr;
332 static BOOL DSPROPERTY_descWtoA(const DSPROPERTY_DIRECTSOUNDDEVICE_DESCRIPTION_W_DATA *dataW,
333 DSPROPERTY_DIRECTSOUNDDEVICE_DESCRIPTION_A_DATA *dataA)
335 DWORD modlen, desclen;
336 static char Interface[] = "Interface";
338 modlen = WideCharToMultiByte(CP_ACP, 0, dataW->Module, -1, NULL, 0, NULL, NULL);
339 desclen = WideCharToMultiByte(CP_ACP, 0, dataW->Description, -1, NULL, 0, NULL, NULL);
340 dataA->Type = dataW->Type;
341 dataA->DataFlow = dataW->DataFlow;
342 dataA->DeviceId = dataW->DeviceId;
343 dataA->WaveDeviceId = dataW->WaveDeviceId;
344 dataA->Interface = Interface;
345 dataA->Module = HeapAlloc(GetProcessHeap(), 0, modlen);
346 dataA->Description = HeapAlloc(GetProcessHeap(), 0, desclen);
347 if (!dataA->Module || !dataA->Description)
349 HeapFree(GetProcessHeap(), 0, dataA->Module);
350 HeapFree(GetProcessHeap(), 0, dataA->Description);
351 dataA->Module = dataA->Description = NULL;
352 return FALSE;
355 WideCharToMultiByte(CP_ACP, 0, dataW->Module, -1, dataA->Module, modlen, NULL, NULL);
356 WideCharToMultiByte(CP_ACP, 0, dataW->Description, -1, dataA->Description, desclen, NULL, NULL);
357 return TRUE;
360 static void DSPROPERTY_descWto1(const DSPROPERTY_DIRECTSOUNDDEVICE_DESCRIPTION_W_DATA *dataW,
361 DSPROPERTY_DIRECTSOUNDDEVICE_DESCRIPTION_1_DATA *data1)
363 data1->DeviceId = dataW->DeviceId;
364 lstrcpynW(data1->ModuleW, dataW->Module, sizeof(data1->ModuleW)/sizeof(*data1->ModuleW));
365 lstrcpynW(data1->DescriptionW, dataW->Description, sizeof(data1->DescriptionW)/sizeof(*data1->DescriptionW));
366 WideCharToMultiByte(CP_ACP, 0, data1->DescriptionW, -1, data1->DescriptionA, sizeof(data1->DescriptionA)-1, NULL, NULL);
367 WideCharToMultiByte(CP_ACP, 0, data1->ModuleW, -1, data1->ModuleA, sizeof(data1->ModuleA)-1, NULL, NULL);
368 data1->DescriptionA[sizeof(data1->DescriptionA)-1] = 0;
369 data1->ModuleA[sizeof(data1->ModuleA)-1] = 0;
370 data1->Type = dataW->Type;
371 data1->DataFlow = dataW->DataFlow;
372 data1->WaveDeviceId = data1->Devnode = dataW->WaveDeviceId;
375 static BOOL CALLBACK DSPROPERTY_enumWtoA(DSPROPERTY_DIRECTSOUNDDEVICE_DESCRIPTION_W_DATA *descW, void *data)
377 DSPROPERTY_DIRECTSOUNDDEVICE_DESCRIPTION_A_DATA descA;
378 DSPROPERTY_DIRECTSOUNDDEVICE_ENUMERATE_A_DATA *ppd = data;
379 BOOL ret;
381 ret = DSPROPERTY_descWtoA(descW, &descA);
382 if (!ret)
383 return FALSE;
384 ret = ppd->Callback(&descA, ppd->Context);
385 HeapFree(GetProcessHeap(), 0, descA.Module);
386 HeapFree(GetProcessHeap(), 0, descA.Description);
387 return ret;
390 static HRESULT DSPROPERTY_EnumerateA(
391 LPVOID pPropData,
392 ULONG cbPropData,
393 PULONG pcbReturned)
395 DSPROPERTY_DIRECTSOUNDDEVICE_ENUMERATE_A_DATA *ppd = pPropData;
396 DSPROPERTY_DIRECTSOUNDDEVICE_ENUMERATE_W_DATA data;
398 if (!ppd || !ppd->Callback)
400 WARN("Invalid ppd %p\n", ppd);
401 return E_PROP_ID_UNSUPPORTED;
404 data.Callback = DSPROPERTY_enumWtoA;
405 data.Context = ppd;
407 return DSPROPERTY_EnumerateW(&data, cbPropData, pcbReturned);
410 static BOOL CALLBACK DSPROPERTY_enumWto1(DSPROPERTY_DIRECTSOUNDDEVICE_DESCRIPTION_W_DATA *descW, void *data)
412 DSPROPERTY_DIRECTSOUNDDEVICE_DESCRIPTION_1_DATA desc1;
413 DSPROPERTY_DIRECTSOUNDDEVICE_ENUMERATE_1_DATA *ppd = data;
414 BOOL ret;
416 DSPROPERTY_descWto1(descW, &desc1);
417 ret = ppd->Callback(&desc1, ppd->Context);
418 return ret;
421 static HRESULT DSPROPERTY_Enumerate1(
422 LPVOID pPropData,
423 ULONG cbPropData,
424 PULONG pcbReturned)
426 DSPROPERTY_DIRECTSOUNDDEVICE_ENUMERATE_1_DATA *ppd = pPropData;
427 DSPROPERTY_DIRECTSOUNDDEVICE_ENUMERATE_W_DATA data;
429 if (!ppd || !ppd->Callback)
431 WARN("Invalid ppd %p\n", ppd);
432 return E_PROP_ID_UNSUPPORTED;
435 data.Callback = DSPROPERTY_enumWto1;
436 data.Context = ppd;
438 return DSPROPERTY_EnumerateW(&data, cbPropData, pcbReturned);
441 static HRESULT DSPROPERTY_DescriptionA(
442 LPVOID pPropData,
443 ULONG cbPropData,
444 PULONG pcbReturned)
446 DSPROPERTY_DIRECTSOUNDDEVICE_DESCRIPTION_W_DATA data;
447 DSPROPERTY_DIRECTSOUNDDEVICE_DESCRIPTION_A_DATA *ppd = pPropData;
448 HRESULT hr;
450 if (pcbReturned)
451 *pcbReturned = sizeof(*ppd);
452 if (!pPropData)
453 return S_OK;
455 data.DeviceId = ppd->DeviceId;
456 data.DataFlow = ppd->DataFlow;
457 hr = DSPROPERTY_DescriptionW(&data, sizeof(data), NULL);
458 if (FAILED(hr))
459 return hr;
460 if (!DSPROPERTY_descWtoA(&data, ppd))
461 hr = E_OUTOFMEMORY;
462 HeapFree(GetProcessHeap(), 0, data.Description);
463 HeapFree(GetProcessHeap(), 0, data.Module);
464 HeapFree(GetProcessHeap(), 0, data.Interface);
465 return hr;
468 static HRESULT DSPROPERTY_Description1(
469 LPVOID pPropData,
470 ULONG cbPropData,
471 PULONG pcbReturned)
473 DSPROPERTY_DIRECTSOUNDDEVICE_DESCRIPTION_W_DATA data;
474 DSPROPERTY_DIRECTSOUNDDEVICE_DESCRIPTION_1_DATA *ppd = pPropData;
475 HRESULT hr;
477 if (pcbReturned)
478 *pcbReturned = sizeof(*ppd);
479 if (!pPropData)
480 return S_OK;
482 data.DeviceId = ppd->DeviceId;
483 data.DataFlow = ppd->DataFlow;
484 hr = DSPROPERTY_DescriptionW(&data, sizeof(data), NULL);
485 if (FAILED(hr))
486 return hr;
487 DSPROPERTY_descWto1(&data, ppd);
488 HeapFree(GetProcessHeap(), 0, data.Description);
489 HeapFree(GetProcessHeap(), 0, data.Module);
490 HeapFree(GetProcessHeap(), 0, data.Interface);
491 return hr;
494 static HRESULT WINAPI IKsPrivatePropertySetImpl_Get(
495 LPKSPROPERTYSET iface,
496 REFGUID guidPropSet,
497 ULONG dwPropID,
498 LPVOID pInstanceData,
499 ULONG cbInstanceData,
500 LPVOID pPropData,
501 ULONG cbPropData,
502 PULONG pcbReturned )
504 IKsPrivatePropertySetImpl *This = impl_from_IKsPropertySet(iface);
505 TRACE("(iface=%p,guidPropSet=%s,dwPropID=%d,pInstanceData=%p,cbInstanceData=%d,pPropData=%p,cbPropData=%d,pcbReturned=%p)\n",
506 This,debugstr_guid(guidPropSet),dwPropID,pInstanceData,cbInstanceData,pPropData,cbPropData,pcbReturned);
508 if ( IsEqualGUID( &DSPROPSETID_DirectSoundDevice, guidPropSet) ) {
509 switch (dwPropID) {
510 case DSPROPERTY_DIRECTSOUNDDEVICE_WAVEDEVICEMAPPING_A:
511 return DSPROPERTY_WaveDeviceMappingA(pPropData,cbPropData,pcbReturned);
512 case DSPROPERTY_DIRECTSOUNDDEVICE_DESCRIPTION_1:
513 return DSPROPERTY_Description1(pPropData,cbPropData,pcbReturned);
514 case DSPROPERTY_DIRECTSOUNDDEVICE_ENUMERATE_1:
515 return DSPROPERTY_Enumerate1(pPropData,cbPropData,pcbReturned);
516 case DSPROPERTY_DIRECTSOUNDDEVICE_WAVEDEVICEMAPPING_W:
517 return DSPROPERTY_WaveDeviceMappingW(pPropData,cbPropData,pcbReturned);
518 case DSPROPERTY_DIRECTSOUNDDEVICE_DESCRIPTION_A:
519 return DSPROPERTY_DescriptionA(pPropData,cbPropData,pcbReturned);
520 case DSPROPERTY_DIRECTSOUNDDEVICE_DESCRIPTION_W:
521 return DSPROPERTY_DescriptionW(pPropData,cbPropData,pcbReturned);
522 case DSPROPERTY_DIRECTSOUNDDEVICE_ENUMERATE_A:
523 return DSPROPERTY_EnumerateA(pPropData,cbPropData,pcbReturned);
524 case DSPROPERTY_DIRECTSOUNDDEVICE_ENUMERATE_W:
525 return DSPROPERTY_EnumerateW(pPropData,cbPropData,pcbReturned);
526 default:
527 FIXME("unsupported ID: %d\n",dwPropID);
528 break;
530 } else {
531 FIXME("unsupported property: %s\n",debugstr_guid(guidPropSet));
534 if (pcbReturned) {
535 *pcbReturned = 0;
536 FIXME("*pcbReturned=%d\n", *pcbReturned);
539 return E_PROP_ID_UNSUPPORTED;
542 static HRESULT WINAPI IKsPrivatePropertySetImpl_Set(
543 LPKSPROPERTYSET iface,
544 REFGUID guidPropSet,
545 ULONG dwPropID,
546 LPVOID pInstanceData,
547 ULONG cbInstanceData,
548 LPVOID pPropData,
549 ULONG cbPropData )
551 IKsPrivatePropertySetImpl *This = impl_from_IKsPropertySet(iface);
553 FIXME("(%p,%s,%d,%p,%d,%p,%d), stub!\n",This,debugstr_guid(guidPropSet),dwPropID,pInstanceData,cbInstanceData,pPropData,cbPropData);
554 return E_PROP_ID_UNSUPPORTED;
557 static HRESULT WINAPI IKsPrivatePropertySetImpl_QuerySupport(
558 LPKSPROPERTYSET iface,
559 REFGUID guidPropSet,
560 ULONG dwPropID,
561 PULONG pTypeSupport )
563 IKsPrivatePropertySetImpl *This = impl_from_IKsPropertySet(iface);
564 TRACE("(%p,%s,%d,%p)\n",This,debugstr_guid(guidPropSet),dwPropID,pTypeSupport);
566 if ( IsEqualGUID( &DSPROPSETID_DirectSoundDevice, guidPropSet) ) {
567 switch (dwPropID) {
568 case DSPROPERTY_DIRECTSOUNDDEVICE_WAVEDEVICEMAPPING_A:
569 *pTypeSupport = KSPROPERTY_SUPPORT_GET;
570 return S_OK;
571 case DSPROPERTY_DIRECTSOUNDDEVICE_DESCRIPTION_1:
572 *pTypeSupport = KSPROPERTY_SUPPORT_GET;
573 return S_OK;
574 case DSPROPERTY_DIRECTSOUNDDEVICE_ENUMERATE_1:
575 *pTypeSupport = KSPROPERTY_SUPPORT_GET;
576 return S_OK;
577 case DSPROPERTY_DIRECTSOUNDDEVICE_WAVEDEVICEMAPPING_W:
578 *pTypeSupport = KSPROPERTY_SUPPORT_GET;
579 return S_OK;
580 case DSPROPERTY_DIRECTSOUNDDEVICE_DESCRIPTION_A:
581 *pTypeSupport = KSPROPERTY_SUPPORT_GET;
582 return S_OK;
583 case DSPROPERTY_DIRECTSOUNDDEVICE_DESCRIPTION_W:
584 *pTypeSupport = KSPROPERTY_SUPPORT_GET;
585 return S_OK;
586 case DSPROPERTY_DIRECTSOUNDDEVICE_ENUMERATE_A:
587 *pTypeSupport = KSPROPERTY_SUPPORT_GET;
588 return S_OK;
589 case DSPROPERTY_DIRECTSOUNDDEVICE_ENUMERATE_W:
590 *pTypeSupport = KSPROPERTY_SUPPORT_GET;
591 return S_OK;
592 default:
593 FIXME("unsupported ID: %d\n",dwPropID);
594 break;
596 } else {
597 FIXME("unsupported property: %s\n",debugstr_guid(guidPropSet));
600 return E_PROP_ID_UNSUPPORTED;
603 static const IKsPropertySetVtbl ikspvt = {
604 IKsPrivatePropertySetImpl_QueryInterface,
605 IKsPrivatePropertySetImpl_AddRef,
606 IKsPrivatePropertySetImpl_Release,
607 IKsPrivatePropertySetImpl_Get,
608 IKsPrivatePropertySetImpl_Set,
609 IKsPrivatePropertySetImpl_QuerySupport
612 HRESULT IKsPrivatePropertySetImpl_Create(REFIID riid, void **ppv)
614 IKsPrivatePropertySetImpl *iks;
615 HRESULT hr;
617 TRACE("(%s, %p)\n", debugstr_guid(riid), ppv);
619 iks = HeapAlloc(GetProcessHeap(), 0, sizeof(*iks));
620 if (!iks) {
621 WARN("out of memory\n");
622 return DSERR_OUTOFMEMORY;
625 iks->ref = 1;
626 iks->IKsPropertySet_iface.lpVtbl = &ikspvt;
628 hr = IKsPropertySet_QueryInterface(&iks->IKsPropertySet_iface, riid, ppv);
629 IKsPropertySet_Release(&iks->IKsPropertySet_iface);
631 return hr;