mirror of
https://github.com/reactos/reactos.git
synced 2024-12-28 10:04:49 +00:00
Hervé Poussineau <poussine@freesurf.fr>
Fill DriverName field in DRIVER_OBJECT structure. svn path=/trunk/; revision=12953
This commit is contained in:
parent
8d07772195
commit
1f84743388
2 changed files with 16 additions and 2 deletions
|
@ -86,8 +86,10 @@ IopCreateFile(PVOID ObjectBody,
|
||||||
if (ParentObjectType != IoDeviceObjectType &&
|
if (ParentObjectType != IoDeviceObjectType &&
|
||||||
ParentObjectType != IoFileObjectType)
|
ParentObjectType != IoFileObjectType)
|
||||||
{
|
{
|
||||||
CPRINT("Parent is a %S which is neither a file type nor a device type\n",
|
DPRINT("Parent [%wZ] is a %S which is neither a file type nor a device type ; remaining path = %S\n",
|
||||||
BODY_TO_HEADER(Parent)->ObjectType->TypeName.Buffer);
|
&BODY_TO_HEADER(Parent)->Name,
|
||||||
|
BODY_TO_HEADER(Parent)->ObjectType->TypeName.Buffer,
|
||||||
|
RemainingPath);
|
||||||
return(STATUS_UNSUCCESSFUL);
|
return(STATUS_UNSUCCESSFUL);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -181,6 +181,7 @@ IopDeleteDriver(PVOID ObjectBody)
|
||||||
DPRINT("IopDeleteDriver(ObjectBody %x)\n", ObjectBody);
|
DPRINT("IopDeleteDriver(ObjectBody %x)\n", ObjectBody);
|
||||||
|
|
||||||
ExFreePool(Object->DriverExtension);
|
ExFreePool(Object->DriverExtension);
|
||||||
|
RtlFreeUnicodeString(&Object->DriverName);
|
||||||
|
|
||||||
OldIrql = KeRaiseIrqlToDpcLevel();
|
OldIrql = KeRaiseIrqlToDpcLevel();
|
||||||
|
|
||||||
|
@ -208,6 +209,7 @@ IopCreateDriverObject(
|
||||||
UNICODE_STRING DriverName;
|
UNICODE_STRING DriverName;
|
||||||
OBJECT_ATTRIBUTES ObjectAttributes;
|
OBJECT_ATTRIBUTES ObjectAttributes;
|
||||||
NTSTATUS Status;
|
NTSTATUS Status;
|
||||||
|
PWSTR Buffer = NULL;
|
||||||
|
|
||||||
DPRINT("IopCreateDriverObject(%p '%wZ' %x %p %x)\n",
|
DPRINT("IopCreateDriverObject(%p '%wZ' %x %p %x)\n",
|
||||||
DriverObject, ServiceName, FileSystem, DriverImageStart, DriverImageSize);
|
DriverObject, ServiceName, FileSystem, DriverImageStart, DriverImageSize);
|
||||||
|
@ -225,6 +227,10 @@ IopCreateDriverObject(
|
||||||
|
|
||||||
RtlInitUnicodeString(&DriverName, NameBuffer);
|
RtlInitUnicodeString(&DriverName, NameBuffer);
|
||||||
DPRINT("Driver name: '%wZ'\n", &DriverName);
|
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
|
else
|
||||||
{
|
{
|
||||||
|
@ -258,6 +264,12 @@ IopCreateDriverObject(
|
||||||
|
|
||||||
Object->DriverStart = DriverImageStart;
|
Object->DriverStart = DriverImageStart;
|
||||||
Object->DriverSize = DriverImageSize;
|
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;
|
*DriverObject = Object;
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue