ReactOS 0.4.15-dev-7674-gc0b4db1
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 LPWAVEFORMATEX WaveFormatEx)
118{
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 = 0;
127 DataFormat->DataFormat.FormatSize = sizeof(KSDATAFORMAT) + sizeof(WAVEFORMATEX);
128 DataFormat->DataFormat.Flags = 0;
129 DataFormat->DataFormat.Reserved = 0;
130 DataFormat->DataFormat.MajorFormat = KSDATAFORMAT_TYPE_AUDIO;
131
132 DataFormat->DataFormat.SubFormat = KSDATAFORMAT_SUBTYPE_PCM;
133 DataFormat->DataFormat.Specifier = KSDATAFORMAT_SPECIFIER_WAVEFORMATEX;
134 DataFormat->DataFormat.SampleSize = 4;
135}
136
140 IN HANDLE hDevice,
141 IN ULONG PinId,
142 IN OUT PKSMULTIPLE_ITEM * OutMultipleItem)
143{
144 KSP_PIN PinProperty;
147 PKSMULTIPLE_ITEM MultipleItem;
148
149 /* retrieve size of data ranges buffer */
150 PinProperty.Reserved = 0;
151 PinProperty.PinId = PinId;
152 PinProperty.Property.Set = KSPROPSETID_Pin;
154 PinProperty.Property.Flags = KSPROPERTY_TYPE_GET;
155
156 Status = MixerContext->Control(hDevice, IOCTL_KS_PROPERTY, (PVOID)&PinProperty, sizeof(KSP_PIN), (PVOID)NULL, 0, &BytesReturned);
158 {
159 return Status;
160 }
161
162 MultipleItem = MixerContext->Alloc(BytesReturned);
163 if (!MultipleItem)
164 {
165 /* not enough memory */
166 return MM_STATUS_NO_MEMORY;
167 }
168
169 Status = MixerContext->Control(hDevice, IOCTL_KS_PROPERTY, (PVOID)&PinProperty, sizeof(KSP_PIN), (PVOID)MultipleItem, BytesReturned, &BytesReturned);
171 {
172 /* failed */
173 MixerContext->Free(MultipleItem);
174 return Status;
175 }
176
177 /* save result */
178 *OutMultipleItem = MultipleItem;
179 return Status;
180}
181
184 PKSMULTIPLE_ITEM MultipleItem,
185 PKSDATARANGE_AUDIO * OutDataRangeAudio)
186{
187 ULONG Index;
188 PKSDATARANGE_AUDIO DataRangeAudio;
189 PKSDATARANGE DataRange;
190
191 DataRange = (PKSDATARANGE) (MultipleItem + 1);
192 for(Index = 0; Index < MultipleItem->Count; Index++)
193 {
194 if (DataRange->FormatSize == sizeof(KSDATARANGE_AUDIO))
195 {
196 DataRangeAudio = (PKSDATARANGE_AUDIO)DataRange;
200 {
201 DPRINT("Min Sample %u Max Sample %u Min Bits %u Max Bits %u Max Channel %u\n", DataRangeAudio->MinimumSampleFrequency, DataRangeAudio->MaximumSampleFrequency,
202 DataRangeAudio->MinimumBitsPerSample, DataRangeAudio->MaximumBitsPerSample, DataRangeAudio->MaximumChannels);
203 *OutDataRangeAudio = DataRangeAudio;
204 return MM_STATUS_SUCCESS;
205 }
206 }
207 DataRange = (PKSDATARANGE)((ULONG_PTR)DataRange + DataRange->FormatSize);
208 }
210}
211
215 IN PMIXER_LIST MixerList,
216 IN ULONG DeviceId,
217 IN ULONG PinId,
218 IN LPWAVEFORMATEX WaveFormatEx,
220 IN PIN_CREATE_CALLBACK CreateCallback,
222 OUT PHANDLE PinHandle)
223{
224 PKSPIN_CONNECT PinConnect;
226 LPMIXER_DATA MixerData;
228 MIXER_STATUS MixerStatus;
229
230 MixerData = MMixerGetDataByDeviceId(MixerList, DeviceId);
231 if (!MixerData)
233
234 /* allocate pin connect */
236 if (!PinConnect)
237 {
238 /* no memory */
239 return MM_STATUS_NO_MEMORY;
240 }
241
242 /* initialize pin connect struct */
243 MMixerInitializePinConnect(PinConnect, PinId);
244
245 /* get offset to dataformat */
246 DataFormat = (PKSDATAFORMAT_WAVEFORMATEX) (PinConnect + 1);
247 /* initialize with requested wave format */
249
250 if (CreateCallback)
251 {
252 /* let the callback handle the creation */
253 MixerStatus = CreateCallback(Context, DeviceId, PinId, MixerData->hDevice, PinConnect, DesiredAccess, PinHandle);
254 }
255 else
256 {
257 /* now create the pin */
258 Status = KsCreatePin(MixerData->hDevice, PinConnect, DesiredAccess, PinHandle);
259
260 /* normalize status */
261 if (Status == STATUS_SUCCESS)
262 MixerStatus = MM_STATUS_SUCCESS;
263 else
264 MixerStatus = MM_STATUS_UNSUCCESSFUL;
265 }
266
267 /* free create info */
268 MixerContext->Free(PinConnect);
269
270 /* done */
271 return MixerStatus;
272}
273
274VOID
276 IN PKSDATARANGE_AUDIO DataRangeAudio,
277 IN LPWAVE_INFO WaveInfo,
278 IN ULONG bInput)
279{
280 ULONG Index, SampleFrequency;
281 ULONG Result = 0;
282
283 for(Index = 0; Index < AUDIO_TEST_RANGE; Index++)
284 {
285 SampleFrequency = TestRange[Index].SampleRate;
286
287 if (DataRangeAudio->MinimumSampleFrequency <= SampleFrequency && DataRangeAudio->MaximumSampleFrequency >= SampleFrequency)
288 {
289 /* the audio adapter supports the sample frequency */
290 if (DataRangeAudio->MinimumBitsPerSample <= 8 && DataRangeAudio->MaximumBitsPerSample >= 8)
291 {
293
294 if (DataRangeAudio->MaximumChannels > 1)
295 {
296 /* check if pin supports the sample rate in 8-Bit Stereo */
298 }
299 }
300
301 if (DataRangeAudio->MinimumBitsPerSample <= 16 && DataRangeAudio->MaximumBitsPerSample >= 16)
302 {
303 /* check if pin supports the sample rate in 16-Bit Mono */
305
306 if (DataRangeAudio->MaximumChannels > 1)
307 {
308 /* check if pin supports the sample rate in 16-Bit Stereo */
310 }
311 }
312 }
313 }
314
315 if (bInput)
316 WaveInfo->u.InCaps.dwFormats = Result;
317 else
318 WaveInfo->u.OutCaps.dwFormats = Result;
319
320 DPRINT("Format %lx bInput %u\n", Result, bInput);
321}
322
326 IN PMIXER_LIST MixerList,
327 IN LPMIXER_DATA MixerData,
329 IN ULONG bWaveIn,
331 IN PULONG Pins)
332{
334 PKSMULTIPLE_ITEM MultipleItem;
335 PKSDATARANGE_AUDIO DataRangeAudio;
336 LPWAVE_INFO WaveInfo;
337
338 WaveInfo = (LPWAVE_INFO)MixerContext->Alloc(sizeof(WAVE_INFO));
339 if (!WaveInfo)
340 return MM_STATUS_NO_MEMORY;
341
342 if (PinCount > 1)
343 {
344 /* FIXME support multiple pins for wave device */
345 DPRINT1("Implement support for multiple pins\n");
346 //ASSERT(PinCount == 1);
347 }
348
349 /* initialize wave info */
350 WaveInfo->DeviceId = MixerData->DeviceId;
351 WaveInfo->PinId = Pins[0];
352
353 /* sanity check */
355
356 /* copy device name */
357 if (bWaveIn)
358 {
359 wcscpy(WaveInfo->u.InCaps.szPname, DeviceName);
360 }
361 else
362 {
363 wcscpy(WaveInfo->u.OutCaps.szPname, DeviceName);
364 }
365
366 /* FIXME determine manufacturer / product id */
367 if (bWaveIn)
368 {
369 WaveInfo->u.InCaps.wMid = MM_MICROSOFT;
370 WaveInfo->u.InCaps.wPid = MM_PID_UNMAPPED;
371 WaveInfo->u.InCaps.vDriverVersion = 1;
372 }
373 else
374 {
375 WaveInfo->u.OutCaps.wMid = MM_MICROSOFT;
376 WaveInfo->u.OutCaps.wPid = MM_PID_UNMAPPED;
377 WaveInfo->u.OutCaps.vDriverVersion = 1;
378 }
379
380 /* get audio pin data ranges */
381 Status = MMixerGetAudioPinDataRanges(MixerContext, MixerData->hDevice, Pins[0], &MultipleItem);
383 {
384 /* failed to get audio pin data ranges */
385 MixerContext->Free(WaveInfo);
387 }
388
389 /* find an KSDATARANGE_AUDIO range */
390 Status = MMixerFindAudioDataRange(MultipleItem, &DataRangeAudio);
392 {
393 /* failed to find audio pin data range */
394 MixerContext->Free(MultipleItem);
395 MixerContext->Free(WaveInfo);
397 }
398
399 /* store channel count */
400 if (bWaveIn)
401 {
402 WaveInfo->u.InCaps.wChannels = DataRangeAudio->MaximumChannels;
403 }
404 else
405 {
406 WaveInfo->u.OutCaps.wChannels = DataRangeAudio->MaximumChannels;
407 }
408
409 /* get all supported formats */
410 MMixerCheckFormat(DataRangeAudio, WaveInfo, bWaveIn);
411
412 /* free dataranges buffer */
413 MixerContext->Free(MultipleItem);
414
415 if (bWaveIn)
416 {
417 InsertTailList(&MixerList->WaveInList, &WaveInfo->Entry);
418 MixerList->WaveInListCount++;
419 }
420 else
421 {
422 InsertTailList(&MixerList->WaveOutList, &WaveInfo->Entry);
423 MixerList->WaveOutListCount++;
424 }
425
426 return MM_STATUS_SUCCESS;
427}
428
432 IN ULONG DeviceIndex,
433 IN ULONG bWaveIn,
434 IN LPWAVEFORMATEX WaveFormat,
435 IN PIN_CREATE_CALLBACK CreateCallback,
437 OUT PHANDLE PinHandle)
438{
439 PMIXER_LIST MixerList;
441 LPWAVE_INFO WaveInfo;
443
444 /* verify mixer context */
446
448 {
449 /* invalid context passed */
450 return Status;
451 }
452
453 /* grab mixer list */
455
456 if (WaveFormat->wFormatTag != WAVE_FORMAT_PCM)
457 {
458 /* not implemented */
460 }
461
462 /* find destination wave */
463 Status = MMixerGetWaveInfoByIndexAndType(MixerList, DeviceIndex, bWaveIn, &WaveInfo);
465 {
466 /* failed to find wave info */
468 }
469
470 /* get desired access */
471 if (bWaveIn)
472 {
474 }
475 else
476 {
478 }
479
480 /* now try open the pin */
481 return MMixerOpenWavePin(MixerContext, MixerList, WaveInfo->DeviceId, WaveInfo->PinId, WaveFormat, DesiredAccess, CreateCallback, Context, PinHandle);
482}
483
487 IN ULONG DeviceIndex,
488 OUT LPWAVEINCAPSW Caps)
489{
490 PMIXER_LIST MixerList;
492 LPWAVE_INFO WaveInfo;
493
494 /* verify mixer context */
496
498 {
499 /* invalid context passed */
500 return Status;
501 }
502
503 /* grab mixer list */
505
506 /* find destination wave */
507 Status = MMixerGetWaveInfoByIndexAndType(MixerList, DeviceIndex, TRUE, &WaveInfo);
509 {
510 /* failed to find wave info */
512 }
513
514 /* copy capabilities */
515 MixerContext->Copy(Caps, &WaveInfo->u.InCaps, sizeof(WAVEINCAPSW));
516
517 return MM_STATUS_SUCCESS;
518}
519
523 IN ULONG DeviceIndex,
524 OUT LPWAVEOUTCAPSW Caps)
525{
526 PMIXER_LIST MixerList;
528 LPWAVE_INFO WaveInfo;
529
530 /* verify mixer context */
532
534 {
535 /* invalid context passed */
536 return Status;
537 }
538
539 /* grab mixer list */
541
542 /* find destination wave */
543 Status = MMixerGetWaveInfoByIndexAndType(MixerList, DeviceIndex, FALSE, &WaveInfo);
545 {
546 /* failed to find wave info */
548 }
549
550 /* copy capabilities */
551 MixerContext->Copy(Caps, &WaveInfo->u.OutCaps, sizeof(WAVEOUTCAPSW));
552
553 return MM_STATUS_SUCCESS;
554}
555
556ULONG
559{
560 PMIXER_LIST MixerList;
562
563 /* verify mixer context */
565
567 {
568 /* invalid context passed */
569 return Status;
570 }
571
572 /* grab mixer list */
574
575 return MixerList->WaveInListCount;
576}
577
578ULONG
581{
582 PMIXER_LIST MixerList;
584
585 /* verify mixer context */
587
589 {
590 /* invalid context passed */
591 return Status;
592 }
593
594 /* grab mixer list */
596
597 return MixerList->WaveOutListCount;
598}
599
603 IN HANDLE PinHandle,
605{
609
610 /* verify mixer context */
612
614 {
615 /* invalid context passed */
616 return Status;
617 }
618
619 /* setup property request */
623
624 return MixerContext->Control(PinHandle, IOCTL_KS_PROPERTY, &Property, sizeof(KSPROPERTY), &State, sizeof(KSSTATE), &Length);
625}
626
630 IN HANDLE PinHandle,
631 IN ULONG bBegin)
632{
635 KSRESET Reset;
636
637 /* verify mixer context */
639
641 {
642 /* invalid context passed */
643 return Status;
644 }
645
646 /* begin / stop reset */
647 Reset = (bBegin ? KSRESET_BEGIN : KSRESET_END);
648
649 return MixerContext->Control(PinHandle, IOCTL_KS_RESET_STATE, &Reset, sizeof(KSRESET), NULL, 0, &Length);
650}
651
655 IN ULONG bWaveIn,
656 IN ULONG DeviceId,
657 OUT LPWSTR * DevicePath)
658{
659 PMIXER_LIST MixerList;
660 LPMIXER_DATA MixerData;
661 LPWAVE_INFO WaveInfo;
664
665 /* verify mixer context */
667
669 {
670 /* invalid context passed */
671 return Status;
672 }
673
674 /* grab mixer list */
676
677 /* find destination wave */
678 Status = MMixerGetWaveInfoByIndexAndType(MixerList, DeviceId, bWaveIn, &WaveInfo);
680 {
681 /* failed to find wave info */
683 }
684
685 /* get associated device id */
686 MixerData = MMixerGetDataByDeviceId(MixerList, WaveInfo->DeviceId);
687 if (!MixerData)
689
690 /* calculate length */
691 Length = wcslen(MixerData->DeviceName)+1;
692
693 /* allocate destination buffer */
694 *DevicePath = MixerContext->Alloc(Length * sizeof(WCHAR));
695
696 if (!*DevicePath)
697 {
698 /* no memory */
699 return MM_STATUS_NO_MEMORY;
700 }
701
702 /* copy device path */
703 MixerContext->Copy(*DevicePath, MixerData->DeviceName, Length * sizeof(WCHAR));
704
705 /* done */
706 return MM_STATUS_SUCCESS;
707}
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)
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
struct KSDATAFORMAT_WAVEFORMATEX * PKSDATAFORMAT_WAVEFORMATEX
#define KSDATAFORMAT_SUBTYPE_PCM
Definition: ksmedia.h:1021
struct KSDATARANGE_AUDIO * PKSDATARANGE_AUDIO
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_NOT_IMPLEMENTED
Definition: mmixer.h:7
@ 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
ULONG ACCESS_MASK
Definition: nt_native.h:40
#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
_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
MIXER_STATUS MMixerSetWaveStatus(IN PMIXER_CONTEXT MixerContext, IN HANDLE PinHandle, IN KSSTATE State)
Definition: wave.c:601
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:275
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:213
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:183
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:324
VOID MMixerInitializeDataFormat(IN PKSDATAFORMAT_WAVEFORMATEX DataFormat, LPWAVEFORMATEX WaveFormatEx)
Definition: wave.c:115
#define AUDIO_TEST_RANGE
Definition: wave.c:30
ULONG MMixerGetWaveInCount(IN PMIXER_CONTEXT MixerContext)
Definition: wave.c:557
MIXER_STATUS MMixerWaveOutCapabilities(IN PMIXER_CONTEXT MixerContext, IN ULONG DeviceIndex, OUT LPWAVEOUTCAPSW Caps)
Definition: wave.c:521
MIXER_STATUS MMixerGetWaveDevicePath(IN PMIXER_CONTEXT MixerContext, IN ULONG bWaveIn, IN ULONG DeviceId, OUT LPWSTR *DevicePath)
Definition: wave.c:653
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:430
MIXER_STATUS MMixerGetAudioPinDataRanges(IN PMIXER_CONTEXT MixerContext, IN HANDLE hDevice, IN ULONG PinId, IN OUT PKSMULTIPLE_ITEM *OutMultipleItem)
Definition: wave.c:138
MIXER_STATUS MMixerWaveInCapabilities(IN PMIXER_CONTEXT MixerContext, IN ULONG DeviceIndex, OUT LPWAVEINCAPSW Caps)
Definition: wave.c:485
const GUID KSMEDIUMSETID_Standard
Definition: wave.c:19
MIXER_STATUS MMixerSetWaveResetState(IN PMIXER_CONTEXT MixerContext, IN HANDLE PinHandle, IN ULONG bBegin)
Definition: wave.c:628
ULONG MMixerGetWaveOutCount(IN PMIXER_CONTEXT MixerContext)
Definition: wave.c:579
MIXER_STATUS MMixerGetWaveInfoByIndexAndType(IN PMIXER_LIST MixerList, IN ULONG DeviceIndex, IN ULONG bWaveInType, OUT LPWAVE_INFO *OutWaveInfo)
Definition: wave.c:80
#define STATUS_SUCCESS
Definition: shellext.h:65
#define DPRINT
Definition: sndvol32.h:71
_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
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
LIST_ENTRY Entry
Definition: precomp.h:124
union WAVE_INFO::@4331 u
ULONG DeviceId
Definition: precomp.h:125
ULONG PinId
Definition: precomp.h:126
WAVEOUTCAPSW OutCaps
Definition: precomp.h:129
WAVEINCAPSW InCaps
Definition: precomp.h:130
Definition: typedefs.h:120
struct _LIST_ENTRY * Flink
Definition: typedefs.h:121
WORD nBlockAlign
Definition: mmreg.h:82
DWORD nAvgBytesPerSec
Definition: mmreg.h:81
DWORD nSamplesPerSec
Definition: mmreg.h:80
WORD nChannels
Definition: mmreg.h:79
WORD wFormatTag
Definition: mmreg.h:78
WORD wBitsPerSample
Definition: mmreg.h:83
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
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