[ros-diffs] [navaraf] 12953: Herv, Poussineau <poussine@freesurf.fr>

navaraf at svn.reactos.com navaraf at svn.reactos.com
Wed Jan 12 11:24:57 CET 2005


Herv, Poussineau <poussine at freesurf.fr>
Fill DriverName field in DRIVER_OBJECT structure.
Modified: trunk/reactos/ntoskrnl/io/create.c
Modified: trunk/reactos/ntoskrnl/io/driver.c
  _____  

Modified: trunk/reactos/ntoskrnl/io/create.c
--- trunk/reactos/ntoskrnl/io/create.c	2005-01-12 10:23:25 UTC (rev
12952)
+++ trunk/reactos/ntoskrnl/io/create.c	2005-01-12 10:24:56 UTC (rev
12953)
@@ -86,8 +86,10 @@

   if (ParentObjectType != IoDeviceObjectType &&
       ParentObjectType != IoFileObjectType)
     {
-      CPRINT("Parent is a %S which is neither a file type nor a device
type\n",
-	     BODY_TO_HEADER(Parent)->ObjectType->TypeName.Buffer);
+      DPRINT("Parent [%wZ] is a %S which is neither a file type nor a
device type ; remaining path = %S\n",
+        &BODY_TO_HEADER(Parent)->Name,
+        BODY_TO_HEADER(Parent)->ObjectType->TypeName.Buffer,
+        RemainingPath);
       return(STATUS_UNSUCCESSFUL);
     }
 
  _____  

Modified: trunk/reactos/ntoskrnl/io/driver.c
--- trunk/reactos/ntoskrnl/io/driver.c	2005-01-12 10:23:25 UTC (rev
12952)
+++ trunk/reactos/ntoskrnl/io/driver.c	2005-01-12 10:24:56 UTC (rev
12953)
@@ -181,6 +181,7 @@

    DPRINT("IopDeleteDriver(ObjectBody %x)\n", ObjectBody);
 
    ExFreePool(Object->DriverExtension);
+   RtlFreeUnicodeString(&Object->DriverName);
 
    OldIrql = KeRaiseIrqlToDpcLevel();
 
@@ -208,6 +209,7 @@
    UNICODE_STRING DriverName;
    OBJECT_ATTRIBUTES ObjectAttributes;
    NTSTATUS Status;
+   PWSTR Buffer = NULL;
 
    DPRINT("IopCreateDriverObject(%p '%wZ' %x %p %x)\n",
       DriverObject, ServiceName, FileSystem, DriverImageStart,
DriverImageSize);
@@ -225,6 +227,10 @@
 
       RtlInitUnicodeString(&DriverName, NameBuffer);
       DPRINT("Driver name: '%wZ'\n", &DriverName);
+      
+      Buffer = (PWSTR)ExAllocatePool(NonPagedPool, DriverName.Length);
+      /* If we don't success, it is not a problem. Our driver
+       * object will not have associated driver name... */
    }
    else
    {
@@ -258,6 +264,12 @@
 
    Object->DriverStart = DriverImageStart;
    Object->DriverSize = DriverImageSize;
+   if (Buffer)
+   {
+      Object->DriverName.Buffer = Buffer;
+      Object->DriverName.Length = Object->DriverName.MaximumLength =
DriverName.Length;
+      RtlCopyMemory(Object->DriverName.Buffer, DriverName.Buffer,
DriverName.Length);
+   }
 
    *DriverObject = Object;
 
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://www.reactos.org/pipermail/ros-diffs/attachments/20050112/9ea0bce9/attachment.html


More information about the Ros-diffs mailing list