https://git.reactos.org/?p=reactos.git;a=commitdiff;h=d8c38c4b4c2066d770af75471889f735e6bb4ad3

commit d8c38c4b4c2066d770af75471889f735e6bb4ad3
Author:     Eric Kohl <[email protected]>
AuthorDate: Mon Apr 5 14:33:09 2021 +0200
Commit:     Eric Kohl <[email protected]>
CommitDate: Mon Apr 5 14:33:48 2021 +0200

    [NTOS:PNP] PiSetDevNodeText: Do not overwrite existing DeviceDesc values
    
    CORE-17513
---
 ntoskrnl/io/pnpmgr/devaction.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/ntoskrnl/io/pnpmgr/devaction.c b/ntoskrnl/io/pnpmgr/devaction.c
index 1cf30fa8575..638dccb8dcd 100644
--- a/ntoskrnl/io/pnpmgr/devaction.c
+++ b/ntoskrnl/io/pnpmgr/devaction.c
@@ -1101,13 +1101,13 @@ PiSetDevNodeText(
         return;
     }
 
-    // Step 1: write DeviceDesc key if not exists
+    // Step 1: Write the DeviceDesc value if does not exist
 
     UNICODE_STRING valDeviceDesc = RTL_CONSTANT_STRING(L"DeviceDesc");
     ULONG len;
 
     status = ZwQueryValueKey(InstanceKey, &valDeviceDesc, 
KeyValueBasicInformation, NULL, 0, &len);
-    if (!NT_SUCCESS(status))
+    if (status == STATUS_OBJECT_NAME_NOT_FOUND)
     {
         PWSTR deviceDesc = NULL;
         status = PiIrpQueryDeviceText(DeviceNode, localeId, 
DeviceTextDescription, &deviceDesc);

Reply via email to