Hervé Poussineau <poussine@freesurf.fr>

Fill DriverName field in DRIVER_OBJECT structure.

svn path=/trunk/; revision=12953
This commit is contained in:
Filip Navara 2005-01-12 10:24:56 +00:00
parent 8d07772195
commit 1f84743388
2 changed files with 16 additions and 2 deletions

View file

@ -86,8 +86,10 @@ IopCreateFile(PVOID ObjectBody,
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);
}

View file

@ -181,6 +181,7 @@ IopDeleteDriver(PVOID ObjectBody)
DPRINT("IopDeleteDriver(ObjectBody %x)\n", ObjectBody);
ExFreePool(Object->DriverExtension);
RtlFreeUnicodeString(&Object->DriverName);
OldIrql = KeRaiseIrqlToDpcLevel();
@ -208,6 +209,7 @@ IopCreateDriverObject(
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 @@ IopCreateDriverObject(
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 @@ IopCreateDriverObject(
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;