Juan Lang : setupapi: Make error checking in SetupDiCreateDevRegKeyW more like that in SetupDiOpenDevRegKey .
Alexandre Julliard
julliard at winehq.org
Mon Oct 15 11:27:49 CDT 2007
Module: wine
Branch: master
Commit: 36229a74d1c1fcab58c56ff9bf23326707d5832c
URL: http://source.winehq.org/git/wine.git/?a=commit;h=36229a74d1c1fcab58c56ff9bf23326707d5832c
Author: Juan Lang <juan.lang at gmail.com>
Date: Fri Oct 12 08:25:51 2007 -0700
setupapi: Make error checking in SetupDiCreateDevRegKeyW more like that in SetupDiOpenDevRegKey.
---
dlls/setupapi/devinst.c | 10 ++++++++++
1 files changed, 10 insertions(+), 0 deletions(-)
diff --git a/dlls/setupapi/devinst.c b/dlls/setupapi/devinst.c
index 9ac5008..0a6bed8 100644
--- a/dlls/setupapi/devinst.c
+++ b/dlls/setupapi/devinst.c
@@ -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);
More information about the wine-cvs
mailing list