Commit c6ba4eed authored by Aric Stewart's avatar Aric Stewart Committed by Alexandre Julliard

shell32: In ParseDisplayName make use of shdocvw if the display name is not a drive but has a :.

parent 7392162e
......@@ -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 \
......
......@@ -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 */
......
......@@ -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;
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment