From 9c03ef676e8a1a26a4d93c74dabbac1f2e41e162 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Herv=C3=A9=20Poussineau?= Date: Wed, 4 Jul 2007 14:13:30 +0000 Subject: [PATCH] Add a message in case of error when loading/initializing driver svn path=/trunk/; revision=27386 --- reactos/ntoskrnl/cm/ntfunc.c | 2 +- reactos/ntoskrnl/io/pnpmgr/pnpmgr.c | 72 ++++++++++++++++------------- 2 files changed, 42 insertions(+), 32 deletions(-) diff --git a/reactos/ntoskrnl/cm/ntfunc.c b/reactos/ntoskrnl/cm/ntfunc.c index 4518b423c7f..bfb2108e47d 100644 --- a/reactos/ntoskrnl/cm/ntfunc.c +++ b/reactos/ntoskrnl/cm/ntfunc.c @@ -290,7 +290,7 @@ NtCreateKey(OUT PHANDLE KeyHandle, { 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; diff --git a/reactos/ntoskrnl/io/pnpmgr/pnpmgr.c b/reactos/ntoskrnl/io/pnpmgr/pnpmgr.c index cdcedd9786a..478d71fc1dd 100644 --- a/reactos/ntoskrnl/io/pnpmgr/pnpmgr.c +++ b/reactos/ntoskrnl/io/pnpmgr/pnpmgr.c @@ -2379,45 +2379,55 @@ IopActionInitChildServices(PDEVICE_NODE DeviceNode, if (!NT_SUCCESS(Status)) { - /* Driver is not initialized, try to load it */ - Status = IopLoadServiceModule(&DeviceNode->ServiceName, &ModuleObject); + /* 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; - } - } + 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); + /* Attach upper level filter drivers. */ + IopAttachFilterDrivers(DeviceNode, FALSE); + IopDeviceNodeSetFlag(DeviceNode, DNF_STARTED); - if (NT_SUCCESS(Status)) - { - /* Attach upper level filter drivers. */ - IopAttachFilterDrivers(DeviceNode, FALSE); - IopDeviceNodeSetFlag(DeviceNode, DNF_STARTED); - - Status = IopStartDevice(DeviceNode); - } + Status = IopStartDevice(DeviceNode); } + else + { + DPRINT1("IopInitializeDevice(%wZ) failed with status 0x%08x\n", + &DeviceNode->InstancePath, Status); + } + } else { /*