Author: cwittich
Date: Thu Jun 25 18:39:01 2009
New Revision: 41611
URL:
http://svn.reactos.org/svn/reactos?rev=41611&view=rev
Log:
sync shell32 with wine 1.1.24
Modified:
trunk/rostests/winetests/shell32/appbar.c
trunk/rostests/winetests/shell32/shlfolder.c
Modified: trunk/rostests/winetests/shell32/appbar.c
URL:
http://svn.reactos.org/svn/reactos/trunk/rostests/winetests/shell32/appbar.…
==============================================================================
--- trunk/rostests/winetests/shell32/appbar.c [iso-8859-1] (original)
+++ trunk/rostests/winetests/shell32/appbar.c [iso-8859-1] Thu Jun 25 18:39:01 2009
@@ -36,6 +36,7 @@
{
HWND hwnd;
BOOL registered;
+ BOOL to_be_deleted;
RECT desired_rect;
UINT edge;
RECT allocated_rect;
@@ -55,6 +56,12 @@
if (!info || !info->registered)
{
+ return;
+ }
+
+ if (info->to_be_deleted)
+ {
+ win_skip("Some Win95 and NT4 systems send messages to removed
taskbars\n");
return;
}
@@ -71,15 +78,15 @@
abd.rc.top = abd.rc.bottom - (info->desired_rect.bottom -
info->desired_rect.top);
break;
case ABE_LEFT:
- ok(info->desired_rect.right == abd.rc.right, "ABM_QUERYPOS changed
right of rect from %i to %i\n", info->desired_rect.top, abd.rc.top);
+ ok(info->desired_rect.right == abd.rc.right, "ABM_QUERYPOS changed
right of rect from %i to %i\n", info->desired_rect.right, abd.rc.right);
abd.rc.right = abd.rc.left + (info->desired_rect.right -
info->desired_rect.left);
break;
case ABE_RIGHT:
- ok(info->desired_rect.left == abd.rc.left, "ABM_QUERYPOS changed left
of rect from %i to %i\n", info->desired_rect.top, abd.rc.top);
+ ok(info->desired_rect.left == abd.rc.left, "ABM_QUERYPOS changed left
of rect from %i to %i\n", info->desired_rect.left, abd.rc.left);
abd.rc.left = abd.rc.right - (info->desired_rect.right -
info->desired_rect.left);
break;
case ABE_TOP:
- ok(info->desired_rect.bottom == abd.rc.bottom, "ABM_QUERYPOS changed
bottom of rect from %i to %i\n", info->desired_rect.top, abd.rc.top);
+ ok(info->desired_rect.bottom == abd.rc.bottom, "ABM_QUERYPOS changed
bottom of rect from %i to %i\n", info->desired_rect.bottom, abd.rc.bottom);
abd.rc.bottom = abd.rc.top + (info->desired_rect.bottom -
info->desired_rect.top);
break;
}
@@ -221,6 +228,7 @@
/* dock windows[0] to the bottom of the screen */
windows[0].registered = TRUE;
+ windows[0].to_be_deleted = FALSE;
windows[0].edge = ABE_BOTTOM;
windows[0].desired_rect.left = 0;
windows[0].desired_rect.right = screen_width;
@@ -241,6 +249,7 @@
/* dock windows[1] to the bottom of the screen */
windows[1].registered = TRUE;
+ windows[1].to_be_deleted = FALSE;
windows[1].edge = ABE_BOTTOM;
windows[1].desired_rect.left = 0;
windows[1].desired_rect.right = screen_width;
@@ -272,6 +281,7 @@
/* dock windows[2] to the bottom of the screen */
windows[2].registered = TRUE;
+ windows[2].to_be_deleted = FALSE;
windows[2].edge = ABE_BOTTOM;
windows[2].desired_rect.left = 0;
windows[2].desired_rect.right = screen_width;
@@ -328,6 +338,7 @@
expected_bottom = max(windows[0].allocated_rect.bottom,
windows[1].allocated_rect.bottom);
abd.hWnd = windows[0].hwnd;
+ windows[0].to_be_deleted = TRUE;
ret = SHAppBarMessage(ABM_REMOVE, &abd);
ok(ret == TRUE, "SHAppBarMessage returned %i\n", ret);
windows[0].registered = FALSE;
@@ -341,12 +352,14 @@
/* remove the other windows */
abd.hWnd = windows[1].hwnd;
+ windows[1].to_be_deleted = TRUE;
ret = SHAppBarMessage(ABM_REMOVE, &abd);
ok(ret == TRUE, "SHAppBarMessage returned %i\n", ret);
windows[1].registered = FALSE;
DestroyWindow(windows[1].hwnd);
abd.hWnd = windows[2].hwnd;
+ windows[2].to_be_deleted = TRUE;
ret = SHAppBarMessage(ABM_REMOVE, &abd);
ok(ret == TRUE, "SHAppBarMessage returned %i\n", ret);
windows[2].registered = FALSE;
@@ -399,7 +412,9 @@
if(ret)
{
ok(abd.hWnd == (HWND)0xcccccccc, "hWnd overwritten\n");
- ok(abd.uEdge <= ABE_BOTTOM, "uEdge not returned\n");
+ ok(abd.uEdge <= ABE_BOTTOM ||
+ broken(abd.uEdge == 0xcccccccc), /* Some Win95 and NT4 */
+ "uEdge not returned\n");
ok(abd.rc.left != 0xcccccccc, "rc not updated\n");
}
Modified: trunk/rostests/winetests/shell32/shlfolder.c
URL:
http://svn.reactos.org/svn/reactos/trunk/rostests/winetests/shell32/shlfold…
==============================================================================
--- trunk/rostests/winetests/shell32/shlfolder.c [iso-8859-1] (original)
+++ trunk/rostests/winetests/shell32/shlfolder.c [iso-8859-1] Thu Jun 25 18:39:01 2009
@@ -81,6 +81,15 @@
ok(hr == S_OK, "SHGetMalloc failed %08x\n", hr);
}
+static const char *wine_dbgstr_w(LPCWSTR str)
+{
+ static char buf[512];
+ if (!str)
+ return "(null)";
+ WideCharToMultiByte(CP_ACP, 0, str, -1, buf, sizeof(buf), NULL, NULL);
+ return buf;
+}
+
static void test_ParseDisplayName(void)
{
HRESULT hr;
@@ -265,13 +274,15 @@
for (i = 0; i < 5; i++)
{
SFGAOF flags;
+#define SFGAO_VISTA SFGAO_DROPTARGET | SFGAO_CANLINK | SFGAO_CANCOPY
/* Native returns all flags no matter what we ask for */
flags = SFGAO_CANCOPY;
hr = IShellFolder_GetAttributesOf(iFolder, 1, (LPCITEMIDLIST*)(idlArr + i),
&flags);
flags &= SFGAO_testfor;
ok(hr == S_OK, "GetAttributesOf returns %08x\n", hr);
ok(flags == (attrs[i]) ||
- flags == (attrs[i] & ~SFGAO_FILESYSANCESTOR), /* Win9x, NT4 */
+ flags == (attrs[i] & ~SFGAO_FILESYSANCESTOR) || /* Win9x, NT4 */
+ flags == ((attrs[i] & ~SFGAO_CAPABILITYMASK) | SFGAO_VISTA), /* Vista and
higher */
"GetAttributesOf[%i] got %08x, expected %08x\n", i, flags,
attrs[i]);
flags = SFGAO_testfor;
@@ -469,7 +480,8 @@
}
/* WinXP and up store the filenames as both ANSI and UNICODE in the pidls */
if (pidlLast->mkid.cb >= 76) {
- ok(!lstrcmpW((WCHAR*)&pidlLast->mkid.abID[46], wszFileName),
+ ok(!lstrcmpW((WCHAR*)&pidlLast->mkid.abID[46], wszFileName) ||
+ (pidlLast->mkid.cb >= 94 &&
!lstrcmpW((WCHAR*)&pidlLast->mkid.abID[64], wszFileName)), /* Vista */
"Filename should be stored as wchar-string at this position!\n");
}
@@ -478,6 +490,7 @@
hr = IShellFolder_BindToObject(psfDesktop, pidlTestFile, NULL, &IID_IUnknown,
(VOID**)&psfFile);
todo_wine
ok (hr == HRESULT_FROM_WIN32(ERROR_FILE_NOT_FOUND) ||
+ hr == E_NOTIMPL || /* Vista */
broken(SUCCEEDED(hr)), /* Win9x, W2K */
"hr = %08x\n", hr);
if (SUCCEEDED(hr)) {
@@ -960,7 +973,9 @@
wszPath[1] = '\0';
result = pSHGetPathFromIDListW(pidlMyComputer, wszPath);
ok (!result, "SHGetPathFromIDListW succeeded where it shouldn't!\n");
- ok (GetLastError()==0xdeadbeef, "SHGetPathFromIDListW shouldn't set last
error! Last error: %u\n", GetLastError());
+ ok (GetLastError()==0xdeadbeef ||
+ GetLastError()==ERROR_SUCCESS, /* Vista and higher */
+ "Unexpected last error from SHGetPathFromIDListW: %u\n",
GetLastError());
ok (!wszPath[0], "Expected empty path\n");
if (result) {
IShellFolder_Release(psfDesktop);
@@ -1116,6 +1131,10 @@
'A','t','t','r','i','b','u','t','e','s',0
};
static const WCHAR wszResolveLinkFlags[] = {
'R','e','s','o','l','v','e','L','i','n','k','F','l','a','g','s',0
};
+ static const WCHAR wszTargetKnownFolder[] = {
+
'T','a','r','g','e','t','K','n','o','w','n','F','o','l','d','e','r',0
};
+ static const WCHAR wszCLSID[] = {
+ 'C','L','S','I','D',0 };
if (!lstrcmpW(pszPropName, wszTargetSpecialFolder)) {
ok(V_VT(pVar) == VT_I4 ||
@@ -1155,7 +1174,19 @@
return S_OK;
}
- ok(FALSE, "PropertyBag was asked for unknown property (vt=%d)!\n",
V_VT(pVar));
+ if (!lstrcmpW(pszPropName, wszTargetKnownFolder)) {
+ ok(V_VT(pVar) == VT_BSTR, "Wrong variant type for
'TargetKnownFolder' property!\n");
+ /* TODO */
+ return E_INVALIDARG;
+ }
+
+ if (!lstrcmpW(pszPropName, wszCLSID)) {
+ ok(V_VT(pVar) == VT_EMPTY, "Wrong variant type for 'CLSID'
property!\n");
+ /* TODO */
+ return E_INVALIDARG;
+ }
+
+ ok(FALSE, "PropertyBag was asked for unknown property %s (vt=%d)!\n",
wine_dbgstr_w(pszPropName), V_VT(pVar));
return E_INVALIDARG;
}
@@ -1529,7 +1560,7 @@
static char toolongpath[MAX_PATH+1];
if(!pSHGetFolderPathA) {
- skip("SHGetFolderPathA not present!\n");
+ win_skip("SHGetFolderPathA not present!\n");
return;
}
if(FAILED(pSHGetFolderPathA(NULL, CSIDL_LOCAL_APPDATA, NULL, SHGFP_TYPE_CURRENT,
appdata)))
@@ -1551,16 +1582,13 @@
skip("RemoveDirectoryA(%s) failed with error %u\n", testpath,
GetLastError());
return;
}
- for(i=0; i< MAX_PATH; i++)
- toolongpath[i] = '0' + i % 10;
- toolongpath[MAX_PATH] = '\0';
/* test invalid second parameter */
ret = pSHGetFolderPathAndSubDirA(NULL, CSIDL_FLAG_DONT_VERIFY | 0xff, NULL,
SHGFP_TYPE_CURRENT, wine, testpath);
ok(E_INVALIDARG == ret, "expected E_INVALIDARG, got %x\n", ret);
- /* test invalid forth parameter */
- ret = pSHGetFolderPathAndSubDirA(NULL, CSIDL_FLAG_DONT_VERIFY | CSIDL_LOCAL_APPDATA,
NULL, 2, wine, testpath);
+ /* test fourth parameter */
+ ret = pSHGetFolderPathAndSubDirA(NULL, CSIDL_FLAG_DONT_VERIFY | CSIDL_LOCAL_APPDATA,
NULL, 2, winetemp, testpath);
switch(ret) {
case S_OK: /* winvista */
ok(!strncmp(appdata, testpath, strlen(appdata)),
@@ -1590,6 +1618,9 @@
ok(S_OK == ret, "expected S_OK, got %x\n", ret);
ok(!lstrcmpA(appdata, testpath), "expected %s, got %s\n", appdata,
testpath);
+ for(i=0; i< MAX_PATH; i++)
+ toolongpath[i] = '0' + i % 10;
+ toolongpath[MAX_PATH] = '\0';
ret = pSHGetFolderPathAndSubDirA(NULL, CSIDL_FLAG_DONT_VERIFY | CSIDL_LOCAL_APPDATA,
NULL, SHGFP_TYPE_CURRENT, toolongpath, testpath);
ok(HRESULT_FROM_WIN32(ERROR_FILENAME_EXCED_RANGE) == ret,
"expected %x, got %x\n",
HRESULT_FROM_WIN32(ERROR_FILENAME_EXCED_RANGE), ret);
@@ -1620,15 +1651,6 @@
RemoveDirectoryA(testpath);
sprintf(testpath, "%s\\%s", appdata, wine);
RemoveDirectoryA(testpath);
-}
-
-static const char *wine_dbgstr_w(LPCWSTR str)
-{
- static char buf[512];
- if (!str)
- return "(null)";
- WideCharToMultiByte(CP_ACP, 0, str, -1, buf, sizeof(buf), NULL, NULL);
- return buf;
}
static void test_LocalizedNames(void)