ReactOS  0.4.13-dev-687-g023794c
wave.c
Go to the documentation of this file.
1 /*
2  * COPYRIGHT: See COPYING in the top level directory
3  * PROJECT: ReactOS Kernel Streaming
4  * FILE: lib/drivers/sound/mmixer/wave.c
5  * PURPOSE: Wave Handling Functions
6  * PROGRAMMER: Johannes Anderwald
7  */
8 
9 #include "precomp.h"
10 
11 #define YDEBUG
12 #include <debug.h>
13 
14 const GUID KSPROPSETID_Connection = {0x1D58C920L, 0xAC9B, 0x11CF, {0xA5, 0xD6, 0x28, 0xDB, 0x04, 0xC1, 0x00, 0x00}};
15 const GUID KSDATAFORMAT_SPECIFIER_WAVEFORMATEX = {0x05589f81L, 0xc356, 0x11ce, {0xbf, 0x01, 0x00, 0xaa, 0x00, 0x55, 0x59, 0x5a}};
16 const GUID KSDATAFORMAT_SUBTYPE_PCM = {0x00000001L, 0x0000, 0x0010, {0x80, 0x00, 0x00, 0xaa, 0x00, 0x38, 0x9b, 0x71}};
17 const GUID KSDATAFORMAT_TYPE_AUDIO = {0x73647561L, 0x0000, 0x0010, {0x80, 0x00, 0x00, 0xaa, 0x00, 0x38, 0x9b, 0x71}};
18 const GUID KSINTERFACESETID_Standard = {0x1A8766A0L, 0x62CE, 0x11CF, {0xA5, 0xD6, 0x28, 0xDB, 0x04, 0xC1, 0x00, 0x00}};
19 const GUID KSMEDIUMSETID_Standard = {0x4747B320L, 0x62CE, 0x11CF, {0xA5, 0xD6, 0x28, 0xDB, 0x04, 0xC1, 0x00, 0x00}};
20 
21 typedef struct
22 {
29 
30 #define AUDIO_TEST_RANGE (5)
31 
33 {
34  {
35  11025,
40  },
41  {
42  22050,
47  },
48  {
49  44100,
54  },
55  {
56  48000,
61  },
62  {
63  96000,
68  }
69 };
70 
74  ULONG DataFormatSize)
75 {
76  return MixerContext->Alloc(sizeof(KSPIN_CONNECT) + DataFormatSize);
77 }
78 
81  IN PMIXER_LIST MixerList,
82  IN ULONG DeviceIndex,
83  IN ULONG bWaveInType,
84  OUT LPWAVE_INFO *OutWaveInfo)
85 {
86  ULONG Index = 0;
87  PLIST_ENTRY Entry, ListHead;
88  LPWAVE_INFO WaveInfo;
89 
90  if (bWaveInType)
91  ListHead = &MixerList->WaveInList;
92  else
93  ListHead = &MixerList->WaveOutList;
94 
95  /* get first entry */
96  Entry = ListHead->Flink;
97 
98  while(Entry != ListHead)
99  {
101 
102  if (Index == DeviceIndex)
103  {
104  *OutWaveInfo = WaveInfo;
105  return MM_STATUS_SUCCESS;
106  }
107  Index++;
108  Entry = Entry->Flink;
109  }
110 
112 }
113 
114 
115 
116 
117 VOID
120  LPWAVEFORMATEX WaveFormatEx)
121 {
122 
123  DataFormat->WaveFormatEx.wFormatTag = WaveFormatEx->wFormatTag;
124  DataFormat->WaveFormatEx.nChannels = WaveFormatEx->nChannels;
125  DataFormat->WaveFormatEx.nSamplesPerSec = WaveFormatEx->nSamplesPerSec;
126  DataFormat->WaveFormatEx.nBlockAlign = WaveFormatEx->nBlockAlign;
127  DataFormat->WaveFormatEx.nAvgBytesPerSec = WaveFormatEx->nAvgBytesPerSec;
128  DataFormat->WaveFormatEx.wBitsPerSample = WaveFormatEx->wBitsPerSample;
129  DataFormat->WaveFormatEx.cbSize = 0;
130  DataFormat->DataFormat.FormatSize = sizeof(KSDATAFORMAT) + sizeof(WAVEFORMATEX);
131  DataFormat->DataFormat.Flags = 0;
132  DataFormat->DataFormat.Reserved = 0;
133  DataFormat->DataFormat.MajorFormat = KSDATAFORMAT_TYPE_AUDIO;
134 
135  DataFormat->DataFormat.SubFormat = KSDATAFORMAT_SUBTYPE_PCM;
136  DataFormat->DataFormat.Specifier = KSDATAFORMAT_SPECIFIER_WAVEFORMATEX;
137  DataFormat->DataFormat.SampleSize = 4;
138 }
139 
140 
144  IN HANDLE hDevice,
145  IN ULONG PinId,
146  IN OUT PKSMULTIPLE_ITEM * OutMultipleItem)
147 {
148  KSP_PIN PinProperty;
149  ULONG BytesReturned = 0;
151  PKSMULTIPLE_ITEM MultipleItem;
152 
153  /* retrieve size of data ranges buffer */
154  PinProperty.Reserved = 0;
155  PinProperty.PinId = PinId;
156  PinProperty.Property.Set = KSPROPSETID_Pin;
157  PinProperty.Property.Id = KSPROPERTY_PIN_DATARANGES;
158  PinProperty.Property.Flags = KSPROPERTY_TYPE_GET;
159 
160  Status = MixerContext->Control(hDevice, IOCTL_KS_PROPERTY, (PVOID)&PinProperty, sizeof(KSP_PIN), (PVOID)NULL, 0, &BytesReturned);
162  {
163  return Status;
164  }
165 
166  MultipleItem = MixerContext->Alloc(BytesReturned);
167  if (!MultipleItem)
168  {
169  /* not enough memory */
170  return MM_STATUS_NO_MEMORY;
171  }
172 
173  Status = MixerContext->Control(hDevice, IOCTL_KS_PROPERTY, (PVOID)&PinProperty, sizeof(KSP_PIN), (PVOID)MultipleItem, BytesReturned, &BytesReturned);
174  if (Status != MM_STATUS_SUCCESS)
175  {
176  /* failed */
177  MixerContext->Free(MultipleItem);
178  return Status;
179  }
180 
181  /* save result */
182  *OutMultipleItem = MultipleItem;
183  return Status;
184 }
185 
188  PKSMULTIPLE_ITEM MultipleItem,
189  PKSDATARANGE_AUDIO * OutDataRangeAudio)
190 {
191  ULONG Index;
192  PKSDATARANGE_AUDIO DataRangeAudio;
193  PKSDATARANGE DataRange;
194 
195  DataRange = (PKSDATARANGE) (MultipleItem + 1);
196  for(Index = 0; Index < MultipleItem->Count; Index++)
197  {
198  if (DataRange->FormatSize == sizeof(KSDATARANGE_AUDIO))
199  {
200  DataRangeAudio = (PKSDATARANGE_AUDIO)DataRange;
204  {
205  DPRINT("Min Sample %u Max Sample %u Min Bits %u Max Bits %u Max Channel %u\n", DataRangeAudio->MinimumSampleFrequency, DataRangeAudio->MaximumSampleFrequency,
206  DataRangeAudio->MinimumBitsPerSample, DataRangeAudio->MaximumBitsPerSample, DataRangeAudio->MaximumChannels);
207  *OutDataRangeAudio = DataRangeAudio;
208  return MM_STATUS_SUCCESS;
209  }
210  }
211  DataRange = (PKSDATARANGE)((ULONG_PTR)DataRange + DataRange->FormatSize);
212  }
213  return MM_STATUS_UNSUCCESSFUL;
214 }
215 
219  IN PMIXER_LIST MixerList,
220  IN ULONG DeviceId,
221  IN ULONG PinId,
222  IN LPWAVEFORMATEX WaveFormatEx,
224  IN PIN_CREATE_CALLBACK CreateCallback,
225  IN PVOID Context,
226  OUT PHANDLE PinHandle)
227 {
228  PKSPIN_CONNECT PinConnect;
230  LPMIXER_DATA MixerData;
232  MIXER_STATUS MixerStatus;
233 
234  MixerData = MMixerGetDataByDeviceId(MixerList, DeviceId);
235  if (!MixerData)
237 
238  /* allocate pin connect */
240  if (!PinConnect)
241  {
242  /* no memory */
243  return MM_STATUS_NO_MEMORY;
244  }
245 
246  /* initialize pin connect struct */
247  MMixerInitializePinConnect(PinConnect, PinId);
248 
249  /* get offset to dataformat */
250  DataFormat = (PKSDATAFORMAT_WAVEFORMATEX) (PinConnect + 1);
251  /* initialize with requested wave format */
252  MMixerInitializeDataFormat(DataFormat, WaveFormatEx);
253 
254  if (CreateCallback)
255  {
256  /* let the callback handle the creation */
257  MixerStatus = CreateCallback(Context, DeviceId, PinId, MixerData->hDevice, PinConnect, DesiredAccess, PinHandle);
258  }
259  else
260  {
261  /* now create the pin */
262  Status = KsCreatePin(MixerData->hDevice, PinConnect, DesiredAccess, PinHandle);
263 
264  /* normalize status */
265  if (Status == STATUS_SUCCESS)
266  MixerStatus = MM_STATUS_SUCCESS;
267  else
268  MixerStatus = MM_STATUS_UNSUCCESSFUL;
269  }
270 
271  /* free create info */
272  MixerContext->Free(PinConnect);
273 
274  /* done */
275  return MixerStatus;
276 }
277 
278 VOID
280  IN PKSDATARANGE_AUDIO DataRangeAudio,
281  IN LPWAVE_INFO WaveInfo,
282  IN ULONG bInput)
283 {
284  ULONG Index, SampleFrequency;
285  ULONG Result = 0;
286 
287  for(Index = 0; Index < AUDIO_TEST_RANGE; Index++)
288  {
289  SampleFrequency = TestRange[Index].SampleRate;
290 
291  if (DataRangeAudio->MinimumSampleFrequency <= SampleFrequency && DataRangeAudio->MaximumSampleFrequency >= SampleFrequency)
292  {
293  /* the audio adapter supports the sample frequency */
294  if (DataRangeAudio->MinimumBitsPerSample <= 8 && DataRangeAudio->MaximumBitsPerSample >= 8)
295  {
297 
298  if (DataRangeAudio->MaximumChannels > 1)
299  {
300  /* check if pin supports the sample rate in 8-Bit Stereo */
302  }
303  }
304 
305  if (DataRangeAudio->MinimumBitsPerSample <= 16 && DataRangeAudio->MaximumBitsPerSample >= 16)
306  {
307  /* check if pin supports the sample rate in 16-Bit Mono */
309 
310 
311  if (DataRangeAudio->MaximumChannels > 1)
312  {
313  /* check if pin supports the sample rate in 16-Bit Stereo */
315  }
316  }
317  }
318  }
319 
320 
321  if (bInput)
322  WaveInfo->u.InCaps.dwFormats = Result;
323  else
324  WaveInfo->u.OutCaps.dwFormats = Result;
325 
326  DPRINT("Format %lx bInput %u\n", Result, bInput);
327 }
328 
332  IN PMIXER_LIST MixerList,
333  IN LPMIXER_DATA MixerData,
335  IN ULONG bWaveIn,
336  IN ULONG PinCount,
337  IN PULONG Pins)
338 {
340  PKSMULTIPLE_ITEM MultipleItem;
341  PKSDATARANGE_AUDIO DataRangeAudio;
342  LPWAVE_INFO WaveInfo;
343 
344  WaveInfo = (LPWAVE_INFO)MixerContext->Alloc(sizeof(WAVE_INFO));
345  if (!WaveInfo)
346  return MM_STATUS_NO_MEMORY;
347 
348  if (PinCount > 1)
349  {
350  /* FIXME support multiple pins for wave device */
351  DPRINT1("Implement support for multiple pins\n");
352  //ASSERT(PinCount == 1);
353  }
354 
355  /* initialize wave info */
356  WaveInfo->DeviceId = MixerData->DeviceId;
357  WaveInfo->PinId = Pins[0];
358 
359  /* sanity check */
361 
362  /* copy device name */
363  if (bWaveIn)
364  {
365  wcscpy(WaveInfo->u.InCaps.szPname, DeviceName);
366  }
367  else
368  {
369  wcscpy(WaveInfo->u.OutCaps.szPname, DeviceName);
370  }
371 
372  /* FIXME determine manufacturer / product id */
373  if (bWaveIn)
374  {
375  WaveInfo->u.InCaps.wMid = MM_MICROSOFT;
376  WaveInfo->u.InCaps.wPid = MM_PID_UNMAPPED;
377  WaveInfo->u.InCaps.vDriverVersion = 1;
378  }
379  else
380  {
381  WaveInfo->u.OutCaps.wMid = MM_MICROSOFT;
382  WaveInfo->u.OutCaps.wPid = MM_PID_UNMAPPED;
383  WaveInfo->u.OutCaps.vDriverVersion = 1;
384  }
385 
386  /* get audio pin data ranges */
387  Status = MMixerGetAudioPinDataRanges(MixerContext, MixerData->hDevice, Pins[0], &MultipleItem);
388  if (Status != MM_STATUS_SUCCESS)
389  {
390  /* failed to get audio pin data ranges */
391  MixerContext->Free(WaveInfo);
392  return MM_STATUS_UNSUCCESSFUL;
393  }
394 
395  /* find an KSDATARANGE_AUDIO range */
396  Status = MMixerFindAudioDataRange(MultipleItem, &DataRangeAudio);
397  if (Status != MM_STATUS_SUCCESS)
398  {
399  /* failed to find audio pin data range */
400  MixerContext->Free(MultipleItem);
401  MixerContext->Free(WaveInfo);
402  return MM_STATUS_UNSUCCESSFUL;
403  }
404 
405  /* store channel count */
406  if (bWaveIn)
407  {
408  WaveInfo->u.InCaps.wChannels = DataRangeAudio->MaximumChannels;
409  }
410  else
411  {
412  WaveInfo->u.OutCaps.wChannels = DataRangeAudio->MaximumChannels;
413  }
414 
415  /* get all supported formats */
416  MMixerCheckFormat(DataRangeAudio, WaveInfo, bWaveIn);
417 
418  /* free dataranges buffer */
419  MixerContext->Free(MultipleItem);
420 
421  if (bWaveIn)
422  {
423  InsertTailList(&MixerList->WaveInList, &WaveInfo->Entry);
424  MixerList->WaveInListCount++;
425  }
426  else
427  {
428  InsertTailList(&MixerList->WaveOutList, &WaveInfo->Entry);
429  MixerList->WaveOutListCount++;
430  }
431 
432  return MM_STATUS_SUCCESS;
433 }
434 
438  IN ULONG DeviceIndex,
439  IN ULONG bWaveIn,
440  IN LPWAVEFORMATEX WaveFormat,
441  IN PIN_CREATE_CALLBACK CreateCallback,
442  IN PVOID Context,
443  OUT PHANDLE PinHandle)
444 {
445  PMIXER_LIST MixerList;
447  LPWAVE_INFO WaveInfo;
449 
450  /* verify mixer context */
452 
453  if (Status != MM_STATUS_SUCCESS)
454  {
455  /* invalid context passed */
456  return Status;
457  }
458 
459  /* grab mixer list */
460  MixerList = (PMIXER_LIST)MixerContext->MixerContext;
461 
462  if (WaveFormat->wFormatTag != WAVE_FORMAT_PCM)
463  {
464  /* not implemented */
466  }
467 
468  /* find destination wave */
469  Status = MMixerGetWaveInfoByIndexAndType(MixerList, DeviceIndex, bWaveIn, &WaveInfo);
470  if (Status != MM_STATUS_SUCCESS)
471  {
472  /* failed to find wave info */
474  }
475 
476  /* get desired access */
477  if (bWaveIn)
478  {
480  }
481  else
482  {
484  }
485 
486  /* now try open the pin */
487  return MMixerOpenWavePin(MixerContext, MixerList, WaveInfo->DeviceId, WaveInfo->PinId, WaveFormat, DesiredAccess, CreateCallback, Context, PinHandle);
488 }
489 
493  IN ULONG DeviceIndex,
494  OUT LPWAVEINCAPSW Caps)
495 {
496  PMIXER_LIST MixerList;
498  LPWAVE_INFO WaveInfo;
499 
500  /* verify mixer context */
502 
503  if (Status != MM_STATUS_SUCCESS)
504  {
505  /* invalid context passed */
506  return Status;
507  }
508 
509  /* grab mixer list */
510  MixerList = (PMIXER_LIST)MixerContext->MixerContext;
511 
512  /* find destination wave */
513  Status = MMixerGetWaveInfoByIndexAndType(MixerList, DeviceIndex, TRUE, &WaveInfo);
514  if (Status != MM_STATUS_SUCCESS)
515  {
516  /* failed to find wave info */
517  return MM_STATUS_UNSUCCESSFUL;
518  }
519 
520  /* copy capabilities */
521  MixerContext->Copy(Caps, &WaveInfo->u.InCaps, sizeof(WAVEINCAPSW));
522 
523  return MM_STATUS_SUCCESS;
524 }
525 
529  IN ULONG DeviceIndex,
530  OUT LPWAVEOUTCAPSW Caps)
531 {
532  PMIXER_LIST MixerList;
534  LPWAVE_INFO WaveInfo;
535 
536  /* verify mixer context */
538 
539  if (Status != MM_STATUS_SUCCESS)
540  {
541  /* invalid context passed */
542  return Status;
543  }
544 
545  /* grab mixer list */
546  MixerList = (PMIXER_LIST)MixerContext->MixerContext;
547 
548  /* find destination wave */
549  Status = MMixerGetWaveInfoByIndexAndType(MixerList, DeviceIndex, FALSE, &WaveInfo);
550  if (Status != MM_STATUS_SUCCESS)
551  {
552  /* failed to find wave info */
553  return MM_STATUS_UNSUCCESSFUL;
554  }
555 
556  /* copy capabilities */
557  MixerContext->Copy(Caps, &WaveInfo->u.OutCaps, sizeof(WAVEOUTCAPSW));
558 
559  return MM_STATUS_SUCCESS;
560 }
561 
562 ULONG
565 {
566  PMIXER_LIST MixerList;
568 
569  /* verify mixer context */
571 
572  if (Status != MM_STATUS_SUCCESS)
573  {
574  /* invalid context passed */
575  return Status;
576  }
577 
578  /* grab mixer list */
579  MixerList = (PMIXER_LIST)MixerContext->MixerContext;
580 
581  return MixerList->WaveInListCount;
582 }
583 
584 ULONG
587 {
588  PMIXER_LIST MixerList;
590 
591  /* verify mixer context */
593 
594  if (Status != MM_STATUS_SUCCESS)
595  {
596  /* invalid context passed */
597  return Status;
598  }
599 
600  /* grab mixer list */
601  MixerList = (PMIXER_LIST)MixerContext->MixerContext;
602 
603  return MixerList->WaveOutListCount;
604 }
605 
609  IN HANDLE PinHandle,
610  IN KSSTATE State)
611 {
613  ULONG Length;
615 
616  /* verify mixer context */
618 
619  if (Status != MM_STATUS_SUCCESS)
620  {
621  /* invalid context passed */
622  return Status;
623  }
624 
625  /* setup property request */
629 
630  return MixerContext->Control(PinHandle, IOCTL_KS_PROPERTY, &Property, sizeof(KSPROPERTY), &State, sizeof(KSSTATE), &Length);
631 }
632 
636  IN HANDLE PinHandle,
637  IN ULONG bBegin)
638 {
639  ULONG Length;
641  KSRESET Reset;
642 
643  /* verify mixer context */
645 
646  if (Status != MM_STATUS_SUCCESS)
647  {
648  /* invalid context passed */
649  return Status;
650  }
651 
652  /* begin / stop reset */
653  Reset = (bBegin ? KSRESET_BEGIN : KSRESET_END);
654 
655  return MixerContext->Control(PinHandle, IOCTL_KS_RESET_STATE, &Reset, sizeof(KSRESET), NULL, 0, &Length);
656 }
657 
661  IN ULONG bWaveIn,
662  IN ULONG DeviceId,
663  OUT LPWSTR * DevicePath)
664 {
665  PMIXER_LIST MixerList;
666  LPMIXER_DATA MixerData;
667  LPWAVE_INFO WaveInfo;
668  SIZE_T Length;
670 
671  /* verify mixer context */
673 
674  if (Status != MM_STATUS_SUCCESS)
675  {
676  /* invalid context passed */
677  return Status;
678  }
679 
680  /* grab mixer list */
681  MixerList = (PMIXER_LIST)MixerContext->MixerContext;
682 
683  /* find destination wave */
684  Status = MMixerGetWaveInfoByIndexAndType(MixerList, DeviceId, bWaveIn, &WaveInfo);
685  if (Status != MM_STATUS_SUCCESS)
686  {
687  /* failed to find wave info */
689  }
690 
691  /* get associated device id */
692  MixerData = MMixerGetDataByDeviceId(MixerList, WaveInfo->DeviceId);
693  if (!MixerData)
695 
696  /* calculate length */
697  Length = wcslen(MixerData->DeviceName)+1;
698 
699  /* allocate destination buffer */
700  *DevicePath = MixerContext->Alloc(Length * sizeof(WCHAR));
701 
702  if (!*DevicePath)
703  {
704  /* no memory */
705  return MM_STATUS_NO_MEMORY;
706  }
707 
708  /* copy device path */
709  MixerContext->Copy(*DevicePath, MixerData->DeviceName, Length * sizeof(WCHAR));
710 
711  /* done */
712  return MM_STATUS_SUCCESS;
713 }
ULONG Count
Definition: ks.h:2010
#define WAVE_FORMAT_48S16
Definition: winmm_test.h:23
VOID MMixerInitializeDataFormat(IN PKSDATAFORMAT_WAVEFORMATEX DataFormat, LPWAVEFORMATEX WaveFormatEx)
Definition: wave.c:118
#define IOCTL_KS_PROPERTY
Definition: ks.h:150
#define IN
Definition: typedefs.h:38
const GUID KSPROPSETID_Connection
Definition: wave.c:14
MIXER_STATUS MMixerSetWaveStatus(IN PMIXER_CONTEXT MixerContext, IN HANDLE PinHandle, IN KSSTATE State)
Definition: wave.c:607
#define TRUE
Definition: types.h:120
#define WAVE_FORMAT_1M08
Definition: mmsystem.h:206
ULONG Bit16Stereo
Definition: wave.c:27
KSDDKAPI DWORD NTAPI KsCreatePin(HANDLE FilterHandle, PKSPIN_CONNECT Connect, ACCESS_MASK DesiredAccess, PHANDLE ConnectionHandle)
Definition: ksuser.c:192
MIXER_STATUS MMixerGetWaveInfoByIndexAndType(IN PMIXER_LIST MixerList, IN ULONG DeviceIndex, IN ULONG bWaveInType, OUT LPWAVE_INFO *OutWaveInfo)
Definition: wave.c:80
struct _Entry Entry
Definition: kefuncs.h:640
#define WAVE_FORMAT_96S08
Definition: winmm_test.h:25
WCHAR szPname[MAXPNAMELEN]
Definition: mmsystem.h:1060
struct WAVE_INFO * LPWAVE_INFO
const GUID KSDATAFORMAT_TYPE_AUDIO
Definition: wave.c:17
ULONG Bit8Stereo
Definition: wave.c:25
MIXER_STATUS MMixerGetAudioPinDataRanges(IN PMIXER_CONTEXT MixerContext, IN HANDLE hDevice, IN ULONG PinId, IN OUT PKSMULTIPLE_ITEM *OutMultipleItem)
Definition: wave.c:142
#define WAVE_FORMAT_48S08
Definition: winmm_test.h:21
PKSPIN_CONNECT MMixerAllocatePinConnect(IN PMIXER_CONTEXT MixerContext, ULONG DataFormatSize)
Definition: wave.c:72
MIXER_STATUS MMixerWaveOutCapabilities(IN PMIXER_CONTEXT MixerContext, IN ULONG DeviceIndex, OUT LPWAVEOUTCAPSW Caps)
Definition: wave.c:527
#define WAVE_FORMAT_4M16
Definition: mmsystem.h:216
DWORD nAvgBytesPerSec
Definition: mmreg.h:81
ULONG MaximumBitsPerSample
Definition: ksmedia.h:582
WORD nChannels
Definition: mmreg.h:79
LIST_ENTRY Entry
Definition: precomp.h:124
LONG NTSTATUS
Definition: precomp.h:26
LPWSTR DeviceName
Definition: precomp.h:117
ULONG Bit8Mono
Definition: wave.c:24
MIXER_STATUS MMixerInitializeWaveInfo(IN PMIXER_CONTEXT MixerContext, IN PMIXER_LIST MixerList, IN LPMIXER_DATA MixerData, IN LPWSTR DeviceName, IN ULONG bWaveIn, IN ULONG PinCount, IN PULONG Pins)
Definition: wave.c:330
LPMIXER_DATA MMixerGetDataByDeviceId(IN PMIXER_LIST MixerList, IN ULONG DeviceId)
Definition: sup.c:736
WCHAR DeviceName[]
Definition: adapter.cpp:21
#define InsertTailList(ListHead, Entry)
ULONG MMixerGetWaveOutCount(IN PMIXER_CONTEXT MixerContext)
Definition: wave.c:585
_In_ const GUID _In_ ULONG PinCount
Definition: strmini.h:504
#define KSPROPERTY_TYPE_GET
Definition: dmksctrl.h:42
GUID Set
Definition: dmksctrl.h:76
#define IOCTL_KS_RESET_STATE
Definition: ks.h:171
#define IsEqualGUIDAligned(guid1, guid2)
Definition: wdm.template.h:233
uint32_t ULONG_PTR
Definition: typedefs.h:63
ULONG DeviceId
Definition: precomp.h:125
MIXER_STATUS MMixerOpenWave(IN PMIXER_CONTEXT MixerContext, IN ULONG DeviceIndex, IN ULONG bWaveIn, IN LPWAVEFORMATEX WaveFormat, IN PIN_CREATE_CALLBACK CreateCallback, IN PVOID Context, OUT PHANDLE PinHandle)
Definition: wave.c:436
ULONG SampleRate
Definition: wave.c:23
#define WAVE_FORMAT_PCM
Definition: constants.h:425
#define WAVE_FORMAT_1S08
Definition: mmsystem.h:207
MIXER_STATUS MMixerVerifyContext(IN PMIXER_CONTEXT MixerContext)
Definition: sup.c:41
ULONG PinId
Definition: precomp.h:126
MIXER_CONTEXT MixerContext
Definition: mmixer.c:46
PMIXER_DEVICE_CONTROL Control
Definition: mmixer.h:95
const GUID KSDATAFORMAT_SUBTYPE_PCM
Definition: wave.c:16
MMVERSION vDriverVersion
Definition: mmsystem.h:1059
#define MM_PID_UNMAPPED
Definition: mmreg.h:141
#define WAVE_FORMAT_2M08
Definition: mmsystem.h:210
#define GENERIC_WRITE
Definition: nt_native.h:90
KSPROPERTY Property
Definition: ks.h:673
KSDATARANGE DataRange
Definition: ksmedia.h:579
#define WAVE_FORMAT_4S16
Definition: mmsystem.h:217
#define WAVE_FORMAT_2M16
Definition: mmsystem.h:212
#define WAVE_FORMAT_96S16
Definition: winmm_test.h:27
#define WAVE_FORMAT_4S08
Definition: mmsystem.h:215
smooth NULL
Definition: ftsmooth.c:416
_At_(*)(_In_ PWSK_CLIENT Client, _In_opt_ PUNICODE_STRING NodeName, _In_opt_ PUNICODE_STRING ServiceName, _In_opt_ ULONG NameSpace, _In_opt_ GUID *Provider, _In_opt_ PADDRINFOEXW Hints, _Outptr_ PADDRINFOEXW *Result, _In_opt_ PEPROCESS OwningProcess, _In_opt_ PETHREAD OwningThread, _Inout_ PIRP Irp Result)(Mem)) NTSTATUS(WSKAPI *PFN_WSK_GET_ADDRESS_INFO
Definition: wsk.h:426
HANDLE hDevice
Definition: precomp.h:115
void DPRINT(...)
Definition: polytest.cpp:61
#define WAVE_FORMAT_48M16
Definition: winmm_test.h:22
PFLT_MESSAGE_WAITER_QUEUE CONTAINING_RECORD(Csq, DEVICE_EXTENSION, IrpQueue)) -> WaiterQ.mLock) _IRQL_raises_(DISPATCH_LEVEL) VOID NTAPI FltpAcquireMessageWaiterLock(_In_ PIO_CSQ Csq, _Out_ PKIRQL Irql)
Definition: Messaging.c:560
MIXER_STATUS MMixerFindAudioDataRange(PKSMULTIPLE_ITEM MultipleItem, PKSDATARANGE_AUDIO *OutDataRangeAudio)
Definition: wave.c:187
ULONG PinId
Definition: ks.h:674
MIXER_STATUS MMixerSetWaveResetState(IN PMIXER_CONTEXT MixerContext, IN HANDLE PinHandle, IN ULONG bBegin)
Definition: wave.c:634
#define WAVE_FORMAT_2S16
Definition: mmsystem.h:213
struct _LIST_ENTRY * Flink
Definition: typedefs.h:119
VOID MMixerCheckFormat(IN PKSDATARANGE_AUDIO DataRangeAudio, IN LPWAVE_INFO WaveInfo, IN ULONG bInput)
Definition: wave.c:279
Definition: ks.h:672
PMIXER_FREE Free
Definition: mmixer.h:96
WAVEINCAPSW InCaps
Definition: precomp.h:130
ULONG Id
Definition: dmksctrl.h:77
if(!(yy_init))
Definition: macro.lex.yy.c:714
__wchar_t WCHAR
Definition: xmlstorage.h:180
MIXER_STATUS MMixerWaveInCapabilities(IN PMIXER_CONTEXT MixerContext, IN ULONG DeviceIndex, OUT LPWAVEINCAPSW Caps)
Definition: wave.c:491
ULONG MinimumSampleFrequency
Definition: ksmedia.h:583
static const UCHAR Index[8]
Definition: usbohci.c:18
ULONG MaximumChannels
Definition: ksmedia.h:580
#define WAVE_FORMAT_4M08
Definition: mmsystem.h:214
const GUID KSMEDIUMSETID_Standard
Definition: wave.c:19
_In_ ULONG _In_ ULONG _In_ ULONG Length
Definition: ntddpcm.h:101
struct KSDATARANGE_AUDIO * PKSDATARANGE_AUDIO
WCHAR szPname[MAXPNAMELEN]
Definition: mmsystem.h:1039
ASSERT((InvokeOnSuccess||InvokeOnError||InvokeOnCancel) ?(CompletionRoutine !=NULL) :TRUE)
#define WAVE_FORMAT_1S16
Definition: mmsystem.h:209
WORD wFormatTag
Definition: mmreg.h:78
ULONG Flags
Definition: dmksctrl.h:78
_CRTIMP wchar_t *__cdecl wcscpy(_Out_writes_z_(_String_length_(_Source)+1) wchar_t *_Dest, _In_z_ const wchar_t *_Source)
static const WCHAR L[]
Definition: oid.c:1250
ULONG Reserved
Definition: ks.h:675
#define MM_MICROSOFT
Definition: mmreg.h:144
WAVEOUTCAPSW OutCaps
Definition: precomp.h:129
PVOID *typedef PHANDLE
Definition: ntsecpkg.h:414
PMIXER_ALLOC Alloc
Definition: mmixer.h:94
#define GENERIC_READ
Definition: compat.h:124
Definition: typedefs.h:117
MIXER_STATUS(* PIN_CREATE_CALLBACK)(IN PVOID Context, IN ULONG DeviceId, IN ULONG PinId, IN HANDLE hFilter, IN PKSPIN_CONNECT PinConnect, IN ACCESS_MASK DesiredAccess, OUT PHANDLE PinHandle)
Definition: mmixer.h:80
static AUDIO_RANGE TestRange[AUDIO_TEST_RANGE]
Definition: wave.c:32
union WAVE_INFO::@3942 u
Status
Definition: gdiplustypes.h:24
MIXER_STATUS MMixerOpenWavePin(IN PMIXER_CONTEXT MixerContext, IN PMIXER_LIST MixerList, IN ULONG DeviceId, IN ULONG PinId, IN LPWAVEFORMATEX WaveFormatEx, IN ACCESS_MASK DesiredAccess, IN PIN_CREATE_CALLBACK CreateCallback, IN PVOID Context, OUT PHANDLE PinHandle)
Definition: wave.c:217
union KSDATAFORMAT * PKSDATARANGE
_In_ DWORD Property
Definition: setupapi.h:1545
MMVERSION vDriverVersion
Definition: mmsystem.h:1038
ULONG_PTR SIZE_T
Definition: typedefs.h:78
#define WAVE_FORMAT_96M08
Definition: winmm_test.h:24
struct KSDATAFORMAT_WAVEFORMATEX * PKSDATAFORMAT_WAVEFORMATEX
KSSTATE
Definition: ks.h:1244
ULONG MaximumSampleFrequency
Definition: ksmedia.h:584
MIXER_STATUS
Definition: mmixer.h:3
PVOID MixerContext
Definition: mmixer.h:92
_In_ PIO_STACK_LOCATION _Inout_ PFILE_OBJECT _Inout_ PVCB _Outptr_result_maybenull_ PDCB _In_ PDCB _In_ PDIRENT _In_ ULONG _In_ ULONG _In_ PUNICODE_STRING _In_ PACCESS_MASK DesiredAccess
Definition: create.c:4157
_In_ FILTER_INFORMATION_CLASS _In_ ULONG _Out_ PULONG BytesReturned
Definition: fltkernel.h:1716
#define WAVE_FORMAT_2S08
Definition: mmsystem.h:211
#define KSPROPSETID_Pin
Definition: ks.h:647
unsigned int * PULONG
Definition: retypes.h:1
const GUID KSINTERFACESETID_Standard
Definition: wave.c:18
#define MAXPNAMELEN
Definition: mmsystem.h:24
#define DPRINT1
Definition: precomp.h:8
#define AUDIO_TEST_RANGE
Definition: wave.c:30
ULONG MinimumBitsPerSample
Definition: ksmedia.h:581
struct MIXER_LIST * PMIXER_LIST
DWORD nSamplesPerSec
Definition: mmreg.h:80
WORD nBlockAlign
Definition: mmreg.h:82
#define OUT
Definition: typedefs.h:39
WORD wBitsPerSample
Definition: mmreg.h:83
unsigned int ULONG
Definition: retypes.h:1
#define WAVE_FORMAT_1M16
Definition: mmsystem.h:208
#define WAVE_FORMAT_96M16
Definition: winmm_test.h:26
ULONG WaveOutListCount
Definition: precomp.h:158
ULONG WaveInListCount
Definition: precomp.h:155
WCHAR * LPWSTR
Definition: xmlstorage.h:184
const GUID KSDATAFORMAT_SPECIFIER_WAVEFORMATEX
Definition: wave.c:15
return STATUS_SUCCESS
Definition: btrfs.c:2777
PMIXER_COPY Copy
Definition: mmixer.h:99
MIXER_STATUS MMixerGetWaveDevicePath(IN PMIXER_CONTEXT MixerContext, IN ULONG bWaveIn, IN ULONG DeviceId, OUT LPWSTR *DevicePath)
Definition: wave.c:659
#define KSPROPERTY_TYPE_SET
Definition: dmksctrl.h:43
size_t __cdecl wcslen(_In_z_ const wchar_t *_Str)
ULONG ACCESS_MASK
Definition: nt_native.h:40
base of all file and directory entries
Definition: entries.h:82
#define WAVE_FORMAT_48M08
Definition: winmm_test.h:20
ULONG Bit16Mono
Definition: wave.c:26
KSRESET
Definition: ks.h:1256
ULONG MMixerGetWaveInCount(IN PMIXER_CONTEXT MixerContext)
Definition: wave.c:563
VOID MMixerInitializePinConnect(IN OUT PKSPIN_CONNECT PinConnect, IN ULONG PinId)
Definition: sup.c:901