diff --git a/reactos/dll/win32/advapi32/reg/reg.c b/reactos/dll/win32/advapi32/reg/reg.c index 919e78b7013..49230b9cd1a 100644 --- a/reactos/dll/win32/advapi32/reg/reg.c +++ b/reactos/dll/win32/advapi32/reg/reg.c @@ -3272,6 +3272,9 @@ RegOpenKeyA(HKEY hKey, TRACE("RegOpenKeyA hKey 0x%x lpSubKey %s phkResult %p\n", hKey, lpSubKey, phkResult); + if (!phkResult) + return ERROR_INVALID_PARAMETER; + if (!hKey && lpSubKey && phkResult) { return ERROR_INVALID_HANDLE; @@ -3308,6 +3311,9 @@ RegOpenKeyW(HKEY hKey, TRACE("RegOpenKeyW hKey 0x%x lpSubKey %S phkResult %p\n", hKey, lpSubKey, phkResult); + if (!phkResult) + return ERROR_INVALID_PARAMETER; + if (!hKey && lpSubKey && phkResult) { return ERROR_INVALID_HANDLE;