ReactOS 0.4.15-dev-8241-g63935f8
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 NDEBUG
12#include <debug.h>
13
14const GUID KSPROPSETID_Connection = {0x1D58C920L, 0xAC9B, 0x11CF, {0xA5, 0xD6, 0x28, 0xDB, 0x04, 0xC1, 0x00, 0x00}};
15const GUID KSDATAFORMAT_SPECIFIER_WAVEFORMATEX = {0x05589f81L, 0xc356, 0x11ce, {0xbf, 0x01, 0x00, 0xaa, 0x00, 0x55, 0x59, 0x5a}};
16const GUID KSDATAFORMAT_SUBTYPE_PCM = {0x00000001L, 0x0000, 0x0010, {0x80, 0x00, 0x00, 0xaa, 0x00, 0x38, 0x9b, 0x71}};
17const GUID KSDATAFORMAT_TYPE_AUDIO = {0x73647561L, 0x0000, 0x0010, {0x80, 0x00, 0x00, 0xaa, 0x00, 0x38, 0x9b, 0x71}};
18const GUID KSINTERFACESETID_Standard = {0x1A8766A0L, 0x62CE, 0x11CF, {0xA5, 0xD6, 0x28, 0xDB, 0x04, 0xC1, 0x00, 0x00}};
19const GUID KSMEDIUMSETID_Standard = {0x4747B320L, 0x62CE, 0x11CF, {0xA5, 0xD6, 0x28, 0xDB, 0x04, 0xC1, 0x00, 0x00}};
20
21typedef 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
114VOID
117 _In_ LPWAVEFORMATEX WaveFormatEx,
118 _In_ DWORD cbSize)
119{
120 DataFormat->WaveFormatEx.wFormatTag = WaveFormatEx->wFormatTag;
121 DataFormat->WaveFormatEx.nChannels = WaveFormatEx->nChannels;
122 DataFormat->WaveFormatEx.nSamplesPerSec = WaveFormatEx->nSamplesPerSec;
123 DataFormat->WaveFormatEx.nBlockAlign = WaveFormatEx->nBlockAlign;
124 DataFormat->WaveFormatEx.nAvgBytesPerSec = WaveFormatEx->nAvgBytesPerSec;
125 DataFormat->WaveFormatEx.wBitsPerSample = WaveFormatEx->wBitsPerSample;
126 DataFormat->WaveFormatEx.cbSize = cbSize;
127 DataFormat->DataFormat.FormatSize = sizeof(KSDATAFORMAT) + sizeof(WAVEFORMATEX) + cbSize;
128 DataFormat->DataFormat.Flags = 0;
129 DataFormat->DataFormat.Reserved = 0;
130 DataFormat->DataFormat.MajorFormat = KSDATAFORMAT_TYPE_AUDIO;
131 DataFormat->DataFormat.SubFormat = KSDATAFORMAT_SUBTYPE_PCM;
132 DataFormat->DataFormat.Specifier = KSDATAFORMAT_SPECIFIER_WAVEFORMATEX;
133 DataFormat->DataFormat.SampleSize = 4;
134
135 /* Write additional fields for Extensible audio format */
136 if (WaveFormatEx->wFormatTag == WAVE_FORMAT_EXTENSIBLE)
137 {
138 PWAVEFORMATEXTENSIBLE WaveFormatExt = (PWAVEFORMATEXTENSIBLE)&DataFormat->WaveFormatEx;
139 WaveFormatExt->SubFormat = KSDATAFORMAT_SUBTYPE_PCM;
140 WaveFormatExt->Samples.wValidBitsPerSample = WaveFormatEx->wBitsPerSample;
141 if (WaveFormatEx->nChannels == 0)
143 else if (WaveFormatEx->nChannels == 1)
144 WaveFormatExt->dwChannelMask = KSAUDIO_SPEAKER_MONO;
145 else if (WaveFormatEx->nChannels == 2)
146 WaveFormatExt->dwChannelMask = KSAUDIO_SPEAKER_STEREO;
147 else if (WaveFormatEx->nChannels == 4)
148 WaveFormatExt->dwChannelMask = KSAUDIO_SPEAKER_QUAD;
149 else if (WaveFormatEx->nChannels == 5)
150 WaveFormatExt->dwChannelMask = KSAUDIO_SPEAKER_5POINT1;
151 else if (WaveFormatEx->nChannels == 7)
152 WaveFormatExt->dwChannelMask = KSAUDIO_SPEAKER_7POINT1;
153 }
154}
155
159 IN HANDLE hDevice,
160 IN ULONG PinId,
161 IN OUT PKSMULTIPLE_ITEM * OutMultipleItem)
162{
163 KSP_PIN PinProperty;
166 PKSMULTIPLE_ITEM MultipleItem;
167
168 /* retrieve size of data ranges buffer */
169 PinProperty.Reserved = 0;
170 PinProperty.PinId = PinId;
171 PinProperty.Property.Set = KSPROPSETID_Pin;
173 PinProperty.Property.Flags = KSPROPERTY_TYPE_GET;
174
175 Status = MixerContext->Control(hDevice, IOCTL_KS_PROPERTY, (PVOID)&PinProperty, sizeof(KSP_PIN), (PVOID)NULL, 0, &BytesReturned);
177 {
178 return Status;
179 }
180
181 MultipleItem = MixerContext->Alloc(BytesReturned);
182 if (!MultipleItem)
183 {
184 /* not enough memory */
185 return MM_STATUS_NO_MEMORY;
186 }
187
188 Status = MixerContext->Control(hDevice, IOCTL_KS_PROPERTY, (PVOID)&PinProperty, sizeof(KSP_PIN), (PVOID)MultipleItem, BytesReturned, &BytesReturned);
190 {
191 /* failed */
192 MixerContext->Free(MultipleItem);
193 return Status;
194 }
195
196 /* save result */
197 *OutMultipleItem = MultipleItem;
198 return Status;
199}
200
203 PKSMULTIPLE_ITEM MultipleItem,
204 PKSDATARANGE_AUDIO * OutDataRangeAudio)
205{
206 ULONG Index;
207 PKSDATARANGE_AUDIO DataRangeAudio;
208 PKSDATARANGE DataRange;
209
210 DataRange = (PKSDATARANGE) (MultipleItem + 1);
211 for(Index = 0; Index < MultipleItem->Count; Index++)
212 {
213 if (DataRange->FormatSize == sizeof(KSDATARANGE_AUDIO))
214 {
215 DataRangeAudio = (PKSDATARANGE_AUDIO)DataRange;
219 {
220 DPRINT("Min Sample %u Max Sample %u Min Bits %u Max Bits %u Max Channel %u\n", DataRangeAudio->MinimumSampleFrequency, DataRangeAudio->MaximumSampleFrequency,
221 DataRangeAudio->MinimumBitsPerSample, DataRangeAudio->MaximumBitsPerSample, DataRangeAudio->MaximumChannels);
222 *OutDataRangeAudio = DataRangeAudio;
223 return MM_STATUS_SUCCESS;
224 }
225 }
226 DataRange = (PKSDATARANGE)((ULONG_PTR)DataRange + DataRange->FormatSize);
227 }
229}
230
234 IN PMIXER_LIST MixerList,
235 IN ULONG DeviceId,
236 IN ULONG PinId,
237 IN LPWAVEFORMATEX WaveFormatEx,
239 IN PIN_CREATE_CALLBACK CreateCallback,
241 OUT PHANDLE PinHandle)
242{
243 PKSPIN_CONNECT PinConnect;
245 LPMIXER_DATA MixerData;
247 MIXER_STATUS MixerStatus;
248 DWORD cbSize;
249
250 MixerData = MMixerGetDataByDeviceId(MixerList, DeviceId);
251 if (!MixerData)
253
254 /* Enforce 0 for WAVE_FORMAT_PCM, which ignores extra information size */
255 cbSize = WaveFormatEx->wFormatTag == WAVE_FORMAT_PCM ? 0 : WaveFormatEx->cbSize;
256
257 /* allocate pin connect */
259 if (!PinConnect)
260 {
261 /* no memory */
262 return MM_STATUS_NO_MEMORY;
263 }
264
265 /* initialize pin connect struct */
266 MMixerInitializePinConnect(PinConnect, PinId);
267
268 /* get offset to dataformat */
269 DataFormat = (PKSDATAFORMAT_WAVEFORMATEX) (PinConnect + 1);
270 /* initialize with requested wave format */
271 MMixerInitializeDataFormat(DataFormat, WaveFormatEx, cbSize);
272
273 if (CreateCallback)
274 {
275 /* let the callback handle the creation */
276 MixerStatus = CreateCallback(Context, DeviceId, PinId, MixerData->hDevice, PinConnect, DesiredAccess, PinHandle);
277 }
278 else
279 {
280 /* now create the pin */
281 Status = KsCreatePin(MixerData->hDevice, PinConnect, DesiredAccess, PinHandle);
282
283 /* normalize status */
284 if (Status == STATUS_SUCCESS)
285 MixerStatus = MM_STATUS_SUCCESS;
286 else
287 MixerStatus = MM_STATUS_UNSUCCESSFUL;
288 }
289
290 /* free create info */
291 MixerContext->Free(PinConnect);
292
293 /* done */
294 return MixerStatus;
295}
296
297VOID
299 IN PKSDATARANGE_AUDIO DataRangeAudio,
300 IN LPWAVE_INFO WaveInfo,
301 IN ULONG bInput)
302{
303 ULONG Index, SampleFrequency;
304 ULONG Result = 0;
305
306 for(Index = 0; Index < AUDIO_TEST_RANGE; Index++)
307 {
308 SampleFrequency = TestRange[Index].SampleRate;
309
310 if (DataRangeAudio->MinimumSampleFrequency <= SampleFrequency && DataRangeAudio->MaximumSampleFrequency >= SampleFrequency)
311 {
312 /* the audio adapter supports the sample frequency */
313 if (DataRangeAudio->MinimumBitsPerSample <= 8 && DataRangeAudio->MaximumBitsPerSample >= 8)
314 {
316
317 if (DataRangeAudio->MaximumChannels > 1)
318 {
319 /* check if pin supports the sample rate in 8-Bit Stereo */
321 }
322 }
323
324 if (DataRangeAudio->MinimumBitsPerSample <= 16 && DataRangeAudio->MaximumBitsPerSample >= 16)
325 {
326 /* check if pin supports the sample rate in 16-Bit Mono */
328
329 if (DataRangeAudio->MaximumChannels > 1)
330 {
331 /* check if pin supports the sample rate in 16-Bit Stereo */
333 }
334 }
335 }
336 }
337
338 if (bInput)
339 WaveInfo->u.InCaps.dwFormats = Result;
340 else
341 WaveInfo->u.OutCaps.dwFormats = Result;
342
343 DPRINT("Format %lx bInput %u\n", Result, bInput);
344}
345
349 IN PMIXER_LIST MixerList,
350 IN LPMIXER_DATA MixerData,
352 IN ULONG bWaveIn,
354 IN PULONG Pins)
355{
357 PKSMULTIPLE_ITEM MultipleItem;
358 PKSDATARANGE_AUDIO DataRangeAudio;
359 LPWAVE_INFO WaveInfo;
360
361 WaveInfo = (LPWAVE_INFO)MixerContext->Alloc(sizeof(WAVE_INFO));
362 if (!WaveInfo)
363 return MM_STATUS_NO_MEMORY;
364
365 if (PinCount > 1)
366 {
367 /* FIXME support multiple pins for wave device */
368 DPRINT1("Implement support for multiple pins\n");
369 //ASSERT(PinCount == 1);
370 }
371
372 /* initialize wave info */
373 WaveInfo->DeviceId = MixerData->DeviceId;
374 WaveInfo->PinId = Pins[0];
375
376 /* sanity check */
378
379 /* copy device name */
380 if (bWaveIn)
381 {
382 wcscpy(WaveInfo->u.InCaps.szPname, DeviceName);
383 }
384 else
385 {
386 wcscpy(WaveInfo->u.OutCaps.szPname, DeviceName);
387 }
388
389 /* FIXME determine manufacturer / product id */
390 if (bWaveIn)
391 {
392 WaveInfo->u.InCaps.wMid = MM_MICROSOFT;
393 WaveInfo->u.InCaps.wPid = MM_PID_UNMAPPED;
394 WaveInfo->u.InCaps.vDriverVersion = 1;
395 }
396 else
397 {
398 WaveInfo->u.OutCaps.wMid = MM_MICROSOFT;
399 WaveInfo->u.OutCaps.wPid = MM_PID_UNMAPPED;
400 WaveInfo->u.OutCaps.vDriverVersion = 1;
401 }
402
403 /* get audio pin data ranges */
404 Status = MMixerGetAudioPinDataRanges(MixerContext, MixerData->hDevice, Pins[0], &MultipleItem);
406 {
407 /* failed to get audio pin data ranges */
408 MixerContext->Free(WaveInfo);
410 }
411
412 /* find an KSDATARANGE_AUDIO range */
413 Status = MMixerFindAudioDataRange(MultipleItem, &DataRangeAudio);
415 {
416 /* failed to find audio pin data range */
417 MixerContext->Free(MultipleItem);
418 MixerContext->Free(WaveInfo);
420 }
421
422 /* store channel count */
423 if (bWaveIn)
424 {
425 WaveInfo->u.InCaps.wChannels = DataRangeAudio->MaximumChannels;
426 }
427 else
428 {
429 WaveInfo->u.OutCaps.wChannels = DataRangeAudio->MaximumChannels;
430 }
431
432 /* get all supported formats */
433 MMixerCheckFormat(DataRangeAudio, WaveInfo, bWaveIn);
434
435 /* free dataranges buffer */
436 MixerContext->Free(MultipleItem);
437
438 if (bWaveIn)
439 {
440 InsertTailList(&MixerList->WaveInList, &WaveInfo->Entry);
441 MixerList->WaveInListCount++;
442 }
443 else
444 {
445 InsertTailList(&MixerList->WaveOutList, &WaveInfo->Entry);
446 MixerList->WaveOutListCount++;
447 }
448
449 return MM_STATUS_SUCCESS;
450}
451
455 IN ULONG DeviceIndex,
456 IN ULONG bWaveIn,
457 IN LPWAVEFORMATEX WaveFormat,
458 IN PIN_CREATE_CALLBACK CreateCallback,
460 OUT PHANDLE PinHandle)
461{
462 PMIXER_LIST MixerList;
464 LPWAVE_INFO WaveInfo;
466
467 /* verify mixer context */
469
471 {
472 /* invalid context passed */
473 return Status;
474 }
475
476 /* grab mixer list */
478
479 /* find destination wave */
480 Status = MMixerGetWaveInfoByIndexAndType(MixerList, DeviceIndex, bWaveIn, &WaveInfo);
482 {
483 /* failed to find wave info */
485 }
486
487 /* get desired access */
488 if (bWaveIn)
489 {
491 }
492 else
493 {
495 }
496
497 /* now try open the pin */
498 return MMixerOpenWavePin(MixerContext, MixerList, WaveInfo->DeviceId, WaveInfo->PinId, WaveFormat, DesiredAccess, CreateCallback, Context, PinHandle);
499}
500
504 IN ULONG DeviceIndex,
505 OUT LPWAVEINCAPSW Caps)
506{
507 PMIXER_LIST MixerList;
509 LPWAVE_INFO WaveInfo;
510
511 /* verify mixer context */
513
515 {
516 /* invalid context passed */
517 return Status;
518 }
519
520 /* grab mixer list */
522
523 /* find destination wave */
524 Status = MMixerGetWaveInfoByIndexAndType(MixerList, DeviceIndex, TRUE, &WaveInfo);
526 {
527 /* failed to find wave info */
529 }
530
531 /* copy capabilities */
532 MixerContext->Copy(Caps, &WaveInfo->u.InCaps, sizeof(WAVEINCAPSW));
533
534 return MM_STATUS_SUCCESS;
535}
536
540 IN ULONG DeviceIndex,
541 OUT LPWAVEOUTCAPSW Caps)
542{
543 PMIXER_LIST MixerList;
545 LPWAVE_INFO WaveInfo;
546
547 /* verify mixer context */
549
551 {
552 /* invalid context passed */
553 return Status;
554 }
555
556 /* grab mixer list */
558
559 /* find destination wave */
560 Status = MMixerGetWaveInfoByIndexAndType(MixerList, DeviceIndex, FALSE, &WaveInfo);
562 {
563 /* failed to find wave info */
565 }
566
567 /* copy capabilities */
568 MixerContext->Copy(Caps, &WaveInfo->u.OutCaps, sizeof(WAVEOUTCAPSW));
569
570 return MM_STATUS_SUCCESS;
571}
572
573ULONG
576{
577 PMIXER_LIST MixerList;
579
580 /* verify mixer context */
582
584 {
585 /* invalid context passed */
586 return Status;
587 }
588
589 /* grab mixer list */
591
592 return MixerList->WaveInListCount;
593}
594
595ULONG
598{
599 PMIXER_LIST MixerList;
601
602 /* verify mixer context */
604
606 {
607 /* invalid context passed */
608 return Status;
609 }
610
611 /* grab mixer list */
613
614 return MixerList->WaveOutListCount;
615}
616
620 _In_ HANDLE PinHandle,
622{
623 KSAUDIO_POSITION AudioPosition;
627
628 /* Validate mixer context */
630
632 return Status;
633
637
639 &Property, sizeof(Property),
640 &AudioPosition, sizeof(AudioPosition),
641 &Length);
643 {
644 /* store audio position */
645 *Position = (DWORD)AudioPosition.PlayOffset;
646 }
647
648 return Status;
649}
650
654 IN HANDLE PinHandle,
656{
660
661 /* verify mixer context */
663
665 {
666 /* invalid context passed */
667 return Status;
668 }
669
670 /* setup property request */
674
675 return MixerContext->Control(PinHandle, IOCTL_KS_PROPERTY, &Property, sizeof(KSPROPERTY), &State, sizeof(KSSTATE), &Length);
676}
677
681 IN HANDLE PinHandle,
682 IN ULONG bBegin)
683{
686 KSRESET Reset;
687
688 /* verify mixer context */
690
692 {
693 /* invalid context passed */
694 return Status;
695 }
696
697 /* begin / stop reset */
698 Reset = (bBegin ? KSRESET_BEGIN : KSRESET_END);
699
700 return MixerContext->Control(PinHandle, IOCTL_KS_RESET_STATE, &Reset, sizeof(KSRESET), NULL, 0, &Length);
701}
702
706 IN ULONG bWaveIn,
707 IN ULONG DeviceId,
708 OUT LPWSTR * DevicePath)
709{
710 PMIXER_LIST MixerList;
711 LPMIXER_DATA MixerData;
712 LPWAVE_INFO WaveInfo;
715
716 /* verify mixer context */
718
720 {
721 /* invalid context passed */
722 return Status;
723 }
724
725 /* grab mixer list */
727
728 /* find destination wave */
729 Status = MMixerGetWaveInfoByIndexAndType(MixerList, DeviceId, bWaveIn, &WaveInfo);
731 {
732 /* failed to find wave info */
734 }
735
736 /* get associated device id */
737 MixerData = MMixerGetDataByDeviceId(MixerList, WaveInfo->DeviceId);
738 if (!MixerData)
740
741 /* calculate length */
742 Length = wcslen(MixerData->DeviceName)+1;
743
744 /* allocate destination buffer */
745 *DevicePath = MixerContext->Alloc(Length * sizeof(WCHAR));
746
747 if (!*DevicePath)
748 {
749 /* no memory */
750 return MM_STATUS_NO_MEMORY;
751 }
752
753 /* copy device path */
754 MixerContext->Copy(*DevicePath, MixerData->DeviceName, Length * sizeof(WCHAR));
755
756 /* done */
757 return MM_STATUS_SUCCESS;
758}
LONG NTSTATUS
Definition: precomp.h:26
#define WAVE_FORMAT_PCM
Definition: constants.h:425
#define DPRINT1
Definition: precomp.h:8
#define NULL
Definition: types.h:112
#define TRUE
Definition: types.h:120
#define FALSE
Definition: types.h:117
#define GENERIC_READ
Definition: compat.h:135
MIXER_CONTEXT MixerContext
Definition: mmixer.c:41
#define KSPROPERTY_TYPE_SET
Definition: dmksctrl.h:43
#define KSPROPERTY_TYPE_GET
Definition: dmksctrl.h:42
#define InsertTailList(ListHead, Entry)
unsigned long DWORD
Definition: ntddk_ex.h:95
Status
Definition: gdiplustypes.h:25
_CRTIMP size_t __cdecl wcslen(_In_z_ const wchar_t *_Str)
KSRESET
Definition: ks.h:1226
@ KSRESET_BEGIN
Definition: ks.h:1227
@ KSRESET_END
Definition: ks.h:1228
@ KSPROPERTY_CONNECTION_STATE
Definition: ks.h:349
#define IOCTL_KS_RESET_STATE
Definition: ks.h:145
#define IOCTL_KS_PROPERTY
Definition: ks.h:127
#define KSPROPSETID_Pin
Definition: ks.h:617
@ KSPROPERTY_PIN_DATARANGES
Definition: ks.h:628
KSSTATE
Definition: ks.h:1214
union KSDATAFORMAT * PKSDATARANGE
@ KSPROPERTY_AUDIO_POSITION
Definition: ksmedia.h:1058
struct KSDATAFORMAT_WAVEFORMATEX * PKSDATAFORMAT_WAVEFORMATEX
#define KSAUDIO_SPEAKER_MONO
Definition: ksmedia.h:1453
#define KSAUDIO_SPEAKER_5POINT1
Definition: ksmedia.h:1459
#define KSDATAFORMAT_SUBTYPE_PCM
Definition: ksmedia.h:1021
struct KSDATARANGE_AUDIO * PKSDATARANGE_AUDIO
#define KSAUDIO_SPEAKER_QUAD
Definition: ksmedia.h:1455
#define WAVE_FORMAT_EXTENSIBLE
Definition: ksmedia.h:651
struct WAVEFORMATEXTENSIBLE * PWAVEFORMATEXTENSIBLE
#define KSAUDIO_SPEAKER_STEREO
Definition: ksmedia.h:1454
#define KSAUDIO_SPEAKER_DIRECTOUT
Definition: ksmedia.h:1450
#define KSPROPSETID_Audio
Definition: ksmedia.h:1051
#define KSAUDIO_SPEAKER_7POINT1
Definition: ksmedia.h:1462
KSDDKAPI DWORD NTAPI KsCreatePin(HANDLE FilterHandle, PKSPIN_CONNECT Connect, ACCESS_MASK DesiredAccess, PHANDLE ConnectionHandle)
Definition: ksuser.c:192
if(dx< 0)
Definition: linetemp.h:194
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
MIXER_STATUS
Definition: mmixer.h:4
@ MM_STATUS_UNSUCCESSFUL
Definition: mmixer.h:11
@ MM_STATUS_INVALID_PARAMETER
Definition: mmixer.h:10
@ MM_STATUS_NO_MEMORY
Definition: mmixer.h:12
@ MM_STATUS_SUCCESS
Definition: mmixer.h:5
@ MM_STATUS_MORE_ENTRIES
Definition: mmixer.h:9
#define MM_PID_UNMAPPED
Definition: mmreg.h:141
#define MM_MICROSOFT
Definition: mmreg.h:144
#define WAVE_FORMAT_2S08
Definition: mmsystem.h:211
#define WAVE_FORMAT_1M08
Definition: mmsystem.h:206
#define WAVE_FORMAT_2M08
Definition: mmsystem.h:210
#define WAVE_FORMAT_2M16
Definition: mmsystem.h:212
#define WAVE_FORMAT_4S08
Definition: mmsystem.h:215
#define WAVE_FORMAT_1S08
Definition: mmsystem.h:207
#define WAVE_FORMAT_4M16
Definition: mmsystem.h:216
#define WAVE_FORMAT_1S16
Definition: mmsystem.h:209
#define WAVE_FORMAT_4M08
Definition: mmsystem.h:214
#define MAXPNAMELEN
Definition: mmsystem.h:24
#define WAVE_FORMAT_4S16
Definition: mmsystem.h:217
#define WAVE_FORMAT_1M16
Definition: mmsystem.h:208
#define WAVE_FORMAT_2S16
Definition: mmsystem.h:213
#define ASSERT(a)
Definition: mode.c:44
#define _Inout_
Definition: ms_sal.h:378
#define _Out_
Definition: ms_sal.h:345
#define _In_
Definition: ms_sal.h:308
ULONG ACCESS_MASK
Definition: nt_native.h:40
#define DWORD
Definition: nt_native.h:44
#define GENERIC_WRITE
Definition: nt_native.h:90
_In_ ULONG _In_ ULONG _In_ ULONG Length
Definition: ntddpcm.h:102
PVOID *typedef PHANDLE
Definition: ntsecpkg.h:455
DWORD * PDWORD
Definition: pedump.c:68
_CRTIMP wchar_t *__cdecl wcscpy(_Out_writes_z_(_String_length_(_Source)+1) wchar_t *_Dest, _In_z_ const wchar_t *_Source)
struct WAVE_INFO * LPWAVE_INFO
VOID MMixerInitializePinConnect(IN OUT PKSPIN_CONNECT PinConnect, IN ULONG PinId)
Definition: sup.c:901
struct MIXER_LIST * PMIXER_LIST
MIXER_STATUS MMixerVerifyContext(IN PMIXER_CONTEXT MixerContext)
Definition: sup.c:40
LPMIXER_DATA MMixerGetDataByDeviceId(IN PMIXER_LIST MixerList, IN ULONG DeviceId)
Definition: sup.c:735
VOID MMixerInitializeDataFormat(_Inout_ PKSDATAFORMAT_WAVEFORMATEX DataFormat, _In_ LPWAVEFORMATEX WaveFormatEx, _In_ DWORD cbSize)
Definition: wave.c:115
MIXER_STATUS MMixerSetWaveStatus(IN PMIXER_CONTEXT MixerContext, IN HANDLE PinHandle, IN KSSTATE State)
Definition: wave.c:652
PKSPIN_CONNECT MMixerAllocatePinConnect(IN PMIXER_CONTEXT MixerContext, ULONG DataFormatSize)
Definition: wave.c:72
const GUID KSPROPSETID_Connection
Definition: wave.c:14
VOID MMixerCheckFormat(IN PKSDATARANGE_AUDIO DataRangeAudio, IN LPWAVE_INFO WaveInfo, IN ULONG bInput)
Definition: wave.c:298
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:232
const GUID KSINTERFACESETID_Standard
Definition: wave.c:18
const GUID KSDATAFORMAT_TYPE_AUDIO
Definition: wave.c:17
const GUID KSDATAFORMAT_SPECIFIER_WAVEFORMATEX
Definition: wave.c:15
static AUDIO_RANGE TestRange[AUDIO_TEST_RANGE]
Definition: wave.c:32
MIXER_STATUS MMixerFindAudioDataRange(PKSMULTIPLE_ITEM MultipleItem, PKSDATARANGE_AUDIO *OutDataRangeAudio)
Definition: wave.c:202
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:347
#define AUDIO_TEST_RANGE
Definition: wave.c:30
ULONG MMixerGetWaveInCount(IN PMIXER_CONTEXT MixerContext)
Definition: wave.c:574
MIXER_STATUS MMixerWaveOutCapabilities(IN PMIXER_CONTEXT MixerContext, IN ULONG DeviceIndex, OUT LPWAVEOUTCAPSW Caps)
Definition: wave.c:538
MIXER_STATUS MMixerGetWaveDevicePath(IN PMIXER_CONTEXT MixerContext, IN ULONG bWaveIn, IN ULONG DeviceId, OUT LPWSTR *DevicePath)
Definition: wave.c:704
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:453
MIXER_STATUS MMixerGetAudioPinDataRanges(IN PMIXER_CONTEXT MixerContext, IN HANDLE hDevice, IN ULONG PinId, IN OUT PKSMULTIPLE_ITEM *OutMultipleItem)
Definition: wave.c:157
MIXER_STATUS MMixerWaveInCapabilities(IN PMIXER_CONTEXT MixerContext, IN ULONG DeviceIndex, OUT LPWAVEINCAPSW Caps)
Definition: wave.c:502
const GUID KSMEDIUMSETID_Standard
Definition: wave.c:19
MIXER_STATUS MMixerSetWaveResetState(IN PMIXER_CONTEXT MixerContext, IN HANDLE PinHandle, IN ULONG bBegin)
Definition: wave.c:679
ULONG MMixerGetWaveOutCount(IN PMIXER_CONTEXT MixerContext)
Definition: wave.c:596
MIXER_STATUS MMixerGetWaveInfoByIndexAndType(IN PMIXER_LIST MixerList, IN ULONG DeviceIndex, IN ULONG bWaveInType, OUT LPWAVE_INFO *OutWaveInfo)
Definition: wave.c:80
MIXER_STATUS MMixerGetWavePosition(_In_ PMIXER_CONTEXT MixerContext, _In_ HANDLE PinHandle, _Out_ PDWORD Position)
Definition: wave.c:618
#define STATUS_SUCCESS
Definition: shellext.h:65
#define DPRINT
Definition: sndvol32.h:73
_In_ const GUID _In_ ULONG PinCount
Definition: strmini.h:505
ULONG SampleRate
Definition: wave.c:23
ULONG Bit16Mono
Definition: wave.c:26
ULONG Bit8Stereo
Definition: wave.c:25
ULONG Bit16Stereo
Definition: wave.c:27
ULONG Bit8Mono
Definition: wave.c:24
base of all file and directory entries
Definition: entries.h:83
DWORDLONG PlayOffset
Definition: ksmedia.h:1250
ULONG MaximumChannels
Definition: ksmedia.h:680
ULONG MinimumBitsPerSample
Definition: ksmedia.h:681
ULONG MaximumBitsPerSample
Definition: ksmedia.h:682
ULONG MaximumSampleFrequency
Definition: ksmedia.h:684
KSDATARANGE DataRange
Definition: ksmedia.h:679
ULONG MinimumSampleFrequency
Definition: ksmedia.h:683
ULONG Id
Definition: dmksctrl.h:77
ULONG Flags
Definition: dmksctrl.h:78
GUID Set
Definition: dmksctrl.h:76
ULONG Count
Definition: ks.h:1980
Definition: ks.h:642
ULONG Reserved
Definition: ks.h:645
KSPROPERTY Property
Definition: ks.h:643
ULONG PinId
Definition: ks.h:644
PMIXER_DEVICE_CONTROL Control
Definition: mmixer.h:95
PMIXER_COPY Copy
Definition: mmixer.h:99
PVOID MixerContext
Definition: mmixer.h:92
PMIXER_FREE Free
Definition: mmixer.h:96
PMIXER_ALLOC Alloc
Definition: mmixer.h:94
HANDLE hDevice
Definition: precomp.h:115
LPWSTR DeviceName
Definition: precomp.h:117
ULONG WaveOutListCount
Definition: precomp.h:158
ULONG WaveInListCount
Definition: precomp.h:155
WORD wValidBitsPerSample
Definition: ksmedia.h:641
union WAVEFORMATEXTENSIBLE::@3040 Samples
LIST_ENTRY Entry
Definition: precomp.h:124
ULONG DeviceId
Definition: precomp.h:125
ULONG PinId
Definition: precomp.h:126
union WAVE_INFO::@4348 u
WAVEOUTCAPSW OutCaps
Definition: precomp.h:129
WAVEINCAPSW InCaps
Definition: precomp.h:130
Definition: typedefs.h:120
struct _LIST_ENTRY * Flink
Definition: typedefs.h:121
WCHAR szPname[MAXPNAMELEN]
Definition: mmsystem.h:1060
MMVERSION vDriverVersion
Definition: mmsystem.h:1059
MMVERSION vDriverVersion
Definition: mmsystem.h:1038
WCHAR szPname[MAXPNAMELEN]
Definition: mmsystem.h:1039
static COORD Position
Definition: mouse.c:34
uint32_t * PULONG
Definition: typedefs.h:59
ULONG_PTR SIZE_T
Definition: typedefs.h:80
uint32_t ULONG_PTR
Definition: typedefs.h:65
#define IN
Definition: typedefs.h:39
#define CONTAINING_RECORD(address, type, field)
Definition: typedefs.h:260
uint32_t ULONG
Definition: typedefs.h:59
#define OUT
Definition: typedefs.h:40
_In_ WDFCOLLECTION _In_ ULONG Index
_Must_inspect_result_ _In_ WDFDEVICE _In_ ULONG _In_ ACCESS_MASK DesiredAccess
Definition: wdfdevice.h:2658
_Must_inspect_result_ _In_ PWDFDEVICE_INIT _In_opt_ PCUNICODE_STRING DeviceName
Definition: wdfdevice.h:3275
_Must_inspect_result_ _In_ WDFIOTARGET _In_opt_ WDFREQUEST _In_ ULONG _In_opt_ PWDF_MEMORY_DESCRIPTOR _In_opt_ PWDF_MEMORY_DESCRIPTOR _In_opt_ PWDF_REQUEST_SEND_OPTIONS _Out_opt_ PULONG_PTR BytesReturned
Definition: wdfiotarget.h:1052
#define IsEqualGUIDAligned(guid1, guid2)
Definition: wdm.template.h:235
#define WAVE_FORMAT_48S16
Definition: winmm_test.h:23
#define WAVE_FORMAT_48M16
Definition: winmm_test.h:22
#define WAVE_FORMAT_96S08
Definition: winmm_test.h:25
#define WAVE_FORMAT_96M16
Definition: winmm_test.h:26
#define WAVE_FORMAT_96S16
Definition: winmm_test.h:27
#define WAVE_FORMAT_48M08
Definition: winmm_test.h:20
#define WAVE_FORMAT_48S08
Definition: winmm_test.h:21
#define WAVE_FORMAT_96M08
Definition: winmm_test.h:24
_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:409
__wchar_t WCHAR
Definition: xmlstorage.h:180
WCHAR * LPWSTR
Definition: xmlstorage.h:184