* dlls/shell32/shellpath.c: Aric Stewart <aric@codeweavers.com>

Make sure that the size of the buffer passed to RegSetValueExW is in
bytes not WCHARs.

svn path=/trunk/; revision=10291
This commit is contained in:
Filip Navara 2004-07-26 17:02:30 +00:00
parent 2fe9583bc7
commit a646b85ed6

View file

@ -1101,6 +1101,7 @@ HRESULT WINAPI SHGetFolderPathW(
if (RegQueryValueExW(hKey,szValueName,NULL,&dwType,(LPBYTE)pszPath,&dwPathLen))
{
/* value not existing */
if (dwCsidlFlags & CSIDL_MYFLAG_RELATIVE)
{
@ -1114,7 +1115,8 @@ HRESULT WINAPI SHGetFolderPathW(
strcpyW(pszPath + 3, szDefaultPath);
}
dwType=REG_SZ;
RegSetValueExW(hKey,szValueName,0,REG_SZ,(LPBYTE)pszPath,strlenW(pszPath)+1);
RegSetValueExW(hKey,szValueName,0,REG_SZ,(LPBYTE)pszPath,
(strlenW(pszPath)+1)*sizeof(WCHAR));
}
}
RegCloseKey(hKey);
@ -1150,7 +1152,8 @@ HRESULT WINAPI SHGetFolderPathW(
strcpyW(pszPath + 3, szDefaultPath);
}
dwType=REG_SZ;
RegSetValueExW(hKey,szValueName,0,REG_SZ,(LPBYTE)pszPath,strlenW(pszPath)+1);
RegSetValueExW(hKey,szValueName,0,REG_SZ,(LPBYTE)pszPath,
(strlenW(pszPath)+1)*sizeof(WCHAR));
}
RegCloseKey(hKey);
}
@ -1322,14 +1325,14 @@ HRESULT WINAPI SHGetSpecialFolderLocation(
*ppidl = _ILCreateControlPanel();
break;
case CSIDL_FONTS:
FIXME("virtual font folder");
break;
case CSIDL_PRINTERS:
*ppidl = _ILCreatePrinters();
break;
case CSIDL_FONTS:
FIXME("virtual font folder");
break;
case CSIDL_BITBUCKET:
*ppidl = _ILCreateBitBucket();
break;