[UMPNPMGR] Fix hang when installing devices. Addendum to 0296fce00.

This commit is contained in:
Stanislav Motylkov 2022-04-20 02:38:41 +03:00
parent 0296fce00e
commit 27453fb759
No known key found for this signature in database
GPG key ID: AFE513258CBA9E92

View file

@ -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;