Comment 30 for bug 913444

Revision history for this message
In , Olivier Dierick (o-dierick) wrote :

Created attachment 65285
v2 Patch 1/2 shell32: Move and split _SHCreateSymbolicLinks()

Hello,

Here is a new patchset that I think is cleaner.
I changed my mind and don't touch anything but the issue.
I think it will help getting the patchset approved sooner.
Other features deserve their own enhancement bugs anyway.

Patch 1/2:
- Splits the _SHCreateSymbolicLinks() into folder type-specific functions, keeping the old logic intact. This way the different folders can be handled separately.
- It also fixes some trailing whitespace in the moved code but that's negligible.

Patch 2/2:
- Adds a helper function that creates a single symbolic link at a time, for the folders we are interested in.
- Calls the helper function where the old code did only create a directory.
- Disables the removal of existing symlinks/directories, in the symlink creation functions.
- Also says to not create the folder when looking up for its path for the symlink, to avoid an infinite loop.

Note that the winecfg code handles the folder symlink/directory switching itself, removing the symlink/directory as appropriate. It even makes a backup of the directory when switching to a symlink and restores it when switching back. The removal of the remove() calls doesn't affect the ability to manage the shell folders through the winecfg UI.

Please, test the patchset thoroughly on your system and give feedback if it breaks anything.
Meanwhile, I'll request for comments on the developer mailing list.

Regards.