shell32: Add a function to create one specific symbolic link at a time for user dirs.

Wine-Bug: https://bugs.winehq.org/show_bug.cgi?id=22974
Signed-off-by: Olivier F. R. Dierick <o.dierick@piezo-forte.be>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
This commit is contained in:
Olivier F. R. Dierick 2020-02-19 00:16:43 +01:00 committed by Alexandre Julliard
parent 60915a5544
commit 9cb47e8821
1 changed files with 35 additions and 11 deletions

View File

@ -4326,6 +4326,39 @@ static void _SHCreateDesktopSymbolicLink(void)
_SHFreeXDGUserDirs(num, xdg_results);
}
/******************************************************************************
* _SHCreateSymbolicLink [Internal]
*
* Sets up a symbolic link for one of the special shell folders to point into
* the users home directory.
*
* PARAMS
* nFolder [I] CSIDL identifying the folder.
*/
static void _SHCreateSymbolicLink(int nFolder)
{
static const UINT aidsMyStuff[] = {
IDS_MYPICTURES, IDS_MYVIDEOS, IDS_MYMUSIC, IDS_DOWNLOADS, IDS_TEMPLATES
};
DWORD folder = nFolder & CSIDL_FOLDER_MASK;
switch (folder) {
case CSIDL_PERSONAL:
_SHCreateMyDocumentsSymbolicLink(aidsMyStuff, ARRAY_SIZE(aidsMyStuff));
break;
case CSIDL_MYPICTURES:
case CSIDL_MYVIDEO:
case CSIDL_MYMUSIC:
case CSIDL_DOWNLOADS:
case CSIDL_TEMPLATES:
_SHCreateMyStuffSymbolicLink(folder);
break;
case CSIDL_DESKTOPDIRECTORY:
_SHCreateDesktopSymbolicLink();
break;
}
}
/******************************************************************************
* _SHCreateSymbolicLinks [Internal]
*
@ -4351,22 +4384,13 @@ static void _SHCreateDesktopSymbolicLink(void)
*/
static void _SHCreateSymbolicLinks(void)
{
static const UINT aidsMyStuff[] = {
IDS_MYPICTURES, IDS_MYVIDEOS, IDS_MYMUSIC, IDS_DOWNLOADS, IDS_TEMPLATES
};
static const int acsidlMyStuff[] = {
CSIDL_MYPICTURES, CSIDL_MYVIDEO, CSIDL_MYMUSIC, CSIDL_DOWNLOADS, CSIDL_TEMPLATES
CSIDL_MYPICTURES, CSIDL_MYVIDEO, CSIDL_MYMUSIC, CSIDL_DOWNLOADS, CSIDL_TEMPLATES, CSIDL_PERSONAL, CSIDL_DESKTOPDIRECTORY
};
UINT i;
_SHCreateMyDocumentsSymbolicLink(aidsMyStuff, ARRAY_SIZE(aidsMyStuff));
/* Create symbolic links for 'My Pictures', 'My Videos', 'My Music' etc. */
for (i=0; i < ARRAY_SIZE(acsidlMyStuff); i++)
_SHCreateMyStuffSymbolicLink(acsidlMyStuff[i]);
/* Last but not least, the Desktop folder */
_SHCreateDesktopSymbolicLink();
_SHCreateSymbolicLink(acsidlMyStuff[i]);
}
/******************************************************************************