Detlef Riekenberg : shlwapi: Fix parameters for RegQueryValueExW to read the default value.
Alexandre Julliard
julliard at winehq.org
Wed Aug 27 08:24:42 CDT 2008
Module: wine
Branch: master
Commit: 177c2a2798ea25297965b65949c685853712e02f
URL: http://source.winehq.org/git/wine.git/?a=commit;h=177c2a2798ea25297965b65949c685853712e02f
Author: Detlef Riekenberg <wine.dev at web.de>
Date: Mon Aug 25 12:49:18 2008 +0200
shlwapi: Fix parameters for RegQueryValueExW to read the default value.
---
dlls/shlwapi/url.c | 12 +++++-------
1 files changed, 5 insertions(+), 7 deletions(-)
diff --git a/dlls/shlwapi/url.c b/dlls/shlwapi/url.c
index 18ebc41..ca6e200 100644
--- a/dlls/shlwapi/url.c
+++ b/dlls/shlwapi/url.c
@@ -1586,7 +1586,7 @@ static HRESULT URL_ApplyDefault(LPCWSTR pszIn, LPWSTR pszOut, LPDWORD pcchOut)
{
HKEY newkey;
DWORD data_len, dwType;
- WCHAR value[MAX_PATH], data[MAX_PATH];
+ WCHAR data[MAX_PATH];
static const WCHAR prefix_keyW[] =
{'S','o','f','t','w','a','r','e',
@@ -1598,14 +1598,12 @@ static HRESULT URL_ApplyDefault(LPCWSTR pszIn, LPWSTR pszOut, LPDWORD pcchOut)
/* get and prepend default */
RegOpenKeyExW(HKEY_LOCAL_MACHINE, prefix_keyW, 0, 1, &newkey);
- data_len = MAX_PATH;
- value[0] = '@';
- value[1] = '\0';
- RegQueryValueExW(newkey, value, 0, &dwType, (LPBYTE)data, &data_len);
+ data_len = sizeof(data);
+ RegQueryValueExW(newkey, NULL, 0, &dwType, (LPBYTE)data, &data_len);
RegCloseKey(newkey);
if (strlenW(data) + strlenW(pszIn) + 1 > *pcchOut) {
- *pcchOut = strlenW(data) + strlenW(pszIn) + 1;
- return E_POINTER;
+ *pcchOut = strlenW(data) + strlenW(pszIn) + 1;
+ return E_POINTER;
}
strcpyW(pszOut, data);
strcatW(pszOut, pszIn);
More information about the wine-cvs
mailing list