Make sure that the size of the buffer passed to RegSetValueExW is in

bytes not WCHARs.
This commit is contained in:
Aric Stewart 2004-05-28 19:28:41 +00:00 committed by Alexandre Julliard
parent c9860a504c
commit 3d9fb73909
1 changed files with 4 additions and 2 deletions

View File

@ -1115,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);
@ -1151,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);
}