mirror of
https://github.com/reactos/reactos.git
synced 2025-08-03 15:46:13 +00:00
[SYSAUDIO]
- Don't build the pin descriptor as this will make problems with dynamic audio devices which dynamically adjust their audio pins - Remove dead code svn path=/trunk/; revision=47225
This commit is contained in:
parent
33284498ec
commit
0e5b61c534
5 changed files with 60 additions and 243 deletions
|
@ -97,7 +97,6 @@ HandleSysAudioFilterPinProperties(
|
||||||
NTSTATUS Status;
|
NTSTATUS Status;
|
||||||
PKSAUDIO_DEVICE_ENTRY Entry;
|
PKSAUDIO_DEVICE_ENTRY Entry;
|
||||||
ULONG BytesReturned;
|
ULONG BytesReturned;
|
||||||
PKSP_PIN Pin;
|
|
||||||
|
|
||||||
// in order to access pin properties of a sysaudio device
|
// in order to access pin properties of a sysaudio device
|
||||||
// the caller must provide a KSP_PIN struct, where
|
// the caller must provide a KSP_PIN struct, where
|
||||||
|
@ -110,8 +109,6 @@ HandleSysAudioFilterPinProperties(
|
||||||
return SetIrpIoStatus(Irp, STATUS_BUFFER_TOO_SMALL, sizeof(KSPROPERTY) + sizeof(ULONG));
|
return SetIrpIoStatus(Irp, STATUS_BUFFER_TOO_SMALL, sizeof(KSPROPERTY) + sizeof(ULONG));
|
||||||
}
|
}
|
||||||
|
|
||||||
Pin = (PKSP_PIN)Property;
|
|
||||||
|
|
||||||
Entry = GetListEntry(&DeviceExtension->KsAudioDeviceList, ((KSP_PIN*)Property)->Reserved);
|
Entry = GetListEntry(&DeviceExtension->KsAudioDeviceList, ((KSP_PIN*)Property)->Reserved);
|
||||||
if (!Entry)
|
if (!Entry)
|
||||||
{
|
{
|
||||||
|
@ -119,64 +116,15 @@ HandleSysAudioFilterPinProperties(
|
||||||
return SetIrpIoStatus(Irp, STATUS_INVALID_PARAMETER, 0);
|
return SetIrpIoStatus(Irp, STATUS_INVALID_PARAMETER, 0);
|
||||||
}
|
}
|
||||||
|
|
||||||
if (!Entry->Pins)
|
/* forward request to the filter implementing the property */
|
||||||
{
|
Status = KsSynchronousIoControlDevice(Entry->FileObject, KernelMode, IOCTL_KS_PROPERTY,
|
||||||
/* expected pins */
|
|
||||||
return SetIrpIoStatus(Irp, STATUS_UNSUCCESSFUL, 0);
|
|
||||||
}
|
|
||||||
|
|
||||||
if (Entry->PinDescriptorsCount <= Pin->PinId)
|
|
||||||
{
|
|
||||||
/* invalid pin id */
|
|
||||||
return SetIrpIoStatus(Irp, STATUS_INVALID_PARAMETER, 0);
|
|
||||||
}
|
|
||||||
|
|
||||||
if (Property->Id == KSPROPERTY_PIN_CTYPES)
|
|
||||||
{
|
|
||||||
if (IoStack->Parameters.DeviceIoControl.OutputBufferLength < sizeof(ULONG))
|
|
||||||
{
|
|
||||||
/* too small buffer */
|
|
||||||
return SetIrpIoStatus(Irp, STATUS_BUFFER_TOO_SMALL, sizeof(ULONG));
|
|
||||||
}
|
|
||||||
/* store result */
|
|
||||||
*((PULONG)Irp->UserBuffer) = Entry->PinDescriptorsCount;
|
|
||||||
return SetIrpIoStatus(Irp, STATUS_SUCCESS, sizeof(ULONG));
|
|
||||||
}
|
|
||||||
else if (Property->Id == KSPROPERTY_PIN_COMMUNICATION)
|
|
||||||
{
|
|
||||||
if (IoStack->Parameters.DeviceIoControl.OutputBufferLength < sizeof(KSPIN_COMMUNICATION))
|
|
||||||
{
|
|
||||||
/* too small buffer */
|
|
||||||
return SetIrpIoStatus(Irp, STATUS_BUFFER_TOO_SMALL, sizeof(KSPIN_COMMUNICATION));
|
|
||||||
}
|
|
||||||
/* store result */
|
|
||||||
*((KSPIN_COMMUNICATION*)Irp->UserBuffer) = Entry->PinDescriptors[Pin->PinId].Communication;
|
|
||||||
return SetIrpIoStatus(Irp, STATUS_SUCCESS, sizeof(KSPIN_COMMUNICATION));
|
|
||||||
|
|
||||||
}
|
|
||||||
else if (Property->Id == KSPROPERTY_PIN_DATAFLOW)
|
|
||||||
{
|
|
||||||
if (IoStack->Parameters.DeviceIoControl.OutputBufferLength < sizeof(KSPIN_DATAFLOW))
|
|
||||||
{
|
|
||||||
/* too small buffer */
|
|
||||||
return SetIrpIoStatus(Irp, STATUS_BUFFER_TOO_SMALL, sizeof(KSPIN_DATAFLOW));
|
|
||||||
}
|
|
||||||
/* store result */
|
|
||||||
*((KSPIN_DATAFLOW*)Irp->UserBuffer) = Entry->PinDescriptors[Pin->PinId].DataFlow;
|
|
||||||
return SetIrpIoStatus(Irp, STATUS_SUCCESS, sizeof(KSPIN_DATAFLOW));
|
|
||||||
}
|
|
||||||
else
|
|
||||||
{
|
|
||||||
/* forward request to the filter implementing the property */
|
|
||||||
Status = KsSynchronousIoControlDevice(Entry->FileObject, KernelMode, IOCTL_KS_PROPERTY,
|
|
||||||
(PVOID)IoStack->Parameters.DeviceIoControl.Type3InputBuffer,
|
(PVOID)IoStack->Parameters.DeviceIoControl.Type3InputBuffer,
|
||||||
IoStack->Parameters.DeviceIoControl.InputBufferLength,
|
IoStack->Parameters.DeviceIoControl.InputBufferLength,
|
||||||
Irp->UserBuffer,
|
Irp->UserBuffer,
|
||||||
IoStack->Parameters.DeviceIoControl.OutputBufferLength,
|
IoStack->Parameters.DeviceIoControl.OutputBufferLength,
|
||||||
&BytesReturned);
|
&BytesReturned);
|
||||||
|
|
||||||
return SetIrpIoStatus(Irp, Status, BytesReturned);
|
return SetIrpIoStatus(Irp, Status, BytesReturned);
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
@ -328,7 +276,7 @@ GetPinInstanceCount(
|
||||||
PinRequest.Property.Set = KSPROPSETID_Pin;
|
PinRequest.Property.Set = KSPROPSETID_Pin;
|
||||||
PinRequest.Property.Flags = KSPROPERTY_TYPE_GET;
|
PinRequest.Property.Flags = KSPROPERTY_TYPE_GET;
|
||||||
PinRequest.Property.Id = KSPROPERTY_PIN_CINSTANCES;
|
PinRequest.Property.Id = KSPROPERTY_PIN_CINSTANCES;
|
||||||
|
ASSERT(Entry->FileObject);
|
||||||
return KsSynchronousIoControlDevice(Entry->FileObject, KernelMode, IOCTL_KS_PROPERTY, (PVOID)&PinRequest, sizeof(KSP_PIN), (PVOID)PinInstances, sizeof(KSPIN_CINSTANCES), &BytesReturned);
|
return KsSynchronousIoControlDevice(Entry->FileObject, KernelMode, IOCTL_KS_PROPERTY, (PVOID)&PinRequest, sizeof(KSP_PIN), (PVOID)PinInstances, sizeof(KSPIN_CINSTANCES), &BytesReturned);
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
|
@ -14,139 +14,6 @@ const GUID KS_CATEGORY_AUDIO = {0x6994AD04L, 0x93EF, 0x11D0, {
|
||||||
const GUID KS_CATEGORY_TOPOLOGY = {0xDDA54A40, 0x1E4C, 0x11D1, {0xA0, 0x50, 0x40, 0x57, 0x05, 0xC1, 0x00, 0x00}};
|
const GUID KS_CATEGORY_TOPOLOGY = {0xDDA54A40, 0x1E4C, 0x11D1, {0xA0, 0x50, 0x40, 0x57, 0x05, 0xC1, 0x00, 0x00}};
|
||||||
const GUID DMOCATEGORY_ACOUSTIC_ECHO_CANCEL = {0xBF963D80L, 0xC559, 0x11D0, {0x8A, 0x2B, 0x00, 0xA0, 0xC9, 0x25, 0x5A, 0xC1}};
|
const GUID DMOCATEGORY_ACOUSTIC_ECHO_CANCEL = {0xBF963D80L, 0xC559, 0x11D0, {0x8A, 0x2B, 0x00, 0xA0, 0xC9, 0x25, 0x5A, 0xC1}};
|
||||||
|
|
||||||
NTSTATUS
|
|
||||||
BuildPinDescriptor(
|
|
||||||
IN PKSAUDIO_DEVICE_ENTRY DeviceEntry,
|
|
||||||
IN ULONG Count)
|
|
||||||
{
|
|
||||||
ULONG Index;
|
|
||||||
KSP_PIN PinRequest;
|
|
||||||
KSPIN_DATAFLOW DataFlow;
|
|
||||||
KSPIN_COMMUNICATION Communication;
|
|
||||||
ULONG NumWaveOutPin, NumWaveInPin;
|
|
||||||
NTSTATUS Status;
|
|
||||||
ULONG BytesReturned;
|
|
||||||
|
|
||||||
NumWaveInPin = 0;
|
|
||||||
NumWaveOutPin = 0;
|
|
||||||
for(Index = 0; Index < Count; Index++)
|
|
||||||
{
|
|
||||||
/* retrieve data flow */
|
|
||||||
PinRequest.PinId = Index;
|
|
||||||
PinRequest.Property.Set = KSPROPSETID_Pin;
|
|
||||||
PinRequest.Property.Flags = KSPROPERTY_TYPE_GET;
|
|
||||||
|
|
||||||
/* get dataflow direction */
|
|
||||||
PinRequest.Property.Id = KSPROPERTY_PIN_DATAFLOW;
|
|
||||||
Status = KsSynchronousIoControlDevice(DeviceEntry->FileObject, KernelMode, IOCTL_KS_PROPERTY, (PVOID)&PinRequest, sizeof(KSP_PIN), (PVOID)&DataFlow, sizeof(KSPIN_DATAFLOW), &BytesReturned);
|
|
||||||
if (NT_SUCCESS(Status))
|
|
||||||
{
|
|
||||||
DeviceEntry->PinDescriptors[Index].DataFlow = DataFlow;
|
|
||||||
}
|
|
||||||
|
|
||||||
/* get irp flow direction */
|
|
||||||
PinRequest.Property.Id = KSPROPERTY_PIN_COMMUNICATION;
|
|
||||||
Status = KsSynchronousIoControlDevice(DeviceEntry->FileObject, KernelMode, IOCTL_KS_PROPERTY, (PVOID)&PinRequest, sizeof(KSP_PIN), (PVOID)&Communication, sizeof(KSPIN_COMMUNICATION), &BytesReturned);
|
|
||||||
if (NT_SUCCESS(Status))
|
|
||||||
{
|
|
||||||
DeviceEntry->PinDescriptors[Index].Communication = Communication;
|
|
||||||
}
|
|
||||||
|
|
||||||
if (Communication == KSPIN_COMMUNICATION_SINK && DataFlow == KSPIN_DATAFLOW_IN)
|
|
||||||
NumWaveOutPin++;
|
|
||||||
|
|
||||||
if (Communication == KSPIN_COMMUNICATION_SINK && DataFlow == KSPIN_DATAFLOW_OUT)
|
|
||||||
NumWaveInPin++;
|
|
||||||
|
|
||||||
/* FIXME query for interface, dataformat etc */
|
|
||||||
}
|
|
||||||
|
|
||||||
DPRINT("Num Pins %u Num WaveIn Pins %u Name WaveOut Pins %u\n", DeviceEntry->PinDescriptorsCount, NumWaveInPin, NumWaveOutPin);
|
|
||||||
return STATUS_SUCCESS;
|
|
||||||
}
|
|
||||||
|
|
||||||
VOID
|
|
||||||
QueryFilterRoutine(
|
|
||||||
IN PKSAUDIO_DEVICE_ENTRY DeviceEntry)
|
|
||||||
{
|
|
||||||
KSPROPERTY PropertyRequest;
|
|
||||||
ULONG Count;
|
|
||||||
NTSTATUS Status;
|
|
||||||
ULONG BytesReturned;
|
|
||||||
|
|
||||||
DPRINT("Querying filter...\n");
|
|
||||||
|
|
||||||
PropertyRequest.Set = KSPROPSETID_Pin;
|
|
||||||
PropertyRequest.Flags = KSPROPERTY_TYPE_GET;
|
|
||||||
PropertyRequest.Id = KSPROPERTY_PIN_CTYPES;
|
|
||||||
|
|
||||||
/* query for num of pins */
|
|
||||||
Status = KsSynchronousIoControlDevice(DeviceEntry->FileObject, KernelMode, IOCTL_KS_PROPERTY, (PVOID)&PropertyRequest, sizeof(KSPROPERTY), (PVOID)&Count, sizeof(ULONG), &BytesReturned);
|
|
||||||
if (!NT_SUCCESS(Status))
|
|
||||||
{
|
|
||||||
DPRINT1("Failed to query number of pins Status %x\n", Status);
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
|
|
||||||
if (!Count)
|
|
||||||
{
|
|
||||||
DPRINT1("Filter has no pins!\n");
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
|
|
||||||
/* allocate pin descriptor array */
|
|
||||||
DeviceEntry->PinDescriptors = ExAllocatePool(NonPagedPool, Count * sizeof(KSPIN_DESCRIPTOR));
|
|
||||||
if (!DeviceEntry->PinDescriptors)
|
|
||||||
{
|
|
||||||
/* no memory */
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
|
|
||||||
/* zero array pin descriptor array */
|
|
||||||
RtlZeroMemory(DeviceEntry->PinDescriptors, Count * sizeof(KSPIN_DESCRIPTOR));
|
|
||||||
|
|
||||||
/* build the device descriptor */
|
|
||||||
Status = BuildPinDescriptor(DeviceEntry, Count);
|
|
||||||
if (!NT_SUCCESS(Status))
|
|
||||||
return;
|
|
||||||
|
|
||||||
|
|
||||||
/* allocate pin array */
|
|
||||||
DeviceEntry->Pins = ExAllocatePool(NonPagedPool, Count * sizeof(PIN_INFO));
|
|
||||||
if (!DeviceEntry->Pins)
|
|
||||||
{
|
|
||||||
/* no memory */
|
|
||||||
DPRINT1("Failed to allocate memory Pins %u Block %x\n", Count, Count * sizeof(PIN_INFO));
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
|
|
||||||
/* clear array */
|
|
||||||
RtlZeroMemory(DeviceEntry->Pins, sizeof(PIN_INFO) * Count);
|
|
||||||
DeviceEntry->PinDescriptorsCount = Count;
|
|
||||||
|
|
||||||
}
|
|
||||||
|
|
||||||
VOID
|
|
||||||
NTAPI
|
|
||||||
FilterPinWorkerRoutine(
|
|
||||||
IN PDEVICE_OBJECT DeviceObject,
|
|
||||||
IN PVOID Context)
|
|
||||||
{
|
|
||||||
PKSAUDIO_DEVICE_ENTRY DeviceEntry;
|
|
||||||
PFILTER_WORKER_CONTEXT Ctx = (PFILTER_WORKER_CONTEXT)Context;
|
|
||||||
|
|
||||||
DeviceEntry = Ctx->DeviceEntry;
|
|
||||||
|
|
||||||
QueryFilterRoutine(DeviceEntry);
|
|
||||||
|
|
||||||
/* free work item */
|
|
||||||
IoFreeWorkItem(Ctx->WorkItem);
|
|
||||||
/* free work item context */
|
|
||||||
ExFreePool(Ctx);
|
|
||||||
return;
|
|
||||||
|
|
||||||
}
|
|
||||||
|
|
||||||
NTSTATUS
|
NTSTATUS
|
||||||
OpenDevice(
|
OpenDevice(
|
||||||
IN PUNICODE_STRING DeviceName,
|
IN PUNICODE_STRING DeviceName,
|
||||||
|
@ -199,8 +66,6 @@ InsertAudioDevice(
|
||||||
IN PUNICODE_STRING DeviceName)
|
IN PUNICODE_STRING DeviceName)
|
||||||
{
|
{
|
||||||
NTSTATUS Status = STATUS_SUCCESS;
|
NTSTATUS Status = STATUS_SUCCESS;
|
||||||
PFILTER_WORKER_CONTEXT Ctx = NULL;
|
|
||||||
PIO_WORKITEM WorkItem = NULL;
|
|
||||||
PSYSAUDIODEVEXT DeviceExtension;
|
PSYSAUDIODEVEXT DeviceExtension;
|
||||||
PKSAUDIO_DEVICE_ENTRY DeviceEntry = NULL;
|
PKSAUDIO_DEVICE_ENTRY DeviceEntry = NULL;
|
||||||
|
|
||||||
|
@ -215,24 +80,6 @@ InsertAudioDevice(
|
||||||
/* initialize audio device entry */
|
/* initialize audio device entry */
|
||||||
RtlZeroMemory(DeviceEntry, sizeof(KSAUDIO_DEVICE_ENTRY));
|
RtlZeroMemory(DeviceEntry, sizeof(KSAUDIO_DEVICE_ENTRY));
|
||||||
|
|
||||||
/* allocate filter ctx */
|
|
||||||
Ctx = ExAllocatePool(NonPagedPool, sizeof(FILTER_WORKER_CONTEXT));
|
|
||||||
if (!Ctx)
|
|
||||||
{
|
|
||||||
/* no memory */
|
|
||||||
Status = STATUS_INSUFFICIENT_RESOURCES;
|
|
||||||
goto cleanup;
|
|
||||||
}
|
|
||||||
|
|
||||||
/* allocate work item */
|
|
||||||
WorkItem = IoAllocateWorkItem(DeviceObject);
|
|
||||||
if (!WorkItem)
|
|
||||||
{
|
|
||||||
/* no memory */
|
|
||||||
Status = STATUS_INSUFFICIENT_RESOURCES;
|
|
||||||
goto cleanup;
|
|
||||||
}
|
|
||||||
|
|
||||||
/* set device name */
|
/* set device name */
|
||||||
DeviceEntry->DeviceName.Length = 0;
|
DeviceEntry->DeviceName.Length = 0;
|
||||||
DeviceEntry->DeviceName.MaximumLength = DeviceName->MaximumLength + 10 * sizeof(WCHAR);
|
DeviceEntry->DeviceName.MaximumLength = DeviceName->MaximumLength + 10 * sizeof(WCHAR);
|
||||||
|
@ -255,9 +102,6 @@ InsertAudioDevice(
|
||||||
goto cleanup;
|
goto cleanup;
|
||||||
}
|
}
|
||||||
|
|
||||||
Ctx->DeviceEntry = DeviceEntry;
|
|
||||||
Ctx->WorkItem = WorkItem;
|
|
||||||
|
|
||||||
/* fetch device extension */
|
/* fetch device extension */
|
||||||
DeviceExtension = (PSYSAUDIODEVEXT)DeviceObject->DeviceExtension;
|
DeviceExtension = (PSYSAUDIODEVEXT)DeviceObject->DeviceExtension;
|
||||||
/* insert new audio device */
|
/* insert new audio device */
|
||||||
|
@ -265,16 +109,9 @@ InsertAudioDevice(
|
||||||
InterlockedIncrement((PLONG)&DeviceExtension->NumberOfKsAudioDevices);
|
InterlockedIncrement((PLONG)&DeviceExtension->NumberOfKsAudioDevices);
|
||||||
|
|
||||||
DPRINT("Successfully opened audio device %u Device %S\n", DeviceExtension->NumberOfKsAudioDevices, DeviceEntry->DeviceName.Buffer);
|
DPRINT("Successfully opened audio device %u Device %S\n", DeviceExtension->NumberOfKsAudioDevices, DeviceEntry->DeviceName.Buffer);
|
||||||
IoQueueWorkItem(WorkItem, FilterPinWorkerRoutine, DelayedWorkQueue, (PVOID)Ctx);
|
|
||||||
return Status;
|
return Status;
|
||||||
|
|
||||||
cleanup:
|
cleanup:
|
||||||
if (Ctx)
|
|
||||||
ExFreePool(Ctx);
|
|
||||||
|
|
||||||
if (WorkItem)
|
|
||||||
IoFreeWorkItem(WorkItem);
|
|
||||||
|
|
||||||
if (DeviceEntry)
|
if (DeviceEntry)
|
||||||
{
|
{
|
||||||
if (DeviceEntry->DeviceName.Buffer)
|
if (DeviceEntry->DeviceName.Buffer)
|
||||||
|
|
|
@ -53,10 +53,10 @@ SysAudio_Shutdown(
|
||||||
|
|
||||||
/* close audio device handle */
|
/* close audio device handle */
|
||||||
ZwClose(DeviceEntry->Handle);
|
ZwClose(DeviceEntry->Handle);
|
||||||
|
|
||||||
/* free device string */
|
/* free device string */
|
||||||
RtlFreeUnicodeString(&DeviceEntry->DeviceName);
|
RtlFreeUnicodeString(&DeviceEntry->DeviceName);
|
||||||
/* free pins */
|
|
||||||
ExFreePool(DeviceEntry->Pins);
|
|
||||||
/* free audio device entry */
|
/* free audio device entry */
|
||||||
ExFreePool(DeviceEntry);
|
ExFreePool(DeviceEntry);
|
||||||
}
|
}
|
||||||
|
|
|
@ -354,7 +354,7 @@ InstantiatePins(
|
||||||
}
|
}
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
DeviceEntry->Pins[Connect->PinId].References = 0;
|
//DeviceEntry->Pins[Connect->PinId].References = 0;
|
||||||
|
|
||||||
/* initialize dispatch context */
|
/* initialize dispatch context */
|
||||||
DispatchContext->Handle = RealPinHandle;
|
DispatchContext->Handle = RealPinHandle;
|
||||||
|
@ -385,6 +385,44 @@ InstantiatePins(
|
||||||
return Status;
|
return Status;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
NTSTATUS
|
||||||
|
GetConnectRequest(
|
||||||
|
IN PIRP Irp,
|
||||||
|
OUT PKSPIN_CONNECT * Result)
|
||||||
|
{
|
||||||
|
PIO_STACK_LOCATION IoStack;
|
||||||
|
ULONG ObjectLength, ParametersLength;
|
||||||
|
PVOID Buffer;
|
||||||
|
|
||||||
|
/* get current irp stack */
|
||||||
|
IoStack = IoGetCurrentIrpStackLocation(Irp);
|
||||||
|
|
||||||
|
/* get object class length */
|
||||||
|
ObjectLength = (wcslen(KSSTRING_Pin) + 2) * sizeof(WCHAR);
|
||||||
|
|
||||||
|
/* check for minium length requirement */
|
||||||
|
if (ObjectLength + sizeof(KSPIN_CONNECT) > IoStack->FileObject->FileName.MaximumLength)
|
||||||
|
return STATUS_UNSUCCESSFUL;
|
||||||
|
|
||||||
|
/* extract parameters length */
|
||||||
|
ParametersLength = IoStack->FileObject->FileName.MaximumLength - ObjectLength;
|
||||||
|
|
||||||
|
/* allocate buffer */
|
||||||
|
Buffer = ExAllocatePool(NonPagedPool, ParametersLength);
|
||||||
|
if (!Buffer)
|
||||||
|
return STATUS_INSUFFICIENT_RESOURCES;
|
||||||
|
|
||||||
|
/* copy parameters */
|
||||||
|
RtlMoveMemory(Buffer, &IoStack->FileObject->FileName.Buffer[ObjectLength / sizeof(WCHAR)], ParametersLength);
|
||||||
|
|
||||||
|
/* store result */
|
||||||
|
*Result = (PKSPIN_CONNECT)Buffer;
|
||||||
|
|
||||||
|
return STATUS_SUCCESS;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
NTSTATUS
|
NTSTATUS
|
||||||
NTAPI
|
NTAPI
|
||||||
DispatchCreateSysAudioPin(
|
DispatchCreateSysAudioPin(
|
||||||
|
@ -394,7 +432,7 @@ DispatchCreateSysAudioPin(
|
||||||
NTSTATUS Status = STATUS_SUCCESS;
|
NTSTATUS Status = STATUS_SUCCESS;
|
||||||
PIO_STACK_LOCATION IoStack;
|
PIO_STACK_LOCATION IoStack;
|
||||||
PKSAUDIO_DEVICE_ENTRY DeviceEntry;
|
PKSAUDIO_DEVICE_ENTRY DeviceEntry;
|
||||||
PKSPIN_CONNECT Connect = NULL;
|
PKSPIN_CONNECT Connect;
|
||||||
PDISPATCH_CONTEXT DispatchContext;
|
PDISPATCH_CONTEXT DispatchContext;
|
||||||
|
|
||||||
DPRINT("DispatchCreateSysAudioPin entered\n");
|
DPRINT("DispatchCreateSysAudioPin entered\n");
|
||||||
|
@ -410,9 +448,6 @@ DispatchCreateSysAudioPin(
|
||||||
/* get current attached virtual device */
|
/* get current attached virtual device */
|
||||||
DeviceEntry = (PKSAUDIO_DEVICE_ENTRY)IoStack->FileObject->RelatedFileObject->FsContext;
|
DeviceEntry = (PKSAUDIO_DEVICE_ENTRY)IoStack->FileObject->RelatedFileObject->FsContext;
|
||||||
|
|
||||||
/* now validate pin connect request */
|
|
||||||
Status = KsValidateConnectRequest(Irp, DeviceEntry->PinDescriptorsCount, DeviceEntry->PinDescriptors, &Connect);
|
|
||||||
|
|
||||||
/* check for success */
|
/* check for success */
|
||||||
if (!NT_SUCCESS(Status))
|
if (!NT_SUCCESS(Status))
|
||||||
{
|
{
|
||||||
|
@ -422,6 +457,19 @@ DispatchCreateSysAudioPin(
|
||||||
return Status;
|
return Status;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/* get connect details */
|
||||||
|
Status = GetConnectRequest(Irp, &Connect);
|
||||||
|
|
||||||
|
/* check for success */
|
||||||
|
if (!NT_SUCCESS(Status))
|
||||||
|
{
|
||||||
|
/* failed to obtain connect details */
|
||||||
|
Irp->IoStatus.Status = Status;
|
||||||
|
IoCompleteRequest(Irp, IO_NO_INCREMENT);
|
||||||
|
return Status;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
/* allocate dispatch context */
|
/* allocate dispatch context */
|
||||||
DispatchContext = ExAllocatePool(NonPagedPool, sizeof(DISPATCH_CONTEXT));
|
DispatchContext = ExAllocatePool(NonPagedPool, sizeof(DISPATCH_CONTEXT));
|
||||||
if (!DispatchContext)
|
if (!DispatchContext)
|
||||||
|
|
|
@ -24,9 +24,7 @@ typedef struct
|
||||||
HANDLE Handle; // handle to audio device
|
HANDLE Handle; // handle to audio device
|
||||||
PFILE_OBJECT FileObject; // file objecto to audio device
|
PFILE_OBJECT FileObject; // file objecto to audio device
|
||||||
|
|
||||||
PIN_INFO * Pins; // array of PIN_INFO
|
//PIN_INFO * Pins; // array of PIN_INFO
|
||||||
ULONG PinDescriptorsCount; // number of pin descriptors
|
|
||||||
KSPIN_DESCRIPTOR *PinDescriptors; // pin descriptors array
|
|
||||||
}KSAUDIO_DEVICE_ENTRY, *PKSAUDIO_DEVICE_ENTRY;
|
}KSAUDIO_DEVICE_ENTRY, *PKSAUDIO_DEVICE_ENTRY;
|
||||||
|
|
||||||
typedef struct
|
typedef struct
|
||||||
|
@ -62,20 +60,6 @@ typedef struct
|
||||||
HANDLE hMixerPin; // handle to mixer pin
|
HANDLE hMixerPin; // handle to mixer pin
|
||||||
}DISPATCH_CONTEXT, *PDISPATCH_CONTEXT;
|
}DISPATCH_CONTEXT, *PDISPATCH_CONTEXT;
|
||||||
|
|
||||||
typedef struct
|
|
||||||
{
|
|
||||||
PIO_WORKITEM WorkItem;
|
|
||||||
PKSAUDIO_DEVICE_ENTRY DeviceEntry;
|
|
||||||
}FILTER_WORKER_CONTEXT, *PFILTER_WORKER_CONTEXT;
|
|
||||||
|
|
||||||
typedef struct
|
|
||||||
{
|
|
||||||
PIRP Irp;
|
|
||||||
IO_STATUS_BLOCK StatusBlock;
|
|
||||||
}COMPLETION_CONTEXT, *PCOMPLETION_CONTEXT;
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
NTSTATUS
|
NTSTATUS
|
||||||
SysAudioAllocateDeviceHeader(
|
SysAudioAllocateDeviceHeader(
|
||||||
IN SYSAUDIODEVEXT *DeviceExtension);
|
IN SYSAUDIODEVEXT *DeviceExtension);
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue