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))