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

commit 27453fb7594ea0c545217242a16092eed6099071
Author:     Stanislav Motylkov <[email protected]>
AuthorDate: Wed Apr 20 02:38:41 2022 +0300
Commit:     Stanislav Motylkov <[email protected]>
CommitDate: Wed Apr 20 02:38:41 2022 +0300

    [UMPNPMGR] Fix hang when installing devices. Addendum to 0296fce00.
---
 base/services/umpnpmgr/rpcserver.c | 9 ++-------
 1 file changed, 2 insertions(+), 7 deletions(-)

diff --git a/base/services/umpnpmgr/rpcserver.c 
b/base/services/umpnpmgr/rpcserver.c
index 1d933e6942b..74a289205d0 100644
--- a/base/services/umpnpmgr/rpcserver.c
+++ b/base/services/umpnpmgr/rpcserver.c
@@ -3004,19 +3004,14 @@ GenerateDeviceID(
     _In_ PNP_RPC_STRING_LEN ulLength)
 {
     WCHAR szGeneratedInstance[MAX_DEVICE_ID_LEN];
-    PWCHAR ptr;
     HKEY hKey;
     DWORD dwInstanceNumber;
     DWORD dwError = ERROR_SUCCESS;
     CONFIGRET ret = CR_SUCCESS;
 
     /* Fail, if the device name contains backslashes */
-    ptr = pszDeviceID;
-    while (*ptr != UNICODE_NULL)
-    {
-        if (*ptr == L'\\')
-            return CR_INVALID_DEVICE_ID;
-    }
+    if (wcschr(pszDeviceID, L'\\') != NULL)
+        return CR_INVALID_DEVICE_ID;
 
     /* Generated ID is: Root\<Device ID>\<Instance number> */
     dwInstanceNumber = 0;

Reply via email to