Author: cwittich
Date: Thu Mar 4 21:55:58 2010
New Revision: 45842
URL:
http://svn.reactos.org/svn/reactos?rev=45842&view=rev
Log:
[SHELL32_WINETEST]
sync shell32_winetest to wine 1.1.39
Modified:
trunk/rostests/winetests/shell32/autocomplete.c
trunk/rostests/winetests/shell32/progman_dde.c
trunk/rostests/winetests/shell32/shelllink.c
trunk/rostests/winetests/shell32/shellpath.c
trunk/rostests/winetests/shell32/shlfileop.c
Modified: trunk/rostests/winetests/shell32/autocomplete.c
URL:
http://svn.reactos.org/svn/reactos/trunk/rostests/winetests/shell32/autocom…
==============================================================================
--- trunk/rostests/winetests/shell32/autocomplete.c [iso-8859-1] (original)
+++ trunk/rostests/winetests/shell32/autocomplete.c [iso-8859-1] Thu Mar 4 21:55:58 2010
@@ -33,7 +33,8 @@
static HINSTANCE hinst;
static int killfocus_count;
-static BOOL test_init(void) {
+static IAutoComplete *test_init(void)
+{
HRESULT r;
IAutoComplete* ac;
IUnknown *acSource;
@@ -44,7 +45,7 @@
if (r == REGDB_E_CLASSNOTREG)
{
win_skip("CLSID_AutoComplete is not registered\n");
- return FALSE;
+ return NULL;
}
ok(SUCCEEDED(r), "no IID_IAutoComplete (0x%08x)\n", r);
@@ -54,7 +55,7 @@
if (r == REGDB_E_CLASSNOTREG)
{
win_skip("CLSID_ACLMulti is not registered\n");
- return FALSE;
+ return NULL;
}
ok(SUCCEEDED(r), "no IID_IACList (0x%08x)\n", r);
@@ -62,9 +63,13 @@
r = IAutoComplete_Init(ac, hEdit, acSource, NULL, NULL);
ok(SUCCEEDED(r), "Init failed (0x%08x)\n", r);
- return TRUE;
+ IUnknown_Release(acSource);
+
+ return ac;
}
-static void test_killfocus(void) {
+
+static void test_killfocus(void)
+{
/* Test if WM_KILLFOCUS messages are handled properly by checking if
* the parent receives an EN_KILLFOCUS message. */
SetFocus(hEdit);
@@ -72,7 +77,9 @@
SetFocus(0);
ok(killfocus_count == 1, "Expected one EN_KILLFOCUS message, got: %d\n",
killfocus_count);
}
-static LRESULT CALLBACK MyWndProc(HWND hWnd, UINT msg, WPARAM wParam, LPARAM lParam) {
+
+static LRESULT CALLBACK MyWndProc(HWND hWnd, UINT msg, WPARAM wParam, LPARAM lParam)
+{
switch(msg) {
case WM_CREATE:
/* create edit control */
@@ -87,7 +94,9 @@
}
return DefWindowProcA(hWnd, msg, wParam, lParam);
}
-static void createMainWnd(void) {
+
+static void createMainWnd(void)
+{
WNDCLASSA wc;
wc.style = CS_HREDRAW | CS_VREDRAW;
wc.cbClsExtra = 0;
@@ -104,9 +113,12 @@
hMainWnd = CreateWindowExA(0, "MyTestWnd", "Blah",
WS_OVERLAPPEDWINDOW,
CW_USEDEFAULT, CW_USEDEFAULT, 130, 105, NULL, NULL, GetModuleHandleA(NULL), 0);
}
-START_TEST(autocomplete) {
+
+START_TEST(autocomplete)
+{
HRESULT r;
MSG msg;
+ IAutoComplete* ac;
r = CoInitialize(NULL);
ok(SUCCEEDED(r), "CoInitialize failed (0x%08x). Tests aborted.\n", r);
@@ -118,7 +130,8 @@
if(!ok(hMainWnd != NULL, "Failed to create parent window. Tests
aborted.\n"))
return;
- if (!test_init())
+ ac = test_init();
+ if (!ac)
goto cleanup;
test_killfocus();
@@ -128,6 +141,8 @@
DispatchMessageA(&msg);
}
+ IAutoComplete_Release(ac);
+
cleanup:
DestroyWindow(hEdit);
DestroyWindow(hMainWnd);
Modified: trunk/rostests/winetests/shell32/progman_dde.c
URL:
http://svn.reactos.org/svn/reactos/trunk/rostests/winetests/shell32/progman…
==============================================================================
--- trunk/rostests/winetests/shell32/progman_dde.c [iso-8859-1] (original)
+++ trunk/rostests/winetests/shell32/progman_dde.c [iso-8859-1] Thu Mar 4 21:55:58 2010
@@ -102,6 +102,30 @@
return TRUE;
}
+static BOOL full_title(void)
+{
+ CABINETSTATE cs;
+
+ memset(&cs, 0, sizeof(cs));
+ if (pReadCabinetState)
+ {
+ pReadCabinetState(&cs, sizeof(cs));
+ }
+ else
+ {
+ HKEY key;
+ DWORD size;
+
+ win_skip("ReadCabinetState is not available, reading registry
directly\n");
+ RegOpenKeyA(HKEY_CURRENT_USER,
"Software\\Microsoft\\Windows\\CurrentVersion\\Explorer\\CabinetState",
&key);
+ size = sizeof(cs);
+ RegQueryValueExA(key, "Settings", NULL, NULL, (LPBYTE)&cs,
&size);
+ RegCloseKey(key);
+ }
+
+ return (cs.fFullPathTitle == -1);
+}
+
static char ProgramsDir[MAX_PATH];
static char Group1Title[MAX_PATH] = "Group1";
@@ -114,8 +138,6 @@
char startup[MAX_PATH];
char commonprograms[MAX_PATH];
char programs[MAX_PATH];
-
- CABINETSTATE cs;
if (pSHGetSpecialFolderPathA)
{
@@ -153,9 +175,7 @@
else
lstrcpyA(ProgramsDir, programs);
- memset(&cs, 0, sizeof(cs));
- pReadCabinetState(&cs, sizeof(cs));
- if (cs.fFullPathTitle == -1)
+ if (full_title())
{
lstrcpyA(Group1Title, ProgramsDir);
lstrcatA(Group1Title, "\\Group1");
Modified: trunk/rostests/winetests/shell32/shelllink.c
URL:
http://svn.reactos.org/svn/reactos/trunk/rostests/winetests/shell32/shellli…
==============================================================================
--- trunk/rostests/winetests/shell32/shelllink.c [iso-8859-1] (original)
+++ trunk/rostests/winetests/shell32/shelllink.c [iso-8859-1] Thu Mar 4 21:55:58 2010
@@ -207,6 +207,7 @@
}
if (ret)
ok(lstrcmpi(buffer,str)==0, "GetIDList returned '%s'\n",
buffer);
+ pILFree(tmp_pidl);
}
pidl=path_to_pidl(mypath);
@@ -214,6 +215,8 @@
if (pidl)
{
+ LPITEMIDLIST second_pidl;
+
r = IShellLinkA_SetIDList(sl, pidl);
ok(SUCCEEDED(r), "SetIDList failed (0x%08x)\n", r);
@@ -223,7 +226,14 @@
ok(tmp_pidl && pILIsEqual(pidl, tmp_pidl),
"GetIDList returned an incorrect pidl\n");
- /* tmp_pidl is owned by IShellLink so we don't free it */
+ r = IShellLinkA_GetIDList(sl, &second_pidl);
+ ok(SUCCEEDED(r), "GetIDList failed (0x%08x)\n", r);
+ ok(second_pidl && pILIsEqual(pidl, second_pidl),
+ "GetIDList returned an incorrect pidl\n");
+ ok(second_pidl != tmp_pidl, "pidls are the same\n");
+
+ pILFree(second_pidl);
+ pILFree(tmp_pidl);
pILFree(pidl);
strcpy(buffer,"garbage");
Modified: trunk/rostests/winetests/shell32/shellpath.c
URL:
http://svn.reactos.org/svn/reactos/trunk/rostests/winetests/shell32/shellpa…
==============================================================================
--- trunk/rostests/winetests/shell32/shellpath.c [iso-8859-1] (original)
+++ trunk/rostests/winetests/shell32/shellpath.c [iso-8859-1] Thu Mar 4 21:55:58 2010
@@ -675,7 +675,7 @@
*/
static void testSystemDir(void)
{
- char systemShellPath[MAX_PATH], systemDir[MAX_PATH] = { 0 };
+ char systemShellPath[MAX_PATH], systemDir[MAX_PATH], systemDirx86[MAX_PATH];
if (!pSHGetSpecialFolderPathA) return;
@@ -689,13 +689,13 @@
systemDir, systemShellPath);
}
- if (!pGetSystemWow64DirectoryA || !pGetSystemWow64DirectoryA(systemDir,
sizeof(systemDir)))
- GetSystemDirectoryA(systemDir, sizeof(systemDir));
- myPathRemoveBackslashA(systemDir);
+ if (!pGetSystemWow64DirectoryA || !pGetSystemWow64DirectoryA(systemDirx86,
sizeof(systemDirx86)))
+ GetSystemDirectoryA(systemDirx86, sizeof(systemDirx86));
+ myPathRemoveBackslashA(systemDirx86);
if (pSHGetSpecialFolderPathA(NULL, systemShellPath, CSIDL_SYSTEMX86, FALSE))
{
myPathRemoveBackslashA(systemShellPath);
- ok(!lstrcmpiA(systemDir, systemShellPath),
+ ok(!lstrcmpiA(systemDirx86, systemShellPath) || broken(!lstrcmpiA(systemDir,
systemShellPath)),
"GetSystemDirectory returns %s SHGetSpecialFolderPath returns %s\n",
systemDir, systemShellPath);
}
Modified: trunk/rostests/winetests/shell32/shlfileop.c
URL:
http://svn.reactos.org/svn/reactos/trunk/rostests/winetests/shell32/shlfile…
==============================================================================
--- trunk/rostests/winetests/shell32/shlfileop.c [iso-8859-1] (original)
+++ trunk/rostests/winetests/shell32/shlfileop.c [iso-8859-1] Thu Mar 4 21:55:58 2010
@@ -46,6 +46,8 @@
ok(retval == ret ||\
broken(retval == ret_prewin32),\
"Expected %d, got %d\n", ret, retval)
+
+static BOOL old_shell32 = FALSE;
static CHAR CURR_DIR[MAX_PATH];
static const WCHAR UNICODE_PATH[] =
{'c',':','\\',0x00ae,'\0','\0'};
@@ -764,6 +766,8 @@
/* pTo already exist */
shfo.pFrom = "test1.txt\0";
shfo.pTo = "test2.txt\0";
+ if (old_shell32)
+ shfo.fFlags |= FOF_NOCONFIRMMKDIR;
retval = SHFileOperationA(&shfo);
if (retval == ERROR_SUCCESS)
{
@@ -816,6 +820,12 @@
DWORD retval;
LPSTR ptr;
BOOL on_nt4 = FALSE;
+
+ if (old_shell32)
+ {
+ win_skip("Too many differences for old shell32\n");
+ return;
+ }
shfo.hwnd = NULL;
shfo.wFunc = FO_COPY;
@@ -1710,6 +1720,21 @@
ok(DeleteFileA("ab.txt"), "Expected file to exist\n");
ok(RemoveDirectoryA("one"), "Expected dir to exist\n");
ok(RemoveDirectoryA("two"), "Expected dir to exist\n");
+
+ /* pTo is an empty string */
+ CreateDirectoryA("dir", NULL);
+ createTestFile("dir\\abcdefgh.abc");
+ shfo.pFrom = "dir\\abcdefgh.abc\0";
+ shfo.pTo = "\0";
+ shfo.fFlags = FOF_NOCONFIRMATION | FOF_SILENT | FOF_NOERRORUI;
+ retval = SHFileOperation(&shfo);
+ ok(retval == ERROR_SUCCESS ||
+ broken(retval == DE_OPCANCELLED), /* NT4 */
+ "Expected ERROR_SUCCESS, got %d\n", retval);
+ if (retval == ERROR_SUCCESS)
+ ok(DeleteFileA("abcdefgh.abc"), "Expected file to exist\n");
+ ok(DeleteFileA("dir\\abcdefgh.abc"), "Expected file to
exist\n");
+ ok(RemoveDirectoryA("dir"), "Expected dir to exist\n");
}
/* tests the FO_MOVE action */
@@ -1751,6 +1776,8 @@
set_curr_dir_path(from, "test1.txt\0test2.txt\0test4.txt\0");
set_curr_dir_path(to, "test6.txt\0test7.txt\0test8.txt\0");
+ if (old_shell32)
+ shfo2.fFlags |= FOF_NOCONFIRMMKDIR;
ok(!SHFileOperationA(&shfo2), "Move many files\n");
ok(DeleteFileA("test6.txt"), "The file is not moved - many files are
"
"specified as a target\n");
@@ -1765,12 +1792,23 @@
retval = SHFileOperationA(&shfo2);
if (dir_exists("test6.txt"))
{
- /* Vista and W2K8 (broken or new behavior ?) */
- ok(retval == DE_DESTSAMETREE, "Expected DE_DESTSAMETREE, got %d\n",
retval);
- ok(DeleteFileA("test6.txt\\test1.txt"), "The file is not
moved\n");
- RemoveDirectoryA("test6.txt");
- ok(DeleteFileA("test7.txt\\test2.txt"), "The file is not
moved\n");
- RemoveDirectoryA("test7.txt");
+ if (retval == ERROR_SUCCESS)
+ {
+ /* Old shell32 */
+ DeleteFileA("test6.txt\\test1.txt");
+ DeleteFileA("test6.txt\\test2.txt");
+ RemoveDirectoryA("test6.txt\\test4.txt");
+ RemoveDirectoryA("test6.txt");
+ }
+ else
+ {
+ /* Vista and W2K8 (broken or new behavior ?) */
+ ok(retval == DE_DESTSAMETREE, "Expected DE_DESTSAMETREE, got %d\n",
retval);
+ ok(DeleteFileA("test6.txt\\test1.txt"), "The file is not
moved\n");
+ RemoveDirectoryA("test6.txt");
+ ok(DeleteFileA("test7.txt\\test2.txt"), "The file is not
moved\n");
+ RemoveDirectoryA("test7.txt");
+ }
}
else
{
@@ -1788,9 +1826,12 @@
set_curr_dir_path(from, "test1.txt\0test2.txt\0test4.txt\0");
set_curr_dir_path(to, "test6.txt\0test7.txt\0test8.txt\0");
+ if (old_shell32)
+ shfo.fFlags |= FOF_NOCONFIRMMKDIR;
retval = SHFileOperationA(&shfo);
if (dir_exists("test6.txt"))
{
+ /* Old shell32 */
/* Vista and W2K8 (broken or new behavior ?) */
ok(retval == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n",
retval);
ok(DeleteFileA("test6.txt\\test1.txt"), "The file is not moved.
Many files are specified\n");
@@ -1839,8 +1880,14 @@
else
{
ok(retval == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n",
retval);
+ if (old_shell32)
+ {
+ DeleteFile("a.txt\\a.txt");
+ RemoveDirectoryA("a.txt");
+ }
+ else
+ ok(DeleteFile("a.txt"), "Expected a.txt to exist\n");
ok(!file_exists("test1.txt"), "Expected test1.txt to not
exist\n");
- ok(DeleteFile("a.txt"), "Expected a.txt to exist\n");
}
ok(!file_exists("b.txt"), "Expected b.txt to not exist\n");
@@ -1850,6 +1897,7 @@
retval = SHFileOperationA(&shfo);
if (dir_exists("test1.txt"))
{
+ /* Old shell32 */
/* Vista and W2K8 (broken or new behavior ?) */
ok(retval == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n",
retval);
ok(DeleteFileA("test1.txt\\test2.txt"), "Expected
test1.txt\\test2.txt to exist\n");
@@ -1882,6 +1930,7 @@
retval = SHFileOperationA(&shfo);
if (dir_exists("d.txt"))
{
+ /* Old shell32 */
/* Vista and W2K8 (broken or new behavior ?) */
ok(retval == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n",
retval);
ok(DeleteFileA("d.txt\\test2.txt"), "Expected d.txt\\test2.txt to
exist\n");
@@ -1903,13 +1952,23 @@
retval = SHFileOperationA(&shfo);
if (dir_exists("d.txt"))
{
- /* Vista and W2K8 (broken or new behavior ?) */
- ok(retval == DE_SAMEFILE,
- "Expected DE_SAMEFILE, got %d\n", retval);
- ok(DeleteFileA("d.txt\\test2.txt"), "Expected d.txt\\test2.txt to
exist\n");
- ok(!file_exists("d.txt\\test3.txt"), "Expected d.txt\\test3.txt to
not exist\n");
- RemoveDirectoryA("d.txt");
- createTestFile("test2.txt");
+ if (old_shell32)
+ {
+ DeleteFileA("d.txt\\test2.txt");
+ DeleteFileA("d.txt\\test3.txt");
+ RemoveDirectoryA("d.txt");
+ createTestFile("test2.txt");
+ }
+ else
+ {
+ /* Vista and W2K8 (broken or new behavior ?) */
+ ok(retval == DE_SAMEFILE,
+ "Expected DE_SAMEFILE, got %d\n", retval);
+ ok(DeleteFileA("d.txt\\test2.txt"), "Expected d.txt\\test2.txt
to exist\n");
+ ok(!file_exists("d.txt\\test3.txt"), "Expected
d.txt\\test3.txt to not exist\n");
+ RemoveDirectoryA("d.txt");
+ createTestFile("test2.txt");
+ }
}
else
{
@@ -1947,7 +2006,13 @@
{
ok(retval == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n",
retval);
ok(!file_exists("test2.txt"), "Expected test2.txt to not
exist\n");
- ok(file_exists("test3.txt"), "Expected test3.txt to
exist\n");
+ if (old_shell32)
+ {
+ DeleteFileA("test3.txt\\test3.txt");
+ RemoveDirectoryA("test3.txt");
+ }
+ else
+ ok(file_exists("test3.txt"), "Expected test3.txt to
exist\n");
}
}
@@ -2224,6 +2289,55 @@
ok(!file_existsW(UNICODE_PATH), "The directory should have been
removed\n");
}
+extern HRESULT WINAPI Shell_MergeMenus (HMENU hmDst, HMENU hmSrc, UINT uInsert, UINT
uIDAdjust, UINT uIDAdjustMax, ULONG uFlags);
+
+static void
+test_shlmenu(void) {
+ HRESULT hres;
+ hres = Shell_MergeMenus (0, 0, 0x42, 0x4242, 0x424242, 0);
+ ok (hres == 0x4242, "expected 0x4242 but got %x\n", hres);
+ hres = Shell_MergeMenus ((HMENU)42, 0, 0x42, 0x4242, 0x424242, 0);
+ ok (hres == 0x4242, "expected 0x4242 but got %x\n", hres);
+}
+
+/* Check for old shell32 (4.0.x) */
+static BOOL is_old_shell32(void)
+{
+ SHFILEOPSTRUCTA shfo;
+ CHAR from[5*MAX_PATH];
+ CHAR to[5*MAX_PATH];
+ DWORD retval;
+
+ shfo.hwnd = NULL;
+ shfo.wFunc = FO_COPY;
+ shfo.pFrom = from;
+ shfo.pTo = to;
+ /* FOF_NOCONFIRMMKDIR is needed for old shell32 */
+ shfo.fFlags = FOF_NOCONFIRMATION | FOF_SILENT | FOF_NOERRORUI | FOF_MULTIDESTFILES |
FOF_NOCONFIRMMKDIR;
+ shfo.hNameMappings = NULL;
+ shfo.lpszProgressTitle = NULL;
+
+ set_curr_dir_path(from, "test1.txt\0test2.txt\0test3.txt\0");
+ set_curr_dir_path(to, "test6.txt\0test7.txt\0");
+ retval = SHFileOperationA(&shfo);
+
+ /* Delete extra files on old shell32 and Vista+*/
+ DeleteFileA("test6.txt\\test1.txt");
+ /* Delete extra files on old shell32 */
+ DeleteFileA("test6.txt\\test2.txt");
+ DeleteFileA("test6.txt\\test3.txt");
+ /* Delete extra directory on old shell32 and Vista+ */
+ RemoveDirectoryA("test6.txt");
+ /* Delete extra files/directories on Vista+*/
+ DeleteFileA("test7.txt\\test2.txt");
+ RemoveDirectoryA("test7.txt");
+
+ if (retval == ERROR_SUCCESS)
+ return TRUE;
+
+ return FALSE;
+}
+
START_TEST(shlfileop)
{
InitFunctionPointers();
@@ -2231,6 +2345,12 @@
clean_after_shfo_tests();
init_shfo_tests();
+ old_shell32 = is_old_shell32();
+ if (old_shell32)
+ win_skip("Need to cater for old shell32 (4.0.x) on Win95\n");
+ clean_after_shfo_tests();
+
+ init_shfo_tests();
test_get_file_info();
test_get_file_info_iconlist();
clean_after_shfo_tests();
@@ -2263,4 +2383,6 @@
clean_after_shfo_tests();
test_unicode();
+
+ test_shlmenu();
}