Module: wine Branch: master Commit: c6ba4eed013358a84bd72c25c6a0b572041cad97 URL: http://source.winehq.org/git/wine.git/?a=commit;h=c6ba4eed013358a84bd72c25c6...
Author: Aric Stewart aric@codeweavers.com Date: Wed Jan 28 10:32:38 2009 -0600
shell32: In ParseDisplayName make use of shdocvw if the display name is not a drive but has a :.
---
dlls/shell32/Makefile.in | 2 +- dlls/shell32/shfldr_desktop.c | 8 ++++++++ dlls/shell32/tests/shlfolder.c | 26 ++++++++++++++++++++++++++ 3 files changed, 35 insertions(+), 1 deletions(-)
diff --git a/dlls/shell32/Makefile.in b/dlls/shell32/Makefile.in index 8a3ee40..4fe4300 100644 --- a/dlls/shell32/Makefile.in +++ b/dlls/shell32/Makefile.in @@ -6,7 +6,7 @@ VPATH = @srcdir@ MODULE = shell32.dll IMPORTLIB = shell32 IMPORTS = uuid shlwapi comctl32 user32 gdi32 advapi32 kernel32 ntdll -DELAYIMPORTS = ole32 oleaut32 +DELAYIMPORTS = ole32 oleaut32 shdocvw
C_SRCS = \ appbar.c \ diff --git a/dlls/shell32/shfldr_desktop.c b/dlls/shell32/shfldr_desktop.c index aeb6e4b..c9b7412 100644 --- a/dlls/shell32/shfldr_desktop.c +++ b/dlls/shell32/shfldr_desktop.c @@ -55,6 +55,10 @@
WINE_DEFAULT_DEBUG_CHANNEL (shell);
+/* Undocumented functions from shdocvw */ +extern HRESULT WINAPI IEParseDisplayNameWithBCW(DWORD codepage, LPCWSTR lpszDisplayName, LPBC pbc, LPITEMIDLIST *ppidl); + + /*********************************************************************** * Desktopfolder implementation */ @@ -181,6 +185,10 @@ static HRESULT WINAPI ISF_Desktop_fnParseDisplayName (IShellFolder2 * iface, *ppidl = pidlTemp; return S_OK; } + else if (strchrW(lpszDisplayName,':')) + { + return IEParseDisplayNameWithBCW(CP_ACP,lpszDisplayName,pbc,ppidl); + } else { /* it's a filesystem path on the desktop. Let a FSFolder parse it */ diff --git a/dlls/shell32/tests/shlfolder.c b/dlls/shell32/tests/shlfolder.c index cc32a00..9d563e0 100644 --- a/dlls/shell32/tests/shlfolder.c +++ b/dlls/shell32/tests/shlfolder.c @@ -82,6 +82,8 @@ static void test_ParseDisplayName(void) IShellFolder *IDesktopFolder; static const char *cNonExistDir1A = "c:\nonexist_subdir"; static const char *cNonExistDir2A = "c:\\nonexist_subdir"; + static const char *cInetTestA = "http:\yyy"; + static const char *cInetTest2A = "xx:yyy"; DWORD res; WCHAR cTestDirW [MAX_PATH] = {0}; ITEMIDLIST *newPIDL; @@ -90,6 +92,30 @@ static void test_ParseDisplayName(void) hr = SHGetDesktopFolder(&IDesktopFolder); if(hr != S_OK) return;
+ MultiByteToWideChar(CP_ACP, 0, cInetTestA, -1, cTestDirW, MAX_PATH); + hr = IShellFolder_ParseDisplayName(IDesktopFolder, + NULL, NULL, cTestDirW, NULL, &newPIDL, 0); + todo_wine ok((SUCCEEDED(hr) || broken(hr == E_FAIL) /* NT4 */), + "ParseDisplayName returned %08x, expected SUCCESS or E_FAIL \n", hr); + if (SUCCEEDED(hr)) + { + ok(pILFindLastID(newPIDL)->mkid.abID[0] == 0x61, "Last pidl should be of type " + "PT_IESPECIAL1, but is: %02x\n", pILFindLastID(newPIDL)->mkid.abID[0]); + IMalloc_Free(ppM, newPIDL); + } + + MultiByteToWideChar(CP_ACP, 0, cInetTest2A, -1, cTestDirW, MAX_PATH); + hr = IShellFolder_ParseDisplayName(IDesktopFolder, + NULL, NULL, cTestDirW, NULL, &newPIDL, 0); + todo_wine ok((SUCCEEDED(hr) || broken(hr == E_FAIL) /* NT4 */), + "ParseDisplayName returned %08x, expected SUCCESS or E_FAIL \n", hr); + if (SUCCEEDED(hr)) + { + ok(pILFindLastID(newPIDL)->mkid.abID[0] == 0x61, "Last pidl should be of type " + "PT_IESPECIAL1, but is: %02x\n", pILFindLastID(newPIDL)->mkid.abID[0]); + IMalloc_Free(ppM, newPIDL); + } + res = GetFileAttributesA(cNonExistDir1A); if(res != INVALID_FILE_ATTRIBUTES) return;