Commit 3d9fb739 authored by Aric Stewart's avatar Aric Stewart Committed by Alexandre Julliard

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

bytes not WCHARs.
parent c9860a50
......@@ -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);
}
......
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