mirror of
https://github.com/reactos/reactos.git
synced 2024-12-31 19:42:51 +00:00
[UMPNPMGR] GenerateDeviceID must fail, if pszDeviceID contains backslashes
This commit is contained in:
parent
291a94cd6f
commit
0296fce00e
1 changed files with 9 additions and 0 deletions
|
@ -3004,11 +3004,20 @@ GenerateDeviceID(
|
||||||
_In_ PNP_RPC_STRING_LEN ulLength)
|
_In_ PNP_RPC_STRING_LEN ulLength)
|
||||||
{
|
{
|
||||||
WCHAR szGeneratedInstance[MAX_DEVICE_ID_LEN];
|
WCHAR szGeneratedInstance[MAX_DEVICE_ID_LEN];
|
||||||
|
PWCHAR ptr;
|
||||||
HKEY hKey;
|
HKEY hKey;
|
||||||
DWORD dwInstanceNumber;
|
DWORD dwInstanceNumber;
|
||||||
DWORD dwError = ERROR_SUCCESS;
|
DWORD dwError = ERROR_SUCCESS;
|
||||||
CONFIGRET ret = CR_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> */
|
/* Generated ID is: Root\<Device ID>\<Instance number> */
|
||||||
dwInstanceNumber = 0;
|
dwInstanceNumber = 0;
|
||||||
while (dwError == ERROR_SUCCESS)
|
while (dwError == ERROR_SUCCESS)
|
||||||
|
|
Loading…
Reference in a new issue