[SCSIPORT] Fix setting the "Driver" field in the DeviceMap\Scsi registry key

This commit is contained in:
Victor Perevertkin 2020-12-08 01:32:15 +03:00
parent d9e20ae3fe
commit da1f4ed6af
No known key found for this signature in database
GPG key ID: C750B7222E9C7830

View file

@ -212,13 +212,16 @@ RegistryInitAdapterKey(
} }
/* Set 'Driver' (REG_SZ) value */ /* 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, PWCHAR driverName = ExAllocatePoolWithTag(PagedPool,
driverNameU->Length + sizeof(UNICODE_NULL), driverNameU->Length + sizeof(UNICODE_NULL),
TAG_SCSIPORT); TAG_SCSIPORT);
if (!driverName) if (!driverName)
{ {
DPRINT("Failed to allocate driverName!\n"); DPRINT("Failed to allocate driverName!\n");
ZwClose(ScsiPortKey);
return STATUS_INSUFFICIENT_RESOURCES; return STATUS_INSUFFICIENT_RESOURCES;
} }