[SHELL32_WINETEST] Sync with Wine Staging 1.9.4. CORE-10912

svn path=/trunk/; revision=70977
This commit is contained in:
Amine Khaldi 2016-03-09 08:43:20 +00:00
parent 13376ac48f
commit 182359adfd
4 changed files with 824 additions and 633 deletions

View file

@ -372,7 +372,13 @@ static HWND CheckWindowCreated(const char *winName, BOOL closeWindow, int testPa
for (i = 0; window == NULL && i < PDDE_POLL_NUM; i++)
{
Sleep(PDDE_POLL_TIME);
window = FindWindowA(NULL, winName);
/* Specify the window class name to make sure what we find is really an
* Explorer window. Explorer used two different window classes so try
* both.
*/
window = FindWindowA("ExplorerWClass", winName);
if (!window)
window = FindWindowA("CabinetWClass", winName);
}
ok (window != NULL, "Window \"%s\" was not created in %i seconds - assumed failure.%s\n",
winName, PDDE_POLL_NUM*PDDE_POLL_TIME/1000, GetStringFromTestParams(testParams));

View file

@ -74,6 +74,7 @@ static HRESULT (WINAPI *pSHPropStgReadMultiple)(IPropertyStorage*, UINT,
static HRESULT (WINAPI *pSHPropStgWriteMultiple)(IPropertyStorage*, UINT*,
ULONG, const PROPSPEC*, PROPVARIANT*, PROPID);
static HRESULT (WINAPI *pSHCreateQueryCancelAutoPlayMoniker)(IMoniker**);
static HRESULT (WINAPI *pSHCreateSessionKey)(REGSAM, HKEY*);
static void init(void)
{
@ -83,6 +84,7 @@ static void init(void)
pSHPropStgReadMultiple = (void*)GetProcAddress(hmod, "SHPropStgReadMultiple");
pSHPropStgWriteMultiple = (void*)GetProcAddress(hmod, "SHPropStgWriteMultiple");
pSHCreateQueryCancelAutoPlayMoniker = (void*)GetProcAddress(hmod, "SHCreateQueryCancelAutoPlayMoniker");
pSHCreateSessionKey = (void*)GetProcAddress(hmod, (char*)723);
}
static HRESULT WINAPI PropertyStorage_QueryInterface(IPropertyStorage *This,
@ -857,6 +859,36 @@ static void test_DragQueryFile(void)
}
#undef DROPTEST_FILENAME
static void test_SHCreateSessionKey(void)
{
HKEY hkey, hkey2;
HRESULT hr;
if (!pSHCreateSessionKey)
{
skip("SHCreateSessionKey is not implemented\n");
return;
}
if (0) /* crashes on native */
hr = pSHCreateSessionKey(KEY_READ, NULL);
hkey = (HKEY)0xdeadbeef;
hr = pSHCreateSessionKey(0, &hkey);
todo_wine ok(hr == E_ACCESSDENIED, "got 0x%08x\n", hr);
todo_wine ok(hkey == NULL, "got %p\n", hkey);
hr = pSHCreateSessionKey(KEY_READ, &hkey);
ok(hr == S_OK, "got 0x%08x\n", hr);
hr = pSHCreateSessionKey(KEY_READ, &hkey2);
ok(hr == S_OK, "got 0x%08x\n", hr);
ok(hkey != hkey2, "got %p, %p\n", hkey, hkey2);
RegCloseKey(hkey);
RegCloseKey(hkey2);
}
START_TEST(shellole)
{
init();
@ -864,4 +896,5 @@ START_TEST(shellole)
test_SHPropStg_functions();
test_SHCreateQueryCancelAutoPlayMoniker();
test_DragQueryFile();
test_SHCreateSessionKey();
}

File diff suppressed because it is too large Load diff

View file

@ -388,6 +388,14 @@ static void test_EnumObjects(IShellFolder *iFolder)
SFGAO_CAPABILITYMASK | SFGAO_FILESYSTEM,
SFGAO_CAPABILITYMASK | SFGAO_FILESYSTEM,
};
static const ULONG full_attrs[5] =
{
SFGAO_CAPABILITYMASK | SFGAO_STORAGE | SFGAO_STORAGEANCESTOR | SFGAO_FILESYSTEM | SFGAO_FOLDER | SFGAO_FILESYSANCESTOR,
SFGAO_CAPABILITYMASK | SFGAO_STORAGE | SFGAO_STORAGEANCESTOR | SFGAO_FILESYSTEM | SFGAO_FOLDER | SFGAO_FILESYSANCESTOR,
SFGAO_CAPABILITYMASK | SFGAO_STREAM | SFGAO_FILESYSTEM,
SFGAO_CAPABILITYMASK | SFGAO_STREAM | SFGAO_FILESYSTEM,
SFGAO_CAPABILITYMASK | SFGAO_STREAM | SFGAO_FILESYSTEM,
};
hr = IShellFolder_EnumObjects(iFolder, NULL, SHCONTF_FOLDERS | SHCONTF_NONFOLDERS | SHCONTF_INCLUDEHIDDEN, &iEnumList);
ok(hr == S_OK, "EnumObjects failed %08x\n", hr);
@ -440,6 +448,11 @@ static void test_EnumObjects(IShellFolder *iFolder)
ok(flags == attrs[i] ||
flags == (attrs[i] & ~SFGAO_FILESYSANCESTOR), /* Win9x, NT4 */
"GetAttributesOf[%i] got %08x, expected %08x\n", i, flags, attrs[i]);
flags = ~0u;
hr = IShellFolder_GetAttributesOf(iFolder, 1, (LPCITEMIDLIST*)(idlArr + i), &flags);
ok(hr == S_OK, "GetAttributesOf returns %08x\n", hr);
ok((flags & ~SFGAO_HASSUBFOLDER) == full_attrs[i], "%d: got %08x expected %08x\n", i, flags, full_attrs[i]);
}
for (i=0;i<5;i++)
@ -1889,14 +1902,14 @@ static void test_SHGetFolderPathA(void)
if (!pIsWow64Process || !pIsWow64Process( GetCurrentProcess(), &is_wow64 )) is_wow64 = FALSE;
hr = pSHGetFolderPathA( 0, CSIDL_PROGRAM_FILES, 0, SHGFP_TYPE_CURRENT, path );
ok( !hr, "SHGetFolderPathA failed %x\n", hr );
ok( hr == S_OK, "SHGetFolderPathA failed %x\n", hr );
hr = pSHGetFolderPathA( 0, CSIDL_PROGRAM_FILESX86, 0, SHGFP_TYPE_CURRENT, path_x86 );
if (hr == E_FAIL)
{
win_skip( "Program Files (x86) not supported\n" );
return;
}
ok( !hr, "SHGetFolderPathA failed %x\n", hr );
ok( hr == S_OK, "SHGetFolderPathA failed %x\n", hr );
if (is_win64)
{
ok( lstrcmpiA( path, path_x86 ), "paths are identical '%s'\n", path );
@ -1924,14 +1937,14 @@ static void test_SHGetFolderPathA(void)
}
hr = pSHGetFolderPathA( 0, CSIDL_PROGRAM_FILES_COMMON, 0, SHGFP_TYPE_CURRENT, path );
ok( !hr, "SHGetFolderPathA failed %x\n", hr );
ok( hr == S_OK, "SHGetFolderPathA failed %x\n", hr );
hr = pSHGetFolderPathA( 0, CSIDL_PROGRAM_FILES_COMMONX86, 0, SHGFP_TYPE_CURRENT, path_x86 );
if (hr == E_FAIL)
{
win_skip( "Common Files (x86) not supported\n" );
return;
}
ok( !hr, "SHGetFolderPathA failed %x\n", hr );
ok( hr == S_OK, "SHGetFolderPathA failed %x\n", hr );
if (is_win64)
{
ok( lstrcmpiA( path, path_x86 ), "paths are identical '%s'\n", path );
@ -5256,6 +5269,63 @@ static void test_SHCreateShellFolderViewEx(void)
IShellFolder_Release(desktop);
}
static void test_DataObject(void)
{
IShellFolder *desktop;
IDataObject *data_obj;
HRESULT hres;
IEnumIDList *peidl;
LPITEMIDLIST apidl;
FORMATETC fmt;
DWORD cf_shellidlist;
STGMEDIUM medium;
SHGetDesktopFolder(&desktop);
hres = IShellFolder_EnumObjects(desktop, NULL,
SHCONTF_NONFOLDERS|SHCONTF_FOLDERS|SHCONTF_INCLUDEHIDDEN, &peidl);
ok(hres == S_OK, "got %x\n", hres);
if(IEnumIDList_Next(peidl, 1, &apidl, NULL) != S_OK) {
skip("no files on desktop - skipping GetDataObject tests\n");
IEnumIDList_Release(peidl);
IShellFolder_Release(desktop);
return;
}
IEnumIDList_Release(peidl);
hres = IShellFolder_GetUIObjectOf(desktop, NULL, 1, (LPCITEMIDLIST*)&apidl,
&IID_IDataObject, NULL, (void**)&data_obj);
ok(hres == S_OK, "got %x\n", hres);
pILFree(apidl);
IShellFolder_Release(desktop);
cf_shellidlist = RegisterClipboardFormatW(CFSTR_SHELLIDLISTW);
fmt.cfFormat = cf_shellidlist;
fmt.ptd = NULL;
fmt.dwAspect = DVASPECT_CONTENT;
fmt.lindex = -1;
fmt.tymed = TYMED_HGLOBAL;
hres = IDataObject_QueryGetData(data_obj, &fmt);
ok(hres == S_OK, "got %x\n", hres);
fmt.tymed = TYMED_HGLOBAL | TYMED_ISTREAM;
hres = IDataObject_QueryGetData(data_obj, &fmt);
ok(hres == S_OK, "got %x\n", hres);
fmt.tymed = TYMED_ISTREAM;
hres = IDataObject_QueryGetData(data_obj, &fmt);
todo_wine ok(hres == S_FALSE, "got %x\n", hres);
fmt.tymed = TYMED_HGLOBAL | TYMED_ISTREAM;
hres = IDataObject_GetData(data_obj, &fmt, &medium);
ok(hres == S_OK, "got %x\n", hres);
ok(medium.tymed == TYMED_HGLOBAL, "medium.tymed = %x\n", medium.tymed);
ReleaseStgMedium(&medium);
IDataObject_Release(data_obj);
}
START_TEST(shlfolder)
{
init_function_pointers();
@ -5296,6 +5366,7 @@ START_TEST(shlfolder)
test_SHCreateDefaultContextMenu();
test_SHCreateShellFolderView();
test_SHCreateShellFolderViewEx();
test_DataObject();
OleUninitialize();
}