[ros-diffs] [hpoussin] 27386: Add a message in case of error when loading/initializing driver

hpoussin at svn.reactos.org hpoussin at svn.reactos.org
Wed Jul 4 16:13:31 CEST 2007


Author: hpoussin
Date: Wed Jul  4 18:13:30 2007
New Revision: 27386

URL: http://svn.reactos.org/svn/reactos?rev=27386&view=rev
Log:
Add a message in case of error when loading/initializing driver

Modified:
    trunk/reactos/ntoskrnl/cm/ntfunc.c
    trunk/reactos/ntoskrnl/io/pnpmgr/pnpmgr.c

Modified: trunk/reactos/ntoskrnl/cm/ntfunc.c
URL: http://svn.reactos.org/svn/reactos/trunk/reactos/ntoskrnl/cm/ntfunc.c?rev=27386&r1=27385&r2=27386&view=diff
==============================================================================
--- trunk/reactos/ntoskrnl/cm/ntfunc.c (original)
+++ trunk/reactos/ntoskrnl/cm/ntfunc.c Wed Jul  4 18:13:30 2007
@@ -290,7 +290,7 @@
     {
       if (L'\\' == RemainingPath.Buffer[i])
         {
-          DPRINT1("NtCreateKey() doesn't create trees! (found \'\\\' in remaining path: \"%wZ\"!)\n", &RemainingPath);
+          DPRINT("NtCreateKey() doesn't create trees! (found \'\\\' in remaining path: \"%wZ\"!)\n", &RemainingPath);
 
           PostCreateKeyInfo.Object = NULL;
           PostCreateKeyInfo.Status = STATUS_OBJECT_NAME_NOT_FOUND;

Modified: trunk/reactos/ntoskrnl/io/pnpmgr/pnpmgr.c
URL: http://svn.reactos.org/svn/reactos/trunk/reactos/ntoskrnl/io/pnpmgr/pnpmgr.c?rev=27386&r1=27385&r2=27386&view=diff
==============================================================================
--- trunk/reactos/ntoskrnl/io/pnpmgr/pnpmgr.c (original)
+++ trunk/reactos/ntoskrnl/io/pnpmgr/pnpmgr.c Wed Jul  4 18:13:30 2007
@@ -2379,45 +2379,55 @@
 
       if (!NT_SUCCESS(Status))
       {
-          /* Driver is not initialized, try to load it */
-          Status = IopLoadServiceModule(&DeviceNode->ServiceName, &ModuleObject);
-
-          if (NT_SUCCESS(Status) || Status == STATUS_IMAGE_ALREADY_LOADED)
-          {
-              /* STATUS_IMAGE_ALREADY_LOADED means this driver
-                 was loaded by the bootloader */
-              if (Status != STATUS_IMAGE_ALREADY_LOADED)
-              {
-                  /* Initialize the driver */
-                  Status = IopInitializeDriverModule(DeviceNode, ModuleObject,
-                      &DeviceNode->ServiceName, FALSE, &DriverObject);
-              }
-              else
-              {
-                  Status = STATUS_SUCCESS;
-              }
-          }
+         /* Driver is not initialized, try to load it */
+         Status = IopLoadServiceModule(&DeviceNode->ServiceName, &ModuleObject);
+
+         if (NT_SUCCESS(Status) || Status == STATUS_IMAGE_ALREADY_LOADED)
+         {
+            /* STATUS_IMAGE_ALREADY_LOADED means this driver
+               was loaded by the bootloader */
+            if (Status != STATUS_IMAGE_ALREADY_LOADED)
+            {
+               /* Initialize the driver */
+               Status = IopInitializeDriverModule(DeviceNode, ModuleObject,
+                  &DeviceNode->ServiceName, FALSE, &DriverObject);
+            }
+            else
+            {
+               Status = STATUS_SUCCESS;
+            }
+         }
+         else
+         {
+            DPRINT1("IopLoadServiceModule(%wZ) failed with status 0x%08x\n",
+                    &DeviceNode->ServiceName, Status);
+         }
       }
 
       /* Driver is loaded and initialized at this point */
+      if (NT_SUCCESS(Status))
+      {
+         /* We have a driver for this DeviceNode */
+         DeviceNode->Flags |= DN_DRIVER_LOADED;
+         /* Attach lower level filter drivers. */
+         IopAttachFilterDrivers(DeviceNode, TRUE);
+         /* Initialize the function driver for the device node */
+         Status = IopInitializeDevice(DeviceNode, DriverObject);
+
          if (NT_SUCCESS(Status))
          {
-            /* We have a driver for this DeviceNode */
-            DeviceNode->Flags |= DN_DRIVER_LOADED;
-            /* Attach lower level filter drivers. */
-            IopAttachFilterDrivers(DeviceNode, TRUE);
-            /* Initialize the function driver for the device node */
-            Status = IopInitializeDevice(DeviceNode, DriverObject);
-
-            if (NT_SUCCESS(Status))
-            {
-               /* Attach upper level filter drivers. */
-               IopAttachFilterDrivers(DeviceNode, FALSE);
-               IopDeviceNodeSetFlag(DeviceNode, DNF_STARTED);
-
-               Status = IopStartDevice(DeviceNode);
-            }
-         }
+            /* Attach upper level filter drivers. */
+            IopAttachFilterDrivers(DeviceNode, FALSE);
+            IopDeviceNodeSetFlag(DeviceNode, DNF_STARTED);
+
+            Status = IopStartDevice(DeviceNode);
+         }
+         else
+         {
+            DPRINT1("IopInitializeDevice(%wZ) failed with status 0x%08x\n",
+                    &DeviceNode->InstancePath, Status);
+         }
+      }
       else
       {
          /*




More information about the Ros-diffs mailing list