diff --git a/reactos/ntoskrnl/include/internal/io.h b/reactos/ntoskrnl/include/internal/io.h index 3d2c432f0c8..60425c5f1a6 100644 --- a/reactos/ntoskrnl/include/internal/io.h +++ b/reactos/ntoskrnl/include/internal/io.h @@ -491,6 +491,7 @@ NTSTATUS FASTCALL IopInitializeDriverModule( IN PDEVICE_NODE DeviceNode, IN PMODULE_OBJECT ModuleObject, + IN PUNICODE_STRING ServiceName, IN BOOLEAN FileSystemDriver, OUT PDRIVER_OBJECT *DriverObject); diff --git a/reactos/ntoskrnl/io/driver.c b/reactos/ntoskrnl/io/driver.c index e2452677368..0f58a3e846b 100644 --- a/reactos/ntoskrnl/io/driver.c +++ b/reactos/ntoskrnl/io/driver.c @@ -511,6 +511,9 @@ IopLoadServiceModule( * Module object representing the driver. It can be retrieve by * IopLoadServiceModule. * + * ServiceName + * Name of the service (as in registry). + * * FileSystemDriver * Set to TRUE for file system drivers. * @@ -523,6 +526,7 @@ NTSTATUS FASTCALL IopInitializeDriverModule( IN PDEVICE_NODE DeviceNode, IN PMODULE_OBJECT ModuleObject, + IN PUNICODE_STRING ServiceName, IN BOOLEAN FileSystemDriver, OUT PDRIVER_OBJECT *DriverObject) { @@ -533,7 +537,7 @@ IopInitializeDriverModule( Status = IopCreateDriverObject( DriverObject, - &DeviceNode->ServiceName, + ServiceName, FileSystemDriver, ModuleObject->Base, ModuleObject->Length); @@ -544,14 +548,14 @@ IopInitializeDriverModule( return Status; } - if (DeviceNode->ServiceName.Buffer) + if (ServiceName->Buffer) { - RegistryKey.Length = DeviceNode->ServiceName.Length + + RegistryKey.Length = ServiceName->Length + sizeof(ServicesKeyName) - sizeof(UNICODE_NULL); RegistryKey.MaximumLength = RegistryKey.Length + sizeof(UNICODE_NULL); RegistryKey.Buffer = ExAllocatePool(PagedPool, RegistryKey.MaximumLength); wcscpy(RegistryKey.Buffer, ServicesKeyName); - wcscat(RegistryKey.Buffer, DeviceNode->ServiceName.Buffer); + wcscat(RegistryKey.Buffer, ServiceName->Buffer); } else { @@ -613,7 +617,8 @@ IopAttachFilterDriversCallback( if (!NT_SUCCESS(Status)) continue; - Status = IopInitializeDriverModule(DeviceNode, ModuleObject, FALSE, &DriverObject); + Status = IopInitializeDriverModule(DeviceNode, ModuleObject, &ServiceName, + FALSE, &DriverObject); if (!NT_SUCCESS(Status)) continue; @@ -1165,8 +1170,8 @@ IopInitializeBuiltinDriver( * Initialize the driver */ - Status = IopInitializeDriverModule(DeviceNode, ModuleObject, FALSE, - &DriverObject); + Status = IopInitializeDriverModule(DeviceNode, ModuleObject, + &DeviceNode->ServiceName, FALSE, &DriverObject); if (!NT_SUCCESS(Status)) { @@ -1873,6 +1878,7 @@ NtLoadDriver(IN PUNICODE_STRING DriverServiceName) Status = IopInitializeDriverModule( DeviceNode, ModuleObject, + &DeviceNode->ServiceName, (Type == 2 /* SERVICE_FILE_SYSTEM_DRIVER */ || Type == 8 /* SERVICE_RECOGNIZER_DRIVER */), &DriverObject); diff --git a/reactos/ntoskrnl/io/iomgr.c b/reactos/ntoskrnl/io/iomgr.c index 0cc528d837d..3c3553aa5f0 100644 --- a/reactos/ntoskrnl/io/iomgr.c +++ b/reactos/ntoskrnl/io/iomgr.c @@ -595,6 +595,7 @@ IoInit2(BOOLEAN BootLog) Status = IopInitializeDriverModule( DeviceNode, &ModuleObject, + &DeviceNode->ServiceName, TRUE, &DriverObject); if (!NT_SUCCESS(Status)) diff --git a/reactos/ntoskrnl/io/pnpmgr.c b/reactos/ntoskrnl/io/pnpmgr.c index d706ba06031..a19f0e7b17c 100644 --- a/reactos/ntoskrnl/io/pnpmgr.c +++ b/reactos/ntoskrnl/io/pnpmgr.c @@ -1501,7 +1501,8 @@ IopActionInitChildServices( Status = IopLoadServiceModule(&DeviceNode->ServiceName, &ModuleObject); if (NT_SUCCESS(Status)) { - Status = IopInitializeDriverModule(DeviceNode, ModuleObject, FALSE, &DriverObject); + Status = IopInitializeDriverModule(DeviceNode, ModuleObject, + &DeviceNode->ServiceName, FALSE, &DriverObject); if (NT_SUCCESS(Status)) { /* Attach lower level filter drivers. */