shell32: In ParseDisplayName make use of shdocvw if the display name is not a drive but has a :.
This commit is contained in:
parent
7392162ed1
commit
c6ba4eed01
|
@ -6,7 +6,7 @@ VPATH = @srcdir@
|
||||||
MODULE = shell32.dll
|
MODULE = shell32.dll
|
||||||
IMPORTLIB = shell32
|
IMPORTLIB = shell32
|
||||||
IMPORTS = uuid shlwapi comctl32 user32 gdi32 advapi32 kernel32 ntdll
|
IMPORTS = uuid shlwapi comctl32 user32 gdi32 advapi32 kernel32 ntdll
|
||||||
DELAYIMPORTS = ole32 oleaut32
|
DELAYIMPORTS = ole32 oleaut32 shdocvw
|
||||||
|
|
||||||
C_SRCS = \
|
C_SRCS = \
|
||||||
appbar.c \
|
appbar.c \
|
||||||
|
|
|
@ -55,6 +55,10 @@
|
||||||
|
|
||||||
WINE_DEFAULT_DEBUG_CHANNEL (shell);
|
WINE_DEFAULT_DEBUG_CHANNEL (shell);
|
||||||
|
|
||||||
|
/* Undocumented functions from shdocvw */
|
||||||
|
extern HRESULT WINAPI IEParseDisplayNameWithBCW(DWORD codepage, LPCWSTR lpszDisplayName, LPBC pbc, LPITEMIDLIST *ppidl);
|
||||||
|
|
||||||
|
|
||||||
/***********************************************************************
|
/***********************************************************************
|
||||||
* Desktopfolder implementation
|
* Desktopfolder implementation
|
||||||
*/
|
*/
|
||||||
|
@ -181,6 +185,10 @@ static HRESULT WINAPI ISF_Desktop_fnParseDisplayName (IShellFolder2 * iface,
|
||||||
*ppidl = pidlTemp;
|
*ppidl = pidlTemp;
|
||||||
return S_OK;
|
return S_OK;
|
||||||
}
|
}
|
||||||
|
else if (strchrW(lpszDisplayName,':'))
|
||||||
|
{
|
||||||
|
return IEParseDisplayNameWithBCW(CP_ACP,lpszDisplayName,pbc,ppidl);
|
||||||
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
/* it's a filesystem path on the desktop. Let a FSFolder parse it */
|
/* it's a filesystem path on the desktop. Let a FSFolder parse it */
|
||||||
|
|
|
@ -82,6 +82,8 @@ static void test_ParseDisplayName(void)
|
||||||
IShellFolder *IDesktopFolder;
|
IShellFolder *IDesktopFolder;
|
||||||
static const char *cNonExistDir1A = "c:\\nonexist_subdir";
|
static const char *cNonExistDir1A = "c:\\nonexist_subdir";
|
||||||
static const char *cNonExistDir2A = "c:\\\\nonexist_subdir";
|
static const char *cNonExistDir2A = "c:\\\\nonexist_subdir";
|
||||||
|
static const char *cInetTestA = "http:\\yyy";
|
||||||
|
static const char *cInetTest2A = "xx:yyy";
|
||||||
DWORD res;
|
DWORD res;
|
||||||
WCHAR cTestDirW [MAX_PATH] = {0};
|
WCHAR cTestDirW [MAX_PATH] = {0};
|
||||||
ITEMIDLIST *newPIDL;
|
ITEMIDLIST *newPIDL;
|
||||||
|
@ -90,6 +92,30 @@ static void test_ParseDisplayName(void)
|
||||||
hr = SHGetDesktopFolder(&IDesktopFolder);
|
hr = SHGetDesktopFolder(&IDesktopFolder);
|
||||||
if(hr != S_OK) return;
|
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);
|
res = GetFileAttributesA(cNonExistDir1A);
|
||||||
if(res != INVALID_FILE_ATTRIBUTES) return;
|
if(res != INVALID_FILE_ATTRIBUTES) return;
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue