From 404b530e5b13ac2752204a2a37402a0d7c533ea8 Mon Sep 17 00:00:00 2001 From: Johannes Anderwald Date: Fri, 2 Jun 2006 19:02:21 +0000 Subject: [PATCH] return ERROR_INVALID_HANDLE when hKey is invalid ReactOS passes now 88 of 89 advapi32_winetest registry tests svn path=/trunk/; revision=22185 --- reactos/dll/win32/advapi32/reg/reg.c | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/reactos/dll/win32/advapi32/reg/reg.c b/reactos/dll/win32/advapi32/reg/reg.c index 741660ce289..8faea3a3990 100644 --- a/reactos/dll/win32/advapi32/reg/reg.c +++ b/reactos/dll/win32/advapi32/reg/reg.c @@ -2772,6 +2772,11 @@ RegOpenKeyA (HKEY hKey, PHKEY phkResult) { TRACE("RegOpenKeyA hKey 0x%x lpSubKey %s phkResult %p\n", hKey, lpSubKey, phkResult); + + if (!hKey && lpSubKey && phkResult) + { + return ERROR_INVALID_HANDLE; + } if (!lpSubKey || !*lpSubKey) { @@ -2799,6 +2804,11 @@ RegOpenKeyW (HKEY hKey, { TRACE("RegOpenKeyW hKey 0x%x lpSubKey %S phkResult %p\n", hKey, lpSubKey, phkResult); + if (!hKey && lpSubKey && phkResult) + { + return ERROR_INVALID_HANDLE; + } + if (!lpSubKey || !*lpSubKey) { *phkResult = hKey;