diff --git a/reactos/dll/win32/advapi32/reg/reg.c b/reactos/dll/win32/advapi32/reg/reg.c index 264e36e8924..a669123f196 100644 --- a/reactos/dll/win32/advapi32/reg/reg.c +++ b/reactos/dll/win32/advapi32/reg/reg.c @@ -3861,7 +3861,7 @@ RegQueryValueExW (HKEY hKey, } } - if (lpType != NULL) + if ((lpType != NULL) && (NT_SUCCESS(Status) || (Status == STATUS_BUFFER_OVERFLOW))) { *lpType = ValueInfo->Type; }