diff --git a/reactos/ntoskrnl/io/device.c b/reactos/ntoskrnl/io/device.c index aba2f1f4986..edc94650094 100644 --- a/reactos/ntoskrnl/io/device.c +++ b/reactos/ntoskrnl/io/device.c @@ -1,4 +1,4 @@ -/* $Id: device.c,v 1.43 2002/06/10 23:03:33 ekohl Exp $ +/* $Id: device.c,v 1.44 2002/06/12 14:05:03 chorns Exp $ * * COPYRIGHT: See COPYING in the top level directory * PROJECT: ReactOS kernel @@ -529,7 +529,7 @@ IopInitializeDriver(PDRIVER_INITIALIZE DriverEntry, { DeviceNode->DriverObject = NULL; ExFreePool(DriverObject->DriverExtension); - ExFreePool(DriverObject); + ObDereferenceObject(DriverObject); return(Status); } diff --git a/reactos/ntoskrnl/io/driver.c b/reactos/ntoskrnl/io/driver.c index fce20353bb5..33610d2150f 100644 --- a/reactos/ntoskrnl/io/driver.c +++ b/reactos/ntoskrnl/io/driver.c @@ -1,4 +1,4 @@ -/* $Id: driver.c,v 1.2 2002/06/10 23:03:33 ekohl Exp $ +/* $Id: driver.c,v 1.3 2002/06/12 14:05:03 chorns Exp $ * * COPYRIGHT: See COPYING in the top level directory * PROJECT: ReactOS kernel @@ -142,8 +142,7 @@ NtLoadDriver(IN PUNICODE_STRING DriverServiceName) Length = wcslen(Start); wcsncpy(Buffer, Start, Length); - RtlInitUnicodeString(&DeviceNode->ServiceName, Buffer); - + RtlCreateUnicodeString(&DeviceNode->ServiceName, Buffer); Status = IopInitializeDriver(ModuleObject->EntryPoint, DeviceNode); if (!NT_SUCCESS(Status)) diff --git a/reactos/ntoskrnl/ldr/loader.c b/reactos/ntoskrnl/ldr/loader.c index d251fc20879..9d1ddf08c6f 100644 --- a/reactos/ntoskrnl/ldr/loader.c +++ b/reactos/ntoskrnl/ldr/loader.c @@ -1,4 +1,4 @@ -/* $Id: loader.c,v 1.108 2002/06/11 18:37:23 ekohl Exp $ +/* $Id: loader.c,v 1.109 2002/06/12 14:05:03 chorns Exp $ * * COPYRIGHT: See COPYING in the top level directory * PROJECT: ReactOS kernel @@ -1103,8 +1103,7 @@ LdrInitializeBootStartDriver(PVOID ModuleLoadBase, Length = wcslen(Start); wcsncpy(Buffer, Start, Length); - RtlInitUnicodeString(&DeviceNode->ServiceName, Buffer); - + RtlCreateUnicodeString(&DeviceNode->ServiceName, Buffer); Status = IopInitializeDriver(ModuleObject->EntryPoint, DeviceNode); if (!NT_SUCCESS(Status))