shell32: Pass correct buffer length to RegQueryValueExW().

Signed-off-by: Nikolay Sivov <nsivov@codeweavers.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
This commit is contained in:
Nikolay Sivov 2017-02-08 14:55:57 +03:00 committed by Alexandre Julliard
parent 703e82094b
commit 0bfb97dcba
1 changed files with 2 additions and 1 deletions

View File

@ -3209,8 +3209,8 @@ static HRESULT _SHGetUserShellFolderPath(HKEY rootKey, LPCWSTR userPrefix,
HRESULT hr;
WCHAR shellFolderPath[MAX_PATH], userShellFolderPath[MAX_PATH];
LPCWSTR pShellFolderPath, pUserShellFolderPath;
DWORD dwType, dwPathLen = MAX_PATH;
HKEY userShellFolderKey, shellFolderKey;
DWORD dwType, dwPathLen;
TRACE("%p,%s,%s,%p\n",rootKey, debugstr_w(userPrefix), debugstr_w(value),
path);
@ -3245,6 +3245,7 @@ static HRESULT _SHGetUserShellFolderPath(HKEY rootKey, LPCWSTR userPrefix,
return E_FAIL;
}
dwPathLen = MAX_PATH * sizeof(WCHAR);
if (!RegQueryValueExW(userShellFolderKey, value, NULL, &dwType,
(LPBYTE)path, &dwPathLen) && (dwType == REG_EXPAND_SZ || dwType == REG_SZ))
{