Commit 177c2a27 authored by Detlef Riekenberg's avatar Detlef Riekenberg Committed by Alexandre Julliard

shlwapi: Fix parameters for RegQueryValueExW to read the default value.

parent 52a406f7
...@@ -1586,7 +1586,7 @@ static HRESULT URL_ApplyDefault(LPCWSTR pszIn, LPWSTR pszOut, LPDWORD pcchOut) ...@@ -1586,7 +1586,7 @@ static HRESULT URL_ApplyDefault(LPCWSTR pszIn, LPWSTR pszOut, LPDWORD pcchOut)
{ {
HKEY newkey; HKEY newkey;
DWORD data_len, dwType; DWORD data_len, dwType;
WCHAR value[MAX_PATH], data[MAX_PATH]; WCHAR data[MAX_PATH];
static const WCHAR prefix_keyW[] = static const WCHAR prefix_keyW[] =
{'S','o','f','t','w','a','r','e', {'S','o','f','t','w','a','r','e',
...@@ -1598,14 +1598,12 @@ static HRESULT URL_ApplyDefault(LPCWSTR pszIn, LPWSTR pszOut, LPDWORD pcchOut) ...@@ -1598,14 +1598,12 @@ static HRESULT URL_ApplyDefault(LPCWSTR pszIn, LPWSTR pszOut, LPDWORD pcchOut)
/* get and prepend default */ /* get and prepend default */
RegOpenKeyExW(HKEY_LOCAL_MACHINE, prefix_keyW, 0, 1, &newkey); RegOpenKeyExW(HKEY_LOCAL_MACHINE, prefix_keyW, 0, 1, &newkey);
data_len = MAX_PATH; data_len = sizeof(data);
value[0] = '@'; RegQueryValueExW(newkey, NULL, 0, &dwType, (LPBYTE)data, &data_len);
value[1] = '\0';
RegQueryValueExW(newkey, value, 0, &dwType, (LPBYTE)data, &data_len);
RegCloseKey(newkey); RegCloseKey(newkey);
if (strlenW(data) + strlenW(pszIn) + 1 > *pcchOut) { if (strlenW(data) + strlenW(pszIn) + 1 > *pcchOut) {
*pcchOut = strlenW(data) + strlenW(pszIn) + 1; *pcchOut = strlenW(data) + strlenW(pszIn) + 1;
return E_POINTER; return E_POINTER;
} }
strcpyW(pszOut, data); strcpyW(pszOut, data);
strcatW(pszOut, pszIn); strcatW(pszOut, pszIn);
......
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