ReactOS 0.4.15-dev-5669-g09dde2c
mmixer.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: drivers/wdm/audio/legacy/wdmaud/mmixer.c
5 * PURPOSE: WDM Legacy Mixer
6 * PROGRAMMER: Johannes Anderwald
7 */
8
9#include "wdmaud.h"
10
11#include <mmixer.h>
12
13#define NDEBUG
14#include <debug.h>
15
16PVOID Alloc(ULONG NumBytes);
18VOID Free(PVOID Block);
19VOID Copy(PVOID Src, PVOID Dst, ULONG NumBytes);
20MIXER_STATUS Open(IN LPWSTR DevicePath, OUT PHANDLE hDevice);
21MIXER_STATUS Control(IN HANDLE hMixer, IN ULONG dwIoControlCode, IN PVOID lpInBuffer, IN ULONG nInBufferSize, OUT PVOID lpOutBuffer, ULONG nOutBufferSize, PULONG lpBytesReturned);
22MIXER_STATUS Enum(IN PVOID EnumContext, IN ULONG DeviceIndex, OUT LPWSTR * DeviceName, OUT PHANDLE OutHandle, OUT PHANDLE OutKey);
26PVOID AllocEventData(IN ULONG ExtraSize);
27VOID FreeEventData(IN PVOID EventData);
28
30{
31 sizeof(MIXER_CONTEXT),
32 NULL,
33 Alloc,
34 Control,
35 Free,
36 Open,
37 Close,
38 Copy,
39 OpenKey,
44};
45
47
51 IN LPWSTR lpKeyName,
54 OUT PULONG KeyType)
55{
59 PKEY_VALUE_PARTIAL_INFORMATION PartialInformation;
60
61 /* initialize key name */
62 RtlInitUnicodeString(&KeyName, lpKeyName);
63
64 /* now query MatchingDeviceId key */
65 Status = ZwQueryValueKey(hKey, &KeyName, KeyValuePartialInformation, NULL, 0, &Length);
66
67 /* check for success */
70
71 /* allocate a buffer for key data */
72 PartialInformation = AllocateItem(NonPagedPool, Length);
73
74 if (!PartialInformation)
76
77
78 /* now query MatchingDeviceId key */
79 Status = ZwQueryValueKey(hKey, &KeyName, KeyValuePartialInformation, PartialInformation, Length, &Length);
80
81 /* check for success */
82 if (!NT_SUCCESS(Status))
83 {
84 FreeItem(PartialInformation);
86 }
87
88 if (KeyType)
89 {
90 /* return key type */
91 *KeyType = PartialInformation->Type;
92 }
93
94 if (ResultLength)
95 {
96 /* return data length */
97 *ResultLength = PartialInformation->DataLength;
98 }
99
100 *ResultBuffer = AllocateItem(NonPagedPool, PartialInformation->DataLength);
101 if (!*ResultBuffer)
102 {
103 /* not enough memory */
104 FreeItem(PartialInformation);
105 return MM_STATUS_NO_MEMORY;
106 }
107
108 /* copy key value */
109 RtlMoveMemory(*ResultBuffer, PartialInformation->Data, PartialInformation->DataLength);
110
111 /* free key info */
112 FreeItem(PartialInformation);
113
114 return MM_STATUS_SUCCESS;
115}
116
119 IN HANDLE hKey,
120 IN LPWSTR lpSubKeyName,
122 OUT PHANDLE OutKey)
123{
127
128 /* initialize sub key name */
129 RtlInitUnicodeString(&SubKeyName, lpSubKeyName);
130
131 /* initialize key attributes */
133
134 /* open the key */
135 Status = ZwOpenKey(OutKey, DesiredAccess, &ObjectAttributes);
136
137 if (NT_SUCCESS(Status))
138 return MM_STATUS_SUCCESS;
139 else
141}
142
145 IN HANDLE hKey)
146{
148 return MM_STATUS_SUCCESS;
149 else
151}
152
153
155{
156 return AllocateItem(NonPagedPool, NumBytes);
157}
158
160Close(HANDLE hDevice)
161{
162 if (ZwClose(hDevice) == STATUS_SUCCESS)
163 return MM_STATUS_SUCCESS;
164 else
166}
167
168VOID
170{
171 FreeItem(Block);
172}
173
174VOID
175Copy(PVOID Src, PVOID Dst, ULONG NumBytes)
176{
177 RtlMoveMemory(Src, Dst, NumBytes);
178}
179
182 IN LPWSTR DevicePath,
183 OUT PHANDLE hDevice)
184{
185 if (WdmAudOpenSysAudioDevice(DevicePath, hDevice) == STATUS_SUCCESS)
186 return MM_STATUS_SUCCESS;
187 else
189}
190
195 IN PVOID lpInBuffer,
196 IN ULONG nInBufferSize,
197 OUT PVOID lpOutBuffer,
198 ULONG nOutBufferSize,
200{
203
204 /* get file object */
206 if (!NT_SUCCESS(Status))
207 {
208 DPRINT("failed to reference %p with %lx\n", hMixer, Status);
210 }
211
212 /* perform request */
213 Status = KsSynchronousIoControlDevice(FileObject, KernelMode, dwIoControlCode, lpInBuffer, nInBufferSize, lpOutBuffer, nOutBufferSize, lpBytesReturned);
214
215 /* release object reference */
217
219 {
220 /* more data is available */
222 }
223 else if (Status == STATUS_SUCCESS)
224 {
225 /* operation succeeded */
226 return MM_STATUS_SUCCESS;
227 }
228 else
229 {
230 DPRINT("Failed with %lx\n", Status);
232 }
233}
234
237 IN PVOID EnumContext,
238 IN ULONG DeviceIndex,
240 OUT PHANDLE OutHandle,
241 OUT PHANDLE OutKey)
242{
247
248 /* get enumeration context */
249 DeviceObject = (PDEVICE_OBJECT)EnumContext;
250
251 /* get device count */
253
254 if (DeviceIndex >= DeviceCount)
255 {
256 /* no more devices */
258 }
259
260 /* get device name */
262
263 if (!NT_SUCCESS(Status))
264 {
265 /* failed to retrieve device name */
267 }
268
269 /* initialize key name */
271
272 /* open device interface key */
274
275 if (!NT_SUCCESS(Status))
276 {
277 *OutKey = NULL;
278 }
279
280#if 0
281 if (!NT_SUCCESS(Status))
282 {
283 /* failed to open key */
284 DPRINT("IoOpenDeviceInterfaceRegistryKey failed with %lx\n", Status);
287 }
288#endif
289
290 /* open device handle */
291 Status = OpenDevice(*DeviceName, OutHandle, NULL);
292 if (!NT_SUCCESS(Status))
293 {
294 /* failed to open device */
296 }
297
298 return MM_STATUS_SUCCESS;
299}
300
301PVOID
303 IN ULONG ExtraSize)
304{
306 if (!Data)
307 return NULL;
308
309 Data->EventObject.Event = AllocateItem(NonPagedPool, sizeof(KEVENT));
310 if (!Data->EventHandle.Event)
311 {
312 FreeItem(Data);
313 return NULL;
314 }
315
316 KeInitializeEvent(Data->EventObject.Event, NotificationEvent, FALSE);
317
318 Data->NotificationType = KSEVENTF_EVENT_HANDLE;
319 return Data;
320}
321
322VOID
324{
325 PKSEVENTDATA Data = (PKSEVENTDATA)EventData;
326
327 FreeItem(Data->EventHandle.Event);
328 FreeItem(Data);
329}
330
331VOID
334 IN PVOID MixerEventContext,
337 IN ULONG Value)
338{
341 ULONG Index;
342
343 /* get client context */
344 ClientInfo = (PWDMAUD_CLIENT)MixerEventContext;
345
346 /* now search for the mixer which originated the request */
347 for(Index = 0; Index < ClientInfo->NumPins; Index++)
348 {
349 if (ClientInfo->hPins[Index].Handle == hMixer && ClientInfo->hPins[Index].Type == MIXER_DEVICE_TYPE)
350 {
351 if (ClientInfo->hPins[Index].NotifyEvent)
352 {
353 /* allocate event entry */
355 if (!Entry)
356 {
357 /* no memory */
358 break;
359 }
360
361 /* setup event entry */
362 Entry->NotificationType = NotificationType;
363 Entry->Value = Value;
364 Entry->hMixer = hMixer;
365
366 /* insert entry */
367 InsertTailList(&ClientInfo->MixerEventList, &Entry->Entry);
368
369 /* now notify the client */
370 KeSetEvent(ClientInfo->hPins[Index].NotifyEvent, 0, FALSE);
371 }
372 /* done */
373 break;
374 }
375 }
376}
377
378
382{
384
385 /* initialize the mixer library */
387
389 {
390 /* failed to initialize mmixer library */
391 DPRINT("MMixerInitialize failed with %lx\n", Status);
392 }
393
394 return Status;
395}
396
402 IN PWDMAUD_DEVICE_EXTENSION DeviceExtension)
403{
405 return STATUS_SUCCESS;
406
408}
409
413 IN PIRP Irp,
416{
418 PWDMAUD_HANDLE Handles;
419 //PWDMAUD_DEVICE_EXTENSION DeviceExtension;
421 PKEVENT EventObject = NULL;
422
423 DPRINT("WdmAudControlOpenMixer\n");
424
425 //DeviceExtension = (PWDMAUD_DEVICE_EXTENSION)DeviceObject->DeviceExtension;
426
427 if (DeviceInfo->u.hNotifyEvent)
428 {
430
431 if (!NT_SUCCESS(Status))
432 {
433 DPRINT1("Invalid notify event passed %p from client %p\n", DeviceInfo->u.hNotifyEvent, ClientInfo);
436 }
437 }
438
440 {
441 ObDereferenceObject(EventObject);
442 DPRINT1("Failed to open mixer\n");
444 }
445
446
447 Handles = AllocateItem(NonPagedPool, sizeof(WDMAUD_HANDLE) * (ClientInfo->NumPins+1));
448
449 if (Handles)
450 {
451 if (ClientInfo->NumPins)
452 {
453 RtlMoveMemory(Handles, ClientInfo->hPins, sizeof(WDMAUD_HANDLE) * ClientInfo->NumPins);
454 FreeItem(ClientInfo->hPins);
455 }
456
457 ClientInfo->hPins = Handles;
458 ClientInfo->hPins[ClientInfo->NumPins].Handle = hMixer;
459 ClientInfo->hPins[ClientInfo->NumPins].Type = MIXER_DEVICE_TYPE;
460 ClientInfo->hPins[ClientInfo->NumPins].NotifyEvent = EventObject;
461 ClientInfo->NumPins++;
462 }
463 else
464 {
465 ObDereferenceObject(EventObject);
467 }
468
469 DeviceInfo->hDevice = hMixer;
470
472}
473
477 IN PIRP Irp,
480 IN ULONG Index)
481{
482 /* Remove event associated to this client */
484 {
485 DPRINT1("Failed to close mixer\n");
487 }
488
489 /* Dereference event */
490 if (ClientInfo->hPins[Index].NotifyEvent)
491 {
492 ObDereferenceObject(ClientInfo->hPins[Index].NotifyEvent);
493 ClientInfo->hPins[Index].NotifyEvent = NULL;
494 }
495
496 /* FIXME: do we need to free ClientInfo->hPins ? */
498}
499
500VOID
504 IN ULONG Index)
505{
506 ULONG DeviceCount, DeviceIndex;
507
508 /* Get all mixers */
510
511 /* Close every mixer attached to the device */
512 for (DeviceIndex = 0; DeviceIndex < DeviceCount; DeviceIndex++)
513 {
515 {
516 DPRINT1("Failed to close mixer for device %lu\n", DeviceIndex);
517 }
518 }
519
520 /* Dereference event */
521 if (ClientInfo->hPins[Index].NotifyEvent)
522 {
523 ObDereferenceObject(ClientInfo->hPins[Index].NotifyEvent);
524 ClientInfo->hPins[Index].NotifyEvent = NULL;
525 }
526}
527
529NTAPI
532 IN PIRP Irp,
535{
537
538 /* clear hmixer type flag */
539 DeviceInfo->Flags &= ~MIXER_OBJECTF_HMIXER;
540
541 /* query mmixer library */
542 Status = MMixerGetControlDetails(&MixerContext, DeviceInfo->hDevice, DeviceInfo->DeviceIndex, DeviceInfo->Flags, &DeviceInfo->u.MixDetails);
543
546 else
548}
549
551NTAPI
554 IN PIRP Irp,
557{
559
560 /* clear hmixer type flag */
561 DeviceInfo->Flags &= ~MIXER_OBJECTF_HMIXER;
562
563 /* query mixer library */
564 Status = MMixerGetLineInfo(&MixerContext, DeviceInfo->hDevice, DeviceInfo->DeviceIndex, DeviceInfo->Flags, &DeviceInfo->u.MixLine);
565
568 else
570}
571
573NTAPI
576 IN PIRP Irp,
579{
581
582 /* clear hmixer type flag */
583 DeviceInfo->Flags &= ~MIXER_OBJECTF_HMIXER;
584
585 /* query mixer library */
586 Status = MMixerGetLineControls(&MixerContext, DeviceInfo->hDevice, DeviceInfo->DeviceIndex, DeviceInfo->Flags, &DeviceInfo->u.MixControls);
587
590 else
592
593
594}
595
597NTAPI
600 IN PIRP Irp,
603{
605
606 /* clear hmixer type flag */
607 DeviceInfo->Flags &= ~MIXER_OBJECTF_HMIXER;
608
609 /* query mixer library */
610 Status = MMixerSetControlDetails(&MixerContext, DeviceInfo->hDevice, DeviceInfo->DeviceIndex, DeviceInfo->Flags, &DeviceInfo->u.MixDetails);
611
614 else
616}
617
619NTAPI
622 IN PIRP Irp,
625{
627 PEVENT_ENTRY EventEntry;
628
629 /* enumerate event list and check if there is a new event */
630 Entry = ClientInfo->MixerEventList.Flink;
631
632 while(Entry != &ClientInfo->MixerEventList)
633 {
634 /* grab event entry */
636
637 if (EventEntry->hMixer == DeviceInfo->hDevice)
638 {
639 /* found an entry */
640 DeviceInfo->u.MixerEvent.hMixer = EventEntry->hMixer;
641 DeviceInfo->u.MixerEvent.NotificationType = EventEntry->NotificationType;
642 DeviceInfo->u.MixerEvent.Value = EventEntry->Value;
643
644 /* remove entry from list */
645 RemoveEntryList(&EventEntry->Entry);
646
647 /* free event entry */
648 FreeItem(EventEntry);
649
650 /* done */
652 }
653
654 /* move to next */
655 Entry = Entry->Flink;
656 }
657
658 /* no event entry available */
660}
661
662ULONG
664{
666}
667
668ULONG
670{
672}
673
674ULONG
676{
678}
679
680ULONG
682{
684}
685
686ULONG
688{
690}
691
694 IN ULONG DeviceIndex,
696 OUT LPWSTR *DevicePath)
697{
699 {
701 return STATUS_SUCCESS;
702 else
703 return STATUS_UNSUCCESSFUL;
704 }
706 {
708 return STATUS_SUCCESS;
709 else
710 return STATUS_UNSUCCESSFUL;
711 }
712 else if (DeviceType == MIXER_DEVICE_TYPE)
713 {
715 }
716
717 return STATUS_UNSUCCESSFUL;
718}
719
725 IN PWDMAUD_DEVICE_EXTENSION DeviceExtension)
726{
728
729 if (DeviceInfo->DeviceType == WAVE_IN_DEVICE_TYPE)
730 {
731 /* get capabilities */
732 Status = MMixerWaveInCapabilities(&MixerContext, DeviceInfo->DeviceIndex, &DeviceInfo->u.WaveInCaps);
733 }
734 else if (DeviceInfo->DeviceType == WAVE_OUT_DEVICE_TYPE)
735 {
736 /* get capabilities */
737 Status = MMixerWaveOutCapabilities(&MixerContext, DeviceInfo->DeviceIndex, &DeviceInfo->u.WaveOutCaps);
738 }
739
741 return STATUS_SUCCESS;
742 else
743 return Status;
744}
745
751 IN PWDMAUD_DEVICE_EXTENSION DeviceExtension)
752{
754
755 if (DeviceInfo->DeviceType == MIDI_IN_DEVICE_TYPE)
756 {
757 /* get capabilities */
758 Status = MMixerMidiInCapabilities(&MixerContext, DeviceInfo->DeviceIndex, &DeviceInfo->u.MidiInCaps);
759 }
760 else if (DeviceInfo->DeviceType == WAVE_OUT_DEVICE_TYPE)
761 {
762 /* get capabilities */
763 Status = MMixerMidiOutCapabilities(&MixerContext, DeviceInfo->DeviceIndex, &DeviceInfo->u.MidiOutCaps);
764 }
765
767 return STATUS_SUCCESS;
768 else
769 return STATUS_UNSUCCESSFUL;
770}
771
772
775 IN PVOID Ctx,
776 IN ULONG VirtualDeviceId,
777 IN ULONG PinId,
778 IN HANDLE hFilter,
779 IN PKSPIN_CONNECT PinConnect,
781 OUT PHANDLE PinHandle)
782{
784 SYSAUDIO_INSTANCE_INFO InstanceInfo;
786 ULONG FreeIndex;
788
789 /* setup property request */
790 InstanceInfo.Property.Set = KSPROPSETID_Sysaudio;
792 InstanceInfo.Property.Flags = KSPROPERTY_TYPE_SET;
793 InstanceInfo.Flags = 0;
794 InstanceInfo.DeviceNumber = VirtualDeviceId;
795
796 /* attach to virtual device */
797 Status = KsSynchronousIoControlDevice(Context->DeviceExtension->FileObject, KernelMode, IOCTL_KS_PROPERTY, (PVOID)&InstanceInfo, sizeof(SYSAUDIO_INSTANCE_INFO), NULL, 0, &BytesReturned);
798
799 if (!NT_SUCCESS(Status))
801
802 /* close existing pin */
803 FreeIndex = ClosePin(Context->ClientInfo, VirtualDeviceId, PinId, Context->DeviceType);
804
805 /* now create the pin */
806 Status = KsCreatePin(Context->DeviceExtension->hSysAudio, PinConnect, DesiredAccess, PinHandle);
807
808 /* check for success */
809 if (!NT_SUCCESS(Status))
811
812 /* store the handle */
813 Status = InsertPinHandle(Context->ClientInfo, VirtualDeviceId, PinId, Context->DeviceType, *PinHandle, FreeIndex);
814 if (!NT_SUCCESS(Status))
815 {
816 /* failed to insert handle */
817 ZwClose(*PinHandle);
819 }
820
821 return MM_STATUS_SUCCESS;
822}
823
827 IN PIRP Irp,
830{
833
834 Context.ClientInfo = ClientInfo;
835 Context.DeviceExtension = (PWDMAUD_DEVICE_EXTENSION)DeviceObject->DeviceExtension;
836 Context.DeviceType = DeviceInfo->DeviceType;
837
838 Status = MMixerOpenWave(&MixerContext, DeviceInfo->DeviceIndex, DeviceInfo->DeviceType == WAVE_IN_DEVICE_TYPE, &DeviceInfo->u.WaveFormatEx, CreatePinCallback, &Context, &DeviceInfo->hDevice);
839
842 else
844}
845
849 IN PIRP Irp,
852{
855
856 Context.ClientInfo = ClientInfo;
857 Context.DeviceExtension = (PWDMAUD_DEVICE_EXTENSION)DeviceObject->DeviceExtension;
858 Context.DeviceType = DeviceInfo->DeviceType;
859
861
864 else
866}
LONG NTSTATUS
Definition: precomp.h:26
#define DPRINT1
Definition: precomp.h:8
MMRESULT OpenDevice(DeviceInfo **private_data, MIDIOPENDESC *open_desc, DWORD flags)
Definition: beepmidi.c:264
#define UNIMPLEMENTED
Definition: debug.h:115
IN PUNICODE_STRING IN POBJECT_ATTRIBUTES ObjectAttributes
Definition: conport.c:36
_In_ PIRP Irp
Definition: csq.h:116
#define NULL
Definition: types.h:112
#define FALSE
Definition: types.h:117
#define NT_SUCCESS(StatCode)
Definition: apphelp.c:32
#define GENERIC_READ
Definition: compat.h:135
#define CALLBACK
Definition: compat.h:35
MMRESULT WdmAudGetLineControls(IN HANDLE hMixer, IN DWORD MixerId, IN LPMIXERLINECONTROLSW MixControls, IN ULONG Flags)
Definition: mmixer.c:413
MMRESULT WdmAudGetControlDetails(IN HANDLE hMixer, IN DWORD MixerId, IN LPMIXERCONTROLDETAILS MixDetails, IN ULONG Flags)
Definition: mmixer.c:440
VOID FreeEventData(IN PVOID EventData)
Definition: mmixer.c:326
MIXER_STATUS Enum(IN PVOID EnumContext, IN ULONG DeviceIndex, OUT LPWSTR *DeviceName, OUT PHANDLE OutHandle, OUT PHANDLE OutKey)
Definition: mmixer.c:220
MMRESULT WdmAudGetLineInfo(IN HANDLE hMixer, IN DWORD MixerId, IN LPMIXERLINEW MixLine, IN ULONG Flags)
Definition: mmixer.c:400
MMRESULT WdmAudSetControlDetails(IN HANDLE hMixer, IN DWORD MixerId, IN LPMIXERCONTROLDETAILS MixDetails, IN ULONG Flags)
Definition: mmixer.c:426
GUID CategoryGuid
Definition: mmixer.c:58
PVOID AllocEventData(IN ULONG ExtraSize)
Definition: mmixer.c:307
MIXER_STATUS OpenKey(IN HANDLE hKey, IN LPWSTR SubKey, IN ULONG DesiredAccess, OUT PHANDLE OutKey)
Definition: mmixer.c:84
PVOID Alloc(ULONG NumBytes)
Definition: mmixer.c:105
VOID Copy(PVOID Src, PVOID Dst, ULONG NumBytes)
Definition: mmixer.c:126
MIXER_STATUS CloseKey(IN HANDLE hKey)
Definition: mmixer.c:97
MIXER_CONTEXT MixerContext
Definition: mmixer.c:41
MIXER_STATUS QueryKeyValue(IN HANDLE hKey, IN LPWSTR KeyName, OUT PVOID *ResultBuffer, OUT PULONG ResultLength, OUT PULONG KeyType)
Definition: mmixer.c:61
KSDDKAPI NTSTATUS NTAPI KsSynchronousIoControlDevice(IN PFILE_OBJECT FileObject, IN KPROCESSOR_MODE RequestorMode, IN ULONG IoControl, IN PVOID InBuffer, IN ULONG InSize, OUT PVOID OutBuffer, IN ULONG OutSize, OUT PULONG BytesReturned)
Definition: api.c:1099
NTSTATUS WdmAudOpenSysAudioDevice(IN LPWSTR DeviceName, OUT PHANDLE Handle)
Definition: deviface.c:16
VOID CALLBACK EventCallback(IN PVOID MixerEventContext, IN HANDLE hMixer, IN ULONG NotificationType, IN ULONG Value)
Definition: mmixer.c:333
NTSTATUS WdmAudMidiCapabilities(IN PDEVICE_OBJECT DeviceObject, IN PWDMAUD_DEVICE_INFO DeviceInfo, IN PWDMAUD_CLIENT ClientInfo, IN PWDMAUD_DEVICE_EXTENSION DeviceExtension)
Definition: mmixer.c:747
NTSTATUS WdmAudMixerInitialize(IN PDEVICE_OBJECT DeviceObject)
Definition: mmixer.c:380
ULONG WdmAudGetMidiOutDeviceCount()
Definition: mmixer.c:687
ULONG WdmAudGetWaveInDeviceCount()
Definition: mmixer.c:669
NTSTATUS WdmAudControlOpenMixer(IN PDEVICE_OBJECT DeviceObject, IN PIRP Irp, IN PWDMAUD_DEVICE_INFO DeviceInfo, IN PWDMAUD_CLIENT ClientInfo)
Definition: mmixer.c:411
NTSTATUS WdmAudWaveCapabilities(IN PDEVICE_OBJECT DeviceObject, IN PWDMAUD_DEVICE_INFO DeviceInfo, IN PWDMAUD_CLIENT ClientInfo, IN PWDMAUD_DEVICE_EXTENSION DeviceExtension)
Definition: mmixer.c:721
VOID WdmAudCloseAllMixers(IN PDEVICE_OBJECT DeviceObject, IN PWDMAUD_CLIENT ClientInfo, IN ULONG Index)
Definition: mmixer.c:501
NTSTATUS WdmAudGetPnpNameByIndexAndType(IN ULONG DeviceIndex, IN SOUND_DEVICE_TYPE DeviceType, OUT LPWSTR *DevicePath)
Definition: mmixer.c:693
NTSTATUS WdmAudControlOpenWave(IN PDEVICE_OBJECT DeviceObject, IN PIRP Irp, IN PWDMAUD_DEVICE_INFO DeviceInfo, IN PWDMAUD_CLIENT ClientInfo)
Definition: mmixer.c:825
ULONG WdmAudGetWaveOutDeviceCount()
Definition: mmixer.c:675
NTSTATUS NTAPI WdmAudGetMixerEvent(IN PDEVICE_OBJECT DeviceObject, IN PIRP Irp, IN PWDMAUD_DEVICE_INFO DeviceInfo, IN PWDMAUD_CLIENT ClientInfo)
Definition: mmixer.c:620
ULONG WdmAudGetMidiInDeviceCount()
Definition: mmixer.c:681
MIXER_STATUS CreatePinCallback(IN PVOID Ctx, IN ULONG VirtualDeviceId, IN ULONG PinId, IN HANDLE hFilter, IN PKSPIN_CONNECT PinConnect, IN ACCESS_MASK DesiredAccess, OUT PHANDLE PinHandle)
Definition: mmixer.c:774
NTSTATUS WdmAudControlOpenMidi(IN PDEVICE_OBJECT DeviceObject, IN PIRP Irp, IN PWDMAUD_DEVICE_INFO DeviceInfo, IN PWDMAUD_CLIENT ClientInfo)
Definition: mmixer.c:847
NTSTATUS WdmAudMixerCapabilities(IN PDEVICE_OBJECT DeviceObject, IN PWDMAUD_DEVICE_INFO DeviceInfo, IN PWDMAUD_CLIENT ClientInfo, IN PWDMAUD_DEVICE_EXTENSION DeviceExtension)
Definition: mmixer.c:398
ULONG WdmAudGetMixerDeviceCount()
Definition: mmixer.c:663
NTSTATUS WdmAudControlCloseMixer(IN PDEVICE_OBJECT DeviceObject, IN PIRP Irp, IN PWDMAUD_DEVICE_INFO DeviceInfo, IN PWDMAUD_CLIENT ClientInfo, IN ULONG Index)
Definition: mmixer.c:475
NTSTATUS GetSysAudioDevicePnpName(IN PDEVICE_OBJECT DeviceObject, IN ULONG DeviceIndex, OUT LPWSTR *Device)
Definition: sup.c:357
NTSTATUS InsertPinHandle(IN PWDMAUD_CLIENT ClientInfo, IN ULONG FilterId, IN ULONG PinId, IN SOUND_DEVICE_TYPE DeviceType, IN HANDLE PinHandle, IN ULONG FreeIndex)
Definition: sup.c:104
ULONG ClosePin(IN PWDMAUD_CLIENT ClientInfo, IN ULONG FilterId, IN ULONG PinId, IN SOUND_DEVICE_TYPE DeviceType)
Definition: sup.c:80
NTSTATUS SetIrpIoStatus(IN PIRP Irp, IN NTSTATUS Status, IN ULONG Length)
Definition: sup.c:67
ULONG GetSysAudioDeviceCount(IN PDEVICE_OBJECT DeviceObject)
Definition: sup.c:42
struct WDMAUD_CLIENT * PWDMAUD_CLIENT
struct WDMAUD_DEVICE_EXTENSION * PWDMAUD_DEVICE_EXTENSION
struct EVENT_ENTRY * PEVENT_ENTRY
struct PIN_CREATE_CONTEXT * PPIN_CREATE_CONTEXT
#define KSPROPERTY_TYPE_SET
Definition: dmksctrl.h:43
#define RemoveEntryList(Entry)
Definition: env_spec_w32.h:986
#define InsertTailList(ListHead, Entry)
struct _DEVICE_OBJECT * PDEVICE_OBJECT
#define KeInitializeEvent(pEvt, foo, foo2)
Definition: env_spec_w32.h:477
#define KeSetEvent(pEvt, foo, foo2)
Definition: env_spec_w32.h:476
#define NonPagedPool
Definition: env_spec_w32.h:307
FxAutoRegKey hKey
Status
Definition: gdiplustypes.h:25
#define OBJ_KERNEL_HANDLE
Definition: winternl.h:231
#define OBJ_OPENIF
Definition: winternl.h:229
#define OBJ_CASE_INSENSITIVE
Definition: winternl.h:228
NTSYSAPI void WINAPI DbgBreakPoint(void)
CLIENT_DATA ClientInfo
POBJECT_TYPE IoFileObjectType
Definition: iomgr.c:36
PKMT_RESULTBUFFER ResultBuffer
#define IOCTL_KS_PROPERTY
Definition: ks.h:127
struct KSEVENTDATA * PKSEVENTDATA
#define KSEVENTF_EVENT_HANDLE
Definition: ks.h:1778
PVOID AllocateItem(IN POOL_TYPE PoolType, IN SIZE_T NumberOfBytes)
Definition: misc.c:30
VOID FreeItem(IN PVOID Item)
Definition: misc.c:43
@ KSPROPERTY_SYSAUDIO_INSTANCE_INFO
Definition: ksmedia.h:1175
#define STATIC_KSCATEGORY_AUDIO
Definition: ksmedia.h:169
#define KSPROPSETID_Sysaudio
Definition: ksmedia.h:1165
KSDDKAPI DWORD NTAPI KsCreatePin(HANDLE FilterHandle, PKSPIN_CONNECT Connect, ACCESS_MASK DesiredAccess, PHANDLE ConnectionHandle)
Definition: ksuser.c:192
#define Open
Definition: syshdrs.h:62
#define Dst
Definition: mesh.h:153
DeviceType
Definition: mmdrv.h:42
ULONG MMixerGetWaveInCount(IN PMIXER_CONTEXT MixerContext)
Definition: wave.c:563
MIXER_STATUS MMixerWaveOutCapabilities(IN PMIXER_CONTEXT MixerContext, IN ULONG DeviceIndex, OUT LPWAVEOUTCAPSW Caps)
Definition: wave.c:527
MIXER_STATUS MMixerGetWaveDevicePath(IN PMIXER_CONTEXT MixerContext, IN ULONG bWaveIn, IN ULONG DeviceId, OUT LPWSTR *DevicePath)
Definition: wave.c:659
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
MIXER_STATUS MMixerWaveInCapabilities(IN PMIXER_CONTEXT MixerContext, IN ULONG DeviceIndex, OUT LPWAVEINCAPSW Caps)
Definition: wave.c:491
MIXER_STATUS
Definition: mmixer.h:4
@ MM_STATUS_UNSUCCESSFUL
Definition: mmixer.h:11
@ MM_STATUS_NO_MEMORY
Definition: mmixer.h:12
@ MM_STATUS_SUCCESS
Definition: mmixer.h:5
@ MM_STATUS_NO_MORE_DEVICES
Definition: mmixer.h:8
@ MM_STATUS_MORE_ENTRIES
Definition: mmixer.h:9
ULONG MMixerGetWaveOutCount(IN PMIXER_CONTEXT MixerContext)
Definition: wave.c:585
HMIXER hMixer
Definition: test.c:10
#define InitializeObjectAttributes(p, n, a, r, s)
Definition: reg.c:106
ULONG DeviceCount
Definition: mpu401.c:26
_Must_inspect_result_ _Out_ PNDIS_STATUS _In_ NDIS_HANDLE _In_ PNDIS_STRING SubKeyName
Definition: ndis.h:4725
#define KernelMode
Definition: asm.h:34
#define UserMode
Definition: asm.h:35
NTSYSAPI NTSTATUS NTAPI ZwClose(_In_ HANDLE Handle)
@ KeyValuePartialInformation
Definition: nt_native.h:1182
ULONG ACCESS_MASK
Definition: nt_native.h:40
NTSYSAPI VOID NTAPI RtlInitUnicodeString(PUNICODE_STRING DestinationString, PCWSTR SourceString)
#define GENERIC_WRITE
Definition: nt_native.h:90
_In_ ULONG _In_ ULONG _In_ ULONG Length
Definition: ntddpcm.h:102
@ NotificationEvent
POBJECT_TYPE ExEventObjectType
Definition: event.c:18
NTSTATUS NTAPI IoOpenDeviceInterfaceRegistryKey(IN PUNICODE_STRING SymbolicLinkName, IN ACCESS_MASK DesiredAccess, OUT PHANDLE DeviceInterfaceKey)
Definition: deviface.c:241
PVOID *typedef PHANDLE
Definition: ntsecpkg.h:455
#define STATUS_NOT_SUPPORTED
Definition: ntstatus.h:423
NTSTATUS NTAPI ObReferenceObjectByHandle(IN HANDLE Handle, IN ACCESS_MASK DesiredAccess, IN POBJECT_TYPE ObjectType, IN KPROCESSOR_MODE AccessMode, OUT PVOID *Object, OUT POBJECT_HANDLE_INFORMATION HandleInformation OPTIONAL)
Definition: obref.c:494
@ Close
Definition: sacdrv.h:268
MIXER_STATUS MMixerMidiInCapabilities(IN PMIXER_CONTEXT MixerContext, IN ULONG DeviceIndex, OUT LPMIDIINCAPSW Caps)
Definition: midi.c:344
MIXER_STATUS MMixerOpenMidi(IN PMIXER_CONTEXT MixerContext, IN ULONG DeviceIndex, IN ULONG bMidiIn, IN PIN_CREATE_CALLBACK CreateCallback, IN PVOID Context, OUT PHANDLE PinHandle)
Definition: midi.c:454
ULONG MMixerGetMidiInCount(IN PMIXER_CONTEXT MixerContext)
Definition: midi.c:502
MIXER_STATUS MMixerMidiOutCapabilities(IN PMIXER_CONTEXT MixerContext, IN ULONG DeviceIndex, OUT LPMIDIOUTCAPSW Caps)
Definition: midi.c:308
MIXER_STATUS MMixerGetMidiDevicePath(IN PMIXER_CONTEXT MixerContext, IN ULONG bMidiIn, IN ULONG DeviceId, OUT LPWSTR *DevicePath)
Definition: midi.c:380
MIXER_STATUS MMixerGetControlDetails(IN PMIXER_CONTEXT MixerContext, IN HANDLE MixerHandle, IN ULONG MixerId, IN ULONG Flags, OUT LPMIXERCONTROLDETAILS MixerControlDetails)
Definition: mixer.c:566
MIXER_STATUS MMixerClose(IN PMIXER_CONTEXT MixerContext, IN ULONG MixerId, IN PVOID MixerEventContext, IN PMIXER_EVENT MixerEventRoutine)
Definition: mixer.c:116
MIXER_STATUS MMixerOpen(IN PMIXER_CONTEXT MixerContext, IN ULONG MixerId, IN PVOID MixerEventContext, IN PMIXER_EVENT MixerEventRoutine, OUT PHANDLE MixerHandle)
Definition: mixer.c:77
MIXER_STATUS MMixerGetLineControls(IN PMIXER_CONTEXT MixerContext, IN HANDLE MixerHandle, IN ULONG MixerId, IN ULONG Flags, OUT LPMIXERLINECONTROLSW MixerLineControls)
Definition: mixer.c:332
MIXER_STATUS MMixerSetControlDetails(IN PMIXER_CONTEXT MixerContext, IN HANDLE MixerHandle, IN ULONG MixerId, IN ULONG Flags, OUT LPMIXERCONTROLDETAILS MixerControlDetails)
Definition: mixer.c:496
MIXER_STATUS MMixerGetCapabilities(IN PMIXER_CONTEXT MixerContext, IN ULONG MixerIndex, OUT LPMIXERCAPSW MixerCaps)
Definition: mixer.c:38
ULONG MMixerGetCount(IN PMIXER_CONTEXT MixerContext)
Definition: mixer.c:15
MIXER_STATUS MMixerGetLineInfo(IN PMIXER_CONTEXT MixerContext, IN HANDLE MixerHandle, IN ULONG MixerId, IN ULONG Flags, OUT LPMIXERLINEW MixerLine)
Definition: mixer.c:149
MIXER_STATUS MMixerInitialize(IN PMIXER_CONTEXT MixerContext, IN PMIXER_ENUM EnumFunction, IN PVOID EnumContext)
Definition: mixer.c:770
#define STATUS_SUCCESS
Definition: shellext.h:65
#define STATUS_BUFFER_TOO_SMALL
Definition: shellext.h:69
#define STATUS_BUFFER_OVERFLOW
Definition: shellext.h:66
SOUND_DEVICE_TYPE
Definition: sndtypes.h:26
@ MIXER_DEVICE_TYPE
Definition: sndtypes.h:33
@ MIDI_OUT_DEVICE_TYPE
Definition: sndtypes.h:31
@ WAVE_IN_DEVICE_TYPE
Definition: sndtypes.h:28
@ WAVE_OUT_DEVICE_TYPE
Definition: sndtypes.h:29
@ MIDI_IN_DEVICE_TYPE
Definition: sndtypes.h:30
#define DPRINT
Definition: sndvol32.h:71
Definition: wdmaud.h:38
ULONG Value
Definition: wdmaud.h:41
HANDLE hMixer
Definition: wdmaud.h:42
LIST_ENTRY Entry
Definition: wdmaud.h:39
ULONG NotificationType
Definition: wdmaud.h:40
base of all file and directory entries
Definition: entries.h:83
Entry(ENTRY_TYPE etype)
Definition: entries.cpp:35
ULONG Id
Definition: dmksctrl.h:77
ULONG Flags
Definition: dmksctrl.h:78
GUID Set
Definition: dmksctrl.h:76
KSPROPERTY Property
Definition: ksmedia.h:1180
Definition: typedefs.h:120
uint32_t * PULONG
Definition: typedefs.h:59
#define NTAPI
Definition: typedefs.h:36
#define IN
Definition: typedefs.h:39
#define RtlMoveMemory(Destination, Source, Length)
Definition: typedefs.h:264
#define CONTAINING_RECORD(address, type, field)
Definition: typedefs.h:260
uint32_t ULONG
Definition: typedefs.h:59
#define OUT
Definition: typedefs.h:40
#define STATUS_INVALID_PARAMETER
Definition: udferr_usr.h:135
#define STATUS_UNSUCCESSFUL
Definition: udferr_usr.h:132
#define STATUS_MORE_ENTRIES
Definition: udferr_usr.h:124
_In_ WDFCOLLECTION _In_ ULONG Index
_In_ PDEVICE_OBJECT DeviceObject
Definition: wdfdevice.h:2055
_Must_inspect_result_ _In_ WDFDEVICE _In_ DEVICE_REGISTRY_PROPERTY _In_ ULONG _Out_ PULONG ResultLength
Definition: wdfdevice.h:3776
_Must_inspect_result_ _In_ WDFDEVICE _In_ ULONG _In_ ACCESS_MASK DesiredAccess
Definition: wdfdevice.h:2658
_In_ WDFREQUEST _In_ WDFFILEOBJECT FileObject
Definition: wdfdevice.h:550
_In_ WDF_SPECIAL_FILE_TYPE NotificationType
Definition: wdfdevice.h:1024
_Must_inspect_result_ _In_ WDFDEVICE _In_ PCUNICODE_STRING KeyName
Definition: wdfdevice.h:2699
_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
_Must_inspect_result_ _In_ WDFKEY _In_ PCUNICODE_STRING _Out_opt_ PUSHORT _Inout_opt_ PUNICODE_STRING Value
Definition: wdfregistry.h:413
_In_ WDF_WMI_PROVIDER_CONTROL Control
Definition: wdfwmi.h:166
#define EVENT_MODIFY_STATE
Definition: winbase.h:163
_In_ DWORD _In_ DWORD _In_ DWORD _Out_ LPDWORD lpBytesReturned
Definition: winddi.h:1705
_In_ DWORD dwIoControlCode
Definition: winddi.h:1700
_In_opt_ PALLOCATE_FUNCTION _In_opt_ PFREE_FUNCTION Free
Definition: exfuncs.h:815
* PFILE_OBJECT
Definition: iotypes.h:1998
#define ObDereferenceObject
Definition: obfuncs.h:203
WCHAR * LPWSTR
Definition: xmlstorage.h:184