mirror of
https://github.com/reactos/reactos.git
synced 2025-08-03 21:36:11 +00:00
[PORTCLS]
- Silence most dprints of portcls - Remove dead code - Fix a bug in PcCreateSubdeviceDescriptor svn path=/trunk/; revision=43618
This commit is contained in:
parent
8869f7edc2
commit
25db485c93
31 changed files with 195 additions and 343 deletions
|
@ -28,11 +28,11 @@ PcInitializeAdapterDriver(
|
||||||
IN PUNICODE_STRING RegistryPathName,
|
IN PUNICODE_STRING RegistryPathName,
|
||||||
IN PDRIVER_ADD_DEVICE AddDevice)
|
IN PDRIVER_ADD_DEVICE AddDevice)
|
||||||
{
|
{
|
||||||
DPRINT1("PcInitializeAdapterDriver\n");
|
DPRINT("PcInitializeAdapterDriver\n");
|
||||||
PC_ASSERT_IRQL_EQUAL(PASSIVE_LEVEL);
|
PC_ASSERT_IRQL_EQUAL(PASSIVE_LEVEL);
|
||||||
|
|
||||||
// Our IRP handlers
|
// Our IRP handlers
|
||||||
DPRINT1("Setting IRP handlers\n");
|
DPRINT("Setting IRP handlers\n");
|
||||||
DriverObject->MajorFunction[IRP_MJ_CREATE] = PcDispatchIrp;
|
DriverObject->MajorFunction[IRP_MJ_CREATE] = PcDispatchIrp;
|
||||||
DriverObject->MajorFunction[IRP_MJ_PNP] = PcDispatchIrp;
|
DriverObject->MajorFunction[IRP_MJ_PNP] = PcDispatchIrp;
|
||||||
DriverObject->MajorFunction[IRP_MJ_POWER] = PcDispatchIrp;
|
DriverObject->MajorFunction[IRP_MJ_POWER] = PcDispatchIrp;
|
||||||
|
@ -79,7 +79,7 @@ PcAddAdapterDevice(
|
||||||
PDEVICE_OBJECT PrevDeviceObject;
|
PDEVICE_OBJECT PrevDeviceObject;
|
||||||
PPCLASS_DEVICE_EXTENSION portcls_ext = NULL;
|
PPCLASS_DEVICE_EXTENSION portcls_ext = NULL;
|
||||||
|
|
||||||
DPRINT1("PcAddAdapterDevice called\n");
|
DPRINT("PcAddAdapterDevice called\n");
|
||||||
PC_ASSERT_IRQL_EQUAL(PASSIVE_LEVEL);
|
PC_ASSERT_IRQL_EQUAL(PASSIVE_LEVEL);
|
||||||
|
|
||||||
if (!DriverObject || !PhysicalDeviceObject || !StartDevice)
|
if (!DriverObject || !PhysicalDeviceObject || !StartDevice)
|
||||||
|
@ -215,7 +215,7 @@ PcRegisterSubdevice(
|
||||||
UNICODE_STRING RefName;
|
UNICODE_STRING RefName;
|
||||||
PSYMBOLICLINK_ENTRY SymEntry;
|
PSYMBOLICLINK_ENTRY SymEntry;
|
||||||
|
|
||||||
DPRINT1("PcRegisterSubdevice DeviceObject %p Name %S Unknown %p\n", DeviceObject, Name, Unknown);
|
DPRINT("PcRegisterSubdevice DeviceObject %p Name %S Unknown %p\n", DeviceObject, Name, Unknown);
|
||||||
|
|
||||||
PC_ASSERT_IRQL_EQUAL(PASSIVE_LEVEL);
|
PC_ASSERT_IRQL_EQUAL(PASSIVE_LEVEL);
|
||||||
|
|
||||||
|
@ -240,7 +240,7 @@ PcRegisterSubdevice(
|
||||||
Status = Unknown->QueryInterface(IID_ISubdevice, (LPVOID*)&SubDevice);
|
Status = Unknown->QueryInterface(IID_ISubdevice, (LPVOID*)&SubDevice);
|
||||||
if (!NT_SUCCESS(Status))
|
if (!NT_SUCCESS(Status))
|
||||||
{
|
{
|
||||||
DPRINT1("No ISubdevice interface\n");
|
DPRINT("No ISubdevice interface\n");
|
||||||
// the provided port driver doesnt support ISubdevice
|
// the provided port driver doesnt support ISubdevice
|
||||||
return STATUS_INVALID_PARAMETER;
|
return STATUS_INVALID_PARAMETER;
|
||||||
}
|
}
|
||||||
|
@ -249,7 +249,7 @@ PcRegisterSubdevice(
|
||||||
Status = SubDevice->GetDescriptor(&SubDeviceDescriptor);
|
Status = SubDevice->GetDescriptor(&SubDeviceDescriptor);
|
||||||
if (!NT_SUCCESS(Status))
|
if (!NT_SUCCESS(Status))
|
||||||
{
|
{
|
||||||
DPRINT1("Failed to get subdevice descriptor %x\n", Status);
|
DPRINT("Failed to get subdevice descriptor %x\n", Status);
|
||||||
SubDevice->Release();
|
SubDevice->Release();
|
||||||
return STATUS_UNSUCCESSFUL;
|
return STATUS_UNSUCCESSFUL;
|
||||||
}
|
}
|
||||||
|
@ -260,7 +260,7 @@ PcRegisterSubdevice(
|
||||||
{
|
{
|
||||||
// failed to attach
|
// failed to attach
|
||||||
SubDevice->Release();
|
SubDevice->Release();
|
||||||
DPRINT1("KsAddObjectCreateItemToDeviceHeader failed with %x\n", Status);
|
DPRINT("KsAddObjectCreateItemToDeviceHeader failed with %x\n", Status);
|
||||||
return Status;
|
return Status;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -92,7 +92,7 @@ PcRegisterIoTimeout(
|
||||||
TimerContext = (PTIMER_CONTEXT)AllocateItem(NonPagedPool, sizeof(TIMER_CONTEXT), TAG_PORTCLASS);
|
TimerContext = (PTIMER_CONTEXT)AllocateItem(NonPagedPool, sizeof(TIMER_CONTEXT), TAG_PORTCLASS);
|
||||||
if (!TimerContext)
|
if (!TimerContext)
|
||||||
{
|
{
|
||||||
DPRINT1("Failed to allocate memory\n");
|
DPRINT("Failed to allocate memory\n");
|
||||||
return STATUS_INSUFFICIENT_RESOURCES;
|
return STATUS_INSUFFICIENT_RESOURCES;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -82,7 +82,7 @@ CDmaChannelInit::QueryInterface(
|
||||||
PUNKNOWN(*Output)->AddRef();
|
PUNKNOWN(*Output)->AddRef();
|
||||||
return STATUS_SUCCESS;
|
return STATUS_SUCCESS;
|
||||||
}
|
}
|
||||||
DPRINT1("No interface!!!\n");
|
DPRINT("No interface!!!\n");
|
||||||
return STATUS_UNSUCCESSFUL;
|
return STATUS_UNSUCCESSFUL;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -101,20 +101,20 @@ CDmaChannelInit::AllocateBuffer(
|
||||||
// Did the caller already allocate a buffer ?*/
|
// Did the caller already allocate a buffer ?*/
|
||||||
if (m_Buffer)
|
if (m_Buffer)
|
||||||
{
|
{
|
||||||
DPRINT1("CDmaChannelInit_AllocateBuffer free common buffer first \n");
|
DPRINT("CDmaChannelInit_AllocateBuffer free common buffer first \n");
|
||||||
return STATUS_UNSUCCESSFUL;
|
return STATUS_UNSUCCESSFUL;
|
||||||
}
|
}
|
||||||
|
|
||||||
m_Buffer = m_pAdapter->DmaOperations->AllocateCommonBuffer(m_pAdapter, BufferSize, &m_Address, FALSE);
|
m_Buffer = m_pAdapter->DmaOperations->AllocateCommonBuffer(m_pAdapter, BufferSize, &m_Address, FALSE);
|
||||||
if (!m_Buffer)
|
if (!m_Buffer)
|
||||||
{
|
{
|
||||||
DPRINT1("CDmaChannelInit_AllocateBuffer fAllocateCommonBuffer failed \n");
|
DPRINT("CDmaChannelInit_AllocateBuffer fAllocateCommonBuffer failed \n");
|
||||||
return STATUS_UNSUCCESSFUL;
|
return STATUS_UNSUCCESSFUL;
|
||||||
}
|
}
|
||||||
|
|
||||||
m_BufferSize = BufferSize;
|
m_BufferSize = BufferSize;
|
||||||
m_AllocatedBufferSize = BufferSize;
|
m_AllocatedBufferSize = BufferSize;
|
||||||
DPRINT1("CDmaChannelInit::AllocateBuffer Success Buffer %p BufferSize %u Address %x\n", m_Buffer, BufferSize, m_Address);
|
DPRINT("CDmaChannelInit::AllocateBuffer Success Buffer %p BufferSize %u Address %x\n", m_Buffer, BufferSize, m_Address);
|
||||||
|
|
||||||
return STATUS_SUCCESS;
|
return STATUS_SUCCESS;
|
||||||
}
|
}
|
||||||
|
@ -162,7 +162,7 @@ CDmaChannelInit::FreeBuffer()
|
||||||
|
|
||||||
if (!m_Buffer)
|
if (!m_Buffer)
|
||||||
{
|
{
|
||||||
DPRINT1("CDmaChannelInit_FreeBuffer allocate common buffer first \n");
|
DPRINT("CDmaChannelInit_FreeBuffer allocate common buffer first \n");
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -222,6 +222,7 @@ ULONG
|
||||||
NTAPI
|
NTAPI
|
||||||
CDmaChannelInit::BufferSize()
|
CDmaChannelInit::BufferSize()
|
||||||
{
|
{
|
||||||
|
DPRINT("BufferSize %u\n", m_BufferSize);
|
||||||
return m_BufferSize;
|
return m_BufferSize;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -255,6 +256,8 @@ CDmaChannelInit::ReadCounter()
|
||||||
if (!m_DmaStarted || Counter >= m_LastTransferCount)
|
if (!m_DmaStarted || Counter >= m_LastTransferCount)
|
||||||
Counter = 0;
|
Counter = 0;
|
||||||
|
|
||||||
|
DPRINT("ReadCounter %u\n", Counter);
|
||||||
|
|
||||||
return Counter;
|
return Counter;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -57,7 +57,7 @@ CDrmPort2::QueryInterface(
|
||||||
|
|
||||||
if (RtlStringFromGUID(refiid, &GuidString) == STATUS_SUCCESS)
|
if (RtlStringFromGUID(refiid, &GuidString) == STATUS_SUCCESS)
|
||||||
{
|
{
|
||||||
DPRINT1("IDrmPort2_QueryInterface no interface!!! iface %S\n", GuidString.Buffer);
|
DPRINT("IDrmPort2_QueryInterface no interface!!! iface %S\n", GuidString.Buffer);
|
||||||
RtlFreeUnicodeString(&GuidString);
|
RtlFreeUnicodeString(&GuidString);
|
||||||
}
|
}
|
||||||
return STATUS_UNSUCCESSFUL;
|
return STATUS_UNSUCCESSFUL;
|
||||||
|
|
|
@ -138,7 +138,7 @@ CPortFilterDMus::DeviceIoControl(
|
||||||
|
|
||||||
if (IoStack->Parameters.DeviceIoControl.IoControlCode != IOCTL_KS_PROPERTY)
|
if (IoStack->Parameters.DeviceIoControl.IoControlCode != IOCTL_KS_PROPERTY)
|
||||||
{
|
{
|
||||||
DPRINT1("Unhandled function %lx Length %x\n", IoStack->Parameters.DeviceIoControl.IoControlCode, IoStack->Parameters.DeviceIoControl.InputBufferLength);
|
DPRINT("Unhandled function %lx Length %x\n", IoStack->Parameters.DeviceIoControl.IoControlCode, IoStack->Parameters.DeviceIoControl.InputBufferLength);
|
||||||
|
|
||||||
Irp->IoStatus.Status = STATUS_SUCCESS;
|
Irp->IoStatus.Status = STATUS_SUCCESS;
|
||||||
|
|
||||||
|
|
|
@ -95,7 +95,7 @@ CPortFilterTopology::DeviceIoControl(
|
||||||
|
|
||||||
if (IoStack->Parameters.DeviceIoControl.IoControlCode != IOCTL_KS_PROPERTY)
|
if (IoStack->Parameters.DeviceIoControl.IoControlCode != IOCTL_KS_PROPERTY)
|
||||||
{
|
{
|
||||||
DPRINT1("Unhandled function %lx Length %x\n", IoStack->Parameters.DeviceIoControl.IoControlCode, IoStack->Parameters.DeviceIoControl.InputBufferLength);
|
DPRINT("Unhandled function %lx Length %x\n", IoStack->Parameters.DeviceIoControl.IoControlCode, IoStack->Parameters.DeviceIoControl.InputBufferLength);
|
||||||
|
|
||||||
Irp->IoStatus.Status = STATUS_SUCCESS;
|
Irp->IoStatus.Status = STATUS_SUCCESS;
|
||||||
|
|
||||||
|
|
|
@ -141,9 +141,9 @@ CPortFilterWaveCyclic::DeviceIoControl(
|
||||||
|
|
||||||
if (IoStack->Parameters.DeviceIoControl.IoControlCode != IOCTL_KS_PROPERTY)
|
if (IoStack->Parameters.DeviceIoControl.IoControlCode != IOCTL_KS_PROPERTY)
|
||||||
{
|
{
|
||||||
DPRINT1("Unhandled function %lx Length %x\n", IoStack->Parameters.DeviceIoControl.IoControlCode, IoStack->Parameters.DeviceIoControl.InputBufferLength);
|
DPRINT("Unhandled function %lx Length %x\n", IoStack->Parameters.DeviceIoControl.IoControlCode, IoStack->Parameters.DeviceIoControl.InputBufferLength);
|
||||||
|
|
||||||
Irp->IoStatus.Status = STATUS_SUCCESS;
|
Irp->IoStatus.Status = STATUS_UNSUCCESSFUL;
|
||||||
|
|
||||||
IoCompleteRequest(Irp, IO_NO_INCREMENT);
|
IoCompleteRequest(Irp, IO_NO_INCREMENT);
|
||||||
return STATUS_SUCCESS;
|
return STATUS_SUCCESS;
|
||||||
|
@ -336,7 +336,6 @@ CPortFilterWaveCyclic::FreePin(
|
||||||
if (m_Pins[Index] == Pin)
|
if (m_Pins[Index] == Pin)
|
||||||
{
|
{
|
||||||
m_Descriptor->Factory.Instances[Index].CurrentPinInstanceCount--;
|
m_Descriptor->Factory.Instances[Index].CurrentPinInstanceCount--;
|
||||||
m_Pins[Index]->Release();
|
|
||||||
m_Pins[Index] = NULL;
|
m_Pins[Index] = NULL;
|
||||||
return STATUS_SUCCESS;
|
return STATUS_SUCCESS;
|
||||||
}
|
}
|
||||||
|
|
|
@ -143,7 +143,7 @@ CPortFilterWavePci::DeviceIoControl(
|
||||||
|
|
||||||
if (IoStack->Parameters.DeviceIoControl.IoControlCode != IOCTL_KS_PROPERTY)
|
if (IoStack->Parameters.DeviceIoControl.IoControlCode != IOCTL_KS_PROPERTY)
|
||||||
{
|
{
|
||||||
DPRINT1("Unhandled function %lx Length %x\n", IoStack->Parameters.DeviceIoControl.IoControlCode, IoStack->Parameters.DeviceIoControl.InputBufferLength);
|
DPRINT("Unhandled function %lx Length %x\n", IoStack->Parameters.DeviceIoControl.IoControlCode, IoStack->Parameters.DeviceIoControl.InputBufferLength);
|
||||||
|
|
||||||
Irp->IoStatus.Status = STATUS_SUCCESS;
|
Irp->IoStatus.Status = STATUS_SUCCESS;
|
||||||
|
|
||||||
|
|
|
@ -147,7 +147,7 @@ CPortFilterWaveRT::DeviceIoControl(
|
||||||
|
|
||||||
if (IoStack->Parameters.DeviceIoControl.IoControlCode != IOCTL_KS_PROPERTY)
|
if (IoStack->Parameters.DeviceIoControl.IoControlCode != IOCTL_KS_PROPERTY)
|
||||||
{
|
{
|
||||||
DPRINT1("Unhandled function %lx Length %x\n", IoStack->Parameters.DeviceIoControl.IoControlCode, IoStack->Parameters.DeviceIoControl.InputBufferLength);
|
DPRINT("Unhandled function %lx Length %x\n", IoStack->Parameters.DeviceIoControl.IoControlCode, IoStack->Parameters.DeviceIoControl.InputBufferLength);
|
||||||
|
|
||||||
Irp->IoStatus.Status = STATUS_SUCCESS;
|
Irp->IoStatus.Status = STATUS_SUCCESS;
|
||||||
|
|
||||||
|
|
|
@ -797,6 +797,8 @@ DECLARE_INTERFACE_(IPortPinWaveCyclic, IIrpTarget)
|
||||||
STDMETHOD_(PMINIPORT, GetMiniport)(THIS) PURE;
|
STDMETHOD_(PMINIPORT, GetMiniport)(THIS) PURE;
|
||||||
};
|
};
|
||||||
|
|
||||||
|
typedef IPortPinWaveCyclic *PPORTPINWAVECYCLIC;
|
||||||
|
|
||||||
#define IMP_IPortPinWaveCyclic \
|
#define IMP_IPortPinWaveCyclic \
|
||||||
IMP_IIrpTarget; \
|
IMP_IIrpTarget; \
|
||||||
STDMETHODIMP_(NTSTATUS) Init(THIS_ \
|
STDMETHODIMP_(NTSTATUS) Init(THIS_ \
|
||||||
|
|
|
@ -82,7 +82,7 @@ CInterruptSync::QueryInterface(
|
||||||
return STATUS_SUCCESS;
|
return STATUS_SUCCESS;
|
||||||
}
|
}
|
||||||
|
|
||||||
DPRINT1("CInterruptSync::QueryInterface: this %p UNKNOWN interface requested\n", this);
|
DPRINT("CInterruptSync::QueryInterface: this %p UNKNOWN interface requested\n", this);
|
||||||
return STATUS_UNSUCCESSFUL;
|
return STATUS_UNSUCCESSFUL;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -126,7 +126,7 @@ PortClsPnp(
|
||||||
return PcCompleteIrp(DeviceObject, Irp, Status);
|
return PcCompleteIrp(DeviceObject, Irp, Status);
|
||||||
}
|
}
|
||||||
|
|
||||||
DPRINT1("unhandled function %u\n", IoStack->MinorFunction);
|
DPRINT("unhandled function %u\n", IoStack->MinorFunction);
|
||||||
|
|
||||||
Irp->IoStatus.Status = STATUS_UNSUCCESSFUL;
|
Irp->IoStatus.Status = STATUS_UNSUCCESSFUL;
|
||||||
IoCompleteRequest(Irp, IO_NO_INCREMENT);
|
IoCompleteRequest(Irp, IO_NO_INCREMENT);
|
||||||
|
@ -182,7 +182,7 @@ PortClsShutdown(
|
||||||
if (DeviceExtension->AdapterPowerManagement)
|
if (DeviceExtension->AdapterPowerManagement)
|
||||||
{
|
{
|
||||||
// release adapter power management
|
// release adapter power management
|
||||||
DPRINT1("Power %u\n", DeviceExtension->AdapterPowerManagement->Release());
|
DPRINT("Power %u\n", DeviceExtension->AdapterPowerManagement->Release());
|
||||||
}
|
}
|
||||||
|
|
||||||
Irp->IoStatus.Status = STATUS_SUCCESS;
|
Irp->IoStatus.Status = STATUS_SUCCESS;
|
||||||
|
@ -229,7 +229,7 @@ PcDispatchIrp(
|
||||||
return PortClsShutdown(DeviceObject, Irp);
|
return PortClsShutdown(DeviceObject, Irp);
|
||||||
|
|
||||||
default:
|
default:
|
||||||
DPRINT1("Unhandled function %x\n", IoStack->MajorFunction);
|
DPRINT("Unhandled function %x\n", IoStack->MajorFunction);
|
||||||
break;
|
break;
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|
|
@ -108,6 +108,8 @@ CIrpQueue::AddMapping(
|
||||||
NTSTATUS Status = STATUS_SUCCESS;
|
NTSTATUS Status = STATUS_SUCCESS;
|
||||||
PIO_STACK_LOCATION IoStack;
|
PIO_STACK_LOCATION IoStack;
|
||||||
|
|
||||||
|
PC_ASSERT(KeGetCurrentIrql() == PASSIVE_LEVEL);
|
||||||
|
|
||||||
// get current irp stack location
|
// get current irp stack location
|
||||||
IoStack = IoGetCurrentIrpStackLocation(Irp);
|
IoStack = IoGetCurrentIrpStackLocation(Irp);
|
||||||
|
|
||||||
|
@ -126,7 +128,7 @@ CIrpQueue::AddMapping(
|
||||||
// check for success
|
// check for success
|
||||||
if (!NT_SUCCESS(Status))
|
if (!NT_SUCCESS(Status))
|
||||||
{
|
{
|
||||||
DPRINT1("KsProbeStreamIrp failed with %x\n", Status);
|
DPRINT("KsProbeStreamIrp failed with %x\n", Status);
|
||||||
return Status;
|
return Status;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -135,7 +137,7 @@ CIrpQueue::AddMapping(
|
||||||
PC_ASSERT(Header);
|
PC_ASSERT(Header);
|
||||||
PC_ASSERT(Irp->MdlAddress);
|
PC_ASSERT(Irp->MdlAddress);
|
||||||
|
|
||||||
DPRINT1("Size %u DataUsed %u FrameExtent %u SizeHeader %u NumDataAvailable %u OutputLength %u\n", Header->Size, Header->DataUsed, Header->FrameExtent, sizeof(KSSTREAM_HEADER), m_NumDataAvailable, IoStack->Parameters.DeviceIoControl.OutputBufferLength);
|
DPRINT("Size %u DataUsed %u FrameExtent %u SizeHeader %u NumDataAvailable %u OutputLength %u\n", Header->Size, Header->DataUsed, Header->FrameExtent, sizeof(KSSTREAM_HEADER), m_NumDataAvailable, IoStack->Parameters.DeviceIoControl.OutputBufferLength);
|
||||||
|
|
||||||
Header->Data = MmGetSystemAddressForMdlSafe(Irp->MdlAddress, NormalPagePriority);
|
Header->Data = MmGetSystemAddressForMdlSafe(Irp->MdlAddress, NormalPagePriority);
|
||||||
PC_ASSERT(Header->Data);
|
PC_ASSERT(Header->Data);
|
||||||
|
|
|
@ -238,7 +238,7 @@ SetStreamWorkerRoutineDMus(
|
||||||
{
|
{
|
||||||
// reset start stream
|
// reset start stream
|
||||||
This->m_IrpQueue->CancelBuffers(); //FIX function name
|
This->m_IrpQueue->CancelBuffers(); //FIX function name
|
||||||
DPRINT1("Stopping PreCompleted %u PostCompleted %u\n", This->m_PreCompleted, This->m_PostCompleted);
|
DPRINT("Stopping PreCompleted %u PostCompleted %u\n", This->m_PreCompleted, This->m_PostCompleted);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -546,7 +546,7 @@ CloseStreamRoutineDMus(
|
||||||
|
|
||||||
if (Stream)
|
if (Stream)
|
||||||
{
|
{
|
||||||
DPRINT1("Closing stream at Irql %u\n", KeGetCurrentIrql());
|
DPRINT("Closing stream at Irql %u\n", KeGetCurrentIrql());
|
||||||
Stream->Release();
|
Stream->Release();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -564,14 +564,14 @@ CPortPinDMus::Close(
|
||||||
Ctx = (PCLOSESTREAM_CONTEXT)AllocateItem(NonPagedPool, sizeof(CLOSESTREAM_CONTEXT), TAG_PORTCLASS);
|
Ctx = (PCLOSESTREAM_CONTEXT)AllocateItem(NonPagedPool, sizeof(CLOSESTREAM_CONTEXT), TAG_PORTCLASS);
|
||||||
if (!Ctx)
|
if (!Ctx)
|
||||||
{
|
{
|
||||||
DPRINT1("Failed to allocate stream context\n");
|
DPRINT("Failed to allocate stream context\n");
|
||||||
goto cleanup;
|
goto cleanup;
|
||||||
}
|
}
|
||||||
|
|
||||||
Ctx->WorkItem = IoAllocateWorkItem(DeviceObject);
|
Ctx->WorkItem = IoAllocateWorkItem(DeviceObject);
|
||||||
if (!Ctx->WorkItem)
|
if (!Ctx->WorkItem)
|
||||||
{
|
{
|
||||||
DPRINT1("Failed to allocate work item\n");
|
DPRINT("Failed to allocate work item\n");
|
||||||
goto cleanup;
|
goto cleanup;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -714,14 +714,14 @@ CPortPinDMus::Init(
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
DPRINT1("Unexpected Communication %u DataFlow %u\n", KsPinDescriptor->Communication, KsPinDescriptor->DataFlow);
|
DPRINT("Unexpected Communication %u DataFlow %u\n", KsPinDescriptor->Communication, KsPinDescriptor->DataFlow);
|
||||||
KeBugCheck(0);
|
KeBugCheck(0);
|
||||||
}
|
}
|
||||||
|
|
||||||
Status = NewIrpQueue(&m_IrpQueue);
|
Status = NewIrpQueue(&m_IrpQueue);
|
||||||
if (!NT_SUCCESS(Status))
|
if (!NT_SUCCESS(Status))
|
||||||
{
|
{
|
||||||
DPRINT1("Failed to allocate IrpQueue with %x\n", Status);
|
DPRINT("Failed to allocate IrpQueue with %x\n", Status);
|
||||||
return Status;
|
return Status;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -762,7 +762,7 @@ CPortPinDMus::Init(
|
||||||
Status = m_ServiceGroup->AddMember(PSERVICESINK(this));
|
Status = m_ServiceGroup->AddMember(PSERVICESINK(this));
|
||||||
if (!NT_SUCCESS(Status))
|
if (!NT_SUCCESS(Status))
|
||||||
{
|
{
|
||||||
DPRINT1("Failed to add pin to service group\n");
|
DPRINT("Failed to add pin to service group\n");
|
||||||
return Status;
|
return Status;
|
||||||
}
|
}
|
||||||
m_ServiceGroup->SupportDelayedService();
|
m_ServiceGroup->SupportDelayedService();
|
||||||
|
@ -771,7 +771,7 @@ CPortPinDMus::Init(
|
||||||
Status = m_IrpQueue->Init(ConnectDetails, m_Format, DeviceObject, 0, 0, NULL);
|
Status = m_IrpQueue->Init(ConnectDetails, m_Format, DeviceObject, 0, 0, NULL);
|
||||||
if (!NT_SUCCESS(Status))
|
if (!NT_SUCCESS(Status))
|
||||||
{
|
{
|
||||||
DPRINT1("IrpQueue_Init failed with %x\n", Status);
|
DPRINT("IrpQueue_Init failed with %x\n", Status);
|
||||||
return Status;
|
return Status;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -41,13 +41,10 @@ protected:
|
||||||
|
|
||||||
VOID UpdateCommonBuffer(ULONG Position, ULONG MaxTransferCount);
|
VOID UpdateCommonBuffer(ULONG Position, ULONG MaxTransferCount);
|
||||||
VOID UpdateCommonBufferOverlap(ULONG Position, ULONG MaxTransferCount);
|
VOID UpdateCommonBufferOverlap(ULONG Position, ULONG MaxTransferCount);
|
||||||
VOID NTAPI SetStreamState(IN KSSTATE State);
|
|
||||||
NTSTATUS NTAPI HandleKsStream(IN PIRP Irp);
|
NTSTATUS NTAPI HandleKsStream(IN PIRP Irp);
|
||||||
NTSTATUS NTAPI HandleKsProperty(IN PIRP Irp);
|
NTSTATUS NTAPI HandleKsProperty(IN PIRP Irp);
|
||||||
|
|
||||||
|
|
||||||
friend VOID NTAPI CloseStreamRoutineWaveCyclic(IN PDEVICE_OBJECT DeviceObject, IN PVOID Context);
|
|
||||||
friend VOID NTAPI SetStreamWorkerRoutineWaveCyclic(IN PDEVICE_OBJECT DeviceObject, IN PVOID Context);
|
|
||||||
friend NTSTATUS NTAPI PinWaveCyclicState(IN PIRP Irp, IN PKSIDENTIFIER Request, IN OUT PVOID Data);
|
friend NTSTATUS NTAPI PinWaveCyclicState(IN PIRP Irp, IN PKSIDENTIFIER Request, IN OUT PVOID Data);
|
||||||
friend NTSTATUS NTAPI PinWaveCyclicDataFormat(IN PIRP Irp, IN PKSIDENTIFIER Request, IN OUT PVOID Data);
|
friend NTSTATUS NTAPI PinWaveCyclicDataFormat(IN PIRP Irp, IN PKSIDENTIFIER Request, IN OUT PVOID Data);
|
||||||
friend NTSTATUS NTAPI PinWaveCyclicAudioPosition(IN PIRP Irp, IN PKSIDENTIFIER Request, IN OUT PVOID Data);
|
friend NTSTATUS NTAPI PinWaveCyclicAudioPosition(IN PIRP Irp, IN PKSIDENTIFIER Request, IN OUT PVOID Data);
|
||||||
|
@ -211,7 +208,7 @@ PinWaveCyclicAudioPosition(
|
||||||
// copy audio position
|
// copy audio position
|
||||||
RtlMoveMemory(Data, &Pin->m_Position, sizeof(KSAUDIO_POSITION));
|
RtlMoveMemory(Data, &Pin->m_Position, sizeof(KSAUDIO_POSITION));
|
||||||
|
|
||||||
DPRINT1("Play %lu Record %lu\n", Pin->m_Position.PlayOffset, Pin->m_Position.WriteOffset);
|
DPRINT("Play %lu Record %lu\n", Pin->m_Position.PlayOffset, Pin->m_Position.WriteOffset);
|
||||||
Irp->IoStatus.Information = sizeof(KSAUDIO_POSITION);
|
Irp->IoStatus.Information = sizeof(KSAUDIO_POSITION);
|
||||||
return STATUS_SUCCESS;
|
return STATUS_SUCCESS;
|
||||||
}
|
}
|
||||||
|
@ -355,7 +352,7 @@ PinWaveCyclicDataFormat(
|
||||||
PC_ASSERT(IsEqualGUIDAligned(((PKSDATAFORMAT_WAVEFORMATEX)NewDataFormat)->DataFormat.Specifier, KSDATAFORMAT_SPECIFIER_WAVEFORMATEX));
|
PC_ASSERT(IsEqualGUIDAligned(((PKSDATAFORMAT_WAVEFORMATEX)NewDataFormat)->DataFormat.Specifier, KSDATAFORMAT_SPECIFIER_WAVEFORMATEX));
|
||||||
|
|
||||||
|
|
||||||
DPRINT1("NewDataFormat: Channels %u Bits %u Samples %u\n", ((PKSDATAFORMAT_WAVEFORMATEX)NewDataFormat)->WaveFormatEx.nChannels,
|
DPRINT("NewDataFormat: Channels %u Bits %u Samples %u\n", ((PKSDATAFORMAT_WAVEFORMATEX)NewDataFormat)->WaveFormatEx.nChannels,
|
||||||
((PKSDATAFORMAT_WAVEFORMATEX)NewDataFormat)->WaveFormatEx.wBitsPerSample,
|
((PKSDATAFORMAT_WAVEFORMATEX)NewDataFormat)->WaveFormatEx.wBitsPerSample,
|
||||||
((PKSDATAFORMAT_WAVEFORMATEX)NewDataFormat)->WaveFormatEx.nSamplesPerSec);
|
((PKSDATAFORMAT_WAVEFORMATEX)NewDataFormat)->WaveFormatEx.nSamplesPerSec);
|
||||||
#endif
|
#endif
|
||||||
|
@ -490,111 +487,6 @@ CPortPinWaveCyclic::UpdateCommonBufferOverlap(
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
VOID
|
|
||||||
NTAPI
|
|
||||||
SetStreamWorkerRoutineWaveCyclic(
|
|
||||||
IN PDEVICE_OBJECT DeviceObject,
|
|
||||||
IN PVOID Context)
|
|
||||||
{
|
|
||||||
CPortPinWaveCyclic * This;
|
|
||||||
PSETSTREAM_CONTEXT Ctx = (PSETSTREAM_CONTEXT)Context;
|
|
||||||
KSSTATE State;
|
|
||||||
ULONG MinimumDataThreshold;
|
|
||||||
ULONG MaximumDataThreshold;
|
|
||||||
|
|
||||||
This = Ctx->Pin;
|
|
||||||
State = Ctx->State;
|
|
||||||
|
|
||||||
IoFreeWorkItem(Ctx->WorkItem);
|
|
||||||
FreeItem(Ctx, TAG_PORTCLASS);
|
|
||||||
|
|
||||||
// Has the audio stream resumed?
|
|
||||||
if (This->m_IrpQueue->NumMappings() && State == KSSTATE_STOP)
|
|
||||||
return;
|
|
||||||
|
|
||||||
// Has the audio state already been set?
|
|
||||||
if (This->m_State == State)
|
|
||||||
return;
|
|
||||||
|
|
||||||
// Set the state
|
|
||||||
if (NT_SUCCESS(This->m_Stream->SetState(State)))
|
|
||||||
{
|
|
||||||
// Set internal state
|
|
||||||
This->m_State = State;
|
|
||||||
|
|
||||||
if (This->m_State == KSSTATE_STOP)
|
|
||||||
{
|
|
||||||
// reset start stream
|
|
||||||
This->m_IrpQueue->CancelBuffers(); //FIX function name
|
|
||||||
|
|
||||||
// increase stop counter
|
|
||||||
This->m_StopCount++;
|
|
||||||
// get current data threshold
|
|
||||||
MinimumDataThreshold = This->m_IrpQueue->GetMinimumDataThreshold();
|
|
||||||
// get maximum data threshold
|
|
||||||
MaximumDataThreshold = ((PKSDATAFORMAT_WAVEFORMATEX)This->m_Format)->WaveFormatEx.nAvgBytesPerSec;
|
|
||||||
// increase minimum data threshold by a third sec
|
|
||||||
MinimumDataThreshold += This->m_FrameSize * 10;
|
|
||||||
|
|
||||||
// assure it has not exceeded
|
|
||||||
MinimumDataThreshold = min(MinimumDataThreshold, MaximumDataThreshold);
|
|
||||||
// store minimum data threshold
|
|
||||||
This->m_IrpQueue->SetMinimumDataThreshold(MinimumDataThreshold);
|
|
||||||
|
|
||||||
DPRINT1("Stopping TotalPackets %u StopCount %u\n", This->m_TotalPackets, This->m_StopCount);
|
|
||||||
}
|
|
||||||
if (This->m_State == KSSTATE_RUN)
|
|
||||||
{
|
|
||||||
DPRINT1("State RUN %x MinAvailable %u CommonBufferSize %u Offset %u\n", State, This->m_IrpQueue->MinimumDataAvailable(), This->m_CommonBufferSize, This->m_CommonBufferOffset);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
VOID
|
|
||||||
NTAPI
|
|
||||||
CPortPinWaveCyclic::SetStreamState(
|
|
||||||
IN KSSTATE State)
|
|
||||||
{
|
|
||||||
PDEVICE_OBJECT DeviceObject;
|
|
||||||
PIO_WORKITEM WorkItem;
|
|
||||||
PSETSTREAM_CONTEXT Context;
|
|
||||||
|
|
||||||
PC_ASSERT(KeGetCurrentIrql() <= DISPATCH_LEVEL);
|
|
||||||
|
|
||||||
// Has the audio stream resumed?
|
|
||||||
if (m_IrpQueue->NumMappings() && State == KSSTATE_STOP)
|
|
||||||
return;
|
|
||||||
|
|
||||||
// Has the audio state already been set?
|
|
||||||
if (m_State == State)
|
|
||||||
return;
|
|
||||||
|
|
||||||
// Get device object
|
|
||||||
DeviceObject = GetDeviceObject(m_Port);
|
|
||||||
|
|
||||||
// allocate set state context
|
|
||||||
Context = (PSETSTREAM_CONTEXT)AllocateItem(NonPagedPool, sizeof(SETSTREAM_CONTEXT), TAG_PORTCLASS);
|
|
||||||
|
|
||||||
if (!Context)
|
|
||||||
return;
|
|
||||||
|
|
||||||
// allocate work item
|
|
||||||
WorkItem = IoAllocateWorkItem(DeviceObject);
|
|
||||||
|
|
||||||
if (!WorkItem)
|
|
||||||
{
|
|
||||||
ExFreePool(Context);
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
|
|
||||||
Context->Pin = this;
|
|
||||||
Context->WorkItem = WorkItem;
|
|
||||||
Context->State = State;
|
|
||||||
|
|
||||||
// queue the work item
|
|
||||||
IoQueueWorkItem(WorkItem, SetStreamWorkerRoutineWaveCyclic, DelayedWorkQueue, (PVOID)Context);
|
|
||||||
}
|
|
||||||
|
|
||||||
VOID
|
VOID
|
||||||
NTAPI
|
NTAPI
|
||||||
CPortPinWaveCyclic::RequestService()
|
CPortPinWaveCyclic::RequestService()
|
||||||
|
@ -609,7 +501,6 @@ CPortPinWaveCyclic::RequestService()
|
||||||
Status = m_IrpQueue->GetMapping(&Buffer, &BufferSize);
|
Status = m_IrpQueue->GetMapping(&Buffer, &BufferSize);
|
||||||
if (!NT_SUCCESS(Status))
|
if (!NT_SUCCESS(Status))
|
||||||
{
|
{
|
||||||
//SetStreamState(This, KSSTATE_STOP);
|
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -638,7 +529,6 @@ CPortPinWaveCyclic::NewIrpTarget(
|
||||||
IN KSOBJECT_CREATE *CreateObject)
|
IN KSOBJECT_CREATE *CreateObject)
|
||||||
{
|
{
|
||||||
UNIMPLEMENTED
|
UNIMPLEMENTED
|
||||||
DbgBreakPoint();
|
|
||||||
return STATUS_UNSUCCESSFUL;
|
return STATUS_UNSUCCESSFUL;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -660,7 +550,7 @@ CPortPinWaveCyclic::HandleKsProperty(
|
||||||
|
|
||||||
if (IoStack->Parameters.DeviceIoControl.IoControlCode != IOCTL_KS_PROPERTY)
|
if (IoStack->Parameters.DeviceIoControl.IoControlCode != IOCTL_KS_PROPERTY)
|
||||||
{
|
{
|
||||||
DPRINT1("Unhandled function %lx Length %x\n", IoStack->Parameters.DeviceIoControl.IoControlCode, IoStack->Parameters.DeviceIoControl.InputBufferLength);
|
DPRINT("Unhandled function %lx Length %x\n", IoStack->Parameters.DeviceIoControl.IoControlCode, IoStack->Parameters.DeviceIoControl.InputBufferLength);
|
||||||
|
|
||||||
Irp->IoStatus.Status = STATUS_SUCCESS;
|
Irp->IoStatus.Status = STATUS_SUCCESS;
|
||||||
|
|
||||||
|
@ -675,7 +565,7 @@ CPortPinWaveCyclic::HandleKsProperty(
|
||||||
Property = (PKSPROPERTY)IoStack->Parameters.DeviceIoControl.Type3InputBuffer;
|
Property = (PKSPROPERTY)IoStack->Parameters.DeviceIoControl.Type3InputBuffer;
|
||||||
|
|
||||||
RtlStringFromGUID(Property->Set, &GuidString);
|
RtlStringFromGUID(Property->Set, &GuidString);
|
||||||
DPRINT1("Unhandeled property Set |%S| Id %u Flags %x\n", GuidString.Buffer, Property->Id, Property->Flags);
|
DPRINT("Unhandeled property Set |%S| Id %u Flags %x\n", GuidString.Buffer, Property->Id, Property->Flags);
|
||||||
RtlFreeUnicodeString(&GuidString);
|
RtlFreeUnicodeString(&GuidString);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -792,127 +682,82 @@ CPortPinWaveCyclic::Flush(
|
||||||
return KsDispatchInvalidDeviceRequest(DeviceObject, Irp);
|
return KsDispatchInvalidDeviceRequest(DeviceObject, Irp);
|
||||||
}
|
}
|
||||||
|
|
||||||
VOID
|
|
||||||
NTAPI
|
|
||||||
CloseStreamRoutineWaveCyclic(
|
|
||||||
IN PDEVICE_OBJECT DeviceObject,
|
|
||||||
IN PVOID Context)
|
|
||||||
{
|
|
||||||
PMINIPORTWAVECYCLICSTREAM Stream;
|
|
||||||
CPortPinWaveCyclic * This;
|
|
||||||
NTSTATUS Status;
|
|
||||||
PCLOSESTREAM_CONTEXT Ctx = (PCLOSESTREAM_CONTEXT)Context;
|
|
||||||
|
|
||||||
This = (CPortPinWaveCyclic*)Ctx->Pin;
|
|
||||||
|
|
||||||
if (This->m_State != KSSTATE_STOP)
|
|
||||||
{
|
|
||||||
// stop stream in case it hasn't been
|
|
||||||
Status = This->m_Stream->SetState(KSSTATE_STOP);
|
|
||||||
if (!NT_SUCCESS(Status))
|
|
||||||
DPRINT1("Warning: failed to stop stream with %x\n", Status);
|
|
||||||
|
|
||||||
This->m_State = KSSTATE_STOP;
|
|
||||||
}
|
|
||||||
|
|
||||||
if (This->m_Format)
|
|
||||||
{
|
|
||||||
// free format
|
|
||||||
ExFreePool(This->m_Format);
|
|
||||||
This->m_Format = NULL;
|
|
||||||
}
|
|
||||||
|
|
||||||
if (This->m_IrpQueue)
|
|
||||||
{
|
|
||||||
This->m_IrpQueue->Release();
|
|
||||||
}
|
|
||||||
|
|
||||||
// complete the irp
|
|
||||||
Ctx->Irp->IoStatus.Information = 0;
|
|
||||||
Ctx->Irp->IoStatus.Status = STATUS_SUCCESS;
|
|
||||||
IoCompleteRequest(Ctx->Irp, IO_NO_INCREMENT);
|
|
||||||
|
|
||||||
// free the work item
|
|
||||||
IoFreeWorkItem(Ctx->WorkItem);
|
|
||||||
|
|
||||||
// free work item ctx
|
|
||||||
FreeItem(Ctx, TAG_PORTCLASS);
|
|
||||||
|
|
||||||
// release reference to port driver
|
|
||||||
This->m_Port->Release();
|
|
||||||
|
|
||||||
// release reference to filter instance
|
|
||||||
This->m_Filter->Release();
|
|
||||||
|
|
||||||
if (This->m_Stream)
|
|
||||||
{
|
|
||||||
Stream = This->m_Stream;
|
|
||||||
This->m_Stream = NULL;
|
|
||||||
This->m_Filter->FreePin(This);
|
|
||||||
DPRINT1("Closing stream at Irql %u\n", KeGetCurrentIrql());
|
|
||||||
Stream->Release();
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
NTSTATUS
|
NTSTATUS
|
||||||
NTAPI
|
NTAPI
|
||||||
CPortPinWaveCyclic::Close(
|
CPortPinWaveCyclic::Close(
|
||||||
IN PDEVICE_OBJECT DeviceObject,
|
IN PDEVICE_OBJECT DeviceObject,
|
||||||
IN PIRP Irp)
|
IN PIRP Irp)
|
||||||
{
|
{
|
||||||
PCLOSESTREAM_CONTEXT Ctx;
|
DPRINT("CPortPinWaveCyclic::Close entered\n");
|
||||||
|
|
||||||
DPRINT1("CPortPinWaveCyclic::Close entered\n");
|
PC_ASSERT_IRQL(PASSIVE_LEVEL);
|
||||||
|
|
||||||
|
if (m_Format)
|
||||||
|
{
|
||||||
|
// free format
|
||||||
|
ExFreePool(m_Format);
|
||||||
|
m_Format = NULL;
|
||||||
|
}
|
||||||
|
|
||||||
|
if (m_IrpQueue)
|
||||||
|
{
|
||||||
|
// fixme cancel irps
|
||||||
|
m_IrpQueue->Release();
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
if (m_Port)
|
||||||
|
{
|
||||||
|
// release reference to port driver
|
||||||
|
m_Port->Release();
|
||||||
|
m_Port = NULL;
|
||||||
|
}
|
||||||
|
|
||||||
|
if (m_ServiceGroup)
|
||||||
|
{
|
||||||
|
// remove member from service group
|
||||||
|
m_ServiceGroup->RemoveMember(PSERVICESINK(this));
|
||||||
|
m_ServiceGroup = NULL;
|
||||||
|
}
|
||||||
|
|
||||||
if (m_Stream)
|
if (m_Stream)
|
||||||
{
|
{
|
||||||
// allocate a close context
|
if (m_State != KSSTATE_STOP)
|
||||||
Ctx = (PCLOSESTREAM_CONTEXT)AllocateItem(NonPagedPool, sizeof(CLOSESTREAM_CONTEXT), TAG_PORTCLASS);
|
|
||||||
if (!Ctx)
|
|
||||||
{
|
{
|
||||||
DPRINT1("Failed to allocate stream context\n");
|
// stop stream
|
||||||
goto cleanup;
|
NTSTATUS Status = m_Stream->SetState(KSSTATE_STOP);
|
||||||
|
if (!NT_SUCCESS(Status))
|
||||||
|
{
|
||||||
|
DPRINT("Warning: failed to stop stream with %x\n", Status);
|
||||||
|
PC_ASSERT(0);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
// allocate work context
|
// set state to stop
|
||||||
Ctx->WorkItem = IoAllocateWorkItem(DeviceObject);
|
m_State = KSSTATE_STOP;
|
||||||
if (!Ctx->WorkItem)
|
|
||||||
{
|
|
||||||
DPRINT1("Failed to allocate work item\n");
|
|
||||||
goto cleanup;
|
|
||||||
}
|
|
||||||
// setup the close context
|
|
||||||
Ctx->Irp = Irp;
|
|
||||||
Ctx->Pin = this;
|
|
||||||
|
|
||||||
IoMarkIrpPending(Irp);
|
|
||||||
Irp->IoStatus.Information = 0;
|
|
||||||
Irp->IoStatus.Status = STATUS_PENDING;
|
|
||||||
|
|
||||||
// remove member from service group
|
DPRINT("Closing stream at Irql %u\n", KeGetCurrentIrql());
|
||||||
m_ServiceGroup->RemoveMember(PSERVICESINK(this));
|
// release stream
|
||||||
|
m_Stream->Release();
|
||||||
|
|
||||||
// defer work item
|
}
|
||||||
IoQueueWorkItem(Ctx->WorkItem, CloseStreamRoutineWaveCyclic, DelayedWorkQueue, (PVOID)Ctx);
|
|
||||||
// Return result
|
|
||||||
return STATUS_PENDING;
|
if (m_Filter)
|
||||||
|
{
|
||||||
|
// release reference to filter instance
|
||||||
|
m_Filter->FreePin((PPORTPINWAVECYCLIC)this);
|
||||||
|
m_Filter->Release();
|
||||||
|
m_Filter = NULL;
|
||||||
}
|
}
|
||||||
|
|
||||||
Irp->IoStatus.Information = 0;
|
Irp->IoStatus.Information = 0;
|
||||||
Irp->IoStatus.Status = STATUS_SUCCESS;
|
Irp->IoStatus.Status = STATUS_SUCCESS;
|
||||||
IoCompleteRequest(Irp, IO_NO_INCREMENT);
|
IoCompleteRequest(Irp, IO_NO_INCREMENT);
|
||||||
|
|
||||||
|
delete this;
|
||||||
|
|
||||||
return STATUS_SUCCESS;
|
return STATUS_SUCCESS;
|
||||||
|
|
||||||
cleanup:
|
|
||||||
|
|
||||||
if (Ctx)
|
|
||||||
FreeItem(Ctx, TAG_PORTCLASS);
|
|
||||||
|
|
||||||
Irp->IoStatus.Information = 0;
|
|
||||||
Irp->IoStatus.Status = STATUS_UNSUCCESSFUL;
|
|
||||||
IoCompleteRequest(Irp, IO_NO_INCREMENT);
|
|
||||||
return STATUS_UNSUCCESSFUL;
|
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
NTSTATUS
|
NTSTATUS
|
||||||
|
@ -1022,7 +867,7 @@ CPortPinWaveCyclic::Init(
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
DPRINT1("Unexpected Communication %u DataFlow %u\n", KsPinDescriptor->Communication, KsPinDescriptor->DataFlow);
|
DPRINT("Unexpected Communication %u DataFlow %u\n", KsPinDescriptor->Communication, KsPinDescriptor->DataFlow);
|
||||||
KeBugCheck(0);
|
KeBugCheck(0);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -1040,7 +885,7 @@ CPortPinWaveCyclic::Init(
|
||||||
if (NT_SUCCESS(Status))
|
if (NT_SUCCESS(Status))
|
||||||
{
|
{
|
||||||
DRMRIGHTS DrmRights;
|
DRMRIGHTS DrmRights;
|
||||||
DPRINT1("Got IID_IDrmAudioStream interface %p\n", DrmAudio);
|
DPRINT("Got IID_IDrmAudioStream interface %p\n", DrmAudio);
|
||||||
|
|
||||||
DrmRights.CopyProtect = FALSE;
|
DrmRights.CopyProtect = FALSE;
|
||||||
DrmRights.Reserved = 0;
|
DrmRights.Reserved = 0;
|
||||||
|
@ -1087,7 +932,7 @@ CPortPinWaveCyclic::Init(
|
||||||
Status = m_ServiceGroup->AddMember(PSERVICESINK(this));
|
Status = m_ServiceGroup->AddMember(PSERVICESINK(this));
|
||||||
if (!NT_SUCCESS(Status))
|
if (!NT_SUCCESS(Status))
|
||||||
{
|
{
|
||||||
DPRINT1("Failed to add pin to service group\n");
|
DPRINT("Failed to add pin to service group\n");
|
||||||
return Status;
|
return Status;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -1138,9 +983,10 @@ CPortPinWaveCyclic::Init(
|
||||||
m_Port = Port;
|
m_Port = Port;
|
||||||
m_Filter = Filter;
|
m_Filter = Filter;
|
||||||
|
|
||||||
DPRINT1("Setting state to acquire %x\n", m_Stream->SetState(KSSTATE_ACQUIRE));
|
DPRINT("Setting state to acquire %x\n", m_Stream->SetState(KSSTATE_ACQUIRE));
|
||||||
DPRINT1("Setting state to pause %x\n", m_Stream->SetState(KSSTATE_PAUSE));
|
DPRINT("Setting state to pause %x\n", m_Stream->SetState(KSSTATE_PAUSE));
|
||||||
m_State = KSSTATE_PAUSE;
|
DPRINT("Setting state to run %x\n", m_Stream->SetState(KSSTATE_RUN));
|
||||||
|
m_State = KSSTATE_RUN;
|
||||||
|
|
||||||
|
|
||||||
return STATUS_SUCCESS;
|
return STATUS_SUCCESS;
|
||||||
|
|
|
@ -181,7 +181,7 @@ PinWavePciAudioPosition(
|
||||||
// copy audio position
|
// copy audio position
|
||||||
RtlMoveMemory(Data, &Pin->m_Position, sizeof(KSAUDIO_POSITION));
|
RtlMoveMemory(Data, &Pin->m_Position, sizeof(KSAUDIO_POSITION));
|
||||||
|
|
||||||
DPRINT1("Play %lu Record %lu\n", Pin->m_Position.PlayOffset, Pin->m_Position.WriteOffset);
|
DPRINT("Play %lu Record %lu\n", Pin->m_Position.PlayOffset, Pin->m_Position.WriteOffset);
|
||||||
Irp->IoStatus.Information = sizeof(KSAUDIO_POSITION);
|
Irp->IoStatus.Information = sizeof(KSAUDIO_POSITION);
|
||||||
return STATUS_SUCCESS;
|
return STATUS_SUCCESS;
|
||||||
}
|
}
|
||||||
|
@ -325,7 +325,7 @@ PinWavePciDataFormat(
|
||||||
PC_ASSERT(IsEqualGUIDAligned(((PKSDATAFORMAT_WAVEFORMATEX)NewDataFormat)->DataFormat.Specifier, KSDATAFORMAT_SPECIFIER_WAVEFORMATEX));
|
PC_ASSERT(IsEqualGUIDAligned(((PKSDATAFORMAT_WAVEFORMATEX)NewDataFormat)->DataFormat.Specifier, KSDATAFORMAT_SPECIFIER_WAVEFORMATEX));
|
||||||
|
|
||||||
|
|
||||||
DPRINT1("NewDataFormat: Channels %u Bits %u Samples %u\n", ((PKSDATAFORMAT_WAVEFORMATEX)NewDataFormat)->WaveFormatEx.nChannels,
|
DPRINT("NewDataFormat: Channels %u Bits %u Samples %u\n", ((PKSDATAFORMAT_WAVEFORMATEX)NewDataFormat)->WaveFormatEx.nChannels,
|
||||||
((PKSDATAFORMAT_WAVEFORMATEX)NewDataFormat)->WaveFormatEx.wBitsPerSample,
|
((PKSDATAFORMAT_WAVEFORMATEX)NewDataFormat)->WaveFormatEx.wBitsPerSample,
|
||||||
((PKSDATAFORMAT_WAVEFORMATEX)NewDataFormat)->WaveFormatEx.nSamplesPerSec);
|
((PKSDATAFORMAT_WAVEFORMATEX)NewDataFormat)->WaveFormatEx.nSamplesPerSec);
|
||||||
#endif
|
#endif
|
||||||
|
@ -470,7 +470,7 @@ CPortPinWavePci::SetState(KSSTATE State)
|
||||||
// store minimum data threshold
|
// store minimum data threshold
|
||||||
m_IrpQueue->SetMinimumDataThreshold(MinimumDataThreshold);
|
m_IrpQueue->SetMinimumDataThreshold(MinimumDataThreshold);
|
||||||
|
|
||||||
DPRINT1("Stopping TotalCompleted %u StopCount %u MinimumDataThreshold %u\n", m_TotalPackets, m_StopCount, MinimumDataThreshold);
|
DPRINT("Stopping TotalCompleted %u StopCount %u MinimumDataThreshold %u\n", m_TotalPackets, m_StopCount, MinimumDataThreshold);
|
||||||
}
|
}
|
||||||
if (m_State == KSSTATE_RUN)
|
if (m_State == KSSTATE_RUN)
|
||||||
{
|
{
|
||||||
|
@ -608,7 +608,7 @@ CPortPinWavePci::HandleKsProperty(
|
||||||
|
|
||||||
if (IoStack->Parameters.DeviceIoControl.IoControlCode != IOCTL_KS_PROPERTY)
|
if (IoStack->Parameters.DeviceIoControl.IoControlCode != IOCTL_KS_PROPERTY)
|
||||||
{
|
{
|
||||||
DPRINT1("Unhandled function %lx Length %x\n", IoStack->Parameters.DeviceIoControl.IoControlCode, IoStack->Parameters.DeviceIoControl.InputBufferLength);
|
DPRINT("Unhandled function %lx Length %x\n", IoStack->Parameters.DeviceIoControl.IoControlCode, IoStack->Parameters.DeviceIoControl.InputBufferLength);
|
||||||
|
|
||||||
Irp->IoStatus.Status = STATUS_SUCCESS;
|
Irp->IoStatus.Status = STATUS_SUCCESS;
|
||||||
|
|
||||||
|
@ -623,7 +623,7 @@ CPortPinWavePci::HandleKsProperty(
|
||||||
Property = (PKSPROPERTY)IoStack->Parameters.DeviceIoControl.Type3InputBuffer;
|
Property = (PKSPROPERTY)IoStack->Parameters.DeviceIoControl.Type3InputBuffer;
|
||||||
|
|
||||||
RtlStringFromGUID(Property->Set, &GuidString);
|
RtlStringFromGUID(Property->Set, &GuidString);
|
||||||
DPRINT1("Unhandeled property Set |%S| Id %u Flags %x\n", GuidString.Buffer, Property->Id, Property->Flags);
|
DPRINT("Unhandeled property Set |%S| Id %u Flags %x\n", GuidString.Buffer, Property->Id, Property->Flags);
|
||||||
RtlFreeUnicodeString(&GuidString);
|
RtlFreeUnicodeString(&GuidString);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -787,7 +787,7 @@ CPortPinWavePci::CloseStream()
|
||||||
{
|
{
|
||||||
Stream = m_Stream;
|
Stream = m_Stream;
|
||||||
m_Stream = 0;
|
m_Stream = 0;
|
||||||
DPRINT1("Closing stream at Irql %u\n", KeGetCurrentIrql());
|
DPRINT("Closing stream at Irql %u\n", KeGetCurrentIrql());
|
||||||
Stream->Release();
|
Stream->Release();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -830,14 +830,14 @@ CPortPinWavePci::Close(
|
||||||
Ctx = (PCLOSESTREAM_CONTEXT)AllocateItem(NonPagedPool, sizeof(CLOSESTREAM_CONTEXT), TAG_PORTCLASS);
|
Ctx = (PCLOSESTREAM_CONTEXT)AllocateItem(NonPagedPool, sizeof(CLOSESTREAM_CONTEXT), TAG_PORTCLASS);
|
||||||
if (!Ctx)
|
if (!Ctx)
|
||||||
{
|
{
|
||||||
DPRINT1("Failed to allocate stream context\n");
|
DPRINT("Failed to allocate stream context\n");
|
||||||
goto cleanup;
|
goto cleanup;
|
||||||
}
|
}
|
||||||
|
|
||||||
Ctx->WorkItem = IoAllocateWorkItem(DeviceObject);
|
Ctx->WorkItem = IoAllocateWorkItem(DeviceObject);
|
||||||
if (!Ctx->WorkItem)
|
if (!Ctx->WorkItem)
|
||||||
{
|
{
|
||||||
DPRINT1("Failed to allocate work item\n");
|
DPRINT("Failed to allocate work item\n");
|
||||||
goto cleanup;
|
goto cleanup;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -980,7 +980,7 @@ CPortPinWavePci::Init(
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
DPRINT1("Unexpected Communication %u DataFlow %u\n", KsPinDescriptor->Communication, KsPinDescriptor->DataFlow);
|
DPRINT("Unexpected Communication %u DataFlow %u\n", KsPinDescriptor->Communication, KsPinDescriptor->DataFlow);
|
||||||
KeBugCheck(0);
|
KeBugCheck(0);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -1004,7 +1004,7 @@ CPortPinWavePci::Init(
|
||||||
Status = m_ServiceGroup->AddMember(PSERVICESINK(this));
|
Status = m_ServiceGroup->AddMember(PSERVICESINK(this));
|
||||||
if (!NT_SUCCESS(Status))
|
if (!NT_SUCCESS(Status))
|
||||||
{
|
{
|
||||||
DPRINT1("Failed to add pin to service group\n");
|
DPRINT("Failed to add pin to service group\n");
|
||||||
return Status;
|
return Status;
|
||||||
}
|
}
|
||||||
m_ServiceGroup->SupportDelayedService();
|
m_ServiceGroup->SupportDelayedService();
|
||||||
|
@ -1016,7 +1016,7 @@ CPortPinWavePci::Init(
|
||||||
Status = m_Stream->GetAllocatorFraming(&m_AllocatorFraming);
|
Status = m_Stream->GetAllocatorFraming(&m_AllocatorFraming);
|
||||||
if (!NT_SUCCESS(Status))
|
if (!NT_SUCCESS(Status))
|
||||||
{
|
{
|
||||||
DPRINT1("GetAllocatorFraming failed with %x\n", Status);
|
DPRINT("GetAllocatorFraming failed with %x\n", Status);
|
||||||
return Status;
|
return Status;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -1058,7 +1058,7 @@ CPortPinWavePci::Init(
|
||||||
Status = m_IrpQueue->Init(ConnectDetails, m_Format, DeviceObject, m_AllocatorFraming.FrameSize, m_AllocatorFraming.FileAlignment, NULL);
|
Status = m_IrpQueue->Init(ConnectDetails, m_Format, DeviceObject, m_AllocatorFraming.FrameSize, m_AllocatorFraming.FileAlignment, NULL);
|
||||||
if (!NT_SUCCESS(Status))
|
if (!NT_SUCCESS(Status))
|
||||||
{
|
{
|
||||||
DPRINT1("IrpQueue_Init failed with %x\n", Status);
|
DPRINT("IrpQueue_Init failed with %x\n", Status);
|
||||||
return Status;
|
return Status;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -130,7 +130,7 @@ SetStreamWorkerRoutine(
|
||||||
{
|
{
|
||||||
// reset start stream
|
// reset start stream
|
||||||
This->m_IrpQueue->CancelBuffers(); //FIX function name
|
This->m_IrpQueue->CancelBuffers(); //FIX function name
|
||||||
DPRINT1("Stopping PreCompleted %u PostCompleted %u\n", This->m_PreCompleted, This->m_PostCompleted);
|
DPRINT("Stopping PreCompleted %u PostCompleted %u\n", This->m_PreCompleted, This->m_PostCompleted);
|
||||||
}
|
}
|
||||||
|
|
||||||
if (This->m_State == KSSTATE_RUN)
|
if (This->m_State == KSSTATE_RUN)
|
||||||
|
@ -249,7 +249,7 @@ CPortPinWaveRT::HandleKsProperty(
|
||||||
{
|
{
|
||||||
Status = m_Stream->SetState(*State);
|
Status = m_Stream->SetState(*State);
|
||||||
|
|
||||||
DPRINT1("Setting state %u %x\n", *State, Status);
|
DPRINT("Setting state %u %x\n", *State, Status);
|
||||||
if (NT_SUCCESS(Status))
|
if (NT_SUCCESS(Status))
|
||||||
{
|
{
|
||||||
m_State = *State;
|
m_State = *State;
|
||||||
|
@ -303,7 +303,7 @@ CPortPinWaveRT::HandleKsProperty(
|
||||||
|
|
||||||
ASSERT(m_State == KSSTATE_STOP);
|
ASSERT(m_State == KSSTATE_STOP);
|
||||||
#endif
|
#endif
|
||||||
DPRINT1("NewDataFormat: Channels %u Bits %u Samples %u\n", ((PKSDATAFORMAT_WAVEFORMATEX)NewDataFormat)->WaveFormatEx.nChannels,
|
DPRINT("NewDataFormat: Channels %u Bits %u Samples %u\n", ((PKSDATAFORMAT_WAVEFORMATEX)NewDataFormat)->WaveFormatEx.nChannels,
|
||||||
((PKSDATAFORMAT_WAVEFORMATEX)NewDataFormat)->WaveFormatEx.wBitsPerSample,
|
((PKSDATAFORMAT_WAVEFORMATEX)NewDataFormat)->WaveFormatEx.wBitsPerSample,
|
||||||
((PKSDATAFORMAT_WAVEFORMATEX)NewDataFormat)->WaveFormatEx.nSamplesPerSec);
|
((PKSDATAFORMAT_WAVEFORMATEX)NewDataFormat)->WaveFormatEx.nSamplesPerSec);
|
||||||
|
|
||||||
|
@ -321,7 +321,7 @@ CPortPinWaveRT::HandleKsProperty(
|
||||||
return STATUS_SUCCESS;
|
return STATUS_SUCCESS;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
DPRINT1("Failed to set format\n");
|
DPRINT("Failed to set format\n");
|
||||||
Irp->IoStatus.Information = 0;
|
Irp->IoStatus.Information = 0;
|
||||||
Irp->IoStatus.Status = STATUS_UNSUCCESSFUL;
|
Irp->IoStatus.Status = STATUS_UNSUCCESSFUL;
|
||||||
IoCompleteRequest(Irp, IO_NO_INCREMENT);
|
IoCompleteRequest(Irp, IO_NO_INCREMENT);
|
||||||
|
@ -331,7 +331,7 @@ CPortPinWaveRT::HandleKsProperty(
|
||||||
{
|
{
|
||||||
if (!m_Format)
|
if (!m_Format)
|
||||||
{
|
{
|
||||||
DPRINT1("No format\n");
|
DPRINT("No format\n");
|
||||||
Irp->IoStatus.Information = 0;
|
Irp->IoStatus.Information = 0;
|
||||||
Irp->IoStatus.Status = STATUS_UNSUCCESSFUL;
|
Irp->IoStatus.Status = STATUS_UNSUCCESSFUL;
|
||||||
IoCompleteRequest(Irp, IO_NO_INCREMENT);
|
IoCompleteRequest(Irp, IO_NO_INCREMENT);
|
||||||
|
@ -355,7 +355,7 @@ CPortPinWaveRT::HandleKsProperty(
|
||||||
|
|
||||||
}
|
}
|
||||||
RtlStringFromGUID(Property->Set, &GuidString);
|
RtlStringFromGUID(Property->Set, &GuidString);
|
||||||
DPRINT1("Unhandeled property Set |%S| Id %u Flags %x\n", GuidString.Buffer, Property->Id, Property->Flags);
|
DPRINT("Unhandeled property Set |%S| Id %u Flags %x\n", GuidString.Buffer, Property->Id, Property->Flags);
|
||||||
RtlFreeUnicodeString(&GuidString);
|
RtlFreeUnicodeString(&GuidString);
|
||||||
|
|
||||||
Irp->IoStatus.Status = STATUS_NOT_IMPLEMENTED;
|
Irp->IoStatus.Status = STATUS_NOT_IMPLEMENTED;
|
||||||
|
@ -414,7 +414,6 @@ CPortPinWaveRT::DeviceIoControl(
|
||||||
}
|
}
|
||||||
|
|
||||||
UNIMPLEMENTED
|
UNIMPLEMENTED
|
||||||
DbgBreakPoint();
|
|
||||||
|
|
||||||
Irp->IoStatus.Information = 0;
|
Irp->IoStatus.Information = 0;
|
||||||
Irp->IoStatus.Status = STATUS_UNSUCCESSFUL;
|
Irp->IoStatus.Status = STATUS_UNSUCCESSFUL;
|
||||||
|
@ -511,7 +510,7 @@ CloseStreamRoutine(
|
||||||
{
|
{
|
||||||
Stream = This->m_Stream;
|
Stream = This->m_Stream;
|
||||||
This->m_Stream = NULL;
|
This->m_Stream = NULL;
|
||||||
DPRINT1("Closing stream at Irql %u\n", KeGetCurrentIrql());
|
DPRINT("Closing stream at Irql %u\n", KeGetCurrentIrql());
|
||||||
Stream->Release();
|
Stream->Release();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -529,14 +528,14 @@ CPortPinWaveRT::Close(
|
||||||
Ctx = (PCLOSESTREAM_CONTEXT)AllocateItem(NonPagedPool, sizeof(CLOSESTREAM_CONTEXT), TAG_PORTCLASS);
|
Ctx = (PCLOSESTREAM_CONTEXT)AllocateItem(NonPagedPool, sizeof(CLOSESTREAM_CONTEXT), TAG_PORTCLASS);
|
||||||
if (!Ctx)
|
if (!Ctx)
|
||||||
{
|
{
|
||||||
DPRINT1("Failed to allocate stream context\n");
|
DPRINT("Failed to allocate stream context\n");
|
||||||
goto cleanup;
|
goto cleanup;
|
||||||
}
|
}
|
||||||
|
|
||||||
Ctx->WorkItem = IoAllocateWorkItem(DeviceObject);
|
Ctx->WorkItem = IoAllocateWorkItem(DeviceObject);
|
||||||
if (!Ctx->WorkItem)
|
if (!Ctx->WorkItem)
|
||||||
{
|
{
|
||||||
DPRINT1("Failed to allocate work item\n");
|
DPRINT("Failed to allocate work item\n");
|
||||||
goto cleanup;
|
goto cleanup;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -696,7 +695,7 @@ CPortPinWaveRT::Init(
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
DPRINT1("Unexpected Communication %u DataFlow %u\n", KsPinDescriptor->Communication, KsPinDescriptor->DataFlow);
|
DPRINT("Unexpected Communication %u DataFlow %u\n", KsPinDescriptor->Communication, KsPinDescriptor->DataFlow);
|
||||||
KeBugCheck(0);
|
KeBugCheck(0);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -713,21 +712,21 @@ CPortPinWaveRT::Init(
|
||||||
Status = m_Stream->AllocateAudioBuffer(16384 * 11, &m_Mdl, &m_CommonBufferSize, &m_CommonBufferOffset, &m_CacheType);
|
Status = m_Stream->AllocateAudioBuffer(16384 * 11, &m_Mdl, &m_CommonBufferSize, &m_CommonBufferOffset, &m_CacheType);
|
||||||
if (!NT_SUCCESS(Status))
|
if (!NT_SUCCESS(Status))
|
||||||
{
|
{
|
||||||
DPRINT1("AllocateAudioBuffer failed with %x\n", Status);
|
DPRINT("AllocateAudioBuffer failed with %x\n", Status);
|
||||||
goto cleanup;
|
goto cleanup;
|
||||||
}
|
}
|
||||||
|
|
||||||
m_CommonBuffer = MmGetSystemAddressForMdlSafe(m_Mdl, NormalPagePriority);
|
m_CommonBuffer = MmGetSystemAddressForMdlSafe(m_Mdl, NormalPagePriority);
|
||||||
if (!NT_SUCCESS(Status))
|
if (!NT_SUCCESS(Status))
|
||||||
{
|
{
|
||||||
DPRINT1("Failed to get system address %x\n", Status);
|
DPRINT("Failed to get system address %x\n", Status);
|
||||||
IoFreeMdl(m_Mdl);
|
IoFreeMdl(m_Mdl);
|
||||||
m_Mdl = NULL;
|
m_Mdl = NULL;
|
||||||
goto cleanup;
|
goto cleanup;
|
||||||
}
|
}
|
||||||
|
|
||||||
DPRINT1("Setting state to acquire %x\n", m_Stream->SetState(KSSTATE_ACQUIRE));
|
DPRINT("Setting state to acquire %x\n", m_Stream->SetState(KSSTATE_ACQUIRE));
|
||||||
DPRINT1("Setting state to pause %x\n", m_Stream->SetState(KSSTATE_PAUSE));
|
DPRINT("Setting state to pause %x\n", m_Stream->SetState(KSSTATE_PAUSE));
|
||||||
m_State = KSSTATE_PAUSE;
|
m_State = KSSTATE_PAUSE;
|
||||||
return STATUS_SUCCESS;
|
return STATUS_SUCCESS;
|
||||||
|
|
||||||
|
|
|
@ -47,7 +47,7 @@ PcNewPort(
|
||||||
|
|
||||||
if (RtlStringFromGUID(ClassId, &GuidString) == STATUS_SUCCESS)
|
if (RtlStringFromGUID(ClassId, &GuidString) == STATUS_SUCCESS)
|
||||||
{
|
{
|
||||||
DPRINT1("unknown interface %S\n", GuidString.Buffer);
|
DPRINT("unknown interface %S\n", GuidString.Buffer);
|
||||||
RtlFreeUnicodeString(&GuidString);
|
RtlFreeUnicodeString(&GuidString);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -139,7 +139,7 @@ CPortDMus::QueryInterface(
|
||||||
|
|
||||||
if (RtlStringFromGUID(refiid, &GuidString) == STATUS_SUCCESS)
|
if (RtlStringFromGUID(refiid, &GuidString) == STATUS_SUCCESS)
|
||||||
{
|
{
|
||||||
DPRINT1("IPortMidi_fnQueryInterface no interface!!! iface %S\n", GuidString.Buffer);
|
DPRINT("IPortMidi_fnQueryInterface no interface!!! iface %S\n", GuidString.Buffer);
|
||||||
RtlFreeUnicodeString(&GuidString);
|
RtlFreeUnicodeString(&GuidString);
|
||||||
}
|
}
|
||||||
return STATUS_UNSUCCESSFUL;
|
return STATUS_UNSUCCESSFUL;
|
||||||
|
@ -225,7 +225,7 @@ CPortDMus::Init(
|
||||||
Status = Miniport->GetDescription(&m_pDescriptor);
|
Status = Miniport->GetDescription(&m_pDescriptor);
|
||||||
if (!NT_SUCCESS(Status))
|
if (!NT_SUCCESS(Status))
|
||||||
{
|
{
|
||||||
DPRINT1("failed to get description\n");
|
DPRINT("failed to get description\n");
|
||||||
Miniport->Release();
|
Miniport->Release();
|
||||||
m_bInitialized = FALSE;
|
m_bInitialized = FALSE;
|
||||||
return Status;
|
return Status;
|
||||||
|
@ -250,7 +250,7 @@ CPortDMus::Init(
|
||||||
Status = MidiMiniport->GetDescription(&m_pDescriptor);
|
Status = MidiMiniport->GetDescription(&m_pDescriptor);
|
||||||
if (!NT_SUCCESS(Status))
|
if (!NT_SUCCESS(Status))
|
||||||
{
|
{
|
||||||
DPRINT1("failed to get description\n");
|
DPRINT("failed to get description\n");
|
||||||
MidiMiniport->Release();
|
MidiMiniport->Release();
|
||||||
m_bInitialized = FALSE;
|
m_bInitialized = FALSE;
|
||||||
return Status;
|
return Status;
|
||||||
|
@ -278,7 +278,7 @@ CPortDMus::Init(
|
||||||
|
|
||||||
if (!NT_SUCCESS(Status))
|
if (!NT_SUCCESS(Status))
|
||||||
{
|
{
|
||||||
DPRINT1("Failed to create descriptior\n");
|
DPRINT("Failed to create descriptior\n");
|
||||||
|
|
||||||
if (Miniport)
|
if (Miniport)
|
||||||
Miniport->Release();
|
Miniport->Release();
|
||||||
|
|
|
@ -171,7 +171,7 @@ CPortTopology::QueryInterface(
|
||||||
|
|
||||||
if (RtlStringFromGUID(refiid, &GuidString) == STATUS_SUCCESS)
|
if (RtlStringFromGUID(refiid, &GuidString) == STATUS_SUCCESS)
|
||||||
{
|
{
|
||||||
DPRINT1("IPortTopology_fnQueryInterface no interface!!! iface %S\n", GuidString.Buffer);
|
DPRINT("IPortTopology_fnQueryInterface no interface!!! iface %S\n", GuidString.Buffer);
|
||||||
RtlFreeUnicodeString(&GuidString);
|
RtlFreeUnicodeString(&GuidString);
|
||||||
}
|
}
|
||||||
return STATUS_UNSUCCESSFUL;
|
return STATUS_UNSUCCESSFUL;
|
||||||
|
@ -219,14 +219,14 @@ CPortTopology::Init(
|
||||||
|
|
||||||
if (m_bInitialized)
|
if (m_bInitialized)
|
||||||
{
|
{
|
||||||
DPRINT1("IPortTopology_Init called again\n");
|
DPRINT("IPortTopology_Init called again\n");
|
||||||
return STATUS_SUCCESS;
|
return STATUS_SUCCESS;
|
||||||
}
|
}
|
||||||
|
|
||||||
Status = UnknownMiniport->QueryInterface(IID_IMiniportTopology, (PVOID*)&Miniport);
|
Status = UnknownMiniport->QueryInterface(IID_IMiniportTopology, (PVOID*)&Miniport);
|
||||||
if (!NT_SUCCESS(Status))
|
if (!NT_SUCCESS(Status))
|
||||||
{
|
{
|
||||||
DPRINT1("IPortTopology_Init called with invalid IMiniport adapter\n");
|
DPRINT("IPortTopology_Init called with invalid IMiniport adapter\n");
|
||||||
return STATUS_INVALID_PARAMETER;
|
return STATUS_INVALID_PARAMETER;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -239,7 +239,7 @@ CPortTopology::Init(
|
||||||
Status = Miniport->Init(UnknownAdapter, ResourceList, this);
|
Status = Miniport->Init(UnknownAdapter, ResourceList, this);
|
||||||
if (!NT_SUCCESS(Status))
|
if (!NT_SUCCESS(Status))
|
||||||
{
|
{
|
||||||
DPRINT1("IPortTopology_Init failed with %x\n", Status);
|
DPRINT("IPortTopology_Init failed with %x\n", Status);
|
||||||
m_bInitialized = FALSE;
|
m_bInitialized = FALSE;
|
||||||
Miniport->Release();
|
Miniport->Release();
|
||||||
return Status;
|
return Status;
|
||||||
|
@ -249,7 +249,7 @@ CPortTopology::Init(
|
||||||
Status = Miniport->GetDescription(&m_pDescriptor);
|
Status = Miniport->GetDescription(&m_pDescriptor);
|
||||||
if (!NT_SUCCESS(Status))
|
if (!NT_SUCCESS(Status))
|
||||||
{
|
{
|
||||||
DPRINT1("failed to get description\n");
|
DPRINT("failed to get description\n");
|
||||||
Miniport->Release();
|
Miniport->Release();
|
||||||
m_bInitialized = FALSE;
|
m_bInitialized = FALSE;
|
||||||
return Status;
|
return Status;
|
||||||
|
@ -371,7 +371,7 @@ NTSTATUS
|
||||||
NTAPI
|
NTAPI
|
||||||
CPortTopology::ReleaseChildren()
|
CPortTopology::ReleaseChildren()
|
||||||
{
|
{
|
||||||
DPRINT1("ISubDevice_fnReleaseChildren\n");
|
DPRINT("ISubDevice_fnReleaseChildren\n");
|
||||||
|
|
||||||
// release the filter
|
// release the filter
|
||||||
m_Filter->Release();
|
m_Filter->Release();
|
||||||
|
@ -468,7 +468,7 @@ CreatePinWorkerRoutine(
|
||||||
WorkerContext->Irp,
|
WorkerContext->Irp,
|
||||||
NULL);
|
NULL);
|
||||||
|
|
||||||
DPRINT1("CreatePinWorkerRoutine Status %x\n", Status);
|
DPRINT("CreatePinWorkerRoutine Status %x\n", Status);
|
||||||
|
|
||||||
if (NT_SUCCESS(Status))
|
if (NT_SUCCESS(Status))
|
||||||
{
|
{
|
||||||
|
@ -505,7 +505,7 @@ PcCreatePinDispatch(
|
||||||
// sanity check
|
// sanity check
|
||||||
PC_ASSERT(CreateItem);
|
PC_ASSERT(CreateItem);
|
||||||
|
|
||||||
DPRINT1("PcCreatePinDispatch called DeviceObject %p %S Name\n", DeviceObject, CreateItem->ObjectClass.Buffer);
|
DPRINT("PcCreatePinDispatch called DeviceObject %p %S Name\n", DeviceObject, CreateItem->ObjectClass.Buffer);
|
||||||
|
|
||||||
Filter = (IIrpTarget*)CreateItem->Context;
|
Filter = (IIrpTarget*)CreateItem->Context;
|
||||||
|
|
||||||
|
@ -517,7 +517,7 @@ PcCreatePinDispatch(
|
||||||
Status = KsReferenceSoftwareBusObject(DeviceExt->KsDeviceHeader);
|
Status = KsReferenceSoftwareBusObject(DeviceExt->KsDeviceHeader);
|
||||||
if (!NT_SUCCESS(Status) && Status != STATUS_NOT_IMPLEMENTED)
|
if (!NT_SUCCESS(Status) && Status != STATUS_NOT_IMPLEMENTED)
|
||||||
{
|
{
|
||||||
DPRINT1("PcCreatePinDispatch failed to reference device header\n");
|
DPRINT("PcCreatePinDispatch failed to reference device header\n");
|
||||||
|
|
||||||
FreeItem(Entry, TAG_PORTCLASS);
|
FreeItem(Entry, TAG_PORTCLASS);
|
||||||
goto cleanup;
|
goto cleanup;
|
||||||
|
@ -577,7 +577,7 @@ PcCreateItemDispatch(
|
||||||
// access the create item
|
// access the create item
|
||||||
CreateItem = KSCREATE_ITEM_IRP_STORAGE(Irp);
|
CreateItem = KSCREATE_ITEM_IRP_STORAGE(Irp);
|
||||||
|
|
||||||
DPRINT1("PcCreateItemDispatch called DeviceObject %p %S Name\n", DeviceObject, CreateItem->ObjectClass.Buffer);
|
DPRINT("PcCreateItemDispatch called DeviceObject %p %S Name\n", DeviceObject, CreateItem->ObjectClass.Buffer);
|
||||||
|
|
||||||
// get the subdevice
|
// get the subdevice
|
||||||
SubDevice = (ISubdevice*)CreateItem->Context;
|
SubDevice = (ISubdevice*)CreateItem->Context;
|
||||||
|
@ -589,7 +589,7 @@ PcCreateItemDispatch(
|
||||||
Status = KsReferenceSoftwareBusObject(DeviceExt->KsDeviceHeader);
|
Status = KsReferenceSoftwareBusObject(DeviceExt->KsDeviceHeader);
|
||||||
if (!NT_SUCCESS(Status) && Status != STATUS_NOT_IMPLEMENTED)
|
if (!NT_SUCCESS(Status) && Status != STATUS_NOT_IMPLEMENTED)
|
||||||
{
|
{
|
||||||
DPRINT1("PcCreateItemDispatch failed to reference device header\n");
|
DPRINT("PcCreateItemDispatch failed to reference device header\n");
|
||||||
|
|
||||||
FreeItem(Entry, TAG_PORTCLASS);
|
FreeItem(Entry, TAG_PORTCLASS);
|
||||||
goto cleanup;
|
goto cleanup;
|
||||||
|
@ -606,7 +606,7 @@ PcCreateItemDispatch(
|
||||||
NULL);
|
NULL);
|
||||||
if (!NT_SUCCESS(Status))
|
if (!NT_SUCCESS(Status))
|
||||||
{
|
{
|
||||||
DPRINT1("Failed to get filter object\n");
|
DPRINT("Failed to get filter object\n");
|
||||||
Irp->IoStatus.Status = Status;
|
Irp->IoStatus.Status = Status;
|
||||||
IoCompleteRequest(Irp, IO_NO_INCREMENT);
|
IoCompleteRequest(Irp, IO_NO_INCREMENT);
|
||||||
return Status;
|
return Status;
|
||||||
|
|
|
@ -181,7 +181,7 @@ CPortWaveCyclic::QueryInterface(
|
||||||
|
|
||||||
if (RtlStringFromGUID(refiid, &GuidString) == STATUS_SUCCESS)
|
if (RtlStringFromGUID(refiid, &GuidString) == STATUS_SUCCESS)
|
||||||
{
|
{
|
||||||
DPRINT1("IPortWaveCyclic_fnQueryInterface no interface!!! iface %S\n", GuidString.Buffer);
|
DPRINT("IPortWaveCyclic_fnQueryInterface no interface!!! iface %S\n", GuidString.Buffer);
|
||||||
RtlFreeUnicodeString(&GuidString);
|
RtlFreeUnicodeString(&GuidString);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -268,7 +268,7 @@ CPortWaveCyclic::Init(
|
||||||
Status = Miniport->GetDescription(&m_pDescriptor);
|
Status = Miniport->GetDescription(&m_pDescriptor);
|
||||||
if (!NT_SUCCESS(Status))
|
if (!NT_SUCCESS(Status))
|
||||||
{
|
{
|
||||||
DPRINT1("failed to get description\n");
|
DPRINT("failed to get description\n");
|
||||||
Miniport->Release();
|
Miniport->Release();
|
||||||
m_bInitialized = FALSE;
|
m_bInitialized = FALSE;
|
||||||
return Status;
|
return Status;
|
||||||
|
@ -292,7 +292,7 @@ CPortWaveCyclic::Init(
|
||||||
|
|
||||||
if (!NT_SUCCESS(Status))
|
if (!NT_SUCCESS(Status))
|
||||||
{
|
{
|
||||||
DPRINT1("PcCreateSubdeviceDescriptor failed with %x\n", Status);
|
DPRINT("PcCreateSubdeviceDescriptor failed with %x\n", Status);
|
||||||
Miniport->Release();
|
Miniport->Release();
|
||||||
m_bInitialized = FALSE;
|
m_bInitialized = FALSE;
|
||||||
return Status;
|
return Status;
|
||||||
|
|
|
@ -201,7 +201,7 @@ CPortWavePci::QueryInterface(
|
||||||
|
|
||||||
if (RtlStringFromGUID(refiid, &GuidString) == STATUS_SUCCESS)
|
if (RtlStringFromGUID(refiid, &GuidString) == STATUS_SUCCESS)
|
||||||
{
|
{
|
||||||
DPRINT1("IPortWavePci_fnQueryInterface no interface!!! iface %S\n", GuidString.Buffer);
|
DPRINT("IPortWavePci_fnQueryInterface no interface!!! iface %S\n", GuidString.Buffer);
|
||||||
RtlFreeUnicodeString(&GuidString);
|
RtlFreeUnicodeString(&GuidString);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -269,7 +269,7 @@ CPortWavePci::Init(
|
||||||
Status = Miniport->GetDescription(&m_pDescriptor);
|
Status = Miniport->GetDescription(&m_pDescriptor);
|
||||||
if (!NT_SUCCESS(Status))
|
if (!NT_SUCCESS(Status))
|
||||||
{
|
{
|
||||||
DPRINT1("failed to get description\n");
|
DPRINT("failed to get description\n");
|
||||||
Miniport->Release();
|
Miniport->Release();
|
||||||
m_bInitialized = FALSE;
|
m_bInitialized = FALSE;
|
||||||
return Status;
|
return Status;
|
||||||
|
@ -294,7 +294,7 @@ CPortWavePci::Init(
|
||||||
|
|
||||||
if (!NT_SUCCESS(Status))
|
if (!NT_SUCCESS(Status))
|
||||||
{
|
{
|
||||||
DPRINT1("PcCreateSubdeviceDescriptor failed with %x\n", Status);
|
DPRINT("PcCreateSubdeviceDescriptor failed with %x\n", Status);
|
||||||
Miniport->Release();
|
Miniport->Release();
|
||||||
m_bInitialized = FALSE;
|
m_bInitialized = FALSE;
|
||||||
return Status;
|
return Status;
|
||||||
|
@ -489,7 +489,7 @@ NTAPI
|
||||||
CPortWavePci::GetDescriptor(
|
CPortWavePci::GetDescriptor(
|
||||||
IN SUBDEVICE_DESCRIPTOR ** Descriptor)
|
IN SUBDEVICE_DESCRIPTOR ** Descriptor)
|
||||||
{
|
{
|
||||||
DPRINT1("ISubDevice_GetDescriptor this %p\n", this);
|
DPRINT("ISubDevice_GetDescriptor this %p\n", this);
|
||||||
*Descriptor = m_SubDeviceDescriptor;
|
*Descriptor = m_SubDeviceDescriptor;
|
||||||
return STATUS_SUCCESS;
|
return STATUS_SUCCESS;
|
||||||
}
|
}
|
||||||
|
|
|
@ -174,7 +174,7 @@ CPortWaveRT::QueryInterface(
|
||||||
|
|
||||||
if (RtlStringFromGUID(refiid, &GuidString) == STATUS_SUCCESS)
|
if (RtlStringFromGUID(refiid, &GuidString) == STATUS_SUCCESS)
|
||||||
{
|
{
|
||||||
DPRINT1("IPortWaveRT_fnQueryInterface no interface!!! iface %S\n", GuidString.Buffer);
|
DPRINT("IPortWaveRT_fnQueryInterface no interface!!! iface %S\n", GuidString.Buffer);
|
||||||
RtlFreeUnicodeString(&GuidString);
|
RtlFreeUnicodeString(&GuidString);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -256,7 +256,7 @@ CPortWaveRT::Init(
|
||||||
Status = Miniport->GetDescription(&m_pDescriptor);
|
Status = Miniport->GetDescription(&m_pDescriptor);
|
||||||
if (!NT_SUCCESS(Status))
|
if (!NT_SUCCESS(Status))
|
||||||
{
|
{
|
||||||
DPRINT1("failed to get description\n");
|
DPRINT("failed to get description\n");
|
||||||
Miniport->Release();
|
Miniport->Release();
|
||||||
m_bInitialized = FALSE;
|
m_bInitialized = FALSE;
|
||||||
return Status;
|
return Status;
|
||||||
|
@ -280,7 +280,7 @@ CPortWaveRT::Init(
|
||||||
|
|
||||||
if (!NT_SUCCESS(Status))
|
if (!NT_SUCCESS(Status))
|
||||||
{
|
{
|
||||||
DPRINT1("PcCreateSubdeviceDescriptor failed with %x\n", Status);
|
DPRINT("PcCreateSubdeviceDescriptor failed with %x\n", Status);
|
||||||
Miniport->Release();
|
Miniport->Release();
|
||||||
m_bInitialized = FALSE;
|
m_bInitialized = FALSE;
|
||||||
return Status;
|
return Status;
|
||||||
|
|
|
@ -81,7 +81,7 @@ CPortWaveRTStreamInit::AllocateContiguousPagesForMdl(
|
||||||
Buffer = MmAllocateContiguousMemorySpecifyCache(TotalBytes, LowAddress, HighAddress, RtlConvertUlongToLargeInteger(0), MmNonCached);
|
Buffer = MmAllocateContiguousMemorySpecifyCache(TotalBytes, LowAddress, HighAddress, RtlConvertUlongToLargeInteger(0), MmNonCached);
|
||||||
if (!Buffer)
|
if (!Buffer)
|
||||||
{
|
{
|
||||||
DPRINT1("MmAllocateContiguousMemorySpecifyCache failed\n");
|
DPRINT("MmAllocateContiguousMemorySpecifyCache failed\n");
|
||||||
return NULL;
|
return NULL;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -92,13 +92,13 @@ CPortWaveRTStreamInit::AllocateContiguousPagesForMdl(
|
||||||
Mdl = MmAllocatePagesForMdl(Address, HighAddress, RtlConvertUlongToLargeInteger(0), TotalBytes);
|
Mdl = MmAllocatePagesForMdl(Address, HighAddress, RtlConvertUlongToLargeInteger(0), TotalBytes);
|
||||||
if (!Mdl)
|
if (!Mdl)
|
||||||
{
|
{
|
||||||
DPRINT1("MmAllocatePagesForMdl failed\n");
|
DPRINT("MmAllocatePagesForMdl failed\n");
|
||||||
return NULL;
|
return NULL;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (MmGetMdlByteCount(Mdl) < TotalBytes)
|
if (MmGetMdlByteCount(Mdl) < TotalBytes)
|
||||||
{
|
{
|
||||||
DPRINT1("ByteCount %u Required %u\n", MmGetMdlByteCount(Mdl), TotalBytes);
|
DPRINT("ByteCount %u Required %u\n", MmGetMdlByteCount(Mdl), TotalBytes);
|
||||||
MmFreePagesFromMdl(Mdl);
|
MmFreePagesFromMdl(Mdl);
|
||||||
ExFreePool(Mdl);
|
ExFreePool(Mdl);
|
||||||
return NULL;
|
return NULL;
|
||||||
|
@ -157,7 +157,7 @@ CPortWaveRTStreamInit::GetPhysicalPageAddress(
|
||||||
Pages = ADDRESS_AND_SIZE_TO_SPAN_PAGES(0, MmGetMdlByteCount(MemoryDescriptorList));
|
Pages = ADDRESS_AND_SIZE_TO_SPAN_PAGES(0, MmGetMdlByteCount(MemoryDescriptorList));
|
||||||
if (Pages <= Index)
|
if (Pages <= Index)
|
||||||
{
|
{
|
||||||
DPRINT1("OutOfBounds: Pages %u Index %u\n", Pages, Index);
|
DPRINT("OutOfBounds: Pages %u Index %u\n", Pages, Index);
|
||||||
return RtlConvertUlongToLargeInteger(0);
|
return RtlConvertUlongToLargeInteger(0);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -32,7 +32,7 @@ PcRegisterAdapterPowerManagement(
|
||||||
Status = pUnknown->QueryInterface(IID_IAdapterPowerManagement, (PVOID*)&pPower);
|
Status = pUnknown->QueryInterface(IID_IAdapterPowerManagement, (PVOID*)&pPower);
|
||||||
if (!NT_SUCCESS(Status))
|
if (!NT_SUCCESS(Status))
|
||||||
{
|
{
|
||||||
DPRINT1("PcRegisterAdapterPowerManagement no IAdapterPowerManagement interface %x\n", Status);
|
DPRINT("PcRegisterAdapterPowerManagement no IAdapterPowerManagement interface %x\n", Status);
|
||||||
DeviceExt->AdapterPowerManagement = NULL;
|
DeviceExt->AdapterPowerManagement = NULL;
|
||||||
return STATUS_SUCCESS;
|
return STATUS_SUCCESS;
|
||||||
}
|
}
|
||||||
|
|
|
@ -124,13 +124,13 @@ HandlePhysicalConnection(
|
||||||
if (RequestLength < sizeof(KSP_PIN))
|
if (RequestLength < sizeof(KSP_PIN))
|
||||||
{
|
{
|
||||||
// input buffer must be at least sizeof KSP_PIN
|
// input buffer must be at least sizeof KSP_PIN
|
||||||
DPRINT1("input length too small\n");
|
DPRINT("input length too small\n");
|
||||||
return STATUS_INVALID_PARAMETER;
|
return STATUS_INVALID_PARAMETER;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (IsListEmpty(&Descriptor->PhysicalConnectionList))
|
if (IsListEmpty(&Descriptor->PhysicalConnectionList))
|
||||||
{
|
{
|
||||||
DPRINT1("no connection\n");
|
DPRINT("no connection\n");
|
||||||
return STATUS_NOT_FOUND;
|
return STATUS_NOT_FOUND;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -201,7 +201,7 @@ PinPropertyHandler(
|
||||||
Status = IrpTarget->QueryInterface(IID_IPort, (PVOID*)&Port);
|
Status = IrpTarget->QueryInterface(IID_IPort, (PVOID*)&Port);
|
||||||
if (!NT_SUCCESS(Status))
|
if (!NT_SUCCESS(Status))
|
||||||
{
|
{
|
||||||
DPRINT1("Failed to obtain IPort interface from filter\n");
|
DPRINT("Failed to obtain IPort interface from filter\n");
|
||||||
Irp->IoStatus.Information = 0;
|
Irp->IoStatus.Information = 0;
|
||||||
Irp->IoStatus.Status = STATUS_UNSUCCESSFUL;
|
Irp->IoStatus.Status = STATUS_UNSUCCESSFUL;
|
||||||
return STATUS_UNSUCCESSFUL;
|
return STATUS_UNSUCCESSFUL;
|
||||||
|
@ -211,7 +211,7 @@ PinPropertyHandler(
|
||||||
Status = Port->QueryInterface(IID_ISubdevice, (PVOID*)&SubDevice);
|
Status = Port->QueryInterface(IID_ISubdevice, (PVOID*)&SubDevice);
|
||||||
if (!NT_SUCCESS(Status))
|
if (!NT_SUCCESS(Status))
|
||||||
{
|
{
|
||||||
DPRINT1("Failed to obtain ISubdevice interface from port driver\n");
|
DPRINT("Failed to obtain ISubdevice interface from port driver\n");
|
||||||
KeBugCheck(0);
|
KeBugCheck(0);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -64,7 +64,6 @@ CRegistryKey::QueryInterface(
|
||||||
}
|
}
|
||||||
|
|
||||||
DPRINT("IRegistryKey_QueryInterface: This %p\n", this);
|
DPRINT("IRegistryKey_QueryInterface: This %p\n", this);
|
||||||
DbgBreakPoint();
|
|
||||||
return STATUS_UNSUCCESSFUL;
|
return STATUS_UNSUCCESSFUL;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -154,7 +153,7 @@ CRegistryKey::NewSubKey(
|
||||||
Status = ZwCreateKey(&hKey, KEY_READ | KEY_WRITE, &Attributes, 0, NULL, 0, Disposition);
|
Status = ZwCreateKey(&hKey, KEY_READ | KEY_WRITE, &Attributes, 0, NULL, 0, Disposition);
|
||||||
if (!NT_SUCCESS(Status))
|
if (!NT_SUCCESS(Status))
|
||||||
{
|
{
|
||||||
DPRINT1("CRegistryKey::NewSubKey failed with %x\n", Status);
|
DPRINT("CRegistryKey::NewSubKey failed with %x\n", Status);
|
||||||
return Status;
|
return Status;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -69,7 +69,7 @@ CResourceList::QueryInterface(
|
||||||
|
|
||||||
if (RtlStringFromGUID(refiid, &GuidString) == STATUS_SUCCESS)
|
if (RtlStringFromGUID(refiid, &GuidString) == STATUS_SUCCESS)
|
||||||
{
|
{
|
||||||
DPRINT1("IResourceList_QueryInterface no interface!!! iface %S\n", GuidString.Buffer);
|
DPRINT("IResourceList_QueryInterface no interface!!! iface %S\n", GuidString.Buffer);
|
||||||
RtlFreeUnicodeString(&GuidString);
|
RtlFreeUnicodeString(&GuidString);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -107,7 +107,7 @@ CResourceList::NumberOfEntriesOfType(
|
||||||
{
|
{
|
||||||
PartialDescriptor = &m_TranslatedResourceList->List[0].PartialResourceList.PartialDescriptors[Index];
|
PartialDescriptor = &m_TranslatedResourceList->List[0].PartialResourceList.PartialDescriptors[Index];
|
||||||
UnPartialDescriptor = &m_UntranslatedResourceList->List[0].PartialResourceList.PartialDescriptors[Index];
|
UnPartialDescriptor = &m_UntranslatedResourceList->List[0].PartialResourceList.PartialDescriptors[Index];
|
||||||
DPRINT1("Descriptor Type %u\n", PartialDescriptor->Type);
|
DPRINT("Descriptor Type %u\n", PartialDescriptor->Type);
|
||||||
if (PartialDescriptor->Type == Type)
|
if (PartialDescriptor->Type == Type)
|
||||||
{
|
{
|
||||||
// Yay! Finally found one that matches!
|
// Yay! Finally found one that matches!
|
||||||
|
@ -116,15 +116,15 @@ CResourceList::NumberOfEntriesOfType(
|
||||||
|
|
||||||
if (PartialDescriptor->Type == CmResourceTypeInterrupt)
|
if (PartialDescriptor->Type == CmResourceTypeInterrupt)
|
||||||
{
|
{
|
||||||
DPRINT1("Index %u TRANS Interrupt Number Affinity %x Level %u Vector %u\n", Index, PartialDescriptor->u.Interrupt.Affinity, PartialDescriptor->u.Interrupt.Level, PartialDescriptor->u.Interrupt.Vector, PartialDescriptor->u.Port.Start.LowPart, PartialDescriptor->Flags);
|
DPRINT("Index %u TRANS Interrupt Number Affinity %x Level %u Vector %u Flags %x Share %x\n", Index, PartialDescriptor->u.Interrupt.Affinity, PartialDescriptor->u.Interrupt.Level, PartialDescriptor->u.Interrupt.Vector, PartialDescriptor->Flags, PartialDescriptor->ShareDisposition);
|
||||||
DPRINT1("Index %u UNTRANS Interrupt Number Affinity %x Level %u Vector %u\n", Index, UnPartialDescriptor->u.Interrupt.Affinity, UnPartialDescriptor->u.Interrupt.Level, UnPartialDescriptor->u.Interrupt.Vector, PartialDescriptor->u.Port.Start.LowPart, PartialDescriptor->Flags);
|
DPRINT("Index %u UNTRANS Interrupt Number Affinity %x Level %u Vector %u Flags %x Share %x\\n", Index, UnPartialDescriptor->u.Interrupt.Affinity, UnPartialDescriptor->u.Interrupt.Level, UnPartialDescriptor->u.Interrupt.Vector, UnPartialDescriptor->Flags, UnPartialDescriptor->ShareDisposition);
|
||||||
|
|
||||||
}
|
}
|
||||||
else if (PartialDescriptor->Type == CmResourceTypePort)
|
else if (PartialDescriptor->Type == CmResourceTypePort)
|
||||||
{
|
{
|
||||||
DPRINT1("Index %u TRANS Port Length %u Start %u %u Flags %x\n", Index, PartialDescriptor->u.Port.Length, PartialDescriptor->u.Port.Start.HighPart, PartialDescriptor->u.Port.Start.LowPart, PartialDescriptor->Flags);
|
DPRINT("Index %u TRANS Port Length %u Start %u %u Flags %x Share %x\n", Index, PartialDescriptor->u.Port.Length, PartialDescriptor->u.Port.Start.HighPart, PartialDescriptor->u.Port.Start.LowPart, PartialDescriptor->Flags, PartialDescriptor->ShareDisposition);
|
||||||
DPRINT1("Index %u UNTRANS Port Length %u Start %u %u Flags %x\n", Index, UnPartialDescriptor->u.Port.Length, UnPartialDescriptor->u.Port.Start.HighPart, UnPartialDescriptor->u.Port.Start.LowPart, UnPartialDescriptor->Flags);
|
DPRINT("Index %u UNTRANS Port Length %u Start %u %u Flags %x Share %x\n", Index, UnPartialDescriptor->u.Port.Length, UnPartialDescriptor->u.Port.Start.HighPart, UnPartialDescriptor->u.Port.Start.LowPart, UnPartialDescriptor->Flags, UnPartialDescriptor->ShareDisposition);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
DPRINT("Found %d type %d\n", Count, Type);
|
DPRINT("Found %d type %d\n", Count, Type);
|
||||||
|
|
|
@ -93,7 +93,7 @@ CServiceGroup::QueryInterface(
|
||||||
|
|
||||||
if (RtlStringFromGUID(refiid, &GuidString) == STATUS_SUCCESS)
|
if (RtlStringFromGUID(refiid, &GuidString) == STATUS_SUCCESS)
|
||||||
{
|
{
|
||||||
DPRINT1("CServiceGroup::QueryInterface no interface!!! iface %S\n", GuidString.Buffer);
|
DPRINT("CServiceGroup::QueryInterface no interface!!! iface %S\n", GuidString.Buffer);
|
||||||
RtlFreeUnicodeString(&GuidString);
|
RtlFreeUnicodeString(&GuidString);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -229,14 +229,14 @@ PcHandlePropertyWithTable(
|
||||||
|
|
||||||
if (Status != STATUS_PENDING)
|
if (Status != STATUS_PENDING)
|
||||||
{
|
{
|
||||||
//DPRINT1("Status %x ValueSize %u
|
//DPRINT("Status %x ValueSize %u
|
||||||
|
|
||||||
Irp->IoStatus.Information = PropertyRequest->ValueSize;
|
Irp->IoStatus.Information = PropertyRequest->ValueSize;
|
||||||
ExFreePool(PropertyRequest);
|
ExFreePool(PropertyRequest);
|
||||||
}
|
}
|
||||||
#if 0
|
#if 0
|
||||||
RtlStringFromGUID(Property->Property.Set, &GuidString);
|
RtlStringFromGUID(Property->Property.Set, &GuidString);
|
||||||
DPRINT1("Id %u Flags %x Set %S FlagsItem %x Status %x\n", Property->Property.Id, Property->Property.Flags, GuidString.Buffer, PropertyItem->Flags, Status);
|
DPRINT("Id %u Flags %x Set %S FlagsItem %x Status %x\n", Property->Property.Id, Property->Property.Flags, GuidString.Buffer, PropertyItem->Flags, Status);
|
||||||
RtlFreeUnicodeString(&GuidString);
|
RtlFreeUnicodeString(&GuidString);
|
||||||
#endif
|
#endif
|
||||||
return Status;
|
return Status;
|
||||||
|
@ -245,7 +245,7 @@ PcHandlePropertyWithTable(
|
||||||
}
|
}
|
||||||
#if 0
|
#if 0
|
||||||
RtlStringFromGUID(Property->Property.Set, &GuidString);
|
RtlStringFromGUID(Property->Property.Set, &GuidString);
|
||||||
DPRINT1("Id %u Flags %x Set %S Status %x\n", Property->Property.Id, Property->Property.Flags, GuidString.Buffer, Status);
|
DPRINT("Id %u Flags %x Set %S Status %x\n", Property->Property.Id, Property->Property.Flags, GuidString.Buffer, Status);
|
||||||
RtlFreeUnicodeString(&GuidString);
|
RtlFreeUnicodeString(&GuidString);
|
||||||
#endif
|
#endif
|
||||||
}
|
}
|
||||||
|
@ -310,12 +310,12 @@ DumpFilterDescriptor(
|
||||||
PPCPROPERTY_ITEM PropertyItem;
|
PPCPROPERTY_ITEM PropertyItem;
|
||||||
UNICODE_STRING GuidString;
|
UNICODE_STRING GuidString;
|
||||||
|
|
||||||
DPRINT1("======================\n");
|
DPRINT("======================\n");
|
||||||
DPRINT1("Descriptor Automation Table%p\n",FilterDescription->AutomationTable);
|
DPRINT("Descriptor Automation Table%p\n",FilterDescription->AutomationTable);
|
||||||
|
|
||||||
if (FilterDescription->AutomationTable)
|
if (FilterDescription->AutomationTable)
|
||||||
{
|
{
|
||||||
DPRINT1("FilterPropertiesCount %u FilterPropertySize %u Expected %u\n", FilterDescription->AutomationTable->PropertyCount, FilterDescription->AutomationTable->PropertyItemSize, sizeof(PCPROPERTY_ITEM));
|
DPRINT("FilterPropertiesCount %u FilterPropertySize %u Expected %u\n", FilterDescription->AutomationTable->PropertyCount, FilterDescription->AutomationTable->PropertyItemSize, sizeof(PCPROPERTY_ITEM));
|
||||||
if (FilterDescription->AutomationTable->PropertyCount)
|
if (FilterDescription->AutomationTable->PropertyCount)
|
||||||
{
|
{
|
||||||
PropertyItem = (PPCPROPERTY_ITEM)FilterDescription->AutomationTable->Properties;
|
PropertyItem = (PPCPROPERTY_ITEM)FilterDescription->AutomationTable->Properties;
|
||||||
|
@ -323,7 +323,7 @@ DumpFilterDescriptor(
|
||||||
for(Index = 0; Index < FilterDescription->AutomationTable->PropertyCount; Index++)
|
for(Index = 0; Index < FilterDescription->AutomationTable->PropertyCount; Index++)
|
||||||
{
|
{
|
||||||
RtlStringFromGUID(*PropertyItem->Set, &GuidString);
|
RtlStringFromGUID(*PropertyItem->Set, &GuidString);
|
||||||
DPRINT1("Index %u GUID %S Id %u Flags %x\n", Index, GuidString.Buffer, PropertyItem->Id, PropertyItem->Flags);
|
DPRINT("Index %u GUID %S Id %u Flags %x\n", Index, GuidString.Buffer, PropertyItem->Id, PropertyItem->Flags);
|
||||||
|
|
||||||
PropertyItem = (PPCPROPERTY_ITEM)((ULONG_PTR)PropertyItem + FilterDescription->AutomationTable->PropertyItemSize);
|
PropertyItem = (PPCPROPERTY_ITEM)((ULONG_PTR)PropertyItem + FilterDescription->AutomationTable->PropertyItemSize);
|
||||||
}
|
}
|
||||||
|
@ -331,8 +331,7 @@ DumpFilterDescriptor(
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
DPRINT1("======================\n");
|
DPRINT("======================\n");
|
||||||
DbgBreakPoint();
|
|
||||||
}
|
}
|
||||||
|
|
||||||
NTSTATUS
|
NTSTATUS
|
||||||
|
@ -451,13 +450,16 @@ PcCreateSubdeviceDescriptor(
|
||||||
{
|
{
|
||||||
RtlMoveMemory(&Descriptor->Factory.KsPinDescriptor[Index], &SrcDescriptor->KsPinDescriptor, sizeof(KSPIN_DESCRIPTOR));
|
RtlMoveMemory(&Descriptor->Factory.KsPinDescriptor[Index], &SrcDescriptor->KsPinDescriptor, sizeof(KSPIN_DESCRIPTOR));
|
||||||
|
|
||||||
|
DPRINT("Index %u DataRangeCount %u\n", Index, SrcDescriptor->KsPinDescriptor.DataRangesCount);
|
||||||
|
|
||||||
Descriptor->Factory.Instances[Index].CurrentPinInstanceCount = 0;
|
Descriptor->Factory.Instances[Index].CurrentPinInstanceCount = 0;
|
||||||
Descriptor->Factory.Instances[Index].MaxFilterInstanceCount = FilterDescription->Pins[Index].MaxFilterInstanceCount;
|
Descriptor->Factory.Instances[Index].MaxFilterInstanceCount = SrcDescriptor->MaxFilterInstanceCount;
|
||||||
Descriptor->Factory.Instances[Index].MaxGlobalInstanceCount = FilterDescription->Pins[Index].MaxGlobalInstanceCount;
|
Descriptor->Factory.Instances[Index].MaxGlobalInstanceCount = SrcDescriptor->MaxGlobalInstanceCount;
|
||||||
Descriptor->Factory.Instances[Index].MinFilterInstanceCount = FilterDescription->Pins[Index].MinFilterInstanceCount;
|
Descriptor->Factory.Instances[Index].MinFilterInstanceCount = SrcDescriptor->MinFilterInstanceCount;
|
||||||
SrcDescriptor = (PPCPIN_DESCRIPTOR)((ULONG_PTR)SrcDescriptor + FilterDescription->PinSize);
|
SrcDescriptor = (PPCPIN_DESCRIPTOR)((ULONG_PTR)SrcDescriptor + FilterDescription->PinSize);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
Descriptor->DeviceDescriptor = FilterDescription;
|
Descriptor->DeviceDescriptor = FilterDescription;
|
||||||
*OutSubdeviceDescriptor = Descriptor;
|
*OutSubdeviceDescriptor = Descriptor;
|
||||||
return STATUS_SUCCESS;
|
return STATUS_SUCCESS;
|
||||||
|
|
|
@ -81,7 +81,7 @@ CUnregisterSubdevice::UnregisterSubdevice(
|
||||||
Status = Unknown->QueryInterface(IID_ISubdevice, (LPVOID*)&SubDevice);
|
Status = Unknown->QueryInterface(IID_ISubdevice, (LPVOID*)&SubDevice);
|
||||||
if (!NT_SUCCESS(Status))
|
if (!NT_SUCCESS(Status))
|
||||||
{
|
{
|
||||||
DPRINT1("No ISubdevice interface\n");
|
DPRINT("No ISubdevice interface\n");
|
||||||
// the provided port driver doesnt support ISubdevice
|
// the provided port driver doesnt support ISubdevice
|
||||||
return STATUS_INVALID_PARAMETER;
|
return STATUS_INVALID_PARAMETER;
|
||||||
}
|
}
|
||||||
|
@ -89,7 +89,7 @@ CUnregisterSubdevice::UnregisterSubdevice(
|
||||||
Status = SubDevice->GetDescriptor(&SubDeviceDescriptor);
|
Status = SubDevice->GetDescriptor(&SubDeviceDescriptor);
|
||||||
if (!NT_SUCCESS(Status))
|
if (!NT_SUCCESS(Status))
|
||||||
{
|
{
|
||||||
DPRINT1("Failed to retrieve subdevice descriptor %x\n", Status);
|
DPRINT("Failed to retrieve subdevice descriptor %x\n", Status);
|
||||||
// the provided port driver doesnt support ISubdevice
|
// the provided port driver doesnt support ISubdevice
|
||||||
return STATUS_INVALID_PARAMETER;
|
return STATUS_INVALID_PARAMETER;
|
||||||
}
|
}
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue