https://git.reactos.org/?p=reactos.git;a=commitdiff;h=e246b9947ebedeb87587fa6f0bf8bd1384e3d1ec

commit e246b9947ebedeb87587fa6f0bf8bd1384e3d1ec
Author:     Hervé Poussineau <hpous...@reactos.org>
AuthorDate: Sat May 16 23:17:19 2020 +0200
Commit:     Hervé Poussineau <hpous...@reactos.org>
CommitDate: Sat May 16 23:20:38 2020 +0200

    [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;

Reply via email to