From 360606f98b620d61a3156ec878942d3a681a7083 Mon Sep 17 00:00:00 2001 From: Johannes Anderwald Date: Fri, 13 Mar 2009 14:07:03 +0000 Subject: [PATCH] - Remove hack in IDmaChannel::PhysicalAddress as it will hide the bug and not prevent es1370mp from crashing - Fix a horrible where the Mdl was not created for the common buffer - Might fix other audio related crashes - Forward IRP_MN_QUERY_INTERFACE to next lower device object - Fix & enable PcForwardIrpSynchronous implementation - Add debug print to IServiceGroup when a unknown IID is requested svn path=/trunk/; revision=40001 --- .../wdm/audio/backpln/portcls/dma_slave.c | 14 +++------- .../drivers/wdm/audio/backpln/portcls/irp.c | 28 +++++++++++++------ .../wdm/audio/backpln/portcls/service_group.c | 5 ++++ 3 files changed, 29 insertions(+), 18 deletions(-) diff --git a/reactos/drivers/wdm/audio/backpln/portcls/dma_slave.c b/reactos/drivers/wdm/audio/backpln/portcls/dma_slave.c index 0bf5314d869..eb09ea56523 100644 --- a/reactos/drivers/wdm/audio/backpln/portcls/dma_slave.c +++ b/reactos/drivers/wdm/audio/backpln/portcls/dma_slave.c @@ -125,7 +125,7 @@ IDmaChannelSlave_fnAllocateBuffer( This->BufferSize = BufferSize; This->AllocatedBufferSize = BufferSize; - DPRINT1("IDmaChannelSlave_fnAllocateBuffer Success Buffer %u Address %x %p\n", BufferSize, This->Address, PhysicalAddressConstraint); + DPRINT1("IDmaChannelSlave_fnAllocateBuffer Success Buffer %p BufferSize %u Address %x\n", This->Buffer, BufferSize, This->Address); return STATUS_SUCCESS; } @@ -227,17 +227,11 @@ IDmaChannelSlave_fnPhysicalAdress( IN IDmaChannelSlave * iface) { PHYSICAL_ADDRESS Address; + IDmaChannelSlaveImpl * This = (IDmaChannelSlaveImpl*)iface; DPRINT("IDmaChannelSlave_PhysicalAdress: This %p Virtuell %p Physical High %x Low %x%\n", This, This->Buffer, This->Address.HighPart, This->Address.LowPart); -#if 1 - - /// HACK - /// Prevent ES1371 driver from crashing by returning the vaddr instead of physical address - Address.QuadPart = (ULONG_PTR)This->Buffer; -#else - Address.QuadPart = This->Address.QuadPart; -#endif + Address = This->Address; return Address; } @@ -351,7 +345,7 @@ IDmaChannelSlave_fnStart( if (!This->Mdl) { - This->Mdl = IoAllocateMdl(&This->Buffer, This->MaximumBufferSize, FALSE, FALSE, NULL); + This->Mdl = IoAllocateMdl(This->Buffer, This->MaximumBufferSize, FALSE, FALSE, NULL); if (!This->Mdl) { return STATUS_INSUFFICIENT_RESOURCES; diff --git a/reactos/drivers/wdm/audio/backpln/portcls/irp.c b/reactos/drivers/wdm/audio/backpln/portcls/irp.c index a946d641340..e8196e59f28 100644 --- a/reactos/drivers/wdm/audio/backpln/portcls/irp.c +++ b/reactos/drivers/wdm/audio/backpln/portcls/irp.c @@ -135,12 +135,8 @@ PortClsPnp( return STATUS_SUCCESS; case IRP_MN_QUERY_INTERFACE: - DPRINT1("FIXME: IRP_MN_QUERY_INTERFACE: call next lower device object\n"); - /* FIXME - * call next lower device object */ - Irp->IoStatus.Status = STATUS_UNSUCCESSFUL; - IoCompleteRequest(Irp, IO_NO_INCREMENT); - return STATUS_UNSUCCESSFUL; + DPRINT("IRP_MN_QUERY_INTERFACE\n"); + return PcForwardIrpSynchronous(DeviceObject, Irp); case IRP_MN_QUERY_DEVICE_RELATIONS: Irp->IoStatus.Status = STATUS_UNSUCCESSFUL; @@ -264,6 +260,21 @@ PcCompleteIrp( return STATUS_UNSUCCESSFUL; } +NTSTATUS +NTAPI +CompletionRoutine( + IN PDEVICE_OBJECT DeviceObject, + IN PIRP Irp, + IN PVOID Context) +{ + if (Irp->PendingReturned == TRUE) + { + KeSetEvent ((PKEVENT) Context, IO_NO_INCREMENT, FALSE); + } + return STATUS_MORE_PROCESSING_REQUIRED; +} + + /* * @implemented */ @@ -279,15 +290,16 @@ PcForwardIrpSynchronous( DPRINT1("PcForwardIrpSynchronous\n"); DeviceExt = (PPCLASS_DEVICE_EXTENSION)DeviceObject->DeviceExtension; -return STATUS_SUCCESS; + /* initialize the notification event */ KeInitializeEvent(&Event, NotificationEvent, FALSE); - /* copy the current stack location */ IoCopyCurrentIrpStackLocationToNext(Irp); DPRINT1("PcForwardIrpSynchronous %p Irp %p\n", DeviceExt->PrevDeviceObject, Irp); + IoSetCompletionRoutine(Irp, CompletionRoutine, (PVOID)&Event, TRUE, TRUE, TRUE); + /* now call the driver */ Status = IoCallDriver(DeviceExt->PrevDeviceObject, Irp); /* did the request complete yet */ diff --git a/reactos/drivers/wdm/audio/backpln/portcls/service_group.c b/reactos/drivers/wdm/audio/backpln/portcls/service_group.c index 7237cbb4d29..a074869822e 100644 --- a/reactos/drivers/wdm/audio/backpln/portcls/service_group.c +++ b/reactos/drivers/wdm/audio/backpln/portcls/service_group.c @@ -35,6 +35,7 @@ IServiceGroup_fnQueryInterface( IN REFIID refiid, OUT PVOID* Output) { + WCHAR Buffer[100]; IServiceGroupImpl * This = (IServiceGroupImpl*)iface; if (IsEqualGUIDAligned(refiid, &IID_IServiceGroup) || IsEqualGUIDAligned(refiid, &IID_IServiceSink) || @@ -44,6 +45,10 @@ IServiceGroup_fnQueryInterface( InterlockedIncrement(&This->ref); return STATUS_SUCCESS; } + + StringFromCLSID(refiid, Buffer); + DPRINT1("IPortWaveCyclic_fnQueryInterface no interface!!! iface %S\n", Buffer); + return STATUS_UNSUCCESSFUL; } -- 2.17.1