Display the error message only in case of... error
Modified: trunk/reactos/ntoskrnl/io/pnpmgr.c

Modified: trunk/reactos/ntoskrnl/io/pnpmgr.c
--- trunk/reactos/ntoskrnl/io/pnpmgr.c	2006-01-08 22:48:21 UTC (rev 20737)
+++ trunk/reactos/ntoskrnl/io/pnpmgr.c	2006-01-08 22:50:11 UTC (rev 20738)
@@ -533,18 +533,20 @@
    InitializeObjectAttributes(&ObjectAttributes, &KeyName,
                               OBJ_CASE_INSENSITIVE, NULL, NULL);
    Status = ZwOpenKey(DevInstRegKey, DesiredAccess, &ObjectAttributes);
+   if (!NT_SUCCESS(Status))
+   {
+      DPRINT1("IoOpenDeviceRegistryKey(%wZ): Base key doesn't exist, exiting... (Status 0x%08lx)\n", &KeyName, Status);
+      ExFreePool(KeyNameBuffer);
+      return Status;
+   }
    ExFreePool(KeyNameBuffer);
 
    /*
-    * For driver key we're done now. Also if the base key doesn't
-    * exist we can bail out with error...
+    * For driver key we're done now.
     */
 
-   if ((DevInstKeyType & PLUGPLAY_REGKEY_DRIVER) || !NT_SUCCESS(Status))
-   {
-      DPRINT1("IoOpenDeviceRegistryKey(): Base key doesn't exist, exiting...\n");
+   if (DevInstKeyType & PLUGPLAY_REGKEY_DRIVER)
       return Status;
-   }
 
    /*
     * Let's go further. For device key we must open "Device Parameters"