Commit bf811fdc authored by Alexandre Julliard's avatar Alexandre Julliard

shell32: Pass the destination Windows path to _SHCreateSymbolicLink().

parent 0a71ea73
...@@ -4202,7 +4202,7 @@ static void _SHCreateMyDocumentsSubDirs(const UINT * aidsMyStuff, const UINT num ...@@ -4202,7 +4202,7 @@ static void _SHCreateMyDocumentsSubDirs(const UINT * aidsMyStuff, const UINT num
* aidsMyStuff [I] Array of IDS_* resources to create sub dirs for. * aidsMyStuff [I] Array of IDS_* resources to create sub dirs for.
* aids_num [I] Number of elements in aidsMyStuff. * aids_num [I] Number of elements in aidsMyStuff.
*/ */
static void _SHCreateMyDocumentsSymbolicLink(const UINT * aidsMyStuff, const UINT aids_num) static void _SHCreateMyDocumentsSymbolicLink(const UINT * aidsMyStuff, const UINT aids_num, const WCHAR *path)
{ {
static const char * const xdg_dirs[] = { "DOCUMENTS" }; static const char * const xdg_dirs[] = { "DOCUMENTS" };
static const unsigned int num = ARRAY_SIZE(xdg_dirs); static const unsigned int num = ARRAY_SIZE(xdg_dirs);
...@@ -4212,7 +4212,7 @@ static void _SHCreateMyDocumentsSymbolicLink(const UINT * aidsMyStuff, const UIN ...@@ -4212,7 +4212,7 @@ static void _SHCreateMyDocumentsSymbolicLink(const UINT * aidsMyStuff, const UIN
char ** xdg_results; char ** xdg_results;
/* Get the unix path of 'My Documents'. */ /* Get the unix path of 'My Documents'. */
pszPersonal = _SHGetFolderUnixPath(CSIDL_PERSONAL|CSIDL_FLAG_DONT_VERIFY); pszPersonal = wine_get_unix_file_name( path );
if (!pszPersonal) return; if (!pszPersonal) return;
_SHGetXDGUserDirs(xdg_dirs, num, &xdg_results); _SHGetXDGUserDirs(xdg_dirs, num, &xdg_results);
...@@ -4284,7 +4284,7 @@ static void _SHCreateMyDocumentsSymbolicLink(const UINT * aidsMyStuff, const UIN ...@@ -4284,7 +4284,7 @@ static void _SHCreateMyDocumentsSymbolicLink(const UINT * aidsMyStuff, const UIN
* PARAMS * PARAMS
* nFolder [I] CSIDL identifying the folder. * nFolder [I] CSIDL identifying the folder.
*/ */
static void _SHCreateMyStuffSymbolicLink(int nFolder) static void _SHCreateMyStuffSymbolicLink(int nFolder, const WCHAR *path)
{ {
static const UINT aidsMyStuff[] = { static const UINT aidsMyStuff[] = {
IDS_MYPICTURES, IDS_MYVIDEOS, IDS_MYMUSIC, IDS_DOWNLOADS, IDS_TEMPLATES IDS_MYPICTURES, IDS_MYVIDEOS, IDS_MYMUSIC, IDS_DOWNLOADS, IDS_TEMPLATES
...@@ -4328,8 +4328,7 @@ static void _SHCreateMyStuffSymbolicLink(int nFolder) ...@@ -4328,8 +4328,7 @@ static void _SHCreateMyStuffSymbolicLink(int nFolder)
while (1) while (1)
{ {
/* Get the current 'My Whatever' folder unix path. */ pszMyStuff = wine_get_unix_file_name( path );
pszMyStuff = _SHGetFolderUnixPath(acsidlMyStuff[i]|CSIDL_FLAG_DONT_VERIFY);
if (!pszMyStuff) break; if (!pszMyStuff) break;
while (1) while (1)
...@@ -4375,7 +4374,7 @@ static void _SHCreateMyStuffSymbolicLink(int nFolder) ...@@ -4375,7 +4374,7 @@ static void _SHCreateMyStuffSymbolicLink(int nFolder)
* Sets up a symbolic link for the 'Desktop' shell folder to point into the * Sets up a symbolic link for the 'Desktop' shell folder to point into the
* users home directory. * users home directory.
*/ */
static void _SHCreateDesktopSymbolicLink(void) static void _SHCreateDesktopSymbolicLink( const WCHAR *path )
{ {
static const char * const xdg_dirs[] = { "DESKTOP" }; static const char * const xdg_dirs[] = { "DESKTOP" };
static const unsigned int num = ARRAY_SIZE(xdg_dirs); static const unsigned int num = ARRAY_SIZE(xdg_dirs);
...@@ -4405,7 +4404,7 @@ static void _SHCreateDesktopSymbolicLink(void) ...@@ -4405,7 +4404,7 @@ static void _SHCreateDesktopSymbolicLink(void)
(_SHAppendToUnixPath(szDesktopTarget, DesktopW) && (_SHAppendToUnixPath(szDesktopTarget, DesktopW) &&
!stat(szDesktopTarget, &statFolder) && S_ISDIR(statFolder.st_mode))) !stat(szDesktopTarget, &statFolder) && S_ISDIR(statFolder.st_mode)))
{ {
pszDesktop = _SHGetFolderUnixPath(CSIDL_DESKTOPDIRECTORY|CSIDL_FLAG_DONT_VERIFY); pszDesktop = wine_get_unix_file_name( path );
if (pszDesktop) if (pszDesktop)
{ {
if (xdg_desktop_dir) if (xdg_desktop_dir)
...@@ -4428,7 +4427,7 @@ static void _SHCreateDesktopSymbolicLink(void) ...@@ -4428,7 +4427,7 @@ static void _SHCreateDesktopSymbolicLink(void)
* PARAMS * PARAMS
* nFolder [I] CSIDL identifying the folder. * nFolder [I] CSIDL identifying the folder.
*/ */
static void _SHCreateSymbolicLink(int nFolder) static void _SHCreateSymbolicLink(int nFolder, const WCHAR *path)
{ {
static const UINT aidsMyStuff[] = { static const UINT aidsMyStuff[] = {
IDS_MYPICTURES, IDS_MYVIDEOS, IDS_MYMUSIC, IDS_DOWNLOADS, IDS_TEMPLATES IDS_MYPICTURES, IDS_MYVIDEOS, IDS_MYMUSIC, IDS_DOWNLOADS, IDS_TEMPLATES
...@@ -4437,17 +4436,17 @@ static void _SHCreateSymbolicLink(int nFolder) ...@@ -4437,17 +4436,17 @@ static void _SHCreateSymbolicLink(int nFolder)
switch (folder) { switch (folder) {
case CSIDL_PERSONAL: case CSIDL_PERSONAL:
_SHCreateMyDocumentsSymbolicLink(aidsMyStuff, ARRAY_SIZE(aidsMyStuff)); _SHCreateMyDocumentsSymbolicLink(aidsMyStuff, ARRAY_SIZE(aidsMyStuff), path);
break; break;
case CSIDL_MYPICTURES: case CSIDL_MYPICTURES:
case CSIDL_MYVIDEO: case CSIDL_MYVIDEO:
case CSIDL_MYMUSIC: case CSIDL_MYMUSIC:
case CSIDL_DOWNLOADS: case CSIDL_DOWNLOADS:
case CSIDL_TEMPLATES: case CSIDL_TEMPLATES:
_SHCreateMyStuffSymbolicLink(folder); _SHCreateMyStuffSymbolicLink(folder, path);
break; break;
case CSIDL_DESKTOPDIRECTORY: case CSIDL_DESKTOPDIRECTORY:
_SHCreateDesktopSymbolicLink(); _SHCreateDesktopSymbolicLink( path );
break; break;
} }
} }
...@@ -4642,7 +4641,7 @@ HRESULT WINAPI SHGetFolderPathAndSubDirW( ...@@ -4642,7 +4641,7 @@ HRESULT WINAPI SHGetFolderPathAndSubDirW(
/* create symbolic links rather than directories for specific /* create symbolic links rather than directories for specific
* user shell folders */ * user shell folders */
_SHCreateSymbolicLink(folder); _SHCreateSymbolicLink(folder, szBuildPath);
/* create directory/directories */ /* create directory/directories */
ret = SHCreateDirectoryExW(hwndOwner, szBuildPath, NULL); ret = SHCreateDirectoryExW(hwndOwner, szBuildPath, NULL);
......
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