From a971f54816e5c9fbe818019974fab3bf45d8bd53 Mon Sep 17 00:00:00 2001 From: Francois Gouget Date: Thu, 20 Nov 2003 04:20:50 +0000 Subject: [PATCH] Don't use the data returned by RegQueryValueExW if it fails (found by Valgrind). A spelling fix. --- dlls/shlwapi/reg.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/dlls/shlwapi/reg.c b/dlls/shlwapi/reg.c index 97f62dc2f4e..623620dd9f0 100644 --- a/dlls/shlwapi/reg.c +++ b/dlls/shlwapi/reg.c @@ -1240,6 +1240,8 @@ DWORD WINAPI SHQueryValueExW(HKEY hKey, LPCWSTR lpszValue, if (pcbData) dwUnExpDataLen = *pcbData; dwRet = RegQueryValueExW(hKey, lpszValue, lpReserved, &dwType, pvData, &dwUnExpDataLen); + if (dwRet!=ERROR_SUCCESS && dwRet!=ERROR_MORE_DATA) + return dwRet; if (pcbData && (dwType == REG_EXPAND_SZ)) { @@ -1248,7 +1250,7 @@ DWORD WINAPI SHQueryValueExW(HKEY hKey, LPCWSTR lpszValue, /* Expand type REG_EXPAND_SZ into REG_SZ */ LPWSTR szData; - /* If the caller didn't supply a buffer or the buffer is to small we have + /* If the caller didn't supply a buffer or the buffer is too small we have * to allocate our own */ if ((!pvData) || (dwRet == ERROR_MORE_DATA) )