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

commit 33a0c66f30d823b1adf21bb95c526e489847b38f
Author:     Eric Kohl <[email protected]>
AuthorDate: Sat Apr 23 15:35:45 2022 +0200
Commit:     Eric Kohl <[email protected]>
CommitDate: Sat Apr 23 15:35:45 2022 +0200

    [UMPNPMGR] PNP_CreateDevInst: Do not create a normal device if it is 
already present
---
 base/services/umpnpmgr/rpcserver.c | 7 +++++++
 1 file changed, 7 insertions(+)

diff --git a/base/services/umpnpmgr/rpcserver.c 
b/base/services/umpnpmgr/rpcserver.c
index 74a289205d0..26b9ab88ab3 100644
--- a/base/services/umpnpmgr/rpcserver.c
+++ b/base/services/umpnpmgr/rpcserver.c
@@ -3097,6 +3097,13 @@ PNP_CreateDevInst(
     }
     else
     {
+        /* Fail, if the device exists and is present */
+        if ((hKey != NULL) && (IsPresentDeviceInstanceID(pszDeviceID)))
+        {
+            ret = CR_ALREADY_SUCH_DEVINST;
+            goto done;
+        }
+
         /* Create the device instance */
         ret = CreateDeviceInstance(pszDeviceID, FALSE);
     }

Reply via email to