mirror of
https://github.com/reactos/reactos.git
synced 2024-12-27 09:34:43 +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;
|
||||
}
|
||||
|
||||
Status = ReadRegistryEntries(RegistryPath, &DriverExtension->Port.Settings);
|
||||
Status = ReadRegistryEntries(&DriverExtension->RegistryPath, &DriverExtension->Port.Settings);
|
||||
if (!NT_SUCCESS(Status))
|
||||
{
|
||||
WARN_(I8042PRT, "ReadRegistryEntries() failed with status 0x%08lx\n", Status);
|
||||
|
|
|
@ -2419,18 +2419,20 @@ DriverEntry(IN PDRIVER_OBJECT DriverObject,
|
|||
NTSTATUS Status;
|
||||
DPRINT("RAM Disk Driver Initialized\n");
|
||||
|
||||
/* Query ramdisk parameters */
|
||||
QueryParameters(RegistryPath);
|
||||
|
||||
/* Save the registry path */
|
||||
DriverRegistryPath = *RegistryPath;
|
||||
DriverRegistryPath.MaximumLength = RegistryPath->Length + sizeof(UNICODE_NULL);
|
||||
DriverRegistryPath.Buffer = ExAllocatePoolWithTag(PagedPool,
|
||||
RegistryPath->Length +
|
||||
sizeof(UNICODE_NULL),
|
||||
DriverRegistryPath.MaximumLength,
|
||||
'dmaR');
|
||||
if (!DriverRegistryPath.Buffer) return STATUS_INSUFFICIENT_RESOURCES;
|
||||
if (!DriverRegistryPath.Buffer)
|
||||
{
|
||||
return STATUS_INSUFFICIENT_RESOURCES;
|
||||
}
|
||||
RtlCopyUnicodeString(&DriverRegistryPath, RegistryPath);
|
||||
|
||||
/* Query ramdisk parameters */
|
||||
QueryParameters(&DriverRegistryPath);
|
||||
|
||||
/* Set device routines */
|
||||
DriverObject->MajorFunction[IRP_MJ_CREATE] = RamdiskOpenClose;
|
||||
DriverObject->MajorFunction[IRP_MJ_CLOSE] = RamdiskOpenClose;
|
||||
|
|
Loading…
Reference in a new issue