From e246b9947ebedeb87587fa6f0bf8bd1384e3d1ec Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Herv=C3=A9=20Poussineau?= Date: Sat, 16 May 2020 23:17:19 +0200 Subject: [PATCH] [ISAPNP] Mark read data port as started, even if no ISAPNP card is present CORE-17056 --- drivers/bus/isapnp/pdo.c | 12 +++++++++--- 1 file changed, 9 insertions(+), 3 deletions(-) diff --git a/drivers/bus/isapnp/pdo.c b/drivers/bus/isapnp/pdo.c index 4a9f28ff481..36ba611e131 100644 --- a/drivers/bus/isapnp/pdo.c +++ b/drivers/bus/isapnp/pdo.c @@ -191,7 +191,7 @@ IsaPdoStartReadPort( IN PIO_STACK_LOCATION IrpSp) { PCM_RESOURCE_LIST ResourceList = IrpSp->Parameters.StartDevice.AllocatedResources; - NTSTATUS Status = STATUS_INVALID_PARAMETER; + NTSTATUS Status = STATUS_INSUFFICIENT_RESOURCES; KIRQL OldIrql; ULONG i; @@ -209,11 +209,12 @@ IsaPdoStartReadPort( for (i = 0; i < ResourceList->List[0].PartialResourceList.Count; i++) { PCM_PARTIAL_RESOURCE_DESCRIPTOR PartialDescriptor = &ResourceList->List[0].PartialResourceList.PartialDescriptors[i]; - if (PartialDescriptor->Type == CmResourceTypePort) + if (PartialDescriptor->Type == CmResourceTypePort && PartialDescriptor->u.Port.Length > 1 && !FdoExt->ReadDataPort) { PUCHAR ReadDataPort = ULongToPtr(PartialDescriptor->u.Port.Start.u.LowPart + 3); - if (PartialDescriptor->u.Port.Length > 1 && !FdoExt->ReadDataPort && NT_SUCCESS(IsaHwTryReadDataPort(ReadDataPort))) + if (NT_SUCCESS(IsaHwTryReadDataPort(ReadDataPort))) { + /* we detected some ISAPNP cards */ FdoExt->ReadDataPort = ReadDataPort; KeAcquireSpinLock(&FdoExt->Lock, &OldIrql); Status = IsaHwFillDeviceList(FdoExt); @@ -224,6 +225,11 @@ IsaPdoStartReadPort( IoInvalidateDeviceRelations(FdoExt->DataPortPdo, RemovalRelations); } } + else + { + /* mark read data port as started, even if no card has been detected */ + Status = STATUS_SUCCESS; + } } } return Status;