[PATCH 1/4] shlwapi: Fix parameters for RegQueryValueExW to read the default prefix
Detlef Riekenberg
wine.dev at web.de
Mon Aug 25 05:49:18 CDT 2008
---
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);
--
1.5.4.3
--=-JLpOWaD+TMyUhpAN6Rm8--
More information about the wine-patches
mailing list