diff --git a/drivers/input/i8042prt/i8042prt.c b/drivers/input/i8042prt/i8042prt.c index 879c231d80f..67106a6e70c 100644 --- a/drivers/input/i8042prt/i8042prt.c +++ b/drivers/input/i8042prt/i8042prt.c @@ -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); diff --git a/drivers/storage/class/ramdisk/ramdisk.c b/drivers/storage/class/ramdisk/ramdisk.c index 987d0ffc6fd..8a05a7065af 100644 --- a/drivers/storage/class/ramdisk/ramdisk.c +++ b/drivers/storage/class/ramdisk/ramdisk.c @@ -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;