ReactOS 0.4.16-dev-297-gc569aee
control.c File Reference
#include "sysaudio.h"
#include <debug.h>
Include dependency graph for control.c:

Go to the source code of this file.

Macros

#define NDEBUG
 

Functions

NTSTATUS SetIrpIoStatus (IN PIRP Irp, IN NTSTATUS Status, IN ULONG Length)
 
PKSAUDIO_DEVICE_ENTRY GetListEntry (IN PLIST_ENTRY Head, IN ULONG Index)
 
NTSTATUS SysAudioOpenVirtualDevice (IN PIRP Irp, IN ULONG DeviceNumber, PSYSAUDIODEVEXT DeviceExtension)
 
NTSTATUS HandleSysAudioFilterPinProperties (PIRP Irp, PKSPROPERTY Property, PSYSAUDIODEVEXT DeviceExtension)
 
NTSTATUS ComputeCompatibleFormat (IN PKSAUDIO_DEVICE_ENTRY Entry, IN ULONG PinId, IN PKSDATAFORMAT_WAVEFORMATEX ClientFormat, OUT PKSDATAFORMAT_WAVEFORMATEX MixerFormat)
 
NTSTATUS GetPinInstanceCount (PKSAUDIO_DEVICE_ENTRY Entry, PKSPIN_CINSTANCES PinInstances, PKSPIN_CONNECT PinConnect)
 
NTSTATUS SysAudioHandleProperty (PDEVICE_OBJECT DeviceObject, PIRP Irp)
 

Variables

const GUID KSPROPSETID_Sysaudio = {0xCBE3FAA0L, 0xCC75, 0x11D0, {0xB4, 0x65, 0x00, 0x00, 0x1A, 0x18, 0x18, 0xE6}}
 
const GUID KSPROPSETID_Sysaudio_Pin = {0xA3A53220L, 0xC6E4, 0x11D0, {0xB4, 0x65, 0x00, 0x00, 0x1A, 0x18, 0x18, 0xE6}}
 
const GUID KSPROPSETID_General = {0x1464EDA5L, 0x6A8F, 0x11D1, {0x9A, 0xA7, 0x00, 0xA0, 0xC9, 0x22, 0x31, 0x96}}
 
const GUID KSPROPSETID_Pin = {0x8C134960L, 0x51AD, 0x11CF, {0x87, 0x8A, 0x94, 0xF8, 0x01, 0xC1, 0x00, 0x00}}
 
const GUID KSPROPSETID_Connection = {0x1D58C920L, 0xAC9B, 0x11CF, {0xA5, 0xD6, 0x28, 0xDB, 0x04, 0xC1, 0x00, 0x00}}
 
const GUID KSPROPSETID_Topology = {0x720D4AC0L, 0x7533, 0x11D0, {0xA5, 0xD6, 0x28, 0xDB, 0x04, 0xC1, 0x00, 0x00}}
 
const GUID KSDATAFORMAT_TYPE_AUDIO = {0x73647561L, 0x0000, 0x0010, {0x80, 0x00, 0x00, 0xaa, 0x00, 0x38, 0x9b, 0x71}}
 
const GUID KSDATAFORMAT_SUBTYPE_PCM = {0x00000001L, 0x0000, 0x0010, {0x80, 0x00, 0x00, 0xaa, 0x00, 0x38, 0x9b, 0x71}}
 
const GUID KSDATAFORMAT_SPECIFIER_WAVEFORMATEX = {0x05589f81L, 0xc356, 0x11ce, {0xbf, 0x01, 0x00, 0xaa, 0x00, 0x55, 0x59, 0x5a}}
 

Macro Definition Documentation

◆ NDEBUG

#define NDEBUG

Definition at line 11 of file control.c.

Function Documentation

◆ ComputeCompatibleFormat()

NTSTATUS ComputeCompatibleFormat ( IN PKSAUDIO_DEVICE_ENTRY  Entry,
IN ULONG  PinId,
IN PKSDATAFORMAT_WAVEFORMATEX  ClientFormat,
OUT PKSDATAFORMAT_WAVEFORMATEX  MixerFormat 
)

Definition at line 135 of file control.c.

140{
141 BOOL bFound;
143 PKSP_PIN PinRequest;
145 PKSMULTIPLE_ITEM MultipleItem;
147 PKSDATARANGE_AUDIO AudioRange;
148 ULONG Index;
149
150 Length = sizeof(KSP_PIN) + sizeof(KSMULTIPLE_ITEM) + ClientFormat->DataFormat.FormatSize;
151 PinRequest = AllocateItem(NonPagedPool, Length);
152 if (!PinRequest)
153 return STATUS_UNSUCCESSFUL;
154
155 PinRequest->PinId = PinId;
156 PinRequest->Property.Set = KSPROPSETID_Pin;
157 PinRequest->Property.Flags = KSPROPERTY_TYPE_GET;
159
160 MultipleItem = (PKSMULTIPLE_ITEM)(PinRequest + 1);
161 MultipleItem->Count = 1;
162 MultipleItem->Size = ClientFormat->DataFormat.FormatSize;
163
164 RtlMoveMemory(MultipleItem + 1, ClientFormat, ClientFormat->DataFormat.FormatSize);
165 /* Query the miniport data intersection handler */
167
168 DPRINT("Status %x\n", Status);
169
170 if (NT_SUCCESS(Status))
171 {
172 FreeItem(PinRequest);
173 return Status;
174 }
175
176 /* Setup request block */
178 /* Query pin data ranges */
180
182 {
183 /* Failed to get data ranges */
184 return Status;
185 }
186
187 MultipleItem = AllocateItem(NonPagedPool, BytesReturned);
188 if (!MultipleItem)
189 {
190 FreeItem(PinRequest);
191 return STATUS_NO_MEMORY;
192 }
193
195 if (!NT_SUCCESS(Status))
196 {
197 DPRINT("Property Request KSPROPERTY_PIN_DATARANGES failed with %x\n", Status);
198 FreeItem(MultipleItem);
199 FreeItem(PinRequest);
200 return STATUS_UNSUCCESSFUL;
201 }
202
203 AudioRange = (PKSDATARANGE_AUDIO)(MultipleItem + 1);
204 bFound = FALSE;
205 for(Index = 0; Index < MultipleItem->Count; Index++)
206 {
207 if (AudioRange->DataRange.FormatSize != sizeof(KSDATARANGE_AUDIO))
208 {
210 AudioRange = (PKSDATARANGE_AUDIO)((PUCHAR)AudioRange + AudioRange->DataRange.FormatSize);
211 continue;
212 }
213 /* Select best quality available */
214
215 MixerFormat->DataFormat.FormatSize = sizeof(KSDATAFORMAT) + sizeof(WAVEFORMATEX);
216 MixerFormat->DataFormat.Flags = 0;
217 MixerFormat->DataFormat.Reserved = 0;
218 MixerFormat->DataFormat.MajorFormat = KSDATAFORMAT_TYPE_AUDIO;
219 MixerFormat->DataFormat.SubFormat = KSDATAFORMAT_SUBTYPE_PCM;
220 MixerFormat->DataFormat.Specifier = KSDATAFORMAT_SPECIFIER_WAVEFORMATEX;
221 MixerFormat->DataFormat.SampleSize = 4;
222 MixerFormat->WaveFormatEx.wFormatTag = ClientFormat->WaveFormatEx.wFormatTag;
223#ifndef NO_AC97_HACK
224 /* HACK: AC97 does not support mono render / record */
225 MixerFormat->WaveFormatEx.nChannels = 2;
226 /*HACK: AC97 only supports 16-Bit Bits */
227 MixerFormat->WaveFormatEx.wBitsPerSample = 16;
228
229#else
230 MixerFormat->WaveFormatEx.nChannels = min(ClientFormat->WaveFormatEx.nChannels, AudioRange->MaximumChannels);
231 MixerFormat->WaveFormatEx.wBitsPerSample = AudioRange->MaximumBitsPerSample;
232#endif
233
234#ifdef KMIXER_RESAMPLING_IMPLEMENTED
235 MixerFormat->WaveFormatEx.nSamplesPerSec = AudioRange->MaximumSampleFrequency;
236#else
237 MixerFormat->WaveFormatEx.nSamplesPerSec = max(AudioRange->MinimumSampleFrequency, min(ClientFormat->WaveFormatEx.nSamplesPerSec, AudioRange->MaximumSampleFrequency));
238#endif
239
240 MixerFormat->WaveFormatEx.cbSize = 0;
241 MixerFormat->WaveFormatEx.nBlockAlign = (MixerFormat->WaveFormatEx.nChannels * MixerFormat->WaveFormatEx.wBitsPerSample) / 8;
242 MixerFormat->WaveFormatEx.nAvgBytesPerSec = MixerFormat->WaveFormatEx.nChannels * MixerFormat->WaveFormatEx.nSamplesPerSec * (MixerFormat->WaveFormatEx.wBitsPerSample / 8);
243
244 bFound = TRUE;
245 break;
246
247 AudioRange = (PKSDATARANGE_AUDIO)((PUCHAR)AudioRange + AudioRange->DataRange.FormatSize);
248 }
249
250#if 0
251 DPRINT1("\nNum Max Channels %u Channels %u Old Channels %u\n Max SampleRate %u SampleRate %u Old SampleRate %u\n Max BitsPerSample %u BitsPerSample %u Old BitsPerSample %u\n",
252 AudioRange->MaximumChannels, MixerFormat->WaveFormatEx.nChannels, ClientFormat->WaveFormatEx.nChannels,
253 AudioRange->MaximumSampleFrequency, MixerFormat->WaveFormatEx.nSamplesPerSec, ClientFormat->WaveFormatEx.nSamplesPerSec,
254 AudioRange->MaximumBitsPerSample, MixerFormat->WaveFormatEx.wBitsPerSample, ClientFormat->WaveFormatEx.wBitsPerSample);
255
256
257#endif
258
259 FreeItem(MultipleItem);
260 FreeItem(PinRequest);
261
262 if (bFound)
263 return STATUS_SUCCESS;
264 else
266}
LONG NTSTATUS
Definition: precomp.h:26
#define DPRINT1
Definition: precomp.h:8
#define UNIMPLEMENTED
Definition: ntoskrnl.c:15
#define STATUS_NO_MEMORY
Definition: d3dkmdt.h:51
#define STATUS_NOT_IMPLEMENTED
Definition: d3dkmdt.h:42
#define NULL
Definition: types.h:112
#define TRUE
Definition: types.h:120
#define FALSE
Definition: types.h:117
#define NT_SUCCESS(StatCode)
Definition: apphelp.c:33
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
const GUID KSPROPSETID_Pin
Definition: control.c:17
const GUID KSDATAFORMAT_TYPE_AUDIO
Definition: control.c:20
const GUID KSDATAFORMAT_SPECIFIER_WAVEFORMATEX
Definition: control.c:22
const GUID KSDATAFORMAT_SUBTYPE_PCM
Definition: control.c:21
#define KSPROPERTY_TYPE_GET
Definition: dmksctrl.h:42
#define NonPagedPool
Definition: env_spec_w32.h:307
unsigned int BOOL
Definition: ntddk_ex.h:94
Status
Definition: gdiplustypes.h:25
#define IOCTL_KS_PROPERTY
Definition: ks.h:127
@ KSPROPERTY_PIN_DATAINTERSECTION
Definition: ks.h:629
@ KSPROPERTY_PIN_DATARANGES
Definition: ks.h:628
struct KSMULTIPLE_ITEM * PKSMULTIPLE_ITEM
PVOID AllocateItem(IN POOL_TYPE PoolType, IN SIZE_T NumberOfBytes)
Definition: misc.c:29
VOID FreeItem(IN PVOID Item)
Definition: misc.c:37
struct KSDATARANGE_AUDIO * PKSDATARANGE_AUDIO
#define min(a, b)
Definition: monoChain.cc:55
#define KernelMode
Definition: asm.h:34
_In_ ULONG _In_ ULONG _In_ ULONG Length
Definition: ntddpcm.h:102
#define STATUS_SUCCESS
Definition: shellext.h:65
#define DPRINT
Definition: sndvol32.h:73
base of all file and directory entries
Definition: entries.h:83
ULONG MaximumChannels
Definition: ksmedia.h:680
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 Size
Definition: ks.h:1979
ULONG Count
Definition: ks.h:1980
Definition: ks.h:642
KSPROPERTY Property
Definition: ks.h:643
ULONG PinId
Definition: ks.h:644
#define max(a, b)
Definition: svc.c:63
#define RtlMoveMemory(Destination, Source, Length)
Definition: typedefs.h:264
unsigned char * PUCHAR
Definition: typedefs.h:53
uint32_t ULONG
Definition: typedefs.h:59
#define STATUS_UNSUCCESSFUL
Definition: udferr_usr.h:132
#define STATUS_MORE_ENTRIES
Definition: udferr_usr.h:124
_In_ WDFCOLLECTION _In_ ULONG Index
_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

Referenced by InstantiatePins().

◆ GetListEntry()

PKSAUDIO_DEVICE_ENTRY GetListEntry ( IN PLIST_ENTRY  Head,
IN ULONG  Index 
)

Definition at line 45 of file control.c.

48{
49 PLIST_ENTRY Entry = Head->Flink;
50
51 while(Index-- && Entry != Head)
52 Entry = Entry->Flink;
53
54 if (Entry == Head)
55 return NULL;
56
58}
Definition: sysaudio.h:13
Definition: typedefs.h:120
#define CONTAINING_RECORD(address, type, field)
Definition: typedefs.h:260

Referenced by HandleSysAudioFilterPinProperties(), CIconWatcher::RemoveIconFromWatcher(), SysAudioHandleProperty(), and SysAudioOpenVirtualDevice().

◆ GetPinInstanceCount()

NTSTATUS GetPinInstanceCount ( PKSAUDIO_DEVICE_ENTRY  Entry,
PKSPIN_CINSTANCES  PinInstances,
PKSPIN_CONNECT  PinConnect 
)

Definition at line 269 of file control.c.

273{
274 KSP_PIN PinRequest;
276
277 /* query the instance count */
278 PinRequest.PinId = PinConnect->PinId;
279 PinRequest.Property.Set = KSPROPSETID_Pin;
282 ASSERT(Entry->FileObject);
283 return KsSynchronousIoControlDevice(Entry->FileObject, KernelMode, IOCTL_KS_PROPERTY, (PVOID)&PinRequest, sizeof(KSP_PIN), (PVOID)PinInstances, sizeof(KSPIN_CINSTANCES), &BytesReturned);
284
285}
@ KSPROPERTY_PIN_CINSTANCES
Definition: ks.h:625
#define ASSERT(a)
Definition: mode.c:44
ULONG PinId
Definition: ks.h:2603

Referenced by InstantiatePins().

◆ HandleSysAudioFilterPinProperties()

NTSTATUS HandleSysAudioFilterPinProperties ( PIRP  Irp,
PKSPROPERTY  Property,
PSYSAUDIODEVEXT  DeviceExtension 
)

Definition at line 94 of file control.c.

98{
99 PIO_STACK_LOCATION IoStack;
103
104 // in order to access pin properties of a sysaudio device
105 // the caller must provide a KSP_PIN struct, where
106 // Reserved member points to virtual device index
107
109 if (IoStack->Parameters.DeviceIoControl.InputBufferLength < sizeof(KSP_PIN))
110 {
111 /* too small buffer */
112 return SetIrpIoStatus(Irp, STATUS_BUFFER_TOO_SMALL, sizeof(KSPROPERTY) + sizeof(ULONG));
113 }
114
115 Entry = GetListEntry(&DeviceExtension->KsAudioDeviceList, ((KSP_PIN*)Property)->Reserved);
116 if (!Entry)
117 {
118 /* invalid device index */
120 }
121
122 /* forward request to the filter implementing the property */
124 (PVOID)IoStack->Parameters.DeviceIoControl.Type3InputBuffer,
125 IoStack->Parameters.DeviceIoControl.InputBufferLength,
126 Irp->UserBuffer,
127 IoStack->Parameters.DeviceIoControl.OutputBufferLength,
129
131}
static PIO_STACK_LOCATION IoGetCurrentIrpStackLocation(PIRP Irp)
_In_ PIRP Irp
Definition: csq.h:116
NTSTATUS SetIrpIoStatus(IN PIRP Irp, IN NTSTATUS Status, IN ULONG Length)
Definition: sup.c:59
PKSAUDIO_DEVICE_ENTRY GetListEntry(IN PLIST_ENTRY Head, IN ULONG Index)
Definition: control.c:45
#define STATUS_BUFFER_TOO_SMALL
Definition: shellext.h:69
LIST_ENTRY KsAudioDeviceList
Definition: sysaudio.h:30
struct _IO_STACK_LOCATION::@1579::@1580 DeviceIoControl
union _IO_STACK_LOCATION::@1579 Parameters
#define STATUS_INVALID_PARAMETER
Definition: udferr_usr.h:135

Referenced by SysAudioHandleProperty().

◆ SetIrpIoStatus()

NTSTATUS SetIrpIoStatus ( IN PIRP  Irp,
IN NTSTATUS  Status,
IN ULONG  Length 
)

Definition at line 25 of file control.c.

29{
30 Irp->IoStatus.Information = Length;
31 Irp->IoStatus.Status = Status;
33 {
35 }
36 else
37 {
39 }
40 return Status;
41
42}
#define STATUS_PENDING
Definition: d3dkmdt.h:43
IoMarkIrpPending(Irp)
#define IoCompleteRequest
Definition: irp.c:1240
#define IO_NO_INCREMENT
Definition: iotypes.h:598

◆ SysAudioHandleProperty()

NTSTATUS SysAudioHandleProperty ( PDEVICE_OBJECT  DeviceObject,
PIRP  Irp 
)

Definition at line 288 of file control.c.

291{
292 PIO_STACK_LOCATION IoStack;
294 KSPROPERTY PropertyRequest;
298 PSYSAUDIODEVEXT DeviceExtension;
300 PSYSAUDIO_INSTANCE_INFO InstanceInfo;
305
307
308 if (IoStack->Parameters.DeviceIoControl.InputBufferLength < sizeof(KSPROPERTY))
309 {
310 /* buffer must be at least of sizeof KSPROPERTY */
312 }
313
314 Property = (PKSPROPERTY)IoStack->Parameters.DeviceIoControl.Type3InputBuffer;
315 DeviceExtension = (PSYSAUDIODEVEXT)DeviceObject->DeviceExtension;
316
318 {
319 return HandleSysAudioFilterPinProperties(Irp, Property, DeviceExtension);
320 }
322 {
323 if (IoStack->Parameters.DeviceIoControl.InputBufferLength < sizeof(KSP_PIN))
324 {
325 /* too small buffer */
327 }
328 Pin = (PKSP_PIN)IoStack->Parameters.DeviceIoControl.Type3InputBuffer;
329 Entry = GetListEntry(&DeviceExtension->KsAudioDeviceList, Pin->Reserved);
330 ASSERT(Entry != NULL);
331
332 /* forward request to the filter implementing the property */
334 (PVOID)IoStack->Parameters.DeviceIoControl.Type3InputBuffer,
335 IoStack->Parameters.DeviceIoControl.InputBufferLength,
336 Irp->UserBuffer,
337 IoStack->Parameters.DeviceIoControl.OutputBufferLength,
339
341 }
343 {
345 {
346 if (IoStack->Parameters.DeviceIoControl.InputBufferLength < sizeof(KSPROPERTY) + sizeof(ULONG))
347 {
348 /* invalid request */
349 return SetIrpIoStatus(Irp, STATUS_UNSUCCESSFUL, sizeof(KSPROPERTY) + sizeof(ULONG));
350 }
351 Index = (PULONG)(Property + 1);
352
353 if (DeviceExtension->NumberOfKsAudioDevices <= *Index)
354 {
355 /* invalid index */
357 }
358
359 Entry = GetListEntry(&DeviceExtension->KsAudioDeviceList, *Index);
360 ASSERT(Entry != NULL);
361
362 BytesReturned = Entry->DeviceName.Length + sizeof(WCHAR);
363 if (IoStack->Parameters.DeviceIoControl.OutputBufferLength < BytesReturned)
364 {
365 /* too small buffer */
367 }
368
369 /* copy device name */
370 DeviceName = (LPWSTR)Irp->UserBuffer;
371
372 RtlMoveMemory(DeviceName, Entry->DeviceName.Buffer, Entry->DeviceName.Length);
373 DeviceName[Entry->DeviceName.Length / sizeof(WCHAR)] = L'\0';
375 }
376
378 {
379 if (IoStack->Parameters.DeviceIoControl.InputBufferLength < sizeof(KSPROPERTY) + sizeof(ULONG))
380 {
381 /* too small buffer */
382 return SetIrpIoStatus(Irp, STATUS_BUFFER_TOO_SMALL, sizeof(KSPROPERTY) + sizeof(ULONG));
383 }
384
385 if (IoStack->Parameters.DeviceIoControl.OutputBufferLength < sizeof(KSCOMPONENTID))
386 {
387 /* too small buffer */
389 }
390
391 Index = (PULONG)(Property + 1);
392
393 if (DeviceExtension->NumberOfKsAudioDevices <= *Index)
394 {
395 /* invalid index */
397 }
398 Entry = GetListEntry(&DeviceExtension->KsAudioDeviceList, *Index);
399 ASSERT(Entry != NULL);
400
401 PropertyRequest.Set = KSPROPSETID_General;
402 PropertyRequest.Id = KSPROPERTY_GENERAL_COMPONENTID;
403 PropertyRequest.Flags = KSPROPERTY_TYPE_GET;
404
405 /* call the filter */
407 if (!NT_SUCCESS(Status))
408 {
409 DPRINT("KsSynchronousIoControlDevice failed with %x for KSPROPERTY_GENERAL_COMPONENTID\n", Status);
410 return SetIrpIoStatus(Irp, Status, 0);
411 }
412 RtlMoveMemory(Irp->UserBuffer, &ComponentId, sizeof(KSCOMPONENTID));
414 }
416 {
417 if (IoStack->Parameters.DeviceIoControl.OutputBufferLength < sizeof(ULONG))
418 {
419 /* too small buffer */
421 }
422
423 *((PULONG)Irp->UserBuffer) = DeviceExtension->NumberOfKsAudioDevices;
424 return SetIrpIoStatus(Irp, STATUS_SUCCESS, sizeof(ULONG));
425 }
427 {
428 if (IoStack->Parameters.DeviceIoControl.OutputBufferLength < sizeof(ULONG))
429 {
430 /* too small buffer */
432 }
433
434 if (Property->Flags & KSPROPERTY_TYPE_SET)
435 {
436 Index = (PULONG)Irp->UserBuffer;
437 return SysAudioOpenVirtualDevice(Irp, *Index, DeviceExtension);
438 }
439 }
441 {
442 if (IoStack->Parameters.DeviceIoControl.InputBufferLength < sizeof(SYSAUDIO_INSTANCE_INFO))
443 {
444 /* too small buffer */
446 }
447
448 /* get input parameter */
449 InstanceInfo = (PSYSAUDIO_INSTANCE_INFO)Property;
450
451 if (Property->Flags & KSPROPERTY_TYPE_SET)
452 {
453 return SysAudioOpenVirtualDevice(Irp, InstanceInfo->DeviceNumber, DeviceExtension);
454 }
455 }
456 }
457
459 DPRINT1("Unhandled property Set |%S| Id %u Flags %x\n", GuidString.Buffer, Property->Id, Property->Flags);
462}
ACPI_BUFFER *RetBuffer ACPI_BUFFER *RetBuffer char ACPI_WALK_RESOURCE_CALLBACK void *Context ACPI_BUFFER *RetBuffer UINT16 ACPI_RESOURCE **ResourcePtr ACPI_GENERIC_ADDRESS *Reg UINT32 *ReturnValue UINT8 UINT8 *Slp_TypB ACPI_PHYSICAL_ADDRESS PhysicalAddress64 UINT32 UINT32 *TimeElapsed UINT32 ACPI_STATUS const char UINT32 ACPI_STATUS const char UINT32 const char const char UINT32 ComponentId
Definition: acpixf.h:1281
NTSTATUS HandleSysAudioFilterPinProperties(PIRP Irp, PKSPROPERTY Property, PSYSAUDIODEVEXT DeviceExtension)
Definition: control.c:94
NTSTATUS SysAudioOpenVirtualDevice(IN PIRP Irp, IN ULONG DeviceNumber, PSYSAUDIODEVEXT DeviceExtension)
Definition: control.c:61
const GUID KSPROPSETID_General
Definition: control.c:16
const GUID KSPROPSETID_Topology
Definition: control.c:19
const GUID KSPROPSETID_Sysaudio
Definition: control.c:14
#define KSPROPERTY_TYPE_SET
Definition: dmksctrl.h:43
struct KSIDENTIFIER * PKSPROPERTY
IN PDCB IN VBO IN ULONG IN BOOLEAN Pin
Definition: fatprocs.h:428
NTSYSAPI NTSTATUS WINAPI RtlStringFromGUID(REFGUID, PUNICODE_STRING)
struct KSP_PIN * PKSP_PIN
@ KSPROPERTY_GENERAL_COMPONENTID
Definition: ks.h:447
@ KSPROPERTY_SYSAUDIO_DEVICE_INTERFACE_NAME
Definition: ksmedia.h:1171
@ KSPROPERTY_SYSAUDIO_DEVICE_INSTANCE
Definition: ksmedia.h:1170
@ KSPROPERTY_SYSAUDIO_COMPONENT_ID
Definition: ksmedia.h:1176
@ KSPROPERTY_SYSAUDIO_INSTANCE_INFO
Definition: ksmedia.h:1175
@ KSPROPERTY_SYSAUDIO_DEVICE_COUNT
Definition: ksmedia.h:1168
struct SYSAUDIO_INSTANCE_INFO * PSYSAUDIO_INSTANCE_INFO
static PWSTR GuidString
Definition: apphelp.c:93
NTSYSAPI VOID NTAPI RtlFreeUnicodeString(PUNICODE_STRING UnicodeString)
#define L(x)
Definition: ntvdm.h:50
ULONG NumberOfKsAudioDevices
Definition: sysaudio.h:28
uint32_t * PULONG
Definition: typedefs.h:59
_In_ PDEVICE_OBJECT DeviceObject
Definition: wdfdevice.h:2055
_Must_inspect_result_ _In_ PWDFDEVICE_INIT _In_opt_ PCUNICODE_STRING DeviceName
Definition: wdfdevice.h:3275
#define IsEqualGUIDAligned(guid1, guid2)
Definition: wdm.template.h:235
__wchar_t WCHAR
Definition: xmlstorage.h:180
WCHAR * LPWSTR
Definition: xmlstorage.h:184

Referenced by Dispatch_fnDeviceIoControl().

◆ SysAudioOpenVirtualDevice()

NTSTATUS SysAudioOpenVirtualDevice ( IN PIRP  Irp,
IN ULONG  DeviceNumber,
PSYSAUDIODEVEXT  DeviceExtension 
)

Definition at line 61 of file control.c.

65{
67 PIO_STACK_LOCATION IoStack;
68
69 /* get current irp stack */
71
72 /* sanity check */
73 ASSERT(IoStack->FileObject);
74
75 if (DeviceNumber >= DeviceExtension->NumberOfKsAudioDevices)
76 {
77 /* invalid device index */
79 }
80
81 /* get device context */
83 ASSERT(Entry != NULL);
84
85 /* store device entry in FsContext
86 * see pin.c DispatchCreateSysAudioPin for details
87 */
88 IoStack->FileObject->FsContext = (PVOID)Entry;
89
91}
_In_ PCHAR _In_ ULONG DeviceNumber
Definition: classpnp.h:1230
PFILE_OBJECT FileObject
Definition: iotypes.h:3169
void * PVOID
Definition: typedefs.h:50

Referenced by SysAudioHandleProperty().

Variable Documentation

◆ KSDATAFORMAT_SPECIFIER_WAVEFORMATEX

const GUID KSDATAFORMAT_SPECIFIER_WAVEFORMATEX = {0x05589f81L, 0xc356, 0x11ce, {0xbf, 0x01, 0x00, 0xaa, 0x00, 0x55, 0x59, 0x5a}}

Definition at line 22 of file control.c.

Referenced by ComputeCompatibleFormat().

◆ KSDATAFORMAT_SUBTYPE_PCM

const GUID KSDATAFORMAT_SUBTYPE_PCM = {0x00000001L, 0x0000, 0x0010, {0x80, 0x00, 0x00, 0xaa, 0x00, 0x38, 0x9b, 0x71}}

Definition at line 21 of file control.c.

Referenced by ComputeCompatibleFormat().

◆ KSDATAFORMAT_TYPE_AUDIO

const GUID KSDATAFORMAT_TYPE_AUDIO = {0x73647561L, 0x0000, 0x0010, {0x80, 0x00, 0x00, 0xaa, 0x00, 0x38, 0x9b, 0x71}}

Definition at line 20 of file control.c.

Referenced by ComputeCompatibleFormat().

◆ KSPROPSETID_Connection

const GUID KSPROPSETID_Connection = {0x1D58C920L, 0xAC9B, 0x11CF, {0xA5, 0xD6, 0x28, 0xDB, 0x04, 0xC1, 0x00, 0x00}}

Definition at line 18 of file control.c.

◆ KSPROPSETID_General

const GUID KSPROPSETID_General = {0x1464EDA5L, 0x6A8F, 0x11D1, {0x9A, 0xA7, 0x00, 0xA0, 0xC9, 0x22, 0x31, 0x96}}

Definition at line 16 of file control.c.

Referenced by SysAudioHandleProperty().

◆ KSPROPSETID_Pin

const GUID KSPROPSETID_Pin = {0x8C134960L, 0x51AD, 0x11CF, {0x87, 0x8A, 0x94, 0xF8, 0x01, 0xC1, 0x00, 0x00}}

Definition at line 17 of file control.c.

Referenced by ComputeCompatibleFormat(), GetPinInstanceCount(), and SysAudioHandleProperty().

◆ KSPROPSETID_Sysaudio

const GUID KSPROPSETID_Sysaudio = {0xCBE3FAA0L, 0xCC75, 0x11D0, {0xB4, 0x65, 0x00, 0x00, 0x1A, 0x18, 0x18, 0xE6}}

Definition at line 14 of file control.c.

◆ KSPROPSETID_Sysaudio_Pin

const GUID KSPROPSETID_Sysaudio_Pin = {0xA3A53220L, 0xC6E4, 0x11D0, {0xB4, 0x65, 0x00, 0x00, 0x1A, 0x18, 0x18, 0xE6}}

Definition at line 15 of file control.c.

◆ KSPROPSETID_Topology

const GUID KSPROPSETID_Topology = {0x720D4AC0L, 0x7533, 0x11D0, {0xA5, 0xD6, 0x28, 0xDB, 0x04, 0xC1, 0x00, 0x00}}

Definition at line 19 of file control.c.

Referenced by SysAudioHandleProperty().