https://git.reactos.org/?p=reactos.git;a=commitdiff;h=a86c3794a6d47bd5c9f4c…
commit a86c3794a6d47bd5c9f4c06eacd6eecfc49181b4
Author: Hervé Poussineau <hpoussin(a)reactos.org>
AuthorDate: Thu Oct 7 20:50:38 2021 +0200
Commit: Hervé Poussineau <hpoussin(a)reactos.org>
CommitDate: Thu Oct 14 23:39:30 2021 +0200
[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
---
ntoskrnl/io/pnpmgr/pnpres.c | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/ntoskrnl/io/pnpmgr/pnpres.c b/ntoskrnl/io/pnpmgr/pnpres.c
index 1cdf1d85b84..57eabfe69c2 100644
--- a/ntoskrnl/io/pnpmgr/pnpres.c
+++ b/ntoskrnl/io/pnpmgr/pnpres.c
@@ -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);