ReactOS 0.4.16-dev-125-g798ea90
propset.c File Reference
#include "dsound_private.h"
Include dependency graph for propset.c:

Go to the source code of this file.

Classes

struct  IKsPrivatePropertySetImpl
 

Typedefs

typedef struct IKsPrivatePropertySetImpl IKsPrivatePropertySetImpl
 

Functions

static IKsPrivatePropertySetImplimpl_from_IKsPropertySet (IKsPropertySet *iface)
 
static HRESULT WINAPI IKsPrivatePropertySetImpl_QueryInterface (LPKSPROPERTYSET iface, REFIID riid, LPVOID *ppobj)
 
static ULONG WINAPI IKsPrivatePropertySetImpl_AddRef (LPKSPROPERTYSET iface)
 
static ULONG WINAPI IKsPrivatePropertySetImpl_Release (LPKSPROPERTYSET iface)
 
static HRESULT DSPROPERTY_WaveDeviceMappingW (LPVOID pPropData, ULONG cbPropData, PULONG pcbReturned)
 
static HRESULT DSPROPERTY_WaveDeviceMappingA (LPVOID pPropData, ULONG cbPropData, PULONG pcbReturned)
 
static HRESULT DSPROPERTY_DescriptionW (LPVOID pPropData, ULONG cbPropData, PULONG pcbReturned)
 
static HRESULT DSPROPERTY_EnumerateW (LPVOID pPropData, ULONG cbPropData, PULONG pcbReturned)
 
static BOOL DSPROPERTY_descWtoA (const DSPROPERTY_DIRECTSOUNDDEVICE_DESCRIPTION_W_DATA *dataW, DSPROPERTY_DIRECTSOUNDDEVICE_DESCRIPTION_A_DATA *dataA)
 
static void DSPROPERTY_descWto1 (const DSPROPERTY_DIRECTSOUNDDEVICE_DESCRIPTION_W_DATA *dataW, DSPROPERTY_DIRECTSOUNDDEVICE_DESCRIPTION_1_DATA *data1)
 
static BOOL CALLBACK DSPROPERTY_enumWtoA (DSPROPERTY_DIRECTSOUNDDEVICE_DESCRIPTION_W_DATA *descW, void *data)
 
static HRESULT DSPROPERTY_EnumerateA (LPVOID pPropData, ULONG cbPropData, PULONG pcbReturned)
 
static BOOL CALLBACK DSPROPERTY_enumWto1 (DSPROPERTY_DIRECTSOUNDDEVICE_DESCRIPTION_W_DATA *descW, void *data)
 
static HRESULT DSPROPERTY_Enumerate1 (LPVOID pPropData, ULONG cbPropData, PULONG pcbReturned)
 
static HRESULT DSPROPERTY_DescriptionA (LPVOID pPropData, ULONG cbPropData, PULONG pcbReturned)
 
static HRESULT DSPROPERTY_Description1 (LPVOID pPropData, ULONG cbPropData, PULONG pcbReturned)
 
static HRESULT WINAPI IKsPrivatePropertySetImpl_Get (LPKSPROPERTYSET iface, REFGUID guidPropSet, ULONG dwPropID, LPVOID pInstanceData, ULONG cbInstanceData, LPVOID pPropData, ULONG cbPropData, PULONG pcbReturned)
 
static HRESULT WINAPI IKsPrivatePropertySetImpl_Set (LPKSPROPERTYSET iface, REFGUID guidPropSet, ULONG dwPropID, LPVOID pInstanceData, ULONG cbInstanceData, LPVOID pPropData, ULONG cbPropData)
 
static HRESULT WINAPI IKsPrivatePropertySetImpl_QuerySupport (LPKSPROPERTYSET iface, REFGUID guidPropSet, ULONG dwPropID, PULONG pTypeSupport)
 
HRESULT IKsPrivatePropertySetImpl_Create (REFIID riid, IKsPropertySet **piks)
 

Variables

static const IKsPropertySetVtbl ikspvt
 

Typedef Documentation

◆ IKsPrivatePropertySetImpl

Function Documentation

◆ DSPROPERTY_Description1()

static HRESULT DSPROPERTY_Description1 ( LPVOID  pPropData,
ULONG  cbPropData,
PULONG  pcbReturned 
)
static

Definition at line 472 of file propset.c.

476{
479 HRESULT hr;
480
481 if (pcbReturned)
482 *pcbReturned = sizeof(*ppd);
483 if (!pPropData)
484 return S_OK;
485
486 data.DeviceId = ppd->DeviceId;
487 data.DataFlow = ppd->DataFlow;
489 if (FAILED(hr))
490 return hr;
492 HeapFree(GetProcessHeap(), 0, data.Module);
493 HeapFree(GetProcessHeap(), 0, data.Interface);
494 return hr;
495}
#define NULL
Definition: types.h:112
static HRESULT DSPROPERTY_DescriptionW(LPVOID pPropData, ULONG cbPropData, PULONG pcbReturned)
Definition: propset.c:177
static void DSPROPERTY_descWto1(const DSPROPERTY_DIRECTSOUNDDEVICE_DESCRIPTION_W_DATA *dataW, DSPROPERTY_DIRECTSOUNDDEVICE_DESCRIPTION_1_DATA *data1)
Definition: propset.c:365
#define GetProcessHeap()
Definition: compat.h:736
#define HeapFree(x, y, z)
Definition: compat.h:735
GLint GLenum GLsizei GLsizei GLsizei GLint GLsizei const GLvoid * data
Definition: gl.h:1950
#define S_OK
Definition: intsafe.h:52
#define FAILED(hr)
Definition: intsafe.h:51
HRESULT hr
Definition: shlfolder.c:183
DIRECTSOUNDDEVICE_DATAFLOW DataFlow
Definition: dsconf.h:62

Referenced by IKsPrivatePropertySetImpl_Get().

◆ DSPROPERTY_DescriptionA()

static HRESULT DSPROPERTY_DescriptionA ( LPVOID  pPropData,
ULONG  cbPropData,
PULONG  pcbReturned 
)
static

Definition at line 446 of file propset.c.

450{
453 HRESULT hr;
454
455 if (pcbReturned)
456 *pcbReturned = sizeof(*ppd);
457 if (!pPropData)
458 return S_OK;
459
460 data.DeviceId = ppd->DeviceId;
461 data.DataFlow = ppd->DataFlow;
463 if (FAILED(hr))
464 return hr;
465 if (!DSPROPERTY_descWtoA(&data, ppd))
467 HeapFree(GetProcessHeap(), 0, data.Module);
468 HeapFree(GetProcessHeap(), 0, data.Interface);
469 return hr;
470}
#define E_OUTOFMEMORY
Definition: ddrawi.h:100
static BOOL DSPROPERTY_descWtoA(const DSPROPERTY_DIRECTSOUNDDEVICE_DESCRIPTION_W_DATA *dataW, DSPROPERTY_DIRECTSOUNDDEVICE_DESCRIPTION_A_DATA *dataA)
Definition: propset.c:337
DIRECTSOUNDDEVICE_DATAFLOW DataFlow
Definition: dsconf.h:70

Referenced by IKsPrivatePropertySetImpl_Get().

◆ DSPROPERTY_DescriptionW()

static HRESULT DSPROPERTY_DescriptionW ( LPVOID  pPropData,
ULONG  cbPropData,
PULONG  pcbReturned 
)
static

Definition at line 177 of file propset.c.

181{
183 HRESULT err;
184 GUID dev_guid;
185 ULONG wod, wid, wodn, widn;
187
188 TRACE("pPropData=%p,cbPropData=%d,pcbReturned=%p)\n",
189 pPropData,cbPropData,pcbReturned);
190
191 TRACE("DeviceId=%s\n",debugstr_guid(&ppd->DeviceId));
192 if ( IsEqualGUID( &ppd->DeviceId , &GUID_NULL) ) {
193 /* default device of type specified by ppd->DataFlow */
195 TRACE("DataFlow=DIRECTSOUNDDEVICE_DATAFLOW_CAPTURE\n");
196 ppd->DeviceId = DSDEVID_DefaultCapture;
197 } else if (ppd->DataFlow == DIRECTSOUNDDEVICE_DATAFLOW_RENDER) {
198 TRACE("DataFlow=DIRECTSOUNDDEVICE_DATAFLOW_RENDER\n");
199 ppd->DeviceId = DSDEVID_DefaultPlayback;
200 } else {
201 WARN("DataFlow=Unknown(%d)\n", ppd->DataFlow);
203 }
204 }
205
207
208 GetDeviceID(&ppd->DeviceId, &dev_guid);
209
210 wodn = waveOutGetNumDevs();
211 widn = waveInGetNumDevs();
212 wid = wod = dev_guid.Data4[7];
213 if (!memcmp(&dev_guid, &DSOUND_renderer_guids[0], sizeof(GUID)-1)
214 && wod < wodn)
215 {
217 ppd->WaveDeviceId = wod;
218 }
219 else if (!memcmp(&dev_guid, &DSOUND_capture_guids[0], sizeof(GUID)-1)
220 && wid < widn)
221 {
223 ppd->WaveDeviceId = wid;
224 }
225 else
226 {
227 WARN("Device not found\n");
229 }
230
232 err = waveOutMessage(UlongToHandle(wod),DRV_QUERYDSOUNDDESC,(DWORD_PTR)&desc,ds_hw_accel);
233 else
234 err = waveInMessage(UlongToHandle(wod),DRV_QUERYDSOUNDDESC,(DWORD_PTR)&desc,ds_hw_accel);
235
236 if (err != MMSYSERR_NOERROR)
237 {
238 WARN("waveMessage(DRV_QUERYDSOUNDDESC) failed!\n");
240 }
241 else
242 {
243 /* FIXME: Still a memory leak.. */
244 int desclen, modlen;
245 static WCHAR wInterface[] = { 'I','n','t','e','r','f','a','c','e',0 };
246
247 modlen = MultiByteToWideChar( CP_ACP, 0, desc.szDrvname, -1, NULL, 0 );
248 desclen = MultiByteToWideChar( CP_ACP, 0, desc.szDesc, -1, NULL, 0 );
249 ppd->Module = HeapAlloc(GetProcessHeap(),0,modlen*sizeof(WCHAR));
250 ppd->Description = HeapAlloc(GetProcessHeap(),0,desclen*sizeof(WCHAR));
251 ppd->Interface = wInterface;
252 if (!ppd->Description || !ppd->Module)
253 {
254 WARN("Out of memory\n");
256 HeapFree(GetProcessHeap(), 0, ppd->Module);
257 ppd->Description = ppd->Module = NULL;
258 return E_OUTOFMEMORY;
259 }
260
261 MultiByteToWideChar( CP_ACP, 0, desc.szDrvname, -1, ppd->Module, modlen );
262 MultiByteToWideChar( CP_ACP, 0, desc.szDesc, -1, ppd->Description, desclen );
263 }
264
266
267 if (pcbReturned) {
268 *pcbReturned = sizeof(*ppd);
269 TRACE("*pcbReturned=%d\n", *pcbReturned);
270 }
271
272 return S_OK;
273}
int memcmp(void *Buffer1, void *Buffer2, ACPI_SIZE Count)
Definition: utclib.c:112
#define WARN(fmt,...)
Definition: precomp.h:61
#define UlongToHandle(ul)
Definition: basetsd.h:97
HRESULT WINAPI GetDeviceID(LPCGUID pGuidSrc, LPGUID pGuidDest)
Definition: dsound.c:53
#define CP_ACP
Definition: compat.h:109
#define HeapAlloc
Definition: compat.h:733
#define MultiByteToWideChar
Definition: compat.h:110
@ DIRECTSOUNDDEVICE_TYPE_VXD
Definition: dsconf.h:30
@ DIRECTSOUNDDEVICE_DATAFLOW_RENDER
Definition: dsconf.h:36
@ DIRECTSOUNDDEVICE_DATAFLOW_CAPTURE
Definition: dsconf.h:37
GUID DSOUND_renderer_guids[MAXWAVEDRIVERS]
Definition: dsound_main.c:41
GUID DSOUND_capture_guids[MAXWAVEDRIVERS]
Definition: dsound_main.c:42
int ds_hw_accel
Definition: dsound_main.c:78
void setup_dsound_options(void)
Definition: dsound_main.c:102
#define debugstr_guid
Definition: kernel32.h:35
#define GUID_NULL
Definition: ks.h:106
#define MMSYSERR_NOERROR
Definition: mmsystem.h:96
static const WCHAR desc[]
Definition: protectdata.c:36
#define IsEqualGUID(rguid1, rguid2)
Definition: guiddef.h:147
#define err(...)
#define TRACE(s)
Definition: solgame.cpp:4
DIRECTSOUNDDEVICE_DATAFLOW DataFlow
Definition: dsconf.h:81
uint32_t DWORD_PTR
Definition: typedefs.h:65
uint32_t ULONG
Definition: typedefs.h:59
#define E_PROP_ID_UNSUPPORTED
Definition: vfwmsgs.h:173
UINT WINAPI waveOutGetNumDevs(void)
Definition: winmm.c:2137
UINT WINAPI waveInGetNumDevs(void)
Definition: winmm.c:2565
UINT WINAPI waveInMessage(HWAVEIN hWaveIn, UINT uMessage, DWORD_PTR dwParam1, DWORD_PTR dwParam2)
Definition: winmm.c:2813
UINT WINAPI waveOutMessage(HWAVEOUT hWaveOut, UINT uMessage, DWORD_PTR dwParam1, DWORD_PTR dwParam2)
Definition: winmm.c:2538
__wchar_t WCHAR
Definition: xmlstorage.h:180

Referenced by DSPROPERTY_Description1(), DSPROPERTY_DescriptionA(), DSPROPERTY_EnumerateW(), and IKsPrivatePropertySetImpl_Get().

◆ DSPROPERTY_descWto1()

Definition at line 365 of file propset.c.

367{
368 data1->DeviceId = dataW->DeviceId;
369 lstrcpynW(data1->ModuleW, dataW->Module, sizeof(data1->ModuleW)/sizeof(*data1->ModuleW));
370 lstrcpynW(data1->DescriptionW, dataW->Description, sizeof(data1->DescriptionW)/sizeof(*data1->DescriptionW));
371 WideCharToMultiByte(CP_ACP, 0, data1->DescriptionW, -1, data1->DescriptionA, sizeof(data1->DescriptionA)-1, NULL, NULL);
372 WideCharToMultiByte(CP_ACP, 0, data1->ModuleW, -1, data1->ModuleA, sizeof(data1->ModuleA)-1, NULL, NULL);
373 data1->DescriptionA[sizeof(data1->DescriptionA)-1] = 0;
374 data1->ModuleA[sizeof(data1->ModuleA)-1] = 0;
375 data1->Type = dataW->Type;
376 data1->DataFlow = dataW->DataFlow;
377 data1->WaveDeviceId = data1->Devnode = dataW->WaveDeviceId;
378}
#define WideCharToMultiByte
Definition: compat.h:111
#define lstrcpynW
Definition: compat.h:738
Definition: tftpd.h:126

Referenced by DSPROPERTY_Description1(), and DSPROPERTY_enumWto1().

◆ DSPROPERTY_descWtoA()

Definition at line 337 of file propset.c.

339{
340 DWORD modlen, desclen;
341 static char Interface[] = "Interface";
342
343 modlen = WideCharToMultiByte(CP_ACP, 0, dataW->Module, -1, NULL, 0, NULL, NULL);
344 desclen = WideCharToMultiByte(CP_ACP, 0, dataW->Description, -1, NULL, 0, NULL, NULL);
345 dataA->Type = dataW->Type;
346 dataA->DataFlow = dataW->DataFlow;
347 dataA->DeviceId = dataW->DeviceId;
348 dataA->WaveDeviceId = dataW->WaveDeviceId;
349 dataA->Interface = Interface;
350 dataA->Module = HeapAlloc(GetProcessHeap(), 0, modlen);
351 dataA->Description = HeapAlloc(GetProcessHeap(), 0, desclen);
352 if (!dataA->Module || !dataA->Description)
353 {
354 HeapFree(GetProcessHeap(), 0, dataA->Module);
355 HeapFree(GetProcessHeap(), 0, dataA->Description);
356 dataA->Module = dataA->Description = NULL;
357 return FALSE;
358 }
359
360 WideCharToMultiByte(CP_ACP, 0, dataW->Module, -1, dataA->Module, modlen, NULL, NULL);
361 WideCharToMultiByte(CP_ACP, 0, dataW->Description, -1, dataA->Description, desclen, NULL, NULL);
362 return TRUE;
363}
#define TRUE
Definition: types.h:120
#define FALSE
Definition: types.h:117
unsigned long DWORD
Definition: ntddk_ex.h:95
_Must_inspect_result_ _In_ WDFDEVICE _In_ LPCGUID _Out_ PINTERFACE Interface
Definition: wdffdo.h:465

Referenced by DSPROPERTY_DescriptionA(), and DSPROPERTY_enumWtoA().

◆ DSPROPERTY_Enumerate1()

static HRESULT DSPROPERTY_Enumerate1 ( LPVOID  pPropData,
ULONG  cbPropData,
PULONG  pcbReturned 
)
static

Definition at line 426 of file propset.c.

430{
433
434 if (!ppd || !ppd->Callback)
435 {
436 WARN("Invalid ppd %p\n", ppd);
438 }
439
440 data.Callback = DSPROPERTY_enumWto1;
441 data.Context = ppd;
442
443 return DSPROPERTY_EnumerateW(&data, cbPropData, pcbReturned);
444}
static BOOL CALLBACK DSPROPERTY_enumWto1(DSPROPERTY_DIRECTSOUNDDEVICE_DESCRIPTION_W_DATA *descW, void *data)
Definition: propset.c:415
static HRESULT DSPROPERTY_EnumerateW(LPVOID pPropData, ULONG cbPropData, PULONG pcbReturned)
Definition: propset.c:275
LPFNDIRECTSOUNDDEVICEENUMERATECALLBACK1 Callback
Definition: dsconf.h:135

Referenced by IKsPrivatePropertySetImpl_Get().

◆ DSPROPERTY_EnumerateA()

static HRESULT DSPROPERTY_EnumerateA ( LPVOID  pPropData,
ULONG  cbPropData,
PULONG  pcbReturned 
)
static

Definition at line 395 of file propset.c.

399{
402
403 if (!ppd || !ppd->Callback)
404 {
405 WARN("Invalid ppd %p\n", ppd);
407 }
408
409 data.Callback = DSPROPERTY_enumWtoA;
410 data.Context = ppd;
411
412 return DSPROPERTY_EnumerateW(&data, cbPropData, pcbReturned);
413}
static BOOL CALLBACK DSPROPERTY_enumWtoA(DSPROPERTY_DIRECTSOUNDDEVICE_DESCRIPTION_W_DATA *descW, void *data)
Definition: propset.c:380
LPFNDIRECTSOUNDDEVICEENUMERATECALLBACKA Callback
Definition: dsconf.h:141

Referenced by IKsPrivatePropertySetImpl_Get().

◆ DSPROPERTY_EnumerateW()

static HRESULT DSPROPERTY_EnumerateW ( LPVOID  pPropData,
ULONG  cbPropData,
PULONG  pcbReturned 
)
static

Definition at line 275 of file propset.c.

279{
282 BOOL ret;
283 int widn, wodn, i;
284 TRACE("(pPropData=%p,cbPropData=%d,pcbReturned=%p)\n",
285 pPropData,cbPropData,pcbReturned);
286
287 if (pcbReturned)
288 *pcbReturned = 0;
289
290 if (!ppd || !ppd->Callback)
291 {
292 WARN("Invalid ppd %p\n", ppd);
294 }
295
296 wodn = waveOutGetNumDevs();
297 widn = waveInGetNumDevs();
298
299 data.DeviceId = DSOUND_renderer_guids[0];
300 for (i = 0; i < wodn; ++i)
301 {
302 HRESULT hr;
303 data.DeviceId.Data4[7] = i;
305 if (FAILED(hr))
306 {
307 ERR("DescriptionW failed!\n");
308 return S_OK;
309 }
310 ret = ppd->Callback(&data, ppd->Context);
311 HeapFree(GetProcessHeap(), 0, data.Module);
312 HeapFree(GetProcessHeap(), 0, data.Description);
313 if (!ret)
314 return S_OK;
315 }
316
317 data.DeviceId = DSOUND_capture_guids[0];
318 for (i = 0; i < widn; ++i)
319 {
320 HRESULT hr;
321 data.DeviceId.Data4[7] = i;
323 if (FAILED(hr))
324 {
325 ERR("DescriptionW failed!\n");
326 return S_OK;
327 }
328 ret = ppd->Callback(&data, ppd->Context);
329 HeapFree(GetProcessHeap(), 0, data.Module);
330 HeapFree(GetProcessHeap(), 0, data.Description);
331 if (!ret)
332 return S_OK;
333 }
334 return S_OK;
335}
#define ERR(fmt,...)
Definition: precomp.h:57
unsigned int BOOL
Definition: ntddk_ex.h:94
GLsizei GLenum const GLvoid GLsizei GLenum GLbyte GLbyte GLbyte GLdouble GLdouble GLdouble GLfloat GLfloat GLfloat GLint GLint GLint GLshort GLshort GLshort GLubyte GLubyte GLubyte GLuint GLuint GLuint GLushort GLushort GLushort GLbyte GLbyte GLbyte GLbyte GLdouble GLdouble GLdouble GLdouble GLfloat GLfloat GLfloat GLfloat GLint GLint GLint GLint GLshort GLshort GLshort GLshort GLubyte GLubyte GLubyte GLubyte GLuint GLuint GLuint GLuint GLushort GLushort GLushort GLushort GLboolean const GLdouble const GLfloat const GLint const GLshort const GLbyte const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLdouble const GLfloat const GLfloat const GLint const GLint const GLshort const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort GLenum GLenum GLenum GLfloat GLenum GLint GLenum GLenum GLenum GLfloat GLenum GLenum GLint GLenum GLfloat GLenum GLint GLint GLushort GLenum GLenum GLfloat GLenum GLenum GLint GLfloat const GLubyte GLenum GLenum GLenum const GLfloat GLenum GLenum const GLint GLenum GLint GLint GLsizei GLsizei GLint GLenum GLenum const GLvoid GLenum GLenum const GLfloat GLenum GLenum const GLint GLenum GLenum const GLdouble GLenum GLenum const GLfloat GLenum GLenum const GLint GLsizei GLuint GLfloat GLuint GLbitfield GLfloat GLint GLuint GLboolean GLenum GLfloat GLenum GLbitfield GLenum GLfloat GLfloat GLint GLint const GLfloat GLenum GLfloat GLfloat GLint GLint GLfloat GLfloat GLint GLint const GLfloat GLint GLfloat GLfloat GLint GLfloat GLfloat GLint GLfloat GLfloat const GLdouble const GLfloat const GLdouble const GLfloat GLint i
Definition: glfuncs.h:248
LPFNDIRECTSOUNDDEVICEENUMERATECALLBACKW Callback
Definition: dsconf.h:147
int ret

Referenced by DSPROPERTY_Enumerate1(), DSPROPERTY_EnumerateA(), and IKsPrivatePropertySetImpl_Get().

◆ DSPROPERTY_enumWto1()

static BOOL CALLBACK DSPROPERTY_enumWto1 ( DSPROPERTY_DIRECTSOUNDDEVICE_DESCRIPTION_W_DATA descW,
void data 
)
static

Definition at line 415 of file propset.c.

Referenced by DSPROPERTY_Enumerate1().

◆ DSPROPERTY_enumWtoA()

static BOOL CALLBACK DSPROPERTY_enumWtoA ( DSPROPERTY_DIRECTSOUNDDEVICE_DESCRIPTION_W_DATA descW,
void data 
)
static

Definition at line 380 of file propset.c.

381{
384 BOOL ret;
385
386 ret = DSPROPERTY_descWtoA(descW, &descA);
387 if (!ret)
388 return FALSE;
389 ret = ppd->Callback(&descA, ppd->Context);
390 HeapFree(GetProcessHeap(), 0, descA.Module);
392 return ret;
393}

Referenced by DSPROPERTY_EnumerateA().

◆ DSPROPERTY_WaveDeviceMappingA()

static HRESULT DSPROPERTY_WaveDeviceMappingA ( LPVOID  pPropData,
ULONG  cbPropData,
PULONG  pcbReturned 
)
static

Definition at line 142 of file propset.c.

146{
149 DWORD len;
150 HRESULT hr;
151
152 TRACE("(pPropData=%p,cbPropData=%d,pcbReturned=%p)\n",
153 pPropData,cbPropData,pcbReturned);
154
155 if (!ppd || !ppd->DeviceName) {
156 WARN("invalid parameter: ppd=%p\n", ppd);
157 return DSERR_INVALIDPARAM;
158 }
159
160 data.DataFlow = ppd->DataFlow;
161 len = MultiByteToWideChar(CP_ACP, 0, ppd->DeviceName, -1, NULL, 0);
162 data.DeviceName = HeapAlloc(GetProcessHeap(), 0, len * sizeof(WCHAR));
163 if (!data.DeviceName)
164 return E_OUTOFMEMORY;
165 MultiByteToWideChar(CP_ACP, 0, ppd->DeviceName, -1, data.DeviceName, len);
166
167 hr = DSPROPERTY_WaveDeviceMappingW(&data, cbPropData, pcbReturned);
168 HeapFree(GetProcessHeap(), 0, data.DeviceName);
169 ppd->DeviceId = data.DeviceId;
170
171 if (pcbReturned)
172 *pcbReturned = cbPropData;
173
174 return hr;
175}
static HRESULT DSPROPERTY_WaveDeviceMappingW(LPVOID pPropData, ULONG cbPropData, PULONG pcbReturned)
Definition: propset.c:79
#define DSERR_INVALIDPARAM
Definition: dsound.h:121
GLenum GLsizei len
Definition: glext.h:6722

Referenced by IKsPrivatePropertySetImpl_Get().

◆ DSPROPERTY_WaveDeviceMappingW()

static HRESULT DSPROPERTY_WaveDeviceMappingW ( LPVOID  pPropData,
ULONG  cbPropData,
PULONG  pcbReturned 
)
static

Definition at line 79 of file propset.c.

83{
86 TRACE("(pPropData=%p,cbPropData=%d,pcbReturned=%p)\n",
87 pPropData,cbPropData,pcbReturned);
88
89 ppd = pPropData;
90
91 if (!ppd) {
92 WARN("invalid parameter: pPropData\n");
93 return DSERR_INVALIDPARAM;
94 }
95
97 ULONG wod;
98 unsigned int wodn;
99 TRACE("DataFlow=DIRECTSOUNDDEVICE_DATAFLOW_RENDER\n");
100 wodn = waveOutGetNumDevs();
101 for (wod = 0; wod < wodn; wod++) {
102 WAVEOUTCAPSW capsW;
104 res = waveOutGetDevCapsW(wod, &capsW, sizeof(capsW));
105 if (res == MMSYSERR_NOERROR) {
106 if (lstrcmpW(capsW.szPname, ppd->DeviceName) == 0) {
108 hr = DS_OK;
109 TRACE("found %s for %s\n", debugstr_guid(&ppd->DeviceId),
110 debugstr_w(ppd->DeviceName));
111 break;
112 }
113 }
114 }
115 } else if (ppd->DataFlow == DIRECTSOUNDDEVICE_DATAFLOW_CAPTURE) {
116 ULONG wid;
117 unsigned int widn;
118 TRACE("DataFlow=DIRECTSOUNDDEVICE_DATAFLOW_CAPTURE\n");
119 widn = waveInGetNumDevs();
120 for (wid = 0; wid < widn; wid++) {
121 WAVEINCAPSW capsW;
123 res = waveInGetDevCapsW(wid, &capsW, sizeof(capsW));
124 if (res == MMSYSERR_NOERROR) {
125 if (lstrcmpW(capsW.szPname, ppd->DeviceName) == 0) {
126 ppd->DeviceId = DSOUND_capture_guids[wid];
127 hr = DS_OK;
128 TRACE("found %s for %s\n", debugstr_guid(&ppd->DeviceId),
129 debugstr_w(ppd->DeviceName));
130 break;
131 }
132 }
133 }
134 }
135
136 if (pcbReturned)
137 *pcbReturned = cbPropData;
138
139 return hr;
140}
int WINAPI lstrcmpW(LPCWSTR str1, LPCWSTR str2)
Definition: locale.c:4242
#define DS_OK
Definition: dsound.h:116
GLuint res
Definition: glext.h:9613
#define debugstr_w
Definition: kernel32.h:32
UINT MMRESULT
Definition: mmsystem.h:962
WCHAR szPname[MAXPNAMELEN]
Definition: mmsystem.h:1060
WCHAR szPname[MAXPNAMELEN]
Definition: mmsystem.h:1039
UINT WINAPI waveOutGetDevCapsW(UINT_PTR uDeviceID, LPWAVEOUTCAPSW lpCaps, UINT uSize)
Definition: winmm.c:2173
UINT WINAPI waveInGetDevCapsW(UINT_PTR uDeviceID, LPWAVEINCAPSW lpCaps, UINT uSize)
Definition: winmm.c:2573

Referenced by DSPROPERTY_WaveDeviceMappingA(), and IKsPrivatePropertySetImpl_Get().

◆ IKsPrivatePropertySetImpl_AddRef()

static ULONG WINAPI IKsPrivatePropertySetImpl_AddRef ( LPKSPROPERTYSET  iface)
static

Definition at line 58 of file propset.c.

59{
62 TRACE("(%p) ref was %d\n", This, ref - 1);
63 return ref;
64}
#define InterlockedIncrement
Definition: armddk.h:53
static IKsPrivatePropertySetImpl * impl_from_IKsPropertySet(IKsPropertySet *iface)
Definition: propset.c:30
Definition: send.c:48

◆ IKsPrivatePropertySetImpl_Create()

HRESULT IKsPrivatePropertySetImpl_Create ( REFIID  riid,
IKsPropertySet **  piks 
)

Definition at line 615 of file propset.c.

618{
620 TRACE("(%s, %p)\n", debugstr_guid(riid), piks);
621
622 if (!IsEqualIID(riid, &IID_IUnknown) &&
624 *piks = 0;
625 return E_NOINTERFACE;
626 }
627
628 iks = HeapAlloc(GetProcessHeap(),0,sizeof(*iks));
629 iks->ref = 1;
630 iks->IKsPropertySet_iface.lpVtbl = &ikspvt;
631
632 *piks = &iks->IKsPropertySet_iface;
633 return S_OK;
634}
const GUID IID_IUnknown
const GUID IID_IKsPropertySet
Definition: controlnode.cpp:13
static const IKsPropertySetVtbl ikspvt
Definition: propset.c:606
REFIID riid
Definition: atlbase.h:39
#define IsEqualIID(riid1, riid2)
Definition: guiddef.h:95
IKsPropertySet IKsPropertySet_iface
Definition: propset.c:26
#define E_NOINTERFACE
Definition: winerror.h:2364

◆ IKsPrivatePropertySetImpl_Get()

static HRESULT WINAPI IKsPrivatePropertySetImpl_Get ( LPKSPROPERTYSET  iface,
REFGUID  guidPropSet,
ULONG  dwPropID,
LPVOID  pInstanceData,
ULONG  cbInstanceData,
LPVOID  pPropData,
ULONG  cbPropData,
PULONG  pcbReturned 
)
static

Definition at line 497 of file propset.c.

506{
508 TRACE("(iface=%p,guidPropSet=%s,dwPropID=%d,pInstanceData=%p,cbInstanceData=%d,pPropData=%p,cbPropData=%d,pcbReturned=%p)\n",
509 This,debugstr_guid(guidPropSet),dwPropID,pInstanceData,cbInstanceData,pPropData,cbPropData,pcbReturned);
510
511 if ( IsEqualGUID( &DSPROPSETID_DirectSoundDevice, guidPropSet) ) {
512 switch (dwPropID) {
514 return DSPROPERTY_WaveDeviceMappingA(pPropData,cbPropData,pcbReturned);
516 return DSPROPERTY_Description1(pPropData,cbPropData,pcbReturned);
518 return DSPROPERTY_Enumerate1(pPropData,cbPropData,pcbReturned);
520 return DSPROPERTY_WaveDeviceMappingW(pPropData,cbPropData,pcbReturned);
522 return DSPROPERTY_DescriptionA(pPropData,cbPropData,pcbReturned);
524 return DSPROPERTY_DescriptionW(pPropData,cbPropData,pcbReturned);
526 return DSPROPERTY_EnumerateA(pPropData,cbPropData,pcbReturned);
528 return DSPROPERTY_EnumerateW(pPropData,cbPropData,pcbReturned);
529 default:
530 FIXME("unsupported ID: %d\n",dwPropID);
531 break;
532 }
533 } else {
534 FIXME("unsupported property: %s\n",debugstr_guid(guidPropSet));
535 }
536
537 if (pcbReturned) {
538 *pcbReturned = 0;
539 FIXME("*pcbReturned=%d\n", *pcbReturned);
540 }
541
543}
#define FIXME(fmt,...)
Definition: precomp.h:53
static HRESULT DSPROPERTY_EnumerateA(LPVOID pPropData, ULONG cbPropData, PULONG pcbReturned)
Definition: propset.c:395
static HRESULT DSPROPERTY_DescriptionA(LPVOID pPropData, ULONG cbPropData, PULONG pcbReturned)
Definition: propset.c:446
static HRESULT DSPROPERTY_WaveDeviceMappingA(LPVOID pPropData, ULONG cbPropData, PULONG pcbReturned)
Definition: propset.c:142
static HRESULT DSPROPERTY_Enumerate1(LPVOID pPropData, ULONG cbPropData, PULONG pcbReturned)
Definition: propset.c:426
static HRESULT DSPROPERTY_Description1(LPVOID pPropData, ULONG cbPropData, PULONG pcbReturned)
Definition: propset.c:472
@ DSPROPERTY_DIRECTSOUNDDEVICE_DESCRIPTION_1
Definition: dsconf.h:18
@ DSPROPERTY_DIRECTSOUNDDEVICE_DESCRIPTION_A
Definition: dsconf.h:21
@ DSPROPERTY_DIRECTSOUNDDEVICE_WAVEDEVICEMAPPING_W
Definition: dsconf.h:20
@ DSPROPERTY_DIRECTSOUNDDEVICE_ENUMERATE_1
Definition: dsconf.h:19
@ DSPROPERTY_DIRECTSOUNDDEVICE_ENUMERATE_W
Definition: dsconf.h:24
@ DSPROPERTY_DIRECTSOUNDDEVICE_WAVEDEVICEMAPPING_A
Definition: dsconf.h:17
@ DSPROPERTY_DIRECTSOUNDDEVICE_DESCRIPTION_W
Definition: dsconf.h:22
@ DSPROPERTY_DIRECTSOUNDDEVICE_ENUMERATE_A
Definition: dsconf.h:23

◆ IKsPrivatePropertySetImpl_QueryInterface()

static HRESULT WINAPI IKsPrivatePropertySetImpl_QueryInterface ( LPKSPROPERTYSET  iface,
REFIID  riid,
LPVOID ppobj 
)
static

Definition at line 40 of file propset.c.

44{
46 TRACE("(%p,%s,%p)\n",This,debugstr_guid(riid),ppobj);
47
50 *ppobj = iface;
51 IUnknown_AddRef(iface);
52 return S_OK;
53 }
54 *ppobj = NULL;
55 return E_NOINTERFACE;
56}

◆ IKsPrivatePropertySetImpl_QuerySupport()

static HRESULT WINAPI IKsPrivatePropertySetImpl_QuerySupport ( LPKSPROPERTYSET  iface,
REFGUID  guidPropSet,
ULONG  dwPropID,
PULONG  pTypeSupport 
)
static

Definition at line 560 of file propset.c.

565{
567 TRACE("(%p,%s,%d,%p)\n",This,debugstr_guid(guidPropSet),dwPropID,pTypeSupport);
568
569 if ( IsEqualGUID( &DSPROPSETID_DirectSoundDevice, guidPropSet) ) {
570 switch (dwPropID) {
572 *pTypeSupport = KSPROPERTY_SUPPORT_GET;
573 return S_OK;
575 *pTypeSupport = KSPROPERTY_SUPPORT_GET;
576 return S_OK;
578 *pTypeSupport = KSPROPERTY_SUPPORT_GET;
579 return S_OK;
581 *pTypeSupport = KSPROPERTY_SUPPORT_GET;
582 return S_OK;
584 *pTypeSupport = KSPROPERTY_SUPPORT_GET;
585 return S_OK;
587 *pTypeSupport = KSPROPERTY_SUPPORT_GET;
588 return S_OK;
590 *pTypeSupport = KSPROPERTY_SUPPORT_GET;
591 return S_OK;
593 *pTypeSupport = KSPROPERTY_SUPPORT_GET;
594 return S_OK;
595 default:
596 FIXME("unsupported ID: %d\n",dwPropID);
597 break;
598 }
599 } else {
600 FIXME("unsupported property: %s\n",debugstr_guid(guidPropSet));
601 }
602
604}
#define KSPROPERTY_SUPPORT_GET
Definition: dsound.h:1129

◆ IKsPrivatePropertySetImpl_Release()

static ULONG WINAPI IKsPrivatePropertySetImpl_Release ( LPKSPROPERTYSET  iface)
static

Definition at line 66 of file propset.c.

67{
70 TRACE("(%p) ref was %d\n", This, ref + 1);
71
72 if (!ref) {
74 TRACE("(%p) released\n", This);
75 }
76 return ref;
77}
#define InterlockedDecrement
Definition: armddk.h:52

◆ IKsPrivatePropertySetImpl_Set()

static HRESULT WINAPI IKsPrivatePropertySetImpl_Set ( LPKSPROPERTYSET  iface,
REFGUID  guidPropSet,
ULONG  dwPropID,
LPVOID  pInstanceData,
ULONG  cbInstanceData,
LPVOID  pPropData,
ULONG  cbPropData 
)
static

Definition at line 545 of file propset.c.

553{
555
556 FIXME("(%p,%s,%d,%p,%d,%p,%d), stub!\n",This,debugstr_guid(guidPropSet),dwPropID,pInstanceData,cbInstanceData,pPropData,cbPropData);
558}

◆ impl_from_IKsPropertySet()

static IKsPrivatePropertySetImpl * impl_from_IKsPropertySet ( IKsPropertySet iface)
static

Variable Documentation

◆ ikspvt

const IKsPropertySetVtbl ikspvt
static
Initial value:
= {
}
static HRESULT WINAPI IKsPrivatePropertySetImpl_Set(LPKSPROPERTYSET iface, REFGUID guidPropSet, ULONG dwPropID, LPVOID pInstanceData, ULONG cbInstanceData, LPVOID pPropData, ULONG cbPropData)
Definition: propset.c:545
static ULONG WINAPI IKsPrivatePropertySetImpl_AddRef(LPKSPROPERTYSET iface)
Definition: propset.c:58
static HRESULT WINAPI IKsPrivatePropertySetImpl_QuerySupport(LPKSPROPERTYSET iface, REFGUID guidPropSet, ULONG dwPropID, PULONG pTypeSupport)
Definition: propset.c:560
static ULONG WINAPI IKsPrivatePropertySetImpl_Release(LPKSPROPERTYSET iface)
Definition: propset.c:66
static HRESULT WINAPI IKsPrivatePropertySetImpl_QueryInterface(LPKSPROPERTYSET iface, REFIID riid, LPVOID *ppobj)
Definition: propset.c:40
static HRESULT WINAPI IKsPrivatePropertySetImpl_Get(LPKSPROPERTYSET iface, REFGUID guidPropSet, ULONG dwPropID, LPVOID pInstanceData, ULONG cbInstanceData, LPVOID pPropData, ULONG cbPropData, PULONG pcbReturned)
Definition: propset.c:497

Definition at line 606 of file propset.c.

Referenced by IKsPrivatePropertySetImpl_Create().