From 33a0c66f30d823b1adf21bb95c526e489847b38f Mon Sep 17 00:00:00 2001 From: Eric Kohl Date: Sat, 23 Apr 2022 15:35:45 +0200 Subject: [PATCH] [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); }