mirror of
https://github.com/reactos/reactos.git
synced 2024-12-28 01:55:19 +00:00
[I8042PRT][RAMDISK] Fix usage of the RegistryPath in DriverEntry
We can't rely on it being zero-terminated, so ensure that it's duplicated first before usage in RtlQueryRegistryValues
This commit is contained in:
parent
e12233daf6
commit
06bff99edb
2 changed files with 10 additions and 8 deletions
|
@ -511,7 +511,7 @@ DriverEntry(
|
||||||
return Status;
|
return Status;
|
||||||
}
|
}
|
||||||
|
|
||||||
Status = ReadRegistryEntries(RegistryPath, &DriverExtension->Port.Settings);
|
Status = ReadRegistryEntries(&DriverExtension->RegistryPath, &DriverExtension->Port.Settings);
|
||||||
if (!NT_SUCCESS(Status))
|
if (!NT_SUCCESS(Status))
|
||||||
{
|
{
|
||||||
WARN_(I8042PRT, "ReadRegistryEntries() failed with status 0x%08lx\n", Status);
|
WARN_(I8042PRT, "ReadRegistryEntries() failed with status 0x%08lx\n", Status);
|
||||||
|
|
|
@ -2419,18 +2419,20 @@ DriverEntry(IN PDRIVER_OBJECT DriverObject,
|
||||||
NTSTATUS Status;
|
NTSTATUS Status;
|
||||||
DPRINT("RAM Disk Driver Initialized\n");
|
DPRINT("RAM Disk Driver Initialized\n");
|
||||||
|
|
||||||
/* Query ramdisk parameters */
|
|
||||||
QueryParameters(RegistryPath);
|
|
||||||
|
|
||||||
/* Save the registry path */
|
/* Save the registry path */
|
||||||
DriverRegistryPath = *RegistryPath;
|
DriverRegistryPath.MaximumLength = RegistryPath->Length + sizeof(UNICODE_NULL);
|
||||||
DriverRegistryPath.Buffer = ExAllocatePoolWithTag(PagedPool,
|
DriverRegistryPath.Buffer = ExAllocatePoolWithTag(PagedPool,
|
||||||
RegistryPath->Length +
|
DriverRegistryPath.MaximumLength,
|
||||||
sizeof(UNICODE_NULL),
|
|
||||||
'dmaR');
|
'dmaR');
|
||||||
if (!DriverRegistryPath.Buffer) return STATUS_INSUFFICIENT_RESOURCES;
|
if (!DriverRegistryPath.Buffer)
|
||||||
|
{
|
||||||
|
return STATUS_INSUFFICIENT_RESOURCES;
|
||||||
|
}
|
||||||
RtlCopyUnicodeString(&DriverRegistryPath, RegistryPath);
|
RtlCopyUnicodeString(&DriverRegistryPath, RegistryPath);
|
||||||
|
|
||||||
|
/* Query ramdisk parameters */
|
||||||
|
QueryParameters(&DriverRegistryPath);
|
||||||
|
|
||||||
/* Set device routines */
|
/* Set device routines */
|
||||||
DriverObject->MajorFunction[IRP_MJ_CREATE] = RamdiskOpenClose;
|
DriverObject->MajorFunction[IRP_MJ_CREATE] = RamdiskOpenClose;
|
||||||
DriverObject->MajorFunction[IRP_MJ_CLOSE] = RamdiskOpenClose;
|
DriverObject->MajorFunction[IRP_MJ_CLOSE] = RamdiskOpenClose;
|
||||||
|
|
Loading…
Reference in a new issue