From eee7297139deac9dde5a58156040ce79fe738c0b Mon Sep 17 00:00:00 2001 From: Claudiu Mihail Date: Sat, 5 Nov 2011 16:40:42 +0000 Subject: [PATCH] [shell32] - Fix ParseDisplayName based on wine by checking for paths that are parsable through IEParseDisplayNameWithBCW. Score 2 failed wine tests in shlfolder svn path=/trunk/; revision=54300 --- reactos/dll/win32/shell32/CMakeLists.txt | 3 +++ reactos/dll/win32/shell32/shfldr_desktop.cpp | 18 ++++++++++++++++++ 2 files changed, 21 insertions(+) diff --git a/reactos/dll/win32/shell32/CMakeLists.txt b/reactos/dll/win32/shell32/CMakeLists.txt index 60dca57bf20..f1b582ace03 100644 --- a/reactos/dll/win32/shell32/CMakeLists.txt +++ b/reactos/dll/win32/shell32/CMakeLists.txt @@ -92,6 +92,7 @@ add_importlibs(shell32 user32 comctl32 comdlg32 + shdocvw shlwapi devmgr winspool @@ -100,6 +101,8 @@ add_importlibs(shell32 kernel32 ntdll) +add_dependencies(shdocvw shdocvw_v1) + add_pch(shell32 precomp.h) add_cd_file(TARGET shell32 DESTINATION reactos/system32 FOR all) diff --git a/reactos/dll/win32/shell32/shfldr_desktop.cpp b/reactos/dll/win32/shell32/shfldr_desktop.cpp index d55d3259e1f..83e5d57effa 100644 --- a/reactos/dll/win32/shell32/shfldr_desktop.cpp +++ b/reactos/dll/win32/shell32/shfldr_desktop.cpp @@ -41,6 +41,9 @@ it from the view by handling the IncludeObject query to return S_FALSE. The enum always shows My Computer. */ +/* Undocumented functions from shdocvw */ +extern "C" HRESULT WINAPI IEParseDisplayNameWithBCW(DWORD codepage, LPCWSTR lpszDisplayName, LPBC pbc, LPITEMIDLIST *ppidl); + /*********************************************************************** * Desktopfolder implementation */ @@ -296,6 +299,7 @@ HRESULT WINAPI CDesktopFolder::ParseDisplayName (HWND hwndOwner, LPBC pbc, LPOLE WCHAR szElement[MAX_PATH]; LPCWSTR szNext = NULL; LPITEMIDLIST pidlTemp = NULL; + PARSEDURLW urldata; HRESULT hr = S_OK; CLSID clsid; @@ -317,6 +321,8 @@ HRESULT WINAPI CDesktopFolder::ParseDisplayName (HWND hwndOwner, LPBC pbc, LPOLE if (pchEaten) *pchEaten = 0; /* strange but like the original */ + urldata.cbSize = sizeof(urldata); + if (lpszDisplayName[0] == ':' && lpszDisplayName[1] == ':') { szNext = GetNextElementW (lpszDisplayName, szElement, MAX_PATH); @@ -340,6 +346,17 @@ HRESULT WINAPI CDesktopFolder::ParseDisplayName (HWND hwndOwner, LPBC pbc, LPOLE *ppidl = pidlTemp; return S_OK; } + else if (SUCCEEDED(ParseURLW(lpszDisplayName, &urldata))) + { + if (urldata.nScheme == URL_SCHEME_SHELL) /* handle shell: urls */ + { + TRACE ("-- shell url: %s\n", debugstr_w(urldata.pszSuffix)); + SHCLSIDFromStringW (urldata.pszSuffix+2, &clsid); + pidlTemp = _ILCreateGuid (PT_GUID, clsid); + } + else + return IEParseDisplayNameWithBCW(CP_ACP,lpszDisplayName,pbc,ppidl); + } else { /* it's a filesystem path on the desktop. Let a FSFolder parse it */ @@ -356,6 +373,7 @@ HRESULT WINAPI CDesktopFolder::ParseDisplayName (HWND hwndOwner, LPBC pbc, LPOLE { lstrcpynW(pathPtr, lpszDisplayName, MAX_PATH - (pathPtr - szPath)); hr = _ILCreateFromPathW(szPath, &pidlTemp); + __debugbreak(); } else {