shell32/tests: Drop shell folder test workarounds for Windows <= 2000.
Signed-off-by: Alex Henrie <alexhenrie24@gmail.com> Signed-off-by: Alexandre Julliard <julliard@winehq.org>
This commit is contained in:
parent
dca38ea895
commit
332898eacd
|
@ -209,10 +209,8 @@ static void test_ParseDisplayName(void)
|
||||||
win_skip("SHCreateShellItem requires XP SP1 or later\n");
|
win_skip("SHCreateShellItem requires XP SP1 or later\n");
|
||||||
|
|
||||||
MultiByteToWideChar(CP_ACP, 0, cInetTestA, -1, cTestDirW, MAX_PATH);
|
MultiByteToWideChar(CP_ACP, 0, cInetTestA, -1, cTestDirW, MAX_PATH);
|
||||||
hr = IShellFolder_ParseDisplayName(IDesktopFolder,
|
hr = IShellFolder_ParseDisplayName(IDesktopFolder, NULL, NULL, cTestDirW, NULL, &newPIDL, 0);
|
||||||
NULL, NULL, cTestDirW, NULL, &newPIDL, 0);
|
todo_wine ok(hr == S_OK, "ParseDisplayName returned %08x, expected SUCCESS\n", hr);
|
||||||
todo_wine ok(hr == S_OK || broken(hr == E_FAIL) /* NT4 */,
|
|
||||||
"ParseDisplayName returned %08x, expected SUCCESS or E_FAIL\n", hr);
|
|
||||||
if (hr == S_OK)
|
if (hr == S_OK)
|
||||||
{
|
{
|
||||||
ok(ILFindLastID(newPIDL)->mkid.abID[0] == 0x61, "Last pidl should be of type "
|
ok(ILFindLastID(newPIDL)->mkid.abID[0] == 0x61, "Last pidl should be of type "
|
||||||
|
@ -223,8 +221,7 @@ static void test_ParseDisplayName(void)
|
||||||
MultiByteToWideChar(CP_ACP, 0, cInetTest2A, -1, cTestDirW, MAX_PATH);
|
MultiByteToWideChar(CP_ACP, 0, cInetTest2A, -1, cTestDirW, MAX_PATH);
|
||||||
hr = IShellFolder_ParseDisplayName(IDesktopFolder,
|
hr = IShellFolder_ParseDisplayName(IDesktopFolder,
|
||||||
NULL, NULL, cTestDirW, NULL, &newPIDL, 0);
|
NULL, NULL, cTestDirW, NULL, &newPIDL, 0);
|
||||||
todo_wine ok(hr == S_OK || broken(hr == E_FAIL) /* NT4 */,
|
todo_wine ok(hr == S_OK, "ParseDisplayName returned %08x, expected SUCCESS\n", hr);
|
||||||
"ParseDisplayName returned %08x, expected SUCCESS or E_FAIL\n", hr);
|
|
||||||
if (hr == S_OK)
|
if (hr == S_OK)
|
||||||
{
|
{
|
||||||
ok(ILFindLastID(newPIDL)->mkid.abID[0] == 0x61, "Last pidl should be of type "
|
ok(ILFindLastID(newPIDL)->mkid.abID[0] == 0x61, "Last pidl should be of type "
|
||||||
|
@ -242,8 +239,8 @@ static void test_ParseDisplayName(void)
|
||||||
MultiByteToWideChar(CP_ACP, 0, cNonExistDir1A, -1, cTestDirW, MAX_PATH);
|
MultiByteToWideChar(CP_ACP, 0, cNonExistDir1A, -1, cTestDirW, MAX_PATH);
|
||||||
hr = IShellFolder_ParseDisplayName(IDesktopFolder,
|
hr = IShellFolder_ParseDisplayName(IDesktopFolder,
|
||||||
NULL, NULL, cTestDirW, NULL, &newPIDL, 0);
|
NULL, NULL, cTestDirW, NULL, &newPIDL, 0);
|
||||||
ok((hr == HRESULT_FROM_WIN32(ERROR_FILE_NOT_FOUND)) || (hr == E_FAIL),
|
ok(hr == HRESULT_FROM_WIN32(ERROR_FILE_NOT_FOUND),
|
||||||
"ParseDisplayName returned %08x, expected 80070002 or E_FAIL\n", hr);
|
"ParseDisplayName returned %08x, expected 0x80070002\n", hr);
|
||||||
|
|
||||||
res = GetFileAttributesA(cNonExistDir2A);
|
res = GetFileAttributesA(cNonExistDir2A);
|
||||||
if(res != INVALID_FILE_ATTRIBUTES)
|
if(res != INVALID_FILE_ATTRIBUTES)
|
||||||
|
@ -255,8 +252,7 @@ static void test_ParseDisplayName(void)
|
||||||
MultiByteToWideChar(CP_ACP, 0, cNonExistDir2A, -1, cTestDirW, MAX_PATH);
|
MultiByteToWideChar(CP_ACP, 0, cNonExistDir2A, -1, cTestDirW, MAX_PATH);
|
||||||
hr = IShellFolder_ParseDisplayName(IDesktopFolder,
|
hr = IShellFolder_ParseDisplayName(IDesktopFolder,
|
||||||
NULL, NULL, cTestDirW, NULL, &newPIDL, 0);
|
NULL, NULL, cTestDirW, NULL, &newPIDL, 0);
|
||||||
ok((hr == HRESULT_FROM_WIN32(ERROR_FILE_NOT_FOUND)) || (hr == E_FAIL) || (hr == E_INVALIDARG),
|
todo_wine ok(hr == E_INVALIDARG, "ParseDisplayName returned %08x, expected E_INVALIDARG\n", hr);
|
||||||
"ParseDisplayName returned %08x, expected 80070002, E_FAIL or E_INVALIDARG\n", hr);
|
|
||||||
|
|
||||||
/* I thought that perhaps the DesktopFolder's ParseDisplayName would recognize the
|
/* I thought that perhaps the DesktopFolder's ParseDisplayName would recognize the
|
||||||
* path corresponding to CSIDL_PERSONAL and return a CLSID_MyDocuments PIDL. Turns
|
* path corresponding to CSIDL_PERSONAL and return a CLSID_MyDocuments PIDL. Turns
|
||||||
|
@ -397,7 +393,6 @@ static void test_EnumObjects(IShellFolder *iFolder)
|
||||||
flags &= SFGAO_testfor;
|
flags &= SFGAO_testfor;
|
||||||
ok(hr == S_OK, "GetAttributesOf returns %08x\n", hr);
|
ok(hr == S_OK, "GetAttributesOf returns %08x\n", hr);
|
||||||
ok(flags == (attrs[i]) ||
|
ok(flags == (attrs[i]) ||
|
||||||
flags == (attrs[i] & ~SFGAO_FILESYSANCESTOR) || /* Win9x, NT4 */
|
|
||||||
flags == ((attrs[i] & ~SFGAO_CAPABILITYMASK) | SFGAO_VISTA), /* Vista and higher */
|
flags == ((attrs[i] & ~SFGAO_CAPABILITYMASK) | SFGAO_VISTA), /* Vista and higher */
|
||||||
"GetAttributesOf[%i] got %08x, expected %08x\n", i, flags, attrs[i]);
|
"GetAttributesOf[%i] got %08x, expected %08x\n", i, flags, attrs[i]);
|
||||||
|
|
||||||
|
@ -405,9 +400,7 @@ static void test_EnumObjects(IShellFolder *iFolder)
|
||||||
hr = IShellFolder_GetAttributesOf(iFolder, 1, (LPCITEMIDLIST*)(idlArr + i), &flags);
|
hr = IShellFolder_GetAttributesOf(iFolder, 1, (LPCITEMIDLIST*)(idlArr + i), &flags);
|
||||||
flags &= SFGAO_testfor;
|
flags &= SFGAO_testfor;
|
||||||
ok(hr == S_OK, "GetAttributesOf returns %08x\n", hr);
|
ok(hr == S_OK, "GetAttributesOf returns %08x\n", hr);
|
||||||
ok(flags == attrs[i] ||
|
ok(flags == attrs[i], "GetAttributesOf[%i] got %08x, expected %08x\n", i, flags, attrs[i]);
|
||||||
flags == (attrs[i] & ~SFGAO_FILESYSANCESTOR), /* Win9x, NT4 */
|
|
||||||
"GetAttributesOf[%i] got %08x, expected %08x\n", i, flags, attrs[i]);
|
|
||||||
|
|
||||||
flags = ~0u;
|
flags = ~0u;
|
||||||
hr = IShellFolder_GetAttributesOf(iFolder, 1, (LPCITEMIDLIST*)(idlArr + i), &flags);
|
hr = IShellFolder_GetAttributesOf(iFolder, 1, (LPCITEMIDLIST*)(idlArr + i), &flags);
|
||||||
|
@ -468,12 +461,8 @@ static void test_BindToObject(void)
|
||||||
hr = IShellFolder_BindToObject(psfMyComputer, pidlEmpty, NULL, &IID_IShellFolder, (LPVOID*)&psfChild);
|
hr = IShellFolder_BindToObject(psfMyComputer, pidlEmpty, NULL, &IID_IShellFolder, (LPVOID*)&psfChild);
|
||||||
ok (hr == E_INVALIDARG, "MyComputers's BindToObject should fail, when called with empty pidl! hr = %08x\n", hr);
|
ok (hr == E_INVALIDARG, "MyComputers's BindToObject should fail, when called with empty pidl! hr = %08x\n", hr);
|
||||||
|
|
||||||
if (0)
|
|
||||||
{
|
|
||||||
/* this call segfaults on 98SE */
|
|
||||||
hr = IShellFolder_BindToObject(psfMyComputer, NULL, NULL, &IID_IShellFolder, (LPVOID*)&psfChild);
|
hr = IShellFolder_BindToObject(psfMyComputer, NULL, NULL, &IID_IShellFolder, (LPVOID*)&psfChild);
|
||||||
ok (hr == E_INVALIDARG, "MyComputers's BindToObject should fail, when called with NULL pidl! hr = %08x\n", hr);
|
ok (hr == E_INVALIDARG, "MyComputers's BindToObject should fail, when called with NULL pidl! hr = %08x\n", hr);
|
||||||
}
|
|
||||||
|
|
||||||
cChars = GetSystemDirectoryA(szSystemDir, MAX_PATH);
|
cChars = GetSystemDirectoryA(szSystemDir, MAX_PATH);
|
||||||
ok (cChars > 0 && cChars < MAX_PATH, "GetSystemDirectoryA failed! LastError: %u\n", GetLastError());
|
ok (cChars > 0 && cChars < MAX_PATH, "GetSystemDirectoryA failed! LastError: %u\n", GetLastError());
|
||||||
|
@ -500,13 +489,9 @@ if (0)
|
||||||
ok (hr == E_INVALIDARG,
|
ok (hr == E_INVALIDARG,
|
||||||
"FileSystem ShellFolder's BindToObject should fail, when called with empty pidl! hr = %08x\n", hr);
|
"FileSystem ShellFolder's BindToObject should fail, when called with empty pidl! hr = %08x\n", hr);
|
||||||
|
|
||||||
if (0)
|
|
||||||
{
|
|
||||||
/* this call segfaults on 98SE */
|
|
||||||
hr = IShellFolder_BindToObject(psfSystemDir, NULL, NULL, &IID_IShellFolder, (LPVOID*)&psfChild);
|
hr = IShellFolder_BindToObject(psfSystemDir, NULL, NULL, &IID_IShellFolder, (LPVOID*)&psfChild);
|
||||||
ok (hr == E_INVALIDARG,
|
ok (hr == E_INVALIDARG,
|
||||||
"FileSystem ShellFolder's BindToObject should fail, when called with NULL pidl! hr = %08x\n", hr);
|
"FileSystem ShellFolder's BindToObject should fail, when called with NULL pidl! hr = %08x\n", hr);
|
||||||
}
|
|
||||||
|
|
||||||
IShellFolder_Release(psfSystemDir);
|
IShellFolder_Release(psfSystemDir);
|
||||||
|
|
||||||
|
@ -542,17 +527,13 @@ if (0)
|
||||||
{
|
{
|
||||||
IPersist *pp;
|
IPersist *pp;
|
||||||
hr = IShellFolder_QueryInterface(psfChild, &IID_IPersist, (void**)&pp);
|
hr = IShellFolder_QueryInterface(psfChild, &IID_IPersist, (void**)&pp);
|
||||||
ok(hr == S_OK ||
|
ok(hr == S_OK, "Got 0x%08x\n", hr);
|
||||||
broken(hr == E_NOINTERFACE), /* Win9x, NT4, W2K */
|
|
||||||
"Got 0x%08x\n", hr);
|
|
||||||
if(SUCCEEDED(hr))
|
if(SUCCEEDED(hr))
|
||||||
{
|
{
|
||||||
CLSID id;
|
CLSID id;
|
||||||
hr = IPersist_GetClassID(pp, &id);
|
hr = IPersist_GetClassID(pp, &id);
|
||||||
ok(hr == S_OK, "Got 0x%08x\n", hr);
|
ok(hr == S_OK, "Got 0x%08x\n", hr);
|
||||||
/* CLSID_ShellFSFolder on some w2k systems */
|
ok(IsEqualIID(&id, &CLSID_ShellDocObjView), "Unexpected classid %s\n", wine_dbgstr_guid(&id));
|
||||||
ok(IsEqualIID(&id, &CLSID_ShellDocObjView) || broken(IsEqualIID(&id, &CLSID_ShellFSFolder)),
|
|
||||||
"Unexpected classid %s\n", wine_dbgstr_guid(&id));
|
|
||||||
IPersist_Release(pp);
|
IPersist_Release(pp);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -579,9 +560,7 @@ if (0)
|
||||||
{
|
{
|
||||||
hr = IShellFolder_BindToObject(psfDesktop, pidl, NULL, &IID_IShellFolder, (void**)&psfChild);
|
hr = IShellFolder_BindToObject(psfDesktop, pidl, NULL, &IID_IShellFolder, (void**)&psfChild);
|
||||||
ok(hr == E_FAIL || /* Vista+ */
|
ok(hr == E_FAIL || /* Vista+ */
|
||||||
hr == HRESULT_FROM_WIN32(ERROR_FILE_NOT_FOUND) || /* XP, W2K3 */
|
hr == HRESULT_FROM_WIN32(ERROR_FILE_NOT_FOUND), /* XP, W2K3 */
|
||||||
hr == E_INVALIDARG || /* W2K item in top dir */
|
|
||||||
broken(hr == S_OK), /* Win9x, NT4, W2K */
|
|
||||||
"Got 0x%08x\n", hr);
|
"Got 0x%08x\n", hr);
|
||||||
if(SUCCEEDED(hr)) IShellFolder_Release(psfChild);
|
if(SUCCEEDED(hr)) IShellFolder_Release(psfChild);
|
||||||
ILFree(pidl);
|
ILFree(pidl);
|
||||||
|
@ -605,9 +584,7 @@ if (0)
|
||||||
{
|
{
|
||||||
hr = IShellFolder_BindToObject(psfDesktop, pidl, NULL, &IID_IShellFolder, (void**)&psfChild);
|
hr = IShellFolder_BindToObject(psfDesktop, pidl, NULL, &IID_IShellFolder, (void**)&psfChild);
|
||||||
ok(hr == E_FAIL || /* Vista+ */
|
ok(hr == E_FAIL || /* Vista+ */
|
||||||
hr == HRESULT_FROM_WIN32(ERROR_FILE_NOT_FOUND) || /* XP, W2K3 */
|
hr == HRESULT_FROM_WIN32(ERROR_FILE_NOT_FOUND), /* XP, W2K3 */
|
||||||
hr == E_INVALIDARG || /* W2K item in top dir */
|
|
||||||
broken(hr == S_OK), /* Win9x, NT4, W2K */
|
|
||||||
"Got 0x%08x\n", hr);
|
"Got 0x%08x\n", hr);
|
||||||
if(SUCCEEDED(hr)) IShellFolder_Release(psfChild);
|
if(SUCCEEDED(hr)) IShellFolder_Release(psfChild);
|
||||||
ILFree(pidl);
|
ILFree(pidl);
|
||||||
|
@ -726,10 +703,7 @@ static void test_GetDisplayName(void)
|
||||||
}
|
}
|
||||||
|
|
||||||
pidlLast = ILFindLastID(pidlTestFile);
|
pidlLast = ILFindLastID(pidlTestFile);
|
||||||
ok(pidlLast->mkid.cb >=76 ||
|
ok(pidlLast->mkid.cb >= 76, "Expected pidl length of at least 76, got %d.\n", pidlLast->mkid.cb);
|
||||||
broken(pidlLast->mkid.cb == 28) || /* W2K */
|
|
||||||
broken(pidlLast->mkid.cb == 40), /* Win9x, WinME */
|
|
||||||
"Expected pidl length of at least 76, got %d.\n", pidlLast->mkid.cb);
|
|
||||||
if (pidlLast->mkid.cb >= 28) {
|
if (pidlLast->mkid.cb >= 28) {
|
||||||
ok(!lstrcmpA((CHAR*)&pidlLast->mkid.abID[12], szFileName),
|
ok(!lstrcmpA((CHAR*)&pidlLast->mkid.abID[12], szFileName),
|
||||||
"Filename should be stored as ansi-string at this position!\n");
|
"Filename should be stored as ansi-string at this position!\n");
|
||||||
|
@ -747,8 +721,7 @@ static void test_GetDisplayName(void)
|
||||||
*/
|
*/
|
||||||
hr = IShellFolder_BindToObject(psfDesktop, pidlTestFile, NULL, &IID_IUnknown, (VOID**)&psfFile);
|
hr = IShellFolder_BindToObject(psfDesktop, pidlTestFile, NULL, &IID_IUnknown, (VOID**)&psfFile);
|
||||||
ok (hr == HRESULT_FROM_WIN32(ERROR_FILE_NOT_FOUND) ||
|
ok (hr == HRESULT_FROM_WIN32(ERROR_FILE_NOT_FOUND) ||
|
||||||
hr == E_NOTIMPL || /* Vista */
|
hr == E_NOTIMPL, /* Vista */
|
||||||
broken(hr == S_OK), /* Win9x, W2K */
|
|
||||||
"hr = %08x\n", hr);
|
"hr = %08x\n", hr);
|
||||||
if (hr == S_OK) {
|
if (hr == S_OK) {
|
||||||
IUnknown_Release(psfFile);
|
IUnknown_Release(psfFile);
|
||||||
|
@ -789,7 +762,8 @@ static void test_GetDisplayName(void)
|
||||||
|
|
||||||
/* SHBindToParent fails, if called with a NULL PIDL. */
|
/* SHBindToParent fails, if called with a NULL PIDL. */
|
||||||
hr = SHBindToParent(NULL, &IID_IShellFolder, (void **)&psfPersonal, &pidlLast);
|
hr = SHBindToParent(NULL, &IID_IShellFolder, (void **)&psfPersonal, &pidlLast);
|
||||||
ok (hr != S_OK, "SHBindToParent(NULL) should fail!\n");
|
ok (hr == E_INVALIDARG || broken(hr == E_OUTOFMEMORY) /* XP */,
|
||||||
|
"SHBindToParent(NULL) should fail! hr = %08x\n", hr);
|
||||||
|
|
||||||
/* But it succeeds with an empty PIDL. */
|
/* But it succeeds with an empty PIDL. */
|
||||||
hr = SHBindToParent(pidlEmpty, &IID_IShellFolder, (void **)&psfPersonal, &pidlLast);
|
hr = SHBindToParent(pidlEmpty, &IID_IShellFolder, (void **)&psfPersonal, &pidlLast);
|
||||||
|
@ -863,8 +837,7 @@ static void test_CallForAttributes(void)
|
||||||
|
|
||||||
hr = IShellFolder_ParseDisplayName(psfDesktop, NULL, NULL, wszMyDocuments, NULL,
|
hr = IShellFolder_ParseDisplayName(psfDesktop, NULL, NULL, wszMyDocuments, NULL,
|
||||||
&pidlMyDocuments, NULL);
|
&pidlMyDocuments, NULL);
|
||||||
ok (hr == S_OK ||
|
ok (hr == S_OK,
|
||||||
broken(hr == E_INVALIDARG), /* Win95, NT4 */
|
|
||||||
"Desktop's ParseDisplayName failed to parse MyDocuments's CLSID! hr = %08x\n", hr);
|
"Desktop's ParseDisplayName failed to parse MyDocuments's CLSID! hr = %08x\n", hr);
|
||||||
if (hr != S_OK) {
|
if (hr != S_OK) {
|
||||||
IShellFolder_Release(psfDesktop);
|
IShellFolder_Release(psfDesktop);
|
||||||
|
@ -959,31 +932,10 @@ static void test_GetAttributesOf(void)
|
||||||
LPCITEMIDLIST pidlEmpty = (LPCITEMIDLIST)&emptyitem;
|
LPCITEMIDLIST pidlEmpty = (LPCITEMIDLIST)&emptyitem;
|
||||||
LPITEMIDLIST pidlMyComputer;
|
LPITEMIDLIST pidlMyComputer;
|
||||||
DWORD dwFlags;
|
DWORD dwFlags;
|
||||||
static const DWORD desktopFlags[] = {
|
static const DWORD desktopFlags = SFGAO_STORAGE | SFGAO_HASPROPSHEET | SFGAO_STORAGEANCESTOR |
|
||||||
/* WinXP */
|
SFGAO_FILESYSANCESTOR | SFGAO_FOLDER | SFGAO_FILESYSTEM | SFGAO_HASSUBFOLDER;
|
||||||
SFGAO_STORAGE | SFGAO_HASPROPSHEET | SFGAO_STORAGEANCESTOR | SFGAO_FILESYSANCESTOR |
|
static const DWORD myComputerFlags = SFGAO_CANRENAME | SFGAO_CANDELETE | SFGAO_HASPROPSHEET |
|
||||||
SFGAO_FOLDER | SFGAO_FILESYSTEM | SFGAO_HASSUBFOLDER,
|
SFGAO_DROPTARGET | SFGAO_FILESYSANCESTOR | SFGAO_FOLDER | SFGAO_HASSUBFOLDER;
|
||||||
/* Win2k */
|
|
||||||
SFGAO_CANRENAME | SFGAO_HASPROPSHEET | SFGAO_STREAM | SFGAO_FILESYSANCESTOR |
|
|
||||||
SFGAO_FOLDER | SFGAO_FILESYSTEM | SFGAO_HASSUBFOLDER,
|
|
||||||
/* WinMe, Win9x, WinNT*/
|
|
||||||
SFGAO_CANRENAME | SFGAO_HASPROPSHEET | SFGAO_FILESYSANCESTOR |
|
|
||||||
SFGAO_FOLDER | SFGAO_FILESYSTEM | SFGAO_HASSUBFOLDER
|
|
||||||
};
|
|
||||||
static const DWORD myComputerFlags[] = {
|
|
||||||
/* WinXP */
|
|
||||||
SFGAO_CANRENAME | SFGAO_CANDELETE | SFGAO_HASPROPSHEET | SFGAO_DROPTARGET |
|
|
||||||
SFGAO_FILESYSANCESTOR | SFGAO_FOLDER | SFGAO_HASSUBFOLDER,
|
|
||||||
/* Win2k */
|
|
||||||
SFGAO_CANRENAME | SFGAO_HASPROPSHEET | SFGAO_DROPTARGET | SFGAO_STREAM |
|
|
||||||
SFGAO_FILESYSANCESTOR | SFGAO_FOLDER | SFGAO_HASSUBFOLDER,
|
|
||||||
/* WinMe, Win9x, WinNT */
|
|
||||||
SFGAO_CANRENAME | SFGAO_HASPROPSHEET | SFGAO_DROPTARGET | SFGAO_FILESYSANCESTOR |
|
|
||||||
SFGAO_FOLDER | SFGAO_HASSUBFOLDER,
|
|
||||||
/* Win95, WinNT when queried directly */
|
|
||||||
SFGAO_CANLINK | SFGAO_HASPROPSHEET | SFGAO_DROPTARGET | SFGAO_FILESYSANCESTOR |
|
|
||||||
SFGAO_FOLDER | SFGAO_FILESYSTEM | SFGAO_HASSUBFOLDER
|
|
||||||
};
|
|
||||||
WCHAR wszMyComputer[] = {
|
WCHAR wszMyComputer[] = {
|
||||||
':',':','{','2','0','D','0','4','F','E','0','-','3','A','E','A','-','1','0','6','9','-',
|
':',':','{','2','0','D','0','4','F','E','0','-','3','A','E','A','-','1','0','6','9','-',
|
||||||
'A','2','D','8','-','0','8','0','0','2','B','3','0','3','0','9','D','}',0 };
|
'A','2','D','8','-','0','8','0','0','2','B','3','0','3','0','9','D','}',0 };
|
||||||
|
@ -992,8 +944,7 @@ static void test_GetAttributesOf(void)
|
||||||
static WCHAR cTestDirW[] = {'t','e','s','t','d','i','r',0};
|
static WCHAR cTestDirW[] = {'t','e','s','t','d','i','r',0};
|
||||||
IShellFolder *IDesktopFolder, *testIShellFolder;
|
IShellFolder *IDesktopFolder, *testIShellFolder;
|
||||||
ITEMIDLIST *newPIDL;
|
ITEMIDLIST *newPIDL;
|
||||||
int len, i;
|
int len;
|
||||||
BOOL foundFlagsMatch;
|
|
||||||
|
|
||||||
hr = SHGetDesktopFolder(&psfDesktop);
|
hr = SHGetDesktopFolder(&psfDesktop);
|
||||||
ok (hr == S_OK, "SHGetDesktopFolder failed! hr = %08x\n", hr);
|
ok (hr == S_OK, "SHGetDesktopFolder failed! hr = %08x\n", hr);
|
||||||
|
@ -1003,25 +954,13 @@ static void test_GetAttributesOf(void)
|
||||||
dwFlags = 0xffffffff;
|
dwFlags = 0xffffffff;
|
||||||
hr = IShellFolder_GetAttributesOf(psfDesktop, 1, &pidlEmpty, &dwFlags);
|
hr = IShellFolder_GetAttributesOf(psfDesktop, 1, &pidlEmpty, &dwFlags);
|
||||||
ok (hr == S_OK, "Desktop->GetAttributesOf(empty pidl) failed! hr = %08x\n", hr);
|
ok (hr == S_OK, "Desktop->GetAttributesOf(empty pidl) failed! hr = %08x\n", hr);
|
||||||
for (i = 0, foundFlagsMatch = FALSE; !foundFlagsMatch &&
|
ok (dwFlags == desktopFlags, "Wrong Desktop attributes: %08x\n", dwFlags);
|
||||||
i < sizeof(desktopFlags) / sizeof(desktopFlags[0]); i++)
|
|
||||||
{
|
|
||||||
if (desktopFlags[i] == dwFlags)
|
|
||||||
foundFlagsMatch = TRUE;
|
|
||||||
}
|
|
||||||
ok (foundFlagsMatch, "Wrong Desktop attributes: %08x\n", dwFlags);
|
|
||||||
|
|
||||||
/* .. or with no itemidlist at all. */
|
/* .. or with no itemidlist at all. */
|
||||||
dwFlags = 0xffffffff;
|
dwFlags = 0xffffffff;
|
||||||
hr = IShellFolder_GetAttributesOf(psfDesktop, 0, NULL, &dwFlags);
|
hr = IShellFolder_GetAttributesOf(psfDesktop, 0, NULL, &dwFlags);
|
||||||
ok (hr == S_OK, "Desktop->GetAttributesOf(NULL) failed! hr = %08x\n", hr);
|
ok (hr == S_OK, "Desktop->GetAttributesOf(NULL) failed! hr = %08x\n", hr);
|
||||||
for (i = 0, foundFlagsMatch = FALSE; !foundFlagsMatch &&
|
ok (dwFlags == desktopFlags, "Wrong Desktop attributes: %08x\n", dwFlags);
|
||||||
i < sizeof(desktopFlags) / sizeof(desktopFlags[0]); i++)
|
|
||||||
{
|
|
||||||
if (desktopFlags[i] == dwFlags)
|
|
||||||
foundFlagsMatch = TRUE;
|
|
||||||
}
|
|
||||||
ok (foundFlagsMatch, "Wrong Desktop attributes: %08x\n", dwFlags);
|
|
||||||
|
|
||||||
/* Testing the attributes of the MyComputer shellfolder */
|
/* Testing the attributes of the MyComputer shellfolder */
|
||||||
hr = IShellFolder_ParseDisplayName(psfDesktop, NULL, NULL, wszMyComputer, NULL, &pidlMyComputer, NULL);
|
hr = IShellFolder_ParseDisplayName(psfDesktop, NULL, NULL, wszMyComputer, NULL, &pidlMyComputer, NULL);
|
||||||
|
@ -1037,14 +976,8 @@ static void test_GetAttributesOf(void)
|
||||||
dwFlags = 0xffffffff;
|
dwFlags = 0xffffffff;
|
||||||
hr = IShellFolder_GetAttributesOf(psfDesktop, 1, (LPCITEMIDLIST*)&pidlMyComputer, &dwFlags);
|
hr = IShellFolder_GetAttributesOf(psfDesktop, 1, (LPCITEMIDLIST*)&pidlMyComputer, &dwFlags);
|
||||||
ok (hr == S_OK, "Desktop->GetAttributesOf(MyComputer) failed! hr = %08x\n", hr);
|
ok (hr == S_OK, "Desktop->GetAttributesOf(MyComputer) failed! hr = %08x\n", hr);
|
||||||
for (i = 0, foundFlagsMatch = FALSE; !foundFlagsMatch &&
|
|
||||||
i < sizeof(myComputerFlags) / sizeof(myComputerFlags[0]); i++)
|
|
||||||
{
|
|
||||||
if ((myComputerFlags[i] | SFGAO_CANLINK) == dwFlags)
|
|
||||||
foundFlagsMatch = TRUE;
|
|
||||||
}
|
|
||||||
todo_wine
|
todo_wine
|
||||||
ok (foundFlagsMatch, "Wrong MyComputer attributes: %08x\n", dwFlags);
|
ok (dwFlags == (myComputerFlags | SFGAO_CANLINK), "Wrong MyComputer attributes: %08x\n", dwFlags);
|
||||||
|
|
||||||
hr = IShellFolder_BindToObject(psfDesktop, pidlMyComputer, NULL, &IID_IShellFolder, (LPVOID*)&psfMyComputer);
|
hr = IShellFolder_BindToObject(psfDesktop, pidlMyComputer, NULL, &IID_IShellFolder, (LPVOID*)&psfMyComputer);
|
||||||
ok (hr == S_OK, "Desktop failed to bind to MyComputer object! hr = %08x\n", hr);
|
ok (hr == S_OK, "Desktop failed to bind to MyComputer object! hr = %08x\n", hr);
|
||||||
|
@ -1054,21 +987,13 @@ static void test_GetAttributesOf(void)
|
||||||
|
|
||||||
hr = IShellFolder_GetAttributesOf(psfMyComputer, 1, &pidlEmpty, &dwFlags);
|
hr = IShellFolder_GetAttributesOf(psfMyComputer, 1, &pidlEmpty, &dwFlags);
|
||||||
todo_wine
|
todo_wine
|
||||||
ok (hr == E_INVALIDARG ||
|
ok (hr == E_INVALIDARG, "MyComputer->GetAttributesOf(empty pidl) should fail! hr = %08x\n", hr);
|
||||||
broken(hr == S_OK), /* W2K and earlier */
|
|
||||||
"MyComputer->GetAttributesOf(empty pidl) should fail! hr = %08x\n", hr);
|
|
||||||
|
|
||||||
dwFlags = 0xffffffff;
|
dwFlags = 0xffffffff;
|
||||||
hr = IShellFolder_GetAttributesOf(psfMyComputer, 0, NULL, &dwFlags);
|
hr = IShellFolder_GetAttributesOf(psfMyComputer, 0, NULL, &dwFlags);
|
||||||
ok (hr == S_OK, "MyComputer->GetAttributesOf(NULL) failed! hr = %08x\n", hr);
|
ok (hr == S_OK, "MyComputer->GetAttributesOf(NULL) failed! hr = %08x\n", hr);
|
||||||
for (i = 0, foundFlagsMatch = FALSE; !foundFlagsMatch &&
|
|
||||||
i < sizeof(myComputerFlags) / sizeof(myComputerFlags[0]); i++)
|
|
||||||
{
|
|
||||||
if (myComputerFlags[i] == dwFlags)
|
|
||||||
foundFlagsMatch = TRUE;
|
|
||||||
}
|
|
||||||
todo_wine
|
todo_wine
|
||||||
ok (foundFlagsMatch, "Wrong MyComputer attributes: %08x\n", dwFlags);
|
ok (dwFlags == myComputerFlags, "Wrong MyComputer attributes: %08x\n", dwFlags);
|
||||||
|
|
||||||
IShellFolder_Release(psfMyComputer);
|
IShellFolder_Release(psfMyComputer);
|
||||||
|
|
||||||
|
@ -1168,15 +1093,6 @@ static void test_SHGetPathFromIDList(void)
|
||||||
ok(result, "SHGetSpecialFolderPathW(CSIDL_DESKTOP) failed! Last error: %u\n", GetLastError());
|
ok(result, "SHGetSpecialFolderPathW(CSIDL_DESKTOP) failed! Last error: %u\n", GetLastError());
|
||||||
if (!result) return;
|
if (!result) return;
|
||||||
|
|
||||||
/* Check if we are on Win9x */
|
|
||||||
SetLastError(0xdeadbeef);
|
|
||||||
lstrcmpiW(wszDesktop, wszDesktop);
|
|
||||||
if (GetLastError() == ERROR_CALL_NOT_IMPLEMENTED)
|
|
||||||
{
|
|
||||||
win_skip("Most W-calls are not implemented\n");
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
|
|
||||||
result = SHGetPathFromIDListW(pidlEmpty, wszPath);
|
result = SHGetPathFromIDListW(pidlEmpty, wszPath);
|
||||||
ok(result, "SHGetPathFromIDListW failed! Last error: %u\n", GetLastError());
|
ok(result, "SHGetPathFromIDListW failed! Last error: %u\n", GetLastError());
|
||||||
if (!result) return;
|
if (!result) return;
|
||||||
|
@ -1381,9 +1297,7 @@ static HRESULT WINAPI InitPropertyBag_IPropertyBag_Read(IPropertyBag *iface, LPC
|
||||||
'C','L','S','I','D',0 };
|
'C','L','S','I','D',0 };
|
||||||
|
|
||||||
if (!lstrcmpW(pszPropName, wszTargetSpecialFolder)) {
|
if (!lstrcmpW(pszPropName, wszTargetSpecialFolder)) {
|
||||||
ok(V_VT(pVar) == VT_I4 ||
|
ok(V_VT(pVar) == VT_I4, "Wrong variant type for 'TargetSpecialFolder' property!\n");
|
||||||
broken(V_VT(pVar) == VT_BSTR), /* Win2k */
|
|
||||||
"Wrong variant type for 'TargetSpecialFolder' property!\n");
|
|
||||||
return E_INVALIDARG;
|
return E_INVALIDARG;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -1397,9 +1311,7 @@ static HRESULT WINAPI InitPropertyBag_IPropertyBag_Read(IPropertyBag *iface, LPC
|
||||||
WCHAR wszPath[MAX_PATH];
|
WCHAR wszPath[MAX_PATH];
|
||||||
BOOL result;
|
BOOL result;
|
||||||
|
|
||||||
ok(V_VT(pVar) == VT_BSTR ||
|
ok(V_VT(pVar) == VT_BSTR, "Wrong variant type for 'Target' property!\n");
|
||||||
broken(V_VT(pVar) == VT_EMPTY), /* Win2k */
|
|
||||||
"Wrong variant type for 'Target' property!\n");
|
|
||||||
if (V_VT(pVar) != VT_BSTR) return E_INVALIDARG;
|
if (V_VT(pVar) != VT_BSTR) return E_INVALIDARG;
|
||||||
|
|
||||||
result = SHGetSpecialFolderPathW(NULL, wszPath, CSIDL_DESKTOPDIRECTORY, FALSE);
|
result = SHGetSpecialFolderPathW(NULL, wszPath, CSIDL_DESKTOPDIRECTORY, FALSE);
|
||||||
|
@ -1725,13 +1637,10 @@ static void test_ITEMIDLIST_format(void) {
|
||||||
* current habit of storing the long filename here, which seems to work
|
* current habit of storing the long filename here, which seems to work
|
||||||
* just fine. */
|
* just fine. */
|
||||||
todo_wine
|
todo_wine
|
||||||
ok(pidlFile->mkid.abID[18] == '~' ||
|
ok(pidlFile->mkid.abID[18] == '~', "Should be derived 8.3 name!\n");
|
||||||
broken(pidlFile->mkid.abID[34] == '~'), /* Win2k */
|
|
||||||
"Should be derived 8.3 name!\n");
|
|
||||||
|
|
||||||
if (i == 0) /* First file name has an even number of chars. No need for alignment. */
|
if (i == 0) /* First file name has an even number of chars. No need for alignment. */
|
||||||
ok(pidlFile->mkid.abID[12 + strlen(szFile) + 1] != '\0' ||
|
ok(pidlFile->mkid.abID[12 + strlen(szFile) + 1] != '\0',
|
||||||
broken(pidlFile->mkid.cb == 2 + 12 + strlen(szFile) + 1 + 1), /* Win2k */
|
|
||||||
"Alignment byte, where there shouldn't be!\n");
|
"Alignment byte, where there shouldn't be!\n");
|
||||||
|
|
||||||
if (i == 1) /* Second file name has an uneven number of chars => alignment byte */
|
if (i == 1) /* Second file name has an uneven number of chars => alignment byte */
|
||||||
|
@ -1741,9 +1650,7 @@ static void test_ITEMIDLIST_format(void) {
|
||||||
/* The offset of the FileStructW member is stored as a WORD at the end of the pidl. */
|
/* The offset of the FileStructW member is stored as a WORD at the end of the pidl. */
|
||||||
cbOffset = *(WORD*)(((LPBYTE)pidlFile)+pidlFile->mkid.cb-sizeof(WORD));
|
cbOffset = *(WORD*)(((LPBYTE)pidlFile)+pidlFile->mkid.cb-sizeof(WORD));
|
||||||
ok ((cbOffset >= sizeof(struct FileStructA) &&
|
ok ((cbOffset >= sizeof(struct FileStructA) &&
|
||||||
cbOffset <= pidlFile->mkid.cb - sizeof(struct FileStructW)) ||
|
cbOffset <= pidlFile->mkid.cb - sizeof(struct FileStructW)),
|
||||||
broken(pidlFile->mkid.cb == 2 + 12 + strlen(szFile) + 1 + 1) || /* Win2k on short names */
|
|
||||||
broken(pidlFile->mkid.cb == 2 + 12 + strlen(szFile) + 1 + 12 + 1), /* Win2k on long names */
|
|
||||||
"Wrong offset value (%d) stored at the end of the PIDL\n", cbOffset);
|
"Wrong offset value (%d) stored at the end of the PIDL\n", cbOffset);
|
||||||
|
|
||||||
if (cbOffset >= sizeof(struct FileStructA) &&
|
if (cbOffset >= sizeof(struct FileStructA) &&
|
||||||
|
@ -4392,7 +4299,7 @@ static void test_desktop_IPersist(void)
|
||||||
ok(hr == S_OK, "failed %08x\n", hr);
|
ok(hr == S_OK, "failed %08x\n", hr);
|
||||||
|
|
||||||
hr = IShellFolder_QueryInterface(desktop, &IID_IPersist, (void**)&persist);
|
hr = IShellFolder_QueryInterface(desktop, &IID_IPersist, (void**)&persist);
|
||||||
ok(hr == S_OK || broken(hr == E_NOINTERFACE) /* NT4, W9X */, "failed %08x\n", hr);
|
ok(hr == S_OK, "failed %08x\n", hr);
|
||||||
|
|
||||||
if (hr == S_OK)
|
if (hr == S_OK)
|
||||||
{
|
{
|
||||||
|
@ -4458,7 +4365,7 @@ static void test_GetUIObject(void)
|
||||||
CreateFilesFolders();
|
CreateFilesFolders();
|
||||||
|
|
||||||
hr = IShellFolder_ParseDisplayName(psf_desktop, NULL, NULL, path, NULL, &pidl, 0);
|
hr = IShellFolder_ParseDisplayName(psf_desktop, NULL, NULL, path, NULL, &pidl, 0);
|
||||||
ok(hr == S_OK || broken(hr == E_FAIL) /* WinME */, "Got 0x%08x\n", hr);
|
ok(hr == S_OK, "Got 0x%08x\n", hr);
|
||||||
if(SUCCEEDED(hr))
|
if(SUCCEEDED(hr))
|
||||||
{
|
{
|
||||||
IShellFolder *psf;
|
IShellFolder *psf;
|
||||||
|
@ -4730,28 +4637,22 @@ static void test_ParseDisplayNamePBC(void)
|
||||||
|
|
||||||
/* fails on unknown dir with no IBindCtx */
|
/* fails on unknown dir with no IBindCtx */
|
||||||
hres = IShellFolder_ParseDisplayName(psf, NULL, NULL, adirW, NULL, &pidl, NULL);
|
hres = IShellFolder_ParseDisplayName(psf, NULL, NULL, adirW, NULL, &pidl, NULL);
|
||||||
ok(hres == exp_err || broken(hres == E_FAIL) /* NT4 */,
|
ok(hres == exp_err, "ParseDisplayName failed with wrong error: 0x%08x\n", hres);
|
||||||
"ParseDisplayName failed with wrong error: 0x%08x\n", hres);
|
|
||||||
hres = IShellFolder_ParseDisplayName(psf, NULL, NULL, afileW, NULL, &pidl, NULL);
|
hres = IShellFolder_ParseDisplayName(psf, NULL, NULL, afileW, NULL, &pidl, NULL);
|
||||||
ok(hres == exp_err || broken(hres == E_FAIL) /* NT4 */,
|
ok(hres == exp_err, "ParseDisplayName failed with wrong error: 0x%08x\n", hres);
|
||||||
"ParseDisplayName failed with wrong error: 0x%08x\n", hres);
|
|
||||||
hres = IShellFolder_ParseDisplayName(psf, NULL, NULL, afile2W, NULL, &pidl, NULL);
|
hres = IShellFolder_ParseDisplayName(psf, NULL, NULL, afile2W, NULL, &pidl, NULL);
|
||||||
ok(hres == exp_err || broken(hres == E_FAIL) /* NT4 */,
|
ok(hres == exp_err, "ParseDisplayName failed with wrong error: 0x%08x\n", hres);
|
||||||
"ParseDisplayName failed with wrong error: 0x%08x\n", hres);
|
|
||||||
|
|
||||||
/* fails on unknown dir with IBindCtx with no IFileSystemBindData */
|
/* fails on unknown dir with IBindCtx with no IFileSystemBindData */
|
||||||
hres = CreateBindCtx(0, &pbc);
|
hres = CreateBindCtx(0, &pbc);
|
||||||
ok(hres == S_OK, "CreateBindCtx failed: 0x%08x\n", hres);
|
ok(hres == S_OK, "CreateBindCtx failed: 0x%08x\n", hres);
|
||||||
|
|
||||||
hres = IShellFolder_ParseDisplayName(psf, NULL, pbc, adirW, NULL, &pidl, NULL);
|
hres = IShellFolder_ParseDisplayName(psf, NULL, pbc, adirW, NULL, &pidl, NULL);
|
||||||
ok(hres == exp_err || broken(hres == E_FAIL) /* NT4 */,
|
ok(hres == exp_err, "ParseDisplayName failed with wrong error: 0x%08x\n", hres);
|
||||||
"ParseDisplayName failed with wrong error: 0x%08x\n", hres);
|
|
||||||
hres = IShellFolder_ParseDisplayName(psf, NULL, pbc, afileW, NULL, &pidl, NULL);
|
hres = IShellFolder_ParseDisplayName(psf, NULL, pbc, afileW, NULL, &pidl, NULL);
|
||||||
ok(hres == exp_err || broken(hres == E_FAIL) /* NT4 */,
|
ok(hres == exp_err, "ParseDisplayName failed with wrong error: 0x%08x\n", hres);
|
||||||
"ParseDisplayName failed with wrong error: 0x%08x\n", hres);
|
|
||||||
hres = IShellFolder_ParseDisplayName(psf, NULL, pbc, afile2W, NULL, &pidl, NULL);
|
hres = IShellFolder_ParseDisplayName(psf, NULL, pbc, afile2W, NULL, &pidl, NULL);
|
||||||
ok(hres == exp_err || broken(hres == E_FAIL) /* NT4 */,
|
ok(hres == exp_err, "ParseDisplayName failed with wrong error: 0x%08x\n", hres);
|
||||||
"ParseDisplayName failed with wrong error: 0x%08x\n", hres);
|
|
||||||
|
|
||||||
/* unknown dir with IBindCtx with IFileSystemBindData */
|
/* unknown dir with IBindCtx with IFileSystemBindData */
|
||||||
hres = IBindCtx_RegisterObjectParam(pbc, wFileSystemBindData, (IUnknown*)&fsbd);
|
hres = IBindCtx_RegisterObjectParam(pbc, wFileSystemBindData, (IUnknown*)&fsbd);
|
||||||
|
@ -4761,24 +4662,21 @@ static void test_ParseDisplayNamePBC(void)
|
||||||
pidl = (ITEMIDLIST*)0xdeadbeef;
|
pidl = (ITEMIDLIST*)0xdeadbeef;
|
||||||
fsbdVtbl.GetFindData = fsbd_GetFindData_fail;
|
fsbdVtbl.GetFindData = fsbd_GetFindData_fail;
|
||||||
hres = IShellFolder_ParseDisplayName(psf, NULL, pbc, adirW, NULL, &pidl, NULL);
|
hres = IShellFolder_ParseDisplayName(psf, NULL, pbc, adirW, NULL, &pidl, NULL);
|
||||||
ok(hres == S_OK || broken(hres == E_FAIL) /* NT4 */,
|
ok(hres == S_OK, "ParseDisplayName failed: 0x%08x\n", hres);
|
||||||
"ParseDisplayName failed: 0x%08x\n", hres);
|
|
||||||
if(SUCCEEDED(hres)){
|
if(SUCCEEDED(hres)){
|
||||||
verify_pidl(pidl, adirW);
|
verify_pidl(pidl, adirW);
|
||||||
ILFree(pidl);
|
ILFree(pidl);
|
||||||
}
|
}
|
||||||
|
|
||||||
hres = IShellFolder_ParseDisplayName(psf, NULL, pbc, afileW, NULL, &pidl, NULL);
|
hres = IShellFolder_ParseDisplayName(psf, NULL, pbc, afileW, NULL, &pidl, NULL);
|
||||||
ok(hres == S_OK || broken(hres == E_FAIL) /* NT4 */,
|
ok(hres == S_OK, "ParseDisplayName failed: 0x%08x\n", hres);
|
||||||
"ParseDisplayName failed: 0x%08x\n", hres);
|
|
||||||
if(SUCCEEDED(hres)){
|
if(SUCCEEDED(hres)){
|
||||||
verify_pidl(pidl, afileW);
|
verify_pidl(pidl, afileW);
|
||||||
ILFree(pidl);
|
ILFree(pidl);
|
||||||
}
|
}
|
||||||
|
|
||||||
hres = IShellFolder_ParseDisplayName(psf, NULL, pbc, afile2W, NULL, &pidl, NULL);
|
hres = IShellFolder_ParseDisplayName(psf, NULL, pbc, afile2W, NULL, &pidl, NULL);
|
||||||
ok(hres == S_OK || broken(hres == E_FAIL) /* NT4 */,
|
ok(hres == S_OK, "ParseDisplayName failed: 0x%08x\n", hres);
|
||||||
"ParseDisplayName failed: 0x%08x\n", hres);
|
|
||||||
if(SUCCEEDED(hres)){
|
if(SUCCEEDED(hres)){
|
||||||
verify_pidl(pidl, afile2W);
|
verify_pidl(pidl, afile2W);
|
||||||
ILFree(pidl);
|
ILFree(pidl);
|
||||||
|
@ -4788,24 +4686,21 @@ static void test_ParseDisplayNamePBC(void)
|
||||||
pidl = (ITEMIDLIST*)0xdeadbeef;
|
pidl = (ITEMIDLIST*)0xdeadbeef;
|
||||||
fsbdVtbl.GetFindData = fsbd_GetFindData_nul;
|
fsbdVtbl.GetFindData = fsbd_GetFindData_nul;
|
||||||
hres = IShellFolder_ParseDisplayName(psf, NULL, pbc, adirW, NULL, &pidl, NULL);
|
hres = IShellFolder_ParseDisplayName(psf, NULL, pbc, adirW, NULL, &pidl, NULL);
|
||||||
ok(hres == S_OK || broken(hres == E_FAIL) /* NT4 */,
|
ok(hres == S_OK, "ParseDisplayName failed: 0x%08x\n", hres);
|
||||||
"ParseDisplayName failed: 0x%08x\n", hres);
|
|
||||||
if(SUCCEEDED(hres)){
|
if(SUCCEEDED(hres)){
|
||||||
verify_pidl(pidl, adirW);
|
verify_pidl(pidl, adirW);
|
||||||
ILFree(pidl);
|
ILFree(pidl);
|
||||||
}
|
}
|
||||||
|
|
||||||
hres = IShellFolder_ParseDisplayName(psf, NULL, pbc, afileW, NULL, &pidl, NULL);
|
hres = IShellFolder_ParseDisplayName(psf, NULL, pbc, afileW, NULL, &pidl, NULL);
|
||||||
ok(hres == S_OK || broken(hres == E_FAIL) /* NT4 */,
|
ok(hres == S_OK, "ParseDisplayName failed: 0x%08x\n", hres);
|
||||||
"ParseDisplayName failed: 0x%08x\n", hres);
|
|
||||||
if(SUCCEEDED(hres)){
|
if(SUCCEEDED(hres)){
|
||||||
verify_pidl(pidl, afileW);
|
verify_pidl(pidl, afileW);
|
||||||
ILFree(pidl);
|
ILFree(pidl);
|
||||||
}
|
}
|
||||||
|
|
||||||
hres = IShellFolder_ParseDisplayName(psf, NULL, pbc, afile2W, NULL, &pidl, NULL);
|
hres = IShellFolder_ParseDisplayName(psf, NULL, pbc, afile2W, NULL, &pidl, NULL);
|
||||||
ok(hres == S_OK || broken(hres == E_FAIL) /* NT4 */,
|
ok(hres == S_OK, "ParseDisplayName failed: 0x%08x\n", hres);
|
||||||
"ParseDisplayName failed: 0x%08x\n", hres);
|
|
||||||
if(SUCCEEDED(hres)){
|
if(SUCCEEDED(hres)){
|
||||||
verify_pidl(pidl, afile2W);
|
verify_pidl(pidl, afile2W);
|
||||||
ILFree(pidl);
|
ILFree(pidl);
|
||||||
|
@ -4815,24 +4710,21 @@ static void test_ParseDisplayNamePBC(void)
|
||||||
pidl = (ITEMIDLIST*)0xdeadbeef;
|
pidl = (ITEMIDLIST*)0xdeadbeef;
|
||||||
fsbdVtbl.GetFindData = fsbd_GetFindData_junk;
|
fsbdVtbl.GetFindData = fsbd_GetFindData_junk;
|
||||||
hres = IShellFolder_ParseDisplayName(psf, NULL, pbc, adirW, NULL, &pidl, NULL);
|
hres = IShellFolder_ParseDisplayName(psf, NULL, pbc, adirW, NULL, &pidl, NULL);
|
||||||
ok(hres == S_OK || broken(hres == E_FAIL) /* NT4 */,
|
ok(hres == S_OK, "ParseDisplayName failed: 0x%08x\n", hres);
|
||||||
"ParseDisplayName failed: 0x%08x\n", hres);
|
|
||||||
if(SUCCEEDED(hres)){
|
if(SUCCEEDED(hres)){
|
||||||
verify_pidl(pidl, adirW);
|
verify_pidl(pidl, adirW);
|
||||||
ILFree(pidl);
|
ILFree(pidl);
|
||||||
}
|
}
|
||||||
|
|
||||||
hres = IShellFolder_ParseDisplayName(psf, NULL, pbc, afileW, NULL, &pidl, NULL);
|
hres = IShellFolder_ParseDisplayName(psf, NULL, pbc, afileW, NULL, &pidl, NULL);
|
||||||
ok(hres == S_OK || broken(hres == E_FAIL) /* NT4 */,
|
ok(hres == S_OK, "ParseDisplayName failed: 0x%08x\n", hres);
|
||||||
"ParseDisplayName failed: 0x%08x\n", hres);
|
|
||||||
if(SUCCEEDED(hres)){
|
if(SUCCEEDED(hres)){
|
||||||
verify_pidl(pidl, afileW);
|
verify_pidl(pidl, afileW);
|
||||||
ILFree(pidl);
|
ILFree(pidl);
|
||||||
}
|
}
|
||||||
|
|
||||||
hres = IShellFolder_ParseDisplayName(psf, NULL, pbc, afile2W, NULL, &pidl, NULL);
|
hres = IShellFolder_ParseDisplayName(psf, NULL, pbc, afile2W, NULL, &pidl, NULL);
|
||||||
ok(hres == S_OK || broken(hres == E_FAIL) /* NT4 */,
|
ok(hres == S_OK, "ParseDisplayName failed: 0x%08x\n", hres);
|
||||||
"ParseDisplayName failed: 0x%08x\n", hres);
|
|
||||||
if(SUCCEEDED(hres)){
|
if(SUCCEEDED(hres)){
|
||||||
verify_pidl(pidl, afile2W);
|
verify_pidl(pidl, afile2W);
|
||||||
ILFree(pidl);
|
ILFree(pidl);
|
||||||
|
@ -4842,24 +4734,21 @@ static void test_ParseDisplayNamePBC(void)
|
||||||
pidl = (ITEMIDLIST*)0xdeadbeef;
|
pidl = (ITEMIDLIST*)0xdeadbeef;
|
||||||
fsbdVtbl.GetFindData = fsbd_GetFindData_invalid;
|
fsbdVtbl.GetFindData = fsbd_GetFindData_invalid;
|
||||||
hres = IShellFolder_ParseDisplayName(psf, NULL, pbc, adirW, NULL, &pidl, NULL);
|
hres = IShellFolder_ParseDisplayName(psf, NULL, pbc, adirW, NULL, &pidl, NULL);
|
||||||
ok(hres == S_OK || broken(hres == E_FAIL) /* NT4 */,
|
ok(hres == S_OK, "ParseDisplayName failed: 0x%08x\n", hres);
|
||||||
"ParseDisplayName failed: 0x%08x\n", hres);
|
|
||||||
if(SUCCEEDED(hres)){
|
if(SUCCEEDED(hres)){
|
||||||
verify_pidl(pidl, adirW);
|
verify_pidl(pidl, adirW);
|
||||||
ILFree(pidl);
|
ILFree(pidl);
|
||||||
}
|
}
|
||||||
|
|
||||||
hres = IShellFolder_ParseDisplayName(psf, NULL, pbc, afileW, NULL, &pidl, NULL);
|
hres = IShellFolder_ParseDisplayName(psf, NULL, pbc, afileW, NULL, &pidl, NULL);
|
||||||
ok(hres == S_OK || broken(hres == E_FAIL) /* NT4 */,
|
ok(hres == S_OK, "ParseDisplayName failed: 0x%08x\n", hres);
|
||||||
"ParseDisplayName failed: 0x%08x\n", hres);
|
|
||||||
if(SUCCEEDED(hres)){
|
if(SUCCEEDED(hres)){
|
||||||
verify_pidl(pidl, afileW);
|
verify_pidl(pidl, afileW);
|
||||||
ILFree(pidl);
|
ILFree(pidl);
|
||||||
}
|
}
|
||||||
|
|
||||||
hres = IShellFolder_ParseDisplayName(psf, NULL, pbc, afile2W, NULL, &pidl, NULL);
|
hres = IShellFolder_ParseDisplayName(psf, NULL, pbc, afile2W, NULL, &pidl, NULL);
|
||||||
ok(hres == S_OK || broken(hres == E_FAIL) /* NT4 */,
|
ok(hres == S_OK, "ParseDisplayName failed: 0x%08x\n", hres);
|
||||||
"ParseDisplayName failed: 0x%08x\n", hres);
|
|
||||||
if(SUCCEEDED(hres)){
|
if(SUCCEEDED(hres)){
|
||||||
verify_pidl(pidl, afile2W);
|
verify_pidl(pidl, afile2W);
|
||||||
ILFree(pidl);
|
ILFree(pidl);
|
||||||
|
@ -4869,24 +4758,21 @@ static void test_ParseDisplayNamePBC(void)
|
||||||
pidl = (ITEMIDLIST*)0xdeadbeef;
|
pidl = (ITEMIDLIST*)0xdeadbeef;
|
||||||
fsbdVtbl.GetFindData = fsbd_GetFindData_valid;
|
fsbdVtbl.GetFindData = fsbd_GetFindData_valid;
|
||||||
hres = IShellFolder_ParseDisplayName(psf, NULL, pbc, adirW, NULL, &pidl, NULL);
|
hres = IShellFolder_ParseDisplayName(psf, NULL, pbc, adirW, NULL, &pidl, NULL);
|
||||||
ok(hres == S_OK || broken(hres == E_FAIL) /* NT4 */,
|
ok(hres == S_OK, "ParseDisplayName failed: 0x%08x\n", hres);
|
||||||
"ParseDisplayName failed: 0x%08x\n", hres);
|
|
||||||
if(SUCCEEDED(hres)){
|
if(SUCCEEDED(hres)){
|
||||||
verify_pidl(pidl, adirW);
|
verify_pidl(pidl, adirW);
|
||||||
ILFree(pidl);
|
ILFree(pidl);
|
||||||
}
|
}
|
||||||
|
|
||||||
hres = IShellFolder_ParseDisplayName(psf, NULL, pbc, afileW, NULL, &pidl, NULL);
|
hres = IShellFolder_ParseDisplayName(psf, NULL, pbc, afileW, NULL, &pidl, NULL);
|
||||||
ok(hres == S_OK || broken(hres == E_FAIL) /* NT4 */,
|
ok(hres == S_OK, "ParseDisplayName failed: 0x%08x\n", hres);
|
||||||
"ParseDisplayName failed: 0x%08x\n", hres);
|
|
||||||
if(SUCCEEDED(hres)){
|
if(SUCCEEDED(hres)){
|
||||||
verify_pidl(pidl, afileW);
|
verify_pidl(pidl, afileW);
|
||||||
ILFree(pidl);
|
ILFree(pidl);
|
||||||
}
|
}
|
||||||
|
|
||||||
hres = IShellFolder_ParseDisplayName(psf, NULL, pbc, afile2W, NULL, &pidl, NULL);
|
hres = IShellFolder_ParseDisplayName(psf, NULL, pbc, afile2W, NULL, &pidl, NULL);
|
||||||
ok(hres == S_OK || broken(hres == E_FAIL) /* NT4 */,
|
ok(hres == S_OK, "ParseDisplayName failed: 0x%08x\n", hres);
|
||||||
"ParseDisplayName failed: 0x%08x\n", hres);
|
|
||||||
if(SUCCEEDED(hres)){
|
if(SUCCEEDED(hres)){
|
||||||
verify_pidl(pidl, afile2W);
|
verify_pidl(pidl, afile2W);
|
||||||
ILFree(pidl);
|
ILFree(pidl);
|
||||||
|
@ -5093,10 +4979,9 @@ static void test_SHCreateDefaultContextMenu(void)
|
||||||
CreateFilesFolders();
|
CreateFilesFolders();
|
||||||
|
|
||||||
hr = IShellFolder_ParseDisplayName(desktop, NULL, NULL, path, NULL, &pidl, 0);
|
hr = IShellFolder_ParseDisplayName(desktop, NULL, NULL, path, NULL, &pidl, 0);
|
||||||
ok(hr == S_OK || broken(hr == E_FAIL) /* WinME */, "Got 0x%08x\n", hr);
|
ok(hr == S_OK, "Got 0x%08x\n", hr);
|
||||||
if(SUCCEEDED(hr))
|
if(SUCCEEDED(hr))
|
||||||
{
|
{
|
||||||
|
|
||||||
hr = SHBindToParent(pidl, &IID_IShellFolder, (void **)&folder, (const ITEMIDLIST **)&pidl_child);
|
hr = SHBindToParent(pidl, &IID_IShellFolder, (void **)&folder, (const ITEMIDLIST **)&pidl_child);
|
||||||
ok(hr == S_OK, "Got 0x%08x\n", hr);
|
ok(hr == S_OK, "Got 0x%08x\n", hr);
|
||||||
|
|
||||||
|
@ -5302,7 +5187,7 @@ START_TEST(shlfolder)
|
||||||
{
|
{
|
||||||
init_function_pointers();
|
init_function_pointers();
|
||||||
/* if OleInitialize doesn't get called, ParseDisplayName returns
|
/* if OleInitialize doesn't get called, ParseDisplayName returns
|
||||||
CO_E_NOTINITIALIZED for malformed directory names on win2k. */
|
CO_E_NOTINITIALIZED for malformed directory names */
|
||||||
OleInitialize(NULL);
|
OleInitialize(NULL);
|
||||||
|
|
||||||
test_ParseDisplayName();
|
test_ParseDisplayName();
|
||||||
|
|
Loading…
Reference in New Issue