From e284c5d6a8644ce285df3c8baf7162cf2edc08dc Mon Sep 17 00:00:00 2001 From: Johannes Anderwald Date: Wed, 14 Jan 2009 21:47:54 +0000 Subject: [PATCH] - sorry folks svn path=/trunk/; revision=38765 --- .../drivers/wdm/audio/backpln/portcls/irp.c | 44 +++++++++++++++++-- .../wdm/audio/backpln/portcls/private.h | 5 +++ 2 files changed, 45 insertions(+), 4 deletions(-) diff --git a/reactos/drivers/wdm/audio/backpln/portcls/irp.c b/reactos/drivers/wdm/audio/backpln/portcls/irp.c index a5ff23de558..b08d5796542 100644 --- a/reactos/drivers/wdm/audio/backpln/portcls/irp.c +++ b/reactos/drivers/wdm/audio/backpln/portcls/irp.c @@ -119,7 +119,7 @@ PortClsPnp( if ( ! NT_SUCCESS(status) ) { DPRINT("StartDevice returned a failure code [0x%8x]\n", status); - resource_list->lpVtbl->Release(resource_list); + //resource_list->lpVtbl->Release(resource_list); Irp->IoStatus.Status = status; IoCompleteRequest(Irp, IO_NO_INCREMENT); @@ -261,14 +261,50 @@ PcCompleteIrp( return STATUS_UNSUCCESSFUL; } +static +NTSTATUS +NTAPI +IrpCompletionRoutine( + IN PDEVICE_OBJECT DeviceObject, + IN PIRP Irp, + IN PVOID Context) +{ + KeSetEvent((PRKEVENT)Context, IO_NO_INCREMENT, FALSE); + return STATUS_SUCCESS; +} + + /* - * @unimplemented + * @implemented */ NTSTATUS NTAPI PcForwardIrpSynchronous( IN PDEVICE_OBJECT DeviceObject, IN PIRP Irp) { - UNIMPLEMENTED; - return STATUS_UNSUCCESSFUL; + KEVENT Event; + PCExtension* DeviceExt; + NTSTATUS Status; + + DPRINT1("PcForwardIrpSynchronous\n"); + + DeviceExt = (PCExtension*)DeviceObject->DeviceExtension; + + /* initialize the notification event */ + KeInitializeEvent(&Event, NotificationEvent, FALSE); + + /* setup a completion routine */ + IoSetCompletionRoutine(Irp, IrpCompletionRoutine, (PVOID)&Event, TRUE, FALSE, FALSE); + + /* now call the driver */ + Status = IoCallDriver(DeviceExt->PrevDeviceObject, Irp); + /* did the request complete yet */ + if (Status == STATUS_PENDING) + { + /* not yet, lets wait a bit */ + KeWaitForSingleObject(&Event, Executive, FALSE, FALSE, NULL); + Status = STATUS_SUCCESS; + } + DPRINT1("Returning status %x\n", Status); + return Status; } diff --git a/reactos/drivers/wdm/audio/backpln/portcls/private.h b/reactos/drivers/wdm/audio/backpln/portcls/private.h index 17afe309b97..e6fbb15f693 100644 --- a/reactos/drivers/wdm/audio/backpln/portcls/private.h +++ b/reactos/drivers/wdm/audio/backpln/portcls/private.h @@ -9,6 +9,7 @@ #include #include +#define YDEBUG #include #include @@ -102,9 +103,13 @@ typedef struct typedef struct { PDEVICE_OBJECT PhysicalDeviceObject; + PDEVICE_OBJECT PrevDeviceObject; PCPFNSTARTDEVICE StartDevice; KSDEVICE_HEADER KsDeviceHeader; IAdapterPowerManagement * AdapterPowerManagement; + ULONG MaxSubDevices; + KSOBJECT_CREATE_ITEM * CreateItems; + IResourceList* resources; LIST_ENTRY SubDeviceList;