From da1f4ed6af0e12669c05b1335b4e23af46946565 Mon Sep 17 00:00:00 2001 From: Victor Perevertkin Date: Tue, 8 Dec 2020 01:32:15 +0300 Subject: [PATCH] [SCSIPORT] Fix setting the "Driver" field in the DeviceMap\Scsi registry key --- drivers/storage/port/scsiport/registry.c | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/drivers/storage/port/scsiport/registry.c b/drivers/storage/port/scsiport/registry.c index 3b9e235d752..24b197a81ef 100644 --- a/drivers/storage/port/scsiport/registry.c +++ b/drivers/storage/port/scsiport/registry.c @@ -212,13 +212,16 @@ RegistryInitAdapterKey( } /* Set 'Driver' (REG_SZ) value */ - PUNICODE_STRING driverNameU = &DeviceExtension->Common.DeviceObject->DriverObject->DriverName; + PUNICODE_STRING driverNameU = &DeviceExtension->Common.DeviceObject->DriverObject + ->DriverExtension->ServiceKeyName; + PWCHAR driverName = ExAllocatePoolWithTag(PagedPool, driverNameU->Length + sizeof(UNICODE_NULL), TAG_SCSIPORT); if (!driverName) { DPRINT("Failed to allocate driverName!\n"); + ZwClose(ScsiPortKey); return STATUS_INSUFFICIENT_RESOURCES; }