mirror of
https://github.com/reactos/reactos.git
synced 2026-05-23 07:40:09 +08:00
[UMPNPMGR] GenerateDeviceID must fail, if pszDeviceID contains backslashes
This commit is contained in:
@@ -3004,11 +3004,20 @@ 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;
|
||||
}
|
||||
|
||||
/* Generated ID is: Root\<Device ID>\<Instance number> */
|
||||
dwInstanceNumber = 0;
|
||||
while (dwError == ERROR_SUCCESS)
|
||||
|
||||
Reference in New Issue
Block a user