On Fri Jan 6 01:02:53 2023 +0000, Vladislav Timonin wrote:
Yup, thats the known folders. Not sure how to handle them. Briefly checked `SHParseDisplayName` on Windows, and it failed on `Desktop`, unless I'm just using a wrong set of SFGAOF attributes. Glancing over usage of known folders IDs in Wine, I'm getting a suspicion that there's no such handy function. There's `IKnownFolderManager::GetFolderByName`, but that wants a non-localized canonical name (which is fine for now, since Wine doesn't seem to do localization for known folders anyway), but canonical name doesn't match the "human-readable" name in some cases, e.g. `Control Panel`' canonical name is `ControlPanelFolder` Did forget about relative paths. Fixed that at the very least.
I think straight parsing only handles GUIDs for the special virtual folders. You can try straight parsing first of course, since it's a shortcut in most cases, but I recall I had to enumerate the contents of the IShellFolder and check each one for a match in such case…
If you do this, make sure to skip filesystem or network shell folders, because enumerating/comparing there would be too slow (and straight parsing there works). Something like:
```c if (SUCCEEDED(IShellFolder_QueryInterface(sf, &IID_IPersist, (void**)&persist))) { CLSID clsid; hres = IPersist_GetClassID(persist, &clsid); IPersist_Release(persist);
if (SUCCEEDED(hres) && (IsEqualCLSID(&clsid, &CLSID_ShellFSFolder) || IsEqualCLSID(&clsid, &CLSID_NetworkPlaces))) return FALSE; } ```
assuming a FALSE return means "not found".
Otherwise use something like `IShellFolder_EnumObjects(sf, NULL, SHCONTF_FOLDERS | SHCONTF_INCLUDEHIDDEN | SHCONTF_INCLUDESUPERHIDDEN, &eidl)` to enumerate and then compare, I think.