setupapi: Make error checking in SetupDiCreateDevRegKeyW more like that in SetupDiOpenDevRegKey.

This commit is contained in:
Juan Lang 2007-10-12 08:25:51 -07:00 committed by Alexandre Julliard
parent 629123bae4
commit 36229a74d1
1 changed files with 10 additions and 0 deletions

View File

@ -1264,6 +1264,16 @@ HKEY WINAPI SetupDiCreateDevRegKeyW(
SetLastError(ERROR_INVALID_PARAMETER);
return INVALID_HANDLE_VALUE;
}
if (Scope != DICS_FLAG_GLOBAL && Scope != DICS_FLAG_CONFIGSPECIFIC)
{
SetLastError(ERROR_INVALID_FLAGS);
return INVALID_HANDLE_VALUE;
}
if (KeyType != DIREG_DEV && KeyType != DIREG_DRV)
{
SetLastError(ERROR_INVALID_FLAGS);
return INVALID_HANDLE_VALUE;
}
if (devInfo->phantom)
{
SetLastError(ERROR_DEVINFO_NOT_REGISTERED);