What I've found though with the SHGetSpecialFolderLocation, is that it seems to me that it is designed to allow the caller to pick an arbitrary value for the CSIDL, and that this will cause windows to create a new CSIDL. As the function's implementation currently stands, it has a hard-coded table of possible CSIDLs, and rejects calls with unknown CSIDLs.
This is right. There is a list with valid CSIDL's. These CSIDL's are mapped to a unique value name in the registry. These functions are supposed to fail when called with a CSIDL which is not predefined. (Whats not saying wine knows all CSIDL's).
Has anyone else looked at this function, and does anyone have any
comments or
suggestions on ways to address this? I'm thinking that these values probably need to go into the registry, or something, rather than being stored in the code...
There is only a need to store the values in the registry when the path is different from the default value. If the there are no registry entrys in
HKEY_CURRENT_USER\Software\Microsoft\Windows\CurrentVersion\ Explorer\Shell Folders HKEY_CURRENT_USER\Software\Microsoft\Windows\CurrentVersion\ Explorer\User Shell Folders HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows\CurrentVer sion\Explorer\Sh ell Folders HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows\CurrentVer sion\Explorer\Us er Shell Folders
the the default values are used. (Was in w95, nt4 like this. Don't know it its true for w2k since apparently most values are set at installation time and there are more values used than before.)
Last but the not least: the current implementation was designed to work without much preset values in the registry to simplify the installation.
The implementation should be cleaned up starting with ShGetFolderLocation since this is the common base of SHGetFolderLocation, SHGetFolderPath, SHGetSpecialFolderLocationand SHGetSpecialFolderPath and you should have a fallback to deal with a empty registry. (I'm not up to date with the wine installation procedure but the installer would have to put many keys in the registry for a good shell32 konfiguration.)
Juergen
--- juergen.schmied@debitel.net