Don't claim IDE channels if they are already claimed
authorHervé Poussineau <hpoussin@reactos.org>
Sun, 5 Mar 2006 19:47:22 +0000 (19:47 +0000)
committerHervé Poussineau <hpoussin@reactos.org>
Sun, 5 Mar 2006 19:47:22 +0000 (19:47 +0000)
svn path=/trunk/; revision=21236

reactos/drivers/storage/pciidex/pdo.c

index bfe5ccc..22668c0 100644 (file)
@@ -178,16 +178,26 @@ GetCurrentResources(
                switch (DeviceExtension->Channel)
                {
                        case 0:
-                               *CommandPortBase = 0x1F0;
-                               *ControlPortBase = 0x3F6;
-                               *InterruptVector = 14;
-                               ret = STATUS_SUCCESS;
+                               if (IoGetConfigurationInformation()->AtDiskPrimaryAddressClaimed)
+                                       ret = STATUS_INSUFFICIENT_RESOURCES;
+                               else
+                               {
+                                       *CommandPortBase = 0x1F0;
+                                       *ControlPortBase = 0x3F6;
+                                       *InterruptVector = 14;
+                                       ret = STATUS_SUCCESS;
+                               }
                                break;
                        case 1:
-                               *CommandPortBase = 0x170;
-                               *ControlPortBase = 0x376;
-                               *InterruptVector = 15;
-                               ret = STATUS_SUCCESS;
+                               if (IoGetConfigurationInformation()->AtDiskSecondaryAddressClaimed)
+                                       ret = STATUS_INSUFFICIENT_RESOURCES;
+                               else
+                               {
+                                       *CommandPortBase = 0x170;
+                                       *ControlPortBase = 0x376;
+                                       *InterruptVector = 15;
+                                       ret = STATUS_SUCCESS;
+                               }
                                break;
                }
        }