mirror of
https://github.com/reactos/reactos.git
synced 2026-06-05 19:43:39 +08:00
[NTOS:IO] Remove final NULL char of PDO name before writing to registry
Otherwise, if a PDO has no name (bad!), you'll see two "(Default)" entries in HKLM\HARDWARE\RESOURCEMAP\PnP Manager\PnpManager
This commit is contained in:
@@ -915,7 +915,7 @@ IopUpdateResourceMap(
|
||||
ASSERT(FALSE);
|
||||
}
|
||||
|
||||
NameU.Length = (USHORT)OldLength;
|
||||
NameU.Length = (USHORT)OldLength - sizeof(UNICODE_NULL); /* Remove final NULL */
|
||||
|
||||
RtlAppendUnicodeStringToString(&NameU, &RawSuffix);
|
||||
|
||||
@@ -933,7 +933,7 @@ IopUpdateResourceMap(
|
||||
}
|
||||
|
||||
/* "Remove" the suffix by setting the length back to what it used to be */
|
||||
NameU.Length = (USHORT)OldLength;
|
||||
NameU.Length = (USHORT)OldLength - sizeof(UNICODE_NULL); /* Remove final NULL */
|
||||
|
||||
RtlAppendUnicodeStringToString(&NameU, &TranslatedSuffix);
|
||||
|
||||
|
||||
Reference in New Issue
Block a user