Fix 2 advapi32:reg winetests
authorSylvain Petreolle <spetreolle@yahoo.fr>
Tue, 19 May 2009 14:24:08 +0000 (14:24 +0000)
committerSylvain Petreolle <spetreolle@yahoo.fr>
Tue, 19 May 2009 14:24:08 +0000 (14:24 +0000)
registry.c:1229: Test failed: Expected ERROR_INVALID_HANDLE or ERROR_BADKEY, got 161
registry.c:956: Test failed: expected ERROR_INVALID_PARAMETER, got 998
by  Victor Martinez(vicmarcal@hotmail.com)
bug 4527

svn path=/trunk/; revision=40979

reactos/dll/win32/advapi32/reg/reg.c

index 61ecd6b..82489ec 100644 (file)
@@ -3338,6 +3338,10 @@ RegOpenKeyExA(HKEY hKey,
 
     TRACE("RegOpenKeyExA hKey 0x%x lpSubKey %s ulOptions 0x%x samDesired 0x%x phkResult %p\n",
           hKey, lpSubKey, ulOptions, samDesired, phkResult);
+       if (!phkResult)
+    {
+        return ERROR_INVALID_PARAMETER;
+    }
 
     Status = MapDefaultKey(&KeyHandle,
                            hKey);
@@ -3389,6 +3393,10 @@ RegOpenKeyExW(HKEY hKey,
 
     TRACE("RegOpenKeyExW hKey 0x%x lpSubKey %S ulOptions 0x%x samDesired 0x%x phkResult %p\n",
           hKey, lpSubKey, ulOptions, samDesired, phkResult);
+       if (!phkResult)
+    {
+        return ERROR_INVALID_PARAMETER;
+    }
 
     Status = MapDefaultKey(&KeyHandle, hKey);
     if (!NT_SUCCESS(Status))
@@ -4265,7 +4273,10 @@ RegQueryValueW(HKEY hKey,
 
     TRACE("hKey 0x%X lpSubKey %S lpValue %p lpcbValue %d\n",
           hKey, lpSubKey, lpValue, lpcbValue ? *lpcbValue : 0);
-
+   if (hKey == NULL)
+       {
+               return ERROR_INVALID_HANDLE;
+       }
     Status = MapDefaultKey(&KeyHandle,
                            hKey);
     if (!NT_SUCCESS(Status))