CUPS uses the ppd file to store the default paper size, so we'll read
[wine] / dlls / dsound / propset.c
1 /*                      DirectSound
2  *
3  * Copyright 1998 Marcus Meissner
4  * Copyright 1998 Rob Riggs
5  * Copyright 2000-2002 TransGaming Technologies, Inc.
6  *
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.
11  *
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.
16  *
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., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
20  */
21
22 #include "config.h"
23 #include <assert.h>
24 #include <stdio.h>
25 #include <sys/types.h>
26 #include <sys/fcntl.h>
27 #ifdef HAVE_UNISTD_H
28 # include <unistd.h>
29 #endif
30 #include <stdlib.h>
31 #include <string.h>
32 #include <math.h>       /* Insomnia - pow() function */
33
34 #include "windef.h"
35 #include "winbase.h"
36 #include "wingdi.h"
37 #include "winuser.h"
38 #include "winerror.h"
39 #include "mmsystem.h"
40 #include "winternl.h"
41 #include "winnls.h"
42 #include "mmddk.h"
43 #include "wine/windef16.h"
44 #include "wine/debug.h"
45 #include "dsound.h"
46 #include "dsdriver.h"
47 #include "dsound_private.h"
48 #include "dsconf.h"
49
50 WINE_DEFAULT_DEBUG_CHANNEL(dsound);
51
52
53 /*******************************************************************************
54  *              IKsPropertySet
55  */
56
57 /* IUnknown methods */
58 static HRESULT WINAPI IKsPropertySetImpl_QueryInterface(
59         LPKSPROPERTYSET iface, REFIID riid, LPVOID *ppobj
60 ) {
61         ICOM_THIS(IKsPropertySetImpl,iface);
62
63         TRACE("(%p,%s,%p)\n",This,debugstr_guid(riid),ppobj);
64         return IDirectSoundBuffer_QueryInterface((LPDIRECTSOUNDBUFFER8)This->dsb, riid, ppobj);
65 }
66
67 static ULONG WINAPI IKsPropertySetImpl_AddRef(LPKSPROPERTYSET iface) {
68         ICOM_THIS(IKsPropertySetImpl,iface);
69         ULONG ulReturn;
70
71         ulReturn = InterlockedIncrement(&This->ref);
72         if (ulReturn == 1)
73                 IDirectSoundBuffer_AddRef((LPDIRECTSOUND3DBUFFER)This->dsb);
74         return ulReturn;
75 }
76
77 static ULONG WINAPI IKsPropertySetImpl_Release(LPKSPROPERTYSET iface) {
78         ICOM_THIS(IKsPropertySetImpl,iface);
79         ULONG ulReturn;
80
81         ulReturn = InterlockedDecrement(&This->ref);
82         if (ulReturn)
83                 return ulReturn;
84         IDirectSoundBuffer_Release((LPDIRECTSOUND3DBUFFER)This->dsb);
85         return 0;
86 }
87
88 static HRESULT WINAPI DSPROPERTY_WaveDeviceMappingA(
89     REFGUID guidPropSet,
90     LPVOID pPropData, 
91     ULONG cbPropData,
92     PULONG pcbReturned )
93 {
94     PDSPROPERTY_DIRECTSOUNDDEVICE_WAVEDEVICEMAPPING_A_DATA ppd;
95     FIXME("(guidPropSet=%s,pPropData=%p,cbPropData=%ld,pcbReturned=%p) not implemented!\n",
96         debugstr_guid(guidPropSet),pPropData,cbPropData,pcbReturned);
97
98     ppd = (PDSPROPERTY_DIRECTSOUNDDEVICE_WAVEDEVICEMAPPING_A_DATA) pPropData;
99
100     if (!ppd) {
101         WARN("invalid parameter: pPropData\n");
102         return DSERR_INVALIDPARAM;
103     }
104
105     FIXME("DeviceName=%s\n",ppd->DeviceName);
106     FIXME("DataFlow=%s\n",
107         ppd->DataFlow == DIRECTSOUNDDEVICE_DATAFLOW_RENDER ? "DIRECTSOUNDDEVICE_DATAFLOW_RENDER" :
108         ppd->DataFlow == DIRECTSOUNDDEVICE_DATAFLOW_CAPTURE ? "DIRECTSOUNDDEVICE_DATAFLOW_CAPTURE" : "UNKNOWN");
109
110     /* FIXME: match the name to a wave device somehow. */
111     ppd->DeviceId = GUID_NULL;
112
113     if (pcbReturned) {
114         *pcbReturned = cbPropData; 
115         FIXME("*pcbReturned=%ld\n", *pcbReturned);
116     }
117
118     return S_OK;
119 }
120
121 static HRESULT WINAPI DSPROPERTY_WaveDeviceMappingW(
122     REFGUID guidPropSet,
123     LPVOID pPropData, 
124     ULONG cbPropData,
125     PULONG pcbReturned )
126 {
127     PDSPROPERTY_DIRECTSOUNDDEVICE_WAVEDEVICEMAPPING_W_DATA ppd;
128     FIXME("(guidPropSet=%s,pPropData=%p,cbPropData=%ld,pcbReturned=%p) not implemented!\n",
129         debugstr_guid(guidPropSet),pPropData,cbPropData,pcbReturned);
130
131     ppd = (PDSPROPERTY_DIRECTSOUNDDEVICE_WAVEDEVICEMAPPING_W_DATA) pPropData;
132
133     if (!ppd) {
134         WARN("invalid parameter: pPropData\n");
135         return DSERR_INVALIDPARAM;
136     }
137
138     FIXME("DeviceName=%s\n",debugstr_w(ppd->DeviceName));
139     FIXME("DataFlow=%s\n",
140         ppd->DataFlow == DIRECTSOUNDDEVICE_DATAFLOW_RENDER ? "DIRECTSOUNDDEVICE_DATAFLOW_RENDER" :
141         ppd->DataFlow == DIRECTSOUNDDEVICE_DATAFLOW_CAPTURE ? "DIRECTSOUNDDEVICE_DATAFLOW_CAPTURE" : "UNKNOWN");
142
143     /* FIXME: match the name to a wave device somehow. */
144     ppd->DeviceId = GUID_NULL;
145
146     if (pcbReturned) {
147         *pcbReturned = cbPropData; 
148         FIXME("*pcbReturned=%ld\n", *pcbReturned);
149     }
150
151     return S_OK;
152 }
153
154 static HRESULT WINAPI DSPROPERTY_Description1(
155     REFGUID guidPropSet,
156     LPVOID pPropData,
157     ULONG cbPropData,
158     PULONG pcbReturned )
159 {
160     HRESULT err;
161     GUID guid, dev_guid;
162     PDSPROPERTY_DIRECTSOUNDDEVICE_DESCRIPTION_1_DATA ppd;
163     TRACE("(guidPropSet=%s,pPropData=%p,cbPropData=%ld,pcbReturned=%p)\n",
164         debugstr_guid(guidPropSet),pPropData,cbPropData,pcbReturned);
165
166     ppd = (PDSPROPERTY_DIRECTSOUNDDEVICE_DESCRIPTION_1_DATA) pPropData;
167
168     if (!ppd) {
169         WARN("invalid parameter: pPropData\n");
170         return DSERR_INVALIDPARAM;
171     }
172
173     TRACE("DeviceId=%s\n",debugstr_guid(&ppd->DeviceId));
174     if ( IsEqualGUID( &ppd->DeviceId , &GUID_NULL) ) {
175         /* default device of type specified by ppd->DataFlow */
176         if (ppd->DataFlow == DIRECTSOUNDDEVICE_DATAFLOW_CAPTURE) {
177             TRACE("DataFlow=DIRECTSOUNDDEVICE_DATAFLOW_CAPTURE\n");
178         } else if (ppd->DataFlow == DIRECTSOUNDDEVICE_DATAFLOW_RENDER) {
179             TRACE("DataFlow=DIRECTSOUNDDEVICE_DATAFLOW_RENDER\n");
180         } else {
181             TRACE("DataFlow=Unknown(%d)\n", ppd->DataFlow);
182         }
183         FIXME("(guidPropSet=%s,pPropData=%p,cbPropData=%ld,pcbReturned=%p) GUID_NULL not implemented!\n",
184             debugstr_guid(guidPropSet),pPropData,cbPropData,pcbReturned);
185         return E_PROP_ID_UNSUPPORTED;
186     } else {
187         GetDeviceID(&ppd->DeviceId, &dev_guid);
188
189         if ( IsEqualGUID( &ppd->DeviceId , &DSDEVID_DefaultPlayback) || 
190              IsEqualGUID( &ppd->DeviceId , &DSDEVID_DefaultVoicePlayback) ) {
191             ULONG wod;
192             int wodn;
193             TRACE("DataFlow=DIRECTSOUNDDEVICE_DATAFLOW_RENDER\n");
194             ppd->DataFlow = DIRECTSOUNDDEVICE_DATAFLOW_RENDER;
195             wodn = waveOutGetNumDevs();
196             for (wod = 0; wod < wodn; wod++) {
197                 err = mmErr(waveOutMessage((HWAVEOUT)wod,DRV_QUERYDSOUNDGUID,(DWORD)(&guid),0));
198                 if (err == DS_OK) {
199                     if (IsEqualGUID( &dev_guid, &guid) ) {
200                         DSDRIVERDESC desc;
201                         ppd->WaveDeviceId = wod;
202                         ppd->Devnode = wod;
203                         err = mmErr(waveOutMessage((HWAVEOUT)wod,DRV_QUERYDSOUNDDESC,(DWORD)&(desc),0));
204                         if (err == DS_OK) {
205                             strncpy(ppd->DescriptionA, desc.szDesc, sizeof(ppd->DescriptionA) - 1);
206                             strncpy(ppd->ModuleA, desc.szDrvName, sizeof(ppd->ModuleA) - 1);
207                             MultiByteToWideChar( CP_ACP, 0, desc.szDesc, -1, ppd->DescriptionW, sizeof(ppd->DescriptionW)/sizeof(WCHAR) );
208                             MultiByteToWideChar( CP_ACP, 0, desc.szDrvName, -1, ppd->ModuleW, sizeof(ppd->ModuleW)/sizeof(WCHAR) );
209                             break;
210                         } else {
211                             WARN("waveOutMessage failed\n");
212                             return E_PROP_ID_UNSUPPORTED;
213                         }
214                     }
215                 } else {
216                     WARN("waveOutMessage failed\n");
217                     return E_PROP_ID_UNSUPPORTED;
218                 }
219             }
220         } else if ( IsEqualGUID( &ppd->DeviceId , &DSDEVID_DefaultCapture) ||
221                     IsEqualGUID( &ppd->DeviceId , &DSDEVID_DefaultVoiceCapture) ) {
222             ULONG wid;
223             int widn;
224             TRACE("DataFlow=DIRECTSOUNDDEVICE_DATAFLOW_CAPTURE\n");
225             ppd->DataFlow = DIRECTSOUNDDEVICE_DATAFLOW_CAPTURE;
226             widn = waveInGetNumDevs();
227             for (wid = 0; wid < widn; wid++) {
228                 err = mmErr(waveInMessage((HWAVEIN)wid,DRV_QUERYDSOUNDGUID,(DWORD)(&guid),0));
229                 if (err == DS_OK) {
230                     if (IsEqualGUID( &dev_guid, &guid) ) {
231                         DSDRIVERDESC desc;
232                         ppd->WaveDeviceId = wid;
233                         ppd->Devnode = wid;
234                         err = mmErr(waveInMessage((HWAVEIN)wid,DRV_QUERYDSOUNDDESC,(DWORD)&(desc),0));
235                         if (err == DS_OK) {
236                             strncpy(ppd->DescriptionA, desc.szDesc, sizeof(ppd->DescriptionA) - 1);
237                             strncpy(ppd->ModuleA, desc.szDrvName, sizeof(ppd->ModuleA) - 1);
238                             MultiByteToWideChar( CP_ACP, 0, desc.szDesc, -1, ppd->DescriptionW, sizeof(ppd->DescriptionW)/sizeof(WCHAR) );
239                             MultiByteToWideChar( CP_ACP, 0, desc.szDrvName, -1, ppd->ModuleW, sizeof(ppd->ModuleW)/sizeof(WCHAR) );
240                             break;
241                         } else {
242                             WARN("waveInMessage failed\n");
243                             return E_PROP_ID_UNSUPPORTED;
244                         }
245                         break;
246                     }
247                 } else {
248                     WARN("waveInMessage failed\n");
249                     return E_PROP_ID_UNSUPPORTED;
250                 }
251             }
252         } else {
253             FIXME("DeviceId=Unknown\n");
254             return E_PROP_ID_UNSUPPORTED;
255         }
256     }
257
258     ppd->Type = DIRECTSOUNDDEVICE_TYPE_EMULATED;
259
260     if (pcbReturned) {
261         *pcbReturned = cbPropData; 
262         TRACE("*pcbReturned=%ld\n", *pcbReturned);
263     }
264
265     return S_OK;
266 }
267
268 static HRESULT WINAPI DSPROPERTY_DescriptionA(
269     REFGUID guidPropSet,
270     LPVOID pPropData,
271     ULONG cbPropData,
272     PULONG pcbReturned )
273 {
274     FIXME("(guidPropSet=%s,pPropData=%p,cbPropData=%ld,pcbReturned=%p)\n",
275         debugstr_guid(guidPropSet),pPropData,cbPropData,pcbReturned);
276     return E_PROP_ID_UNSUPPORTED;
277 }
278
279 static HRESULT WINAPI DSPROPERTY_DescriptionW(
280     REFGUID guidPropSet,
281     LPVOID pPropData,
282     ULONG cbPropData,
283     PULONG pcbReturned )
284 {
285     PDSPROPERTY_DIRECTSOUNDDEVICE_DESCRIPTION_W_DATA ppd = (PDSPROPERTY_DIRECTSOUNDDEVICE_DESCRIPTION_W_DATA) pPropData;
286     HRESULT err;
287     GUID guid, dev_guid;
288     TRACE("(guidPropSet=%s,pPropData=%p,cbPropData=%ld,pcbReturned=%p)\n",
289         debugstr_guid(guidPropSet),pPropData,cbPropData,pcbReturned);
290
291     TRACE("DeviceId=%s\n",debugstr_guid(&ppd->DeviceId));
292     if ( IsEqualGUID( &ppd->DeviceId , &GUID_NULL) ) {
293         /* default device of type specified by ppd->DataFlow */
294         if (ppd->DataFlow == DIRECTSOUNDDEVICE_DATAFLOW_CAPTURE) {
295             TRACE("DataFlow=DIRECTSOUNDDEVICE_DATAFLOW_CAPTURE\n");
296         } else if (ppd->DataFlow == DIRECTSOUNDDEVICE_DATAFLOW_RENDER) {
297             TRACE("DataFlow=DIRECTSOUNDDEVICE_DATAFLOW_RENDER\n");
298         } else {
299             TRACE("DataFlow=Unknown(%d)\n", ppd->DataFlow);
300         }
301         FIXME("(guidPropSet=%s,pPropData=%p,cbPropData=%ld,pcbReturned=%p) GUID_NULL not implemented!\n",
302             debugstr_guid(guidPropSet),pPropData,cbPropData,pcbReturned);
303         return E_PROP_ID_UNSUPPORTED;
304     } else {
305         GetDeviceID(&ppd->DeviceId, &dev_guid);
306
307         if ( IsEqualGUID( &ppd->DeviceId , &DSDEVID_DefaultPlayback) || 
308              IsEqualGUID( &ppd->DeviceId , &DSDEVID_DefaultVoicePlayback) ) {
309             ULONG wod;
310             int wodn;
311             TRACE("DataFlow=DIRECTSOUNDDEVICE_DATAFLOW_RENDER\n");
312             ppd->DataFlow = DIRECTSOUNDDEVICE_DATAFLOW_RENDER;
313             wodn = waveOutGetNumDevs();
314             for (wod = 0; wod < wodn; wod++) {
315                 err = mmErr(waveOutMessage((HWAVEOUT)wod,DRV_QUERYDSOUNDGUID,(DWORD)(&guid),0));
316                 if (err == DS_OK) {
317                     if (IsEqualGUID( &dev_guid, &guid) ) {
318                         DSDRIVERDESC desc;
319                         ppd->WaveDeviceId = wod;
320                         err = mmErr(waveOutMessage((HWAVEOUT)wod,DRV_QUERYDSOUNDDESC,(DWORD)&(desc),0));
321                         if (err == DS_OK) {
322                             /* FIXME: this is a memory leak */
323                             WCHAR * wDescription = HeapAlloc(GetProcessHeap(),0,0x200);
324                             WCHAR * wModule = HeapAlloc(GetProcessHeap(),0,0x200);
325                             WCHAR * wInterface = HeapAlloc(GetProcessHeap(),0,0x200);
326
327                             MultiByteToWideChar( CP_ACP, 0, desc.szDesc, -1, wDescription, 0x100  );
328                             MultiByteToWideChar( CP_ACP, 0, desc.szDrvName, -1, wModule, 0x100 );
329                             MultiByteToWideChar( CP_ACP, 0, "Interface", -1, wInterface, 0x100 );
330
331                             ppd->Description = wDescription;
332                             ppd->Module = wModule;
333                             ppd->Interface = wInterface;
334                             break;
335                         } else {
336                             WARN("waveOutMessage failed\n");
337                             return E_PROP_ID_UNSUPPORTED;
338                         }
339                     }
340                 } else {
341                     WARN("waveOutMessage failed\n");
342                     return E_PROP_ID_UNSUPPORTED;
343                 }
344             }
345         } else if (IsEqualGUID( &ppd->DeviceId , &DSDEVID_DefaultCapture) ||
346                    IsEqualGUID( &ppd->DeviceId , &DSDEVID_DefaultVoiceCapture) ) {
347             ULONG wid;
348             int widn;
349             TRACE("DataFlow=DIRECTSOUNDDEVICE_DATAFLOW_CAPTURE\n");
350             ppd->DataFlow = DIRECTSOUNDDEVICE_DATAFLOW_CAPTURE;
351             widn = waveInGetNumDevs();
352             for (wid = 0; wid < widn; wid++) {
353                 err = mmErr(waveInMessage((HWAVEIN)wid,DRV_QUERYDSOUNDGUID,(DWORD)(&guid),0));
354                 if (err == DS_OK) {
355                     if (IsEqualGUID( &dev_guid, &guid) ) {
356                         DSDRIVERDESC desc;
357                         ppd->WaveDeviceId = wid;
358                         err = mmErr(waveInMessage((HWAVEIN)wid,DRV_QUERYDSOUNDDESC,(DWORD)&(desc),0));
359                         if (err == DS_OK) {
360                             /* FIXME: this is a memory leak */
361                             WCHAR * wDescription = HeapAlloc(GetProcessHeap(),0,0x200);
362                             WCHAR * wModule = HeapAlloc(GetProcessHeap(),0,0x200);
363                             WCHAR * wInterface = HeapAlloc(GetProcessHeap(),0,0x200);
364
365                             MultiByteToWideChar( CP_ACP, 0, desc.szDesc, -1, wDescription, 0x100  );
366                             MultiByteToWideChar( CP_ACP, 0, desc.szDrvName, -1, wModule, 0x100 );
367                             MultiByteToWideChar( CP_ACP, 0, "Interface", -1, wInterface, 0x100 );
368
369                             ppd->Description = wDescription;
370                             ppd->Module = wModule;
371                             ppd->Interface = wInterface;
372                             break;
373                         } else {
374                             WARN("waveInMessage failed\n");
375                             return E_PROP_ID_UNSUPPORTED;
376                         }
377                         break;
378                     }
379                 } else {
380                     WARN("waveInMessage failed\n");
381                     return E_PROP_ID_UNSUPPORTED;
382                 }
383             }
384         } else {
385             FIXME("DeviceId=Unknown\n");
386             return E_PROP_ID_UNSUPPORTED;
387         }
388     }
389
390     ppd->Type = DIRECTSOUNDDEVICE_TYPE_EMULATED;
391
392     if (pcbReturned) {
393         *pcbReturned = cbPropData; 
394         TRACE("*pcbReturned=%ld\n", *pcbReturned);
395     }
396
397     return S_OK;
398 }
399
400 static HRESULT WINAPI DSPROPERTY_Enumerate1(
401     REFGUID guidPropSet,
402     LPVOID pPropData,
403     ULONG cbPropData,
404     PULONG pcbReturned )
405 {
406     FIXME("(guidPropSet=%s,pPropData=%p,cbPropData=%ld,pcbReturned=%p)\n",
407         debugstr_guid(guidPropSet),pPropData,cbPropData,pcbReturned);
408     return E_PROP_ID_UNSUPPORTED;
409 }
410
411 static HRESULT WINAPI DSPROPERTY_EnumerateA(
412     REFGUID guidPropSet,
413     LPVOID pPropData,
414     ULONG cbPropData,
415     PULONG pcbReturned )
416 {
417     FIXME("(guidPropSet=%s,pPropData=%p,cbPropData=%ld,pcbReturned=%p)\n",
418         debugstr_guid(guidPropSet),pPropData,cbPropData,pcbReturned);
419     return E_PROP_ID_UNSUPPORTED;
420 }
421
422 static HRESULT WINAPI DSPROPERTY_EnumerateW(
423     REFGUID guidPropSet,
424     LPVOID pPropData,
425     ULONG cbPropData,
426     PULONG pcbReturned )
427 {
428     FIXME("(guidPropSet=%s,pPropData=%p,cbPropData=%ld,pcbReturned=%p)\n",
429         debugstr_guid(guidPropSet),pPropData,cbPropData,pcbReturned);
430     return E_PROP_ID_UNSUPPORTED;
431 }
432
433 static HRESULT WINAPI IKsPropertySetImpl_Get(LPKSPROPERTYSET iface,
434         REFGUID guidPropSet, ULONG dwPropID,
435         LPVOID pInstanceData, ULONG cbInstanceData,
436         LPVOID pPropData, ULONG cbPropData,
437         PULONG pcbReturned
438 ) {
439         ICOM_THIS(IKsPropertySetImpl,iface);
440         TRACE("(iface=%p,guidPropSet=%s,dwPropID=%ld,pInstanceData=%p,cbInstanceData=%ld,pPropData=%p,cbPropData=%ld,pcbReturned=%p)\n",
441                 This,debugstr_guid(guidPropSet),dwPropID,pInstanceData,cbInstanceData,pPropData,cbPropData,pcbReturned);
442
443         if ( IsEqualGUID( &DSPROPSETID_DirectSoundDevice, guidPropSet) ) {
444                 switch (dwPropID) {
445                 case DSPROPERTY_DIRECTSOUNDDEVICE_WAVEDEVICEMAPPING_A:
446                         return DSPROPERTY_WaveDeviceMappingA(guidPropSet,pPropData,cbPropData,pcbReturned);
447                 case DSPROPERTY_DIRECTSOUNDDEVICE_DESCRIPTION_1:
448                         return DSPROPERTY_Description1(guidPropSet,pPropData,cbPropData,pcbReturned);
449                 case DSPROPERTY_DIRECTSOUNDDEVICE_ENUMERATE_1:
450                         return DSPROPERTY_Enumerate1(guidPropSet,pPropData,cbPropData,pcbReturned);
451                 case DSPROPERTY_DIRECTSOUNDDEVICE_WAVEDEVICEMAPPING_W:
452                         return DSPROPERTY_WaveDeviceMappingW(guidPropSet,pPropData,cbPropData,pcbReturned);
453                 case DSPROPERTY_DIRECTSOUNDDEVICE_DESCRIPTION_A:
454                         return DSPROPERTY_DescriptionA(guidPropSet,pPropData,cbPropData,pcbReturned);
455                 case DSPROPERTY_DIRECTSOUNDDEVICE_DESCRIPTION_W:
456                         return DSPROPERTY_DescriptionW(guidPropSet,pPropData,cbPropData,pcbReturned);
457                 case DSPROPERTY_DIRECTSOUNDDEVICE_ENUMERATE_A:
458                         return DSPROPERTY_EnumerateA(guidPropSet,pPropData,cbPropData,pcbReturned);
459                 case DSPROPERTY_DIRECTSOUNDDEVICE_ENUMERATE_W:
460                         return DSPROPERTY_EnumerateW(guidPropSet,pPropData,cbPropData,pcbReturned);
461                 default:
462                         FIXME("unsupported ID: %ld\n",dwPropID);
463                         break;
464                 }
465         } else {
466                 FIXME("unsupported property: %s\n",debugstr_guid(guidPropSet));
467         }
468
469         if (pcbReturned) {
470                 *pcbReturned = 0; 
471                 FIXME("*pcbReturned=%ld\n", *pcbReturned);
472         }
473
474         return E_PROP_ID_UNSUPPORTED;
475 }
476
477 static HRESULT WINAPI IKsPropertySetImpl_Set(LPKSPROPERTYSET iface,
478         REFGUID guidPropSet, ULONG dwPropID,
479         LPVOID pInstanceData, ULONG cbInstanceData,
480         LPVOID pPropData, ULONG cbPropData
481 ) {
482         ICOM_THIS(IKsPropertySetImpl,iface);
483
484         FIXME("(%p,%s,%ld,%p,%ld,%p,%ld), stub!\n",This,debugstr_guid(guidPropSet),dwPropID,pInstanceData,cbInstanceData,pPropData,cbPropData);
485         return E_PROP_ID_UNSUPPORTED;
486 }
487
488 static HRESULT WINAPI IKsPropertySetImpl_QuerySupport(LPKSPROPERTYSET iface,
489         REFGUID guidPropSet, ULONG dwPropID, PULONG pTypeSupport
490 ) {
491         ICOM_THIS(IKsPropertySetImpl,iface);
492
493         FIXME("(%p,%s,%ld,%p), stub!\n",This,debugstr_guid(guidPropSet),dwPropID,pTypeSupport);
494         return E_PROP_ID_UNSUPPORTED;
495 }
496
497 static ICOM_VTABLE(IKsPropertySet) iksvt = {
498         ICOM_MSVTABLE_COMPAT_DummyRTTIVALUE
499         IKsPropertySetImpl_QueryInterface,
500         IKsPropertySetImpl_AddRef,
501         IKsPropertySetImpl_Release,
502         IKsPropertySetImpl_Get,
503         IKsPropertySetImpl_Set,
504         IKsPropertySetImpl_QuerySupport
505 };
506
507 HRESULT WINAPI IKsPropertySetImpl_Create(
508         IDirectSoundBufferImpl *This,
509         IKsPropertySetImpl **piks)
510 {
511         IKsPropertySetImpl *iks;
512
513         iks = (IKsPropertySetImpl*)HeapAlloc(GetProcessHeap(),0,sizeof(*iks));
514         iks->ref = 0;
515         iks->dsb = This;
516         iks->lpVtbl = &iksvt;
517
518         *piks = iks;
519         return S_OK;
520 }