Commit 0bfb97dc authored by Nikolay Sivov's avatar Nikolay Sivov Committed by Alexandre Julliard

shell32: Pass correct buffer length to RegQueryValueExW().

parent 703e8209
...@@ -3209,8 +3209,8 @@ static HRESULT _SHGetUserShellFolderPath(HKEY rootKey, LPCWSTR userPrefix, ...@@ -3209,8 +3209,8 @@ static HRESULT _SHGetUserShellFolderPath(HKEY rootKey, LPCWSTR userPrefix,
HRESULT hr; HRESULT hr;
WCHAR shellFolderPath[MAX_PATH], userShellFolderPath[MAX_PATH]; WCHAR shellFolderPath[MAX_PATH], userShellFolderPath[MAX_PATH];
LPCWSTR pShellFolderPath, pUserShellFolderPath; LPCWSTR pShellFolderPath, pUserShellFolderPath;
DWORD dwType, dwPathLen = MAX_PATH;
HKEY userShellFolderKey, shellFolderKey; HKEY userShellFolderKey, shellFolderKey;
DWORD dwType, dwPathLen;
TRACE("%p,%s,%s,%p\n",rootKey, debugstr_w(userPrefix), debugstr_w(value), TRACE("%p,%s,%s,%p\n",rootKey, debugstr_w(userPrefix), debugstr_w(value),
path); path);
...@@ -3245,6 +3245,7 @@ static HRESULT _SHGetUserShellFolderPath(HKEY rootKey, LPCWSTR userPrefix, ...@@ -3245,6 +3245,7 @@ static HRESULT _SHGetUserShellFolderPath(HKEY rootKey, LPCWSTR userPrefix,
return E_FAIL; return E_FAIL;
} }
dwPathLen = MAX_PATH * sizeof(WCHAR);
if (!RegQueryValueExW(userShellFolderKey, value, NULL, &dwType, if (!RegQueryValueExW(userShellFolderKey, value, NULL, &dwType,
(LPBYTE)path, &dwPathLen) && (dwType == REG_EXPAND_SZ || dwType == REG_SZ)) (LPBYTE)path, &dwPathLen) && (dwType == REG_EXPAND_SZ || dwType == REG_SZ))
{ {
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment