From f71075ad74a398655a1294755be547c0f6c9d265 Mon Sep 17 00:00:00 2001 From: Sylvain Petreolle Date: Tue, 19 May 2009 14:24:08 +0000 Subject: [PATCH] Fix 2 advapi32:reg winetests 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 | 13 ++++++++++++- 1 file changed, 12 insertions(+), 1 deletion(-) diff --git a/reactos/dll/win32/advapi32/reg/reg.c b/reactos/dll/win32/advapi32/reg/reg.c index 61ecd6b870a..82489ec9591 100644 --- a/reactos/dll/win32/advapi32/reg/reg.c +++ b/reactos/dll/win32/advapi32/reg/reg.c @@ -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))