From 9393580ab5dc5dda96b5ade1446d1adbabe4bcaf Mon Sep 17 00:00:00 2001 From: Michael Jung Date: Wed, 29 Jun 2005 11:17:33 +0000 Subject: [PATCH] If the unixfs is rooted at the Desktop folder, forward ParseDisplayName calls to it instead of to MyComputer. --- dlls/shell32/shell32_main.h | 1 + dlls/shell32/shfldr_desktop.c | 7 +++++-- dlls/shell32/shfldr_unixfs.c | 30 ++++++++++++++++++++++++++++++ 3 files changed, 36 insertions(+), 2 deletions(-) diff --git a/dlls/shell32/shell32_main.h b/dlls/shell32/shell32_main.h index 9dbc9b7e88f..ea8383a966d 100644 --- a/dlls/shell32/shell32_main.h +++ b/dlls/shell32/shell32_main.h @@ -227,6 +227,7 @@ UINT SHELL_FindExecutable(LPCWSTR lpPath, LPCWSTR lpFile, LPCWSTR lpOperation, extern WCHAR swShell32Name[MAX_PATH]; +BOOL UNIXFS_is_rooted_at_desktop(void); extern const GUID CLSID_UnixFolder; extern const GUID CLSID_UnixDosFolder; diff --git a/dlls/shell32/shfldr_desktop.c b/dlls/shell32/shfldr_desktop.c index 9b564f8ed4f..8c05fa2da07 100644 --- a/dlls/shell32/shfldr_desktop.c +++ b/dlls/shell32/shfldr_desktop.c @@ -186,8 +186,11 @@ static HRESULT WINAPI ISF_Desktop_fnParseDisplayName (IShellFolder2 * iface, } else if (PathGetDriveNumberW (lpszDisplayName) >= 0) { - /* it's a filesystem path with a drive. Let MyComputer parse it */ - pidlTemp = _ILCreateMyComputer (); + /* it's a filesystem path with a drive. Let MyComputer/UnixDosFolder parse it */ + if (UNIXFS_is_rooted_at_desktop()) + pidlTemp = _ILCreateGuid(PT_GUID, &CLSID_UnixDosFolder); + else + pidlTemp = _ILCreateMyComputer (); szNext = lpszDisplayName; } else if (PathIsUNCW(lpszDisplayName)) diff --git a/dlls/shell32/shfldr_unixfs.c b/dlls/shell32/shfldr_unixfs.c index 6437c995fd9..610f53935e3 100644 --- a/dlls/shell32/shfldr_unixfs.c +++ b/dlls/shell32/shfldr_unixfs.c @@ -106,6 +106,36 @@ typedef struct _UnixFolder { DWORD m_dwPathMode; } UnixFolder; +/****************************************************************************** + * UNIXFS_is_rooted_at_desktop [Internal] + * + * Checks if the unixfs namespace extension is rooted at desktop level. + * + * RETURNS + * TRUE, if unixfs is rooted at desktop level + * FALSE, if not. + */ +BOOL UNIXFS_is_rooted_at_desktop(void) { + HKEY hKey; + WCHAR *pwszCLSID_UnixDosFolder, wszRootedAtDesktop[69 + CHARS_IN_GUID] = { + 'S','o','f','t','w','a','r','e','\\','M','i','c','r','o','s','o','f','t','\\', + 'W','i','n','d','o','w','s','\\','C','u','r','r','e','n','t','V','e','r','s','i','o','n','\\', + 'E','x','p','l','o','r','e','r','\\','D','e','s','k','t','o','p','\\', + 'N','a','m','e','S','p','a','c','e','\\',0 }; + + if (FAILED(StringFromCLSID(&CLSID_UnixDosFolder, &pwszCLSID_UnixDosFolder))) + return FALSE; + + lstrcatW(wszRootedAtDesktop, pwszCLSID_UnixDosFolder); + CoTaskMemFree(pwszCLSID_UnixDosFolder); + + if (RegOpenKeyExW(HKEY_LOCAL_MACHINE, wszRootedAtDesktop, 0, KEY_READ, &hKey) != ERROR_SUCCESS) + return FALSE; + + RegCloseKey(hKey); + return TRUE; +} + /****************************************************************************** * UNIXFS_is_pidl_of_type [INTERNAL] *