The function '_SHCreateSymbolicLinks' already exists in master branch,
it's defined around line 4250. And originally it was called around line
5961. It's the function that currently reinitializes those "shell
folders" in question.

This function is called during registry of shell32.dll, which happens on
each wine upgrade/reinstall or when 'wineboot -u' is called. Issue is
caused by function SHGetFolderPathAndSubDirW being called for some of
shell folders with flag CSIDL_FLAG_CREATE before function
_SHCreateSymbolicLinks is called. Thus, when function
_SHCreateSymbolicLinks is called, some directories, like Desktop or My
documents, may already exist. To overcome that issue and initialize
shell folders by proper links, current code just removes current shell
folders, and reinitializes them to default locations. And it looks like
it only removes current shell folders if they're symlinks or empty
directories. This causes the current issue.

The proposed registry key solution may circumvent the issue by not
allowing the function _SHCreateSymbolicLinks to run on prefix upgrade
and remove current symlinks. My patch uses different approach. Instead
of removing directories after they're created and recreating them, right
before shell directory is being created in function
SHGetFolderPathAndSubDirW (which shouldn't happen too often) the initial
symlinks setup is performed to make sure that shell folders are properly
set up.

Since _SHCreateSymbolicLinks calls function SHGetFolderPathAndSubDirW
via function SHGetFolderPathW I had to remove flag CSIDL_FLAG_CREATE
from calls in that function and correspondingly modify return code
checks. Otherwise it'd cause infinite recursion and finally a crash.
Well, creation of directory is not what is desired at that point anyway,
just it's path is needed.

I prefer tabs over spaces for identation, due to that my editors are set
up to ident with tabs, and it looks like I added some lines with them.
As for directory permissions, I just made them what is usually proposed
as safe defaults.

Please feel free to modify any parts of patch you think should be
modified or use different approach entirely if you think this one is
undesired.

-- 
You received this bug notification because you are a member of Ubuntu
Bugs, which is subscribed to Ubuntu.
https://bugs.launchpad.net/bugs/913444

Title:
  Every wine update re-enables desktop integration links

To manage notifications about this bug go to:
https://bugs.launchpad.net/wine/+bug/913444/+subscriptions

-- 
ubuntu-bugs mailing list
ubuntu-bugs@lists.ubuntu.com
https://lists.ubuntu.com/mailman/listinfo/ubuntu-bugs

Reply via email to