Author: jimtabor
Date: Tue Sep 4 02:13:48 2012
New Revision: 57232
URL:
http://svn.reactos.org/svn/reactos?rev=57232&view=rev
Log:
[WineTests] - Sync to 1.5.12.
Modified:
trunk/rostests/winetests/user32/clipboard.c
trunk/rostests/winetests/user32/dce.c
trunk/rostests/winetests/user32/dde.c
trunk/rostests/winetests/user32/edit.c
trunk/rostests/winetests/user32/listbox.c
trunk/rostests/winetests/user32/menu.c
trunk/rostests/winetests/user32/monitor.c
trunk/rostests/winetests/user32/scroll.c
trunk/rostests/winetests/user32/win.c
trunk/rostests/winetests/user32/winstation.c
Modified: trunk/rostests/winetests/user32/clipboard.c
URL:
http://svn.reactos.org/svn/reactos/trunk/rostests/winetests/user32/clipboar…
==============================================================================
--- trunk/rostests/winetests/user32/clipboard.c [iso-8859-1] (original)
+++ trunk/rostests/winetests/user32/clipboard.c [iso-8859-1] Tue Sep 4 02:13:48 2012
@@ -66,6 +66,7 @@
ok( ret, "CloseClipboard error %d\n", GetLastError());
ok(OpenClipboard(hWnd1), "OpenClipboard failed\n");
+ todo_wine ok(OpenClipboard(hWnd1), "OpenClipboard second time in the same hwnd
failed\n");
SetLastError(0xdeadbeef);
ret = OpenClipboard(hWnd2);
Modified: trunk/rostests/winetests/user32/dce.c
URL:
http://svn.reactos.org/svn/reactos/trunk/rostests/winetests/user32/dce.c?re…
==============================================================================
--- trunk/rostests/winetests/user32/dce.c [iso-8859-1] (original)
+++ trunk/rostests/winetests/user32/dce.c [iso-8859-1] Tue Sep 4 02:13:48 2012
@@ -406,6 +406,56 @@
"clip box should have been reset %d,%d-%d,%d\n", rect.left, rect.top,
rect.right, rect.bottom );
}
+/* test ScrollWindow with window DCs */
+static void test_scroll_window(void)
+{
+ PAINTSTRUCT ps;
+ HDC hdc;
+ RECT clip, rect;
+
+ /* ScrollWindow uses the window DC, ScrollWindowEx doesn't */
+
+ UpdateWindow( hwnd_owndc );
+ SetRect( &clip, 25, 25, 50, 50 );
+ ScrollWindow( hwnd_owndc, -5, -10, NULL, &clip );
+ hdc = BeginPaint( hwnd_owndc, &ps );
+ SetRectEmpty( &rect );
+ GetClipBox( hdc, &rect );
+ ok( rect.left >= 25 && rect.top >= 25 && rect.right <= 50
&& rect.bottom <= 50,
+ "invalid clip box %d,%d-%d,%d\n", rect.left, rect.top, rect.right,
rect.bottom );
+ EndPaint( hwnd_owndc, &ps );
+
+ SetViewportExtEx( hdc, 2, 3, NULL );
+ SetViewportOrgEx( hdc, 30, 20, NULL );
+
+ ScrollWindow( hwnd_owndc, -5, -10, NULL, &clip );
+ hdc = BeginPaint( hwnd_owndc, &ps );
+ SetRectEmpty( &rect );
+ GetClipBox( hdc, &rect );
+ ok( rect.left >= 25 && rect.top >= 25 && rect.right <= 50
&& rect.bottom <= 50,
+ "invalid clip box %d,%d-%d,%d\n", rect.left, rect.top, rect.right,
rect.bottom );
+ EndPaint( hwnd_owndc, &ps );
+
+ ScrollWindowEx( hwnd_owndc, -5, -10, NULL, &clip, 0, NULL, SW_INVALIDATE |
SW_ERASE );
+ hdc = BeginPaint( hwnd_owndc, &ps );
+ SetRectEmpty( &rect );
+ GetClipBox( hdc, &rect );
+ ok( rect.left >= -5 && rect.top >= 5 && rect.right <= 20
&& rect.bottom <= 30,
+ "invalid clip box %d,%d-%d,%d\n", rect.left, rect.top, rect.right,
rect.bottom );
+ EndPaint( hwnd_owndc, &ps );
+
+ SetViewportExtEx( hdc, 1, 1, NULL );
+ SetViewportOrgEx( hdc, 0, 0, NULL );
+
+ ScrollWindowEx( hwnd_owndc, -5, -10, NULL, &clip, 0, NULL, SW_INVALIDATE |
SW_ERASE );
+ hdc = BeginPaint( hwnd_owndc, &ps );
+ SetRectEmpty( &rect );
+ GetClipBox( hdc, &rect );
+ ok( rect.left >= 25 && rect.top >= 25 && rect.right <= 50
&& rect.bottom <= 50,
+ "invalid clip box %d,%d-%d,%d\n", rect.left, rect.top, rect.right,
rect.bottom );
+ EndPaint( hwnd_owndc, &ps );
+}
+
static void test_invisible_create(void)
{
HWND hwnd_owndc = CreateWindowA("owndc_class", NULL, WS_OVERLAPPED,
@@ -559,6 +609,7 @@
test_parameters();
test_dc_visrgn();
test_begin_paint();
+ test_scroll_window();
test_invisible_create();
test_dc_layout();
Modified: trunk/rostests/winetests/user32/dde.c
URL:
http://svn.reactos.org/svn/reactos/trunk/rostests/winetests/user32/dde.c?re…
==============================================================================
--- trunk/rostests/winetests/user32/dde.c [iso-8859-1] (original)
+++ trunk/rostests/winetests/user32/dde.c [iso-8859-1] Tue Sep 4 02:13:48 2012
@@ -1924,7 +1924,7 @@
ok(err == DMLERR_INVALIDPARAMETER, "Expected DMLERR_INVALIDPARAMETER, got
%d\n", err);
ret = DdeUninitialize(dde_inst2);
- ok(res == DMLERR_NO_ERROR, "Expected DMLERR_NO_ERROR, got %d\n", res);
+ ok(ret == TRUE, "Expected TRUE, got %d\n", ret);
/* NULL pSrc */
@@ -2037,7 +2037,7 @@
ok(ret == TRUE, "Expected TRUE, got %d\n", ret);
ret = DdeUninitialize(dde_inst);
- ok(res == DMLERR_NO_ERROR, "Expected DMLERR_NO_ERROR, got %d\n", res);
+ ok(ret == TRUE, "Expected TRUE, got %d\n", ret);
}
static void test_DdeCreateStringHandle(void)
@@ -2459,7 +2459,6 @@
size = DdeQueryStringA(server_pid, hsz1, str, MAX_PATH, CP_WINANSI);
ok(!lstrcmpA(str, test_topic), "Expected %s, got %s, msg_index=%d\n",
test_topic, str, msg_index);
- ok(size == 12, "Expected 12, got %d, msg_index=%d\n", size,
msg_index);
ok(size == 12, "Expected 12, got %d, msg_index=%d\n", size,
msg_index);
size = DdeGetData(hdata, NULL, 0, 0);
Modified: trunk/rostests/winetests/user32/edit.c
URL:
http://svn.reactos.org/svn/reactos/trunk/rostests/winetests/user32/edit.c?r…
==============================================================================
--- trunk/rostests/winetests/user32/edit.c [iso-8859-1] (original)
+++ trunk/rostests/winetests/user32/edit.c [iso-8859-1] Tue Sep 4 02:13:48 2012
@@ -39,12 +39,14 @@
static struct edit_notify notifications;
static BOOL (WINAPI *pEndMenu) (void);
+static BOOL (WINAPI *pGetMenuBarInfo)(HWND,LONG,LONG,PMENUBARINFO);
static void init_function_pointers(void)
{
HMODULE hdll = GetModuleHandleA("user32");
pEndMenu = (void*)GetProcAddress(hdll, "EndMenu");
+ pGetMenuBarInfo = (void*)GetProcAddress(hdll, "GetMenuBarInfo");
}
static INT_PTR CALLBACK multi_edit_dialog_proc(HWND hdlg, UINT msg, WPARAM wparam, LPARAM
lparam)
@@ -2134,6 +2136,7 @@
static int got_en_setfocus = 0;
static int got_wm_capturechanged = 0;
+static LRESULT (CALLBACK *p_edit_proc)(HWND, UINT, WPARAM, LPARAM);
static LRESULT CALLBACK edit4_wnd_procA(HWND hWnd, UINT msg, WPARAM wParam, LPARAM
lParam)
{
@@ -2156,7 +2159,50 @@
return DefWindowProcA(hWnd, msg, wParam, lParam);
}
-static void test_contextmenu_focus(void)
+static LRESULT CALLBACK edit_proc_proxy(HWND hWnd, UINT msg, WPARAM wParam, LPARAM
lParam)
+{
+ switch (msg) {
+ case WM_ENTERIDLE: {
+ MENUBARINFO mbi;
+ BOOL ret;
+ HWND ctx_menu = (HWND)lParam;
+
+ memset(&mbi, 0, sizeof(mbi));
+ mbi.cbSize = sizeof(mbi);
+ SetLastError(0xdeadbeef);
+ ret = pGetMenuBarInfo(ctx_menu, OBJID_CLIENT, 0, &mbi);
+ ok(ret || broken(!ret && GetLastError()==ERROR_INVALID_WINDOW_HANDLE)
/* NT */,
+ "GetMenuBarInfo failed\n");
+ if (ret)
+ {
+ ok(mbi.hMenu != NULL, "mbi.hMenu = NULL\n");
+ ok(!mbi.hwndMenu, "mbi.hwndMenu != NULL\n");
+ ok(mbi.fBarFocused, "mbi.fBarFocused = FALSE\n");
+ ok(mbi.fFocused, "mbi.fFocused = FALSE\n");
+ }
+
+ memset(&mbi, 0, sizeof(mbi));
+ mbi.cbSize = sizeof(mbi);
+ SetLastError(0xdeadbeef);
+ ret = pGetMenuBarInfo(ctx_menu, OBJID_CLIENT, 1, &mbi);
+ ok(ret || broken(!ret && GetLastError()==ERROR_INVALID_WINDOW_HANDLE)
/* NT */,
+ "GetMenuBarInfo failed\n");
+ if (ret)
+ {
+ ok(mbi.hMenu != NULL, "mbi.hMenu = NULL\n");
+ ok(!mbi.hwndMenu, "mbi.hwndMenu != NULL\n");
+ ok(mbi.fBarFocused, "mbi.fBarFocused = FALSE\n");
+ ok(!mbi.fFocused, "mbi.fFocused = TRUE\n");
+ }
+
+ pEndMenu();
+ break;
+ }
+ }
+ return p_edit_proc(hWnd, msg, wParam, lParam);
+}
+
+static void test_contextmenu(void)
{
HWND hwndMain, hwndEdit;
@@ -2171,14 +2217,16 @@
assert(hwndEdit);
SetFocus(NULL);
-
SetCapture(hwndMain);
-
SendMessage(hwndEdit, WM_CONTEXTMENU, (WPARAM)hwndEdit, MAKEWORD(10, 10));
-
ok(got_en_setfocus, "edit box didn't get focused\n");
-
ok(got_wm_capturechanged, "main window capture did not change\n");
+
+ if (pGetMenuBarInfo)
+ {
+ p_edit_proc = (void*)SetWindowLongPtr(hwndEdit, GWLP_WNDPROC,
(ULONG_PTR)edit_proc_proxy);
+ SendMessage(hwndEdit, WM_CONTEXTMENU, (WPARAM)hwndEdit, MAKEWORD(10, 10));
+ }
DestroyWindow (hwndEdit);
DestroyWindow (hwndMain);
@@ -2516,7 +2564,7 @@
test_fontsize();
test_dialogmode();
if (pEndMenu)
- test_contextmenu_focus();
+ test_contextmenu();
else
win_skip("EndMenu is not available\n");
Modified: trunk/rostests/winetests/user32/listbox.c
URL:
http://svn.reactos.org/svn/reactos/trunk/rostests/winetests/user32/listbox.…
==============================================================================
--- trunk/rostests/winetests/user32/listbox.c [iso-8859-1] (original)
+++ trunk/rostests/winetests/user32/listbox.c [iso-8859-1] Tue Sep 4 02:13:48 2012
@@ -1335,7 +1335,6 @@
ok (itemCount == itemCount_justDrives + itemCount_allDirs,
"DlgDirList() incorrectly filled the listbox!\n");
-
/* Now test DlgDirSelectEx() in normal operation */
/* Fill with everything - drives, directory and all plain files. */
strcpy(pathBuffer, "*");
@@ -1412,6 +1411,8 @@
}
}
+ DeleteFileA( "wtest1.tmp.c" );
+
/* Now test DlgDirSelectEx() in abnormal operation */
/* Fill list with bogus entries, that look somewhat valid */
SendMessage(g_listBox, LB_RESETCONTENT, 0, 0);
@@ -1472,9 +1473,29 @@
ok (!strcmp(pathBuffer, tempBuffer), "Formatted file should be %s, got
%s\n", tempBuffer, pathBuffer);
}
}
+
+ /* Test behavior when loading folders from root with and without wildcard */
+ strcpy(pathBuffer, "C:\\");
+ res = DlgDirList(hWnd, pathBuffer, ID_TEST_LISTBOX, 0, DDL_DIRECTORY |
DDL_EXCLUSIVE);
+ ok(res || broken(!res) /* NT4/W2K */, "DlgDirList failed to list C:\\
folders\n");
+ todo_wine ok(!strcmp(pathBuffer, "*") || broken(!res) /* NT4/W2K */,
+ "DlgDirList set the invalid path spec '%s', expected
'*'\n", pathBuffer);
+
+ strcpy(pathBuffer, "C:\\*");
+ res = DlgDirList(hWnd, pathBuffer, ID_TEST_LISTBOX, 0, DDL_DIRECTORY |
DDL_EXCLUSIVE);
+ ok(res || broken(!res) /* NT4/W2K */, "DlgDirList failed to list C:\\*
folders\n");
+ ok(!strcmp(pathBuffer, "*") || broken(!res) /* NT4/W2K */,
+ "DlgDirList set the invalid path spec '%s', expected
'*'\n", pathBuffer);
+
+ /* Try loading files from an invalid folder */
+ SetLastError(0xdeadbeef);
+ strcpy(pathBuffer, "C:\\INVALID$$DIR");
+ res = DlgDirList(hWnd, pathBuffer, ID_TEST_LISTBOX, 0, DDL_DIRECTORY |
DDL_EXCLUSIVE);
+ todo_wine ok(!res, "DlgDirList should have failed with 0 but %d was
returned\n", res);
+ todo_wine ok(GetLastError() == ERROR_NO_WILDCARD_CHARACTERS,
+ "GetLastError should return 0x589, got 0x%X\n",GetLastError());
+
DestroyWindow(hWnd);
-
- DeleteFileA( "wtest1.tmp.c" );
}
START_TEST(listbox)
Modified: trunk/rostests/winetests/user32/menu.c
URL:
http://svn.reactos.org/svn/reactos/trunk/rostests/winetests/user32/menu.c?r…
==============================================================================
--- trunk/rostests/winetests/user32/menu.c [iso-8859-1] (original)
+++ trunk/rostests/winetests/user32/menu.c [iso-8859-1] Tue Sep 4 02:13:48 2012
@@ -38,6 +38,7 @@
static ATOM atomMenuCheckClass;
static BOOL (WINAPI *pGetMenuInfo)(HMENU,LPCMENUINFO);
+static BOOL (WINAPI *pGetMenuBarInfo)(HWND,LONG,LONG,PMENUBARINFO);
static UINT (WINAPI *pSendInput)(UINT, INPUT*, size_t);
static BOOL (WINAPI *pSetMenuInfo)(HMENU,LPCMENUINFO);
static BOOL (WINAPI *pEndMenu) (void);
@@ -52,6 +53,7 @@
trace("GetProcAddress(%s) failed\n", #func);
GET_PROC(GetMenuInfo)
+ GET_PROC(GetMenuBarInfo)
GET_PROC(SendInput)
GET_PROC(SetMenuInfo)
GET_PROC(EndMenu)
@@ -116,6 +118,7 @@
/* globals to communicate between test and wndproc */
static BOOL bMenuVisible;
+static INT popmenu;
static BOOL got_input;
static HMENU hMenus[4];
@@ -267,6 +270,134 @@
atomMenuCheckClass = RegisterClass(&wc);
}
+static void test_getmenubarinfo(void)
+{
+ BOOL ret;
+ HMENU hmenu;
+ MENUBARINFO mbi;
+ RECT rcw, rci;
+ HWND hwnd;
+ INT err;
+
+ if (!pGetMenuBarInfo) {
+ win_skip("GetMenuBarInfo is not available\n");
+ return;
+ }
+
+ mbi.cbSize = sizeof(MENUBARINFO);
+
+ hwnd = CreateWindowEx(0, MAKEINTATOM(atomMenuCheckClass), NULL,
+ WS_SYSMENU | WS_VISIBLE, CW_USEDEFAULT, CW_USEDEFAULT, 100, 100,
+ NULL, NULL, NULL, NULL);
+ ok(hwnd != NULL, "CreateWindowEx failed with error %d\n", GetLastError());
+
+ /* no menu: getmenubarinfo should fail */
+ SetLastError(0xdeadbeef);
+ ret = pGetMenuBarInfo(hwnd, OBJID_MENU, 0, &mbi);
+ err = GetLastError();
+ ok(ret == FALSE, "GetMenuBarInfo should not have been successful\n");
+ ok(err == 0xdeadbeef, "err = %d\n", err);
+
+ /* create menubar, no items yet */
+ hmenu = CreateMenu();
+ ok(hmenu != NULL, "CreateMenu failed with error %d\n", GetLastError());
+
+ ret = SetMenu(hwnd, hmenu);
+ ok(ret, "SetMenu failed with error %d\n", GetLastError());
+
+ SetLastError(0xdeadbeef);
+ ret = pGetMenuBarInfo(NULL, OBJID_CLIENT, 0, &mbi);
+ err = GetLastError();
+ ok(!ret, "GetMenuBarInfo succeeded\n");
+ ok(err == ERROR_INVALID_WINDOW_HANDLE, "err = %d\n", err);
+
+ SetLastError(0xdeadbeef);
+ ret = pGetMenuBarInfo(hwnd, OBJID_CLIENT, 0, &mbi);
+ err = GetLastError();
+ ok(!ret, "GetMenuBarInfo succeeded\n");
+ ok(err==ERROR_INVALID_MENU_HANDLE || broken(err==0xdeadbeef) /* NT, W2K, XP */,
"err = %d\n", err);
+
+ SetLastError(0xdeadbeef);
+ ret = pGetMenuBarInfo(hwnd, OBJID_MENU, -1, &mbi);
+ err = GetLastError();
+ ok(ret == FALSE, "GetMenuBarInfo should have failed\n");
+ ok(err == 0xdeadbeef, "err = %d\n", err);
+
+ mbi.cbSize = 1000;
+ SetLastError(0xdeadbeef);
+ ret = pGetMenuBarInfo(hwnd, OBJID_MENU, 0, &mbi);
+ err = GetLastError();
+ ok(ret == FALSE, "GetMenuBarInfo should have failed\n");
+ ok(err == ERROR_INVALID_PARAMETER, "err = %d\n", err);
+ mbi.cbSize = sizeof(MENUBARINFO);
+
+ SetLastError(0xdeadbeef);
+ ret = pGetMenuBarInfo(hwnd, 123, 0, &mbi);
+ err = GetLastError();
+ ok(ret == FALSE, "GetMenuBarInfo should have failed\n");
+ ok(err == 0xdeadbeef, "err = %d\n", err);
+
+ ret = pGetMenuBarInfo(hwnd, OBJID_MENU, 0, &mbi);
+ ok(ret, "GetMenuBarInfo failed with error %d\n", GetLastError());
+
+ ok(mbi.rcBar.left == 0 && mbi.rcBar.top == 0 &&
+ mbi.rcBar.bottom == 0 && mbi.rcBar.right == 0,
+ "rcBar: Expected 0,0-0,0, got: %d,%d-%d,%d\n",
+ mbi.rcBar.left, mbi.rcBar.top, mbi.rcBar.right, mbi.rcBar.bottom);
+ ok(mbi.hMenu == hmenu, "hMenu: Got %p instead of %p\n",
+ mbi.hMenu, hmenu);
+ ok(mbi.fBarFocused == 0, "fBarFocused: Got %d instead of 0.\n",
mbi.fBarFocused);
+ ok(mbi.fFocused == 0, "fFocused: Got %d instead of 0.\n", mbi.fFocused);
+
+ /* add some items */
+ ret = AppendMenu(hmenu, MF_STRING , 100, "item 1");
+ ok(ret, "AppendMenu failed.\n");
+ ret = AppendMenu(hmenu, MF_STRING , 101, "item 2");
+ ok(ret, "AppendMenu failed.\n");
+ ret = SetMenu(hwnd, hmenu);
+ ok(ret, "SetMenu failed with error %d\n", GetLastError());
+
+ SetLastError(0xdeadbeef);
+ ret = pGetMenuBarInfo(hwnd, OBJID_MENU, 200, &mbi);
+ err = GetLastError();
+ ok(ret == FALSE, "GetMenuBarInfo should have failed\n");
+ ok(err == 0xdeadbeef, "err = %d\n", err);
+
+ /* get info for the whole menu */
+ ret = pGetMenuBarInfo(hwnd, OBJID_MENU, 0, &mbi);
+ ok(ret, "GetMenuBarInfo failed with error %d\n", GetLastError());
+
+ /* calculate menu rectangle, from window rectangle and the position of the first item
*/
+ ret = GetWindowRect(hwnd, &rcw);
+ ok(ret, "GetWindowRect failed.\n");
+ ret = GetMenuItemRect(hwnd, hmenu, 0, &rci);
+ ok(ret, "GetMenuItemRect failed.\n");
+ todo_wine ok(mbi.rcBar.left == rci.left && mbi.rcBar.top == rci.top
&&
+ mbi.rcBar.bottom == rci.bottom && mbi.rcBar.right == rcw.right -
rci.left + rcw.left,
+ "rcBar: Got %d,%d-%d,%d instead of %d,%d-%d,%d\n",
+ mbi.rcBar.left, mbi.rcBar.top, mbi.rcBar.right, mbi.rcBar.bottom,
+ rci.left, rci.top, rcw.right - rci.left + rcw.left, rci.bottom);
+ ok(mbi.hMenu == hmenu, "hMenu: Got %p instead of %p\n", mbi.hMenu, hmenu);
+ ok(mbi.fBarFocused == 0, "fBarFocused: got %d instead of 0\n",
mbi.fBarFocused);
+ ok(mbi.fFocused == 0, "fFocused: got %d instead of 0\n", mbi.fFocused);
+
+ /* get info for item nr.2 */
+ ret = pGetMenuBarInfo(hwnd, OBJID_MENU, 2, &mbi);
+ ok(ret, "GetMenuBarInfo failed with error %d\n", GetLastError());
+ ret = GetMenuItemRect(hwnd, hmenu, 1, &rci);
+ ok(ret, "GetMenuItemRect failed.\n");
+ ok(mbi.rcBar.left == rci.left && mbi.rcBar.top == rci.top &&
+ mbi.rcBar.bottom == rci.bottom && mbi.rcBar.right == rci.right,
+ "rcBar: Got %d,%d-%d,%d instead of %d,%d-%d,%d\n",
+ mbi.rcBar.left, mbi.rcBar.top, mbi.rcBar.right, mbi.rcBar.bottom,
+ rci.left, rci.top, rci.right, rci.bottom);
+ ok(mbi.hMenu == hmenu, "hMenu: Got %p instead of %p\n", mbi.hMenu, hmenu);
+ ok(mbi.fBarFocused == 0, "fBarFocused: got %d instead of 0\n",
mbi.fBarFocused);
+ ok(mbi.fFocused == 0, "fFocused: got %d instead of 0\n", mbi.fFocused);
+
+ DestroyWindow(hwnd);
+}
+
/* demonstrates that windows locks the menu object so that it is still valid
* even after a client calls DestroyMenu on it */
static void test_menu_locked_by_window(void)
@@ -2030,9 +2161,12 @@
case WM_ENTERMENULOOP:
bMenuVisible = TRUE;
break;
+ case WM_INITMENUPOPUP:
+ case WM_UNINITMENUPOPUP:
case WM_EXITMENULOOP:
- bMenuVisible = FALSE;
+ case WM_MENUSELECT:
break;
+
case WM_KEYDOWN:
case WM_SYSKEYDOWN:
case WM_MOUSEMOVE:
@@ -2046,6 +2180,59 @@
default:
return( DefWindowProcA( hWnd, msg, wParam, lParam ) );
}
+
+ if(pGetMenuBarInfo)
+ {
+ MENUBARINFO mbi;
+ HMENU hmenu;
+ UINT state;
+ BOOL br;
+
+ mbi.cbSize = sizeof(MENUBARINFO);
+
+ /* get info for the menu */
+ br = pGetMenuBarInfo(hWnd, OBJID_MENU, 0, &mbi);
+ ok(br, "msg %x: GetMenuBarInfo failed\n", msg);
+ hmenu = GetMenu(hWnd);
+ ok(!mbi.hwndMenu, "msg %x: GetMenuBarInfo.hwndMenu wrong: %p expected
NULL\n",
+ msg, mbi.hwndMenu);
+ ok(mbi.hMenu == hmenu, "msg %x: GetMenuBarInfo got wrong menu: %p expected
%p\n",
+ msg, mbi.hMenu, hmenu);
+ ok(!bMenuVisible == !mbi.fBarFocused, "msg %x: GetMenuBarInfo.fBarFocused
(%d) is wrong\n",
+ msg, mbi.fBarFocused != 0);
+ ok(!bMenuVisible == !mbi.fFocused, "msg %x: GetMenuBarInfo.fFocused (%d) is
wrong\n",
+ msg, mbi.fFocused != 0);
+
+ /* get info for the menu's first item */
+ br = pGetMenuBarInfo(hWnd, OBJID_MENU, 1, &mbi);
+ ok(br, "msg %x: GetMenuBarInfo failed\n", msg);
+ state = GetMenuState(hmenu, 0, MF_BYPOSITION);
+ if (pGetMenuInfo) /* Skip on NT */
+ {
+ /* Native returns handle to destroyed window */
+ if (msg==WM_UNINITMENUPOPUP && popmenu==1)
+ todo_wine ok(!mbi.hwndMenu == !popmenu,
+ "msg %x: GetMenuBarInfo.hwndMenu wrong: %p expected
%sNULL\n",
+ msg, mbi.hwndMenu, popmenu ? "not " : "");
+ else
+ ok(!mbi.hwndMenu == !popmenu,
+ "msg %x: GetMenuBarInfo.hwndMenu wrong: %p expected
%sNULL\n",
+ msg, mbi.hwndMenu, popmenu ? "not " : "");
+ }
+ ok(mbi.hMenu == hmenu, "msg %x: GetMenuBarInfo got wrong menu: %p expected
%p\n",
+ msg, mbi.hMenu, hmenu);
+ ok(!bMenuVisible == !mbi.fBarFocused, "nsg %x: GetMenuBarInfo.fBarFocused
(%d) is wrong\n",
+ msg, mbi.fBarFocused != 0);
+ ok(!(bMenuVisible && (state & MF_HILITE)) == !mbi.fFocused,
+ "msg %x: GetMenuBarInfo.fFocused (%d) is wrong\n", msg,
mbi.fFocused != 0);
+ }
+
+ if (msg == WM_EXITMENULOOP)
+ bMenuVisible = FALSE;
+ else if (msg == WM_INITMENUPOPUP)
+ popmenu++;
+ else if (msg == WM_UNINITMENUPOPUP)
+ popmenu--;
return 0;
}
@@ -3317,6 +3504,7 @@
test_menu_locked_by_window();
test_subpopup_locked_by_menu();
test_menu_ownerdraw();
+ test_getmenubarinfo();
test_menu_bmp_and_string();
test_menu_getmenuinfo();
test_menu_setmenuinfo();
Modified: trunk/rostests/winetests/user32/monitor.c
URL:
http://svn.reactos.org/svn/reactos/trunk/rostests/winetests/user32/monitor.…
==============================================================================
--- trunk/rostests/winetests/user32/monitor.c [iso-8859-1] (original)
+++ trunk/rostests/winetests/user32/monitor.c [iso-8859-1] Tue Sep 4 02:13:48 2012
@@ -177,7 +177,7 @@
dm.dmDriverExtra = 1;
res = pChangeDisplaySettingsExA(NULL, &dm, NULL, CDS_TEST, NULL);
ok(res == DISP_CHANGE_SUCCESSFUL,
- "ChangeDisplaySettingsExW returned %d, expected DISP_CHANGE_BADMODE\n",
res);
+ "ChangeDisplaySettingsExW returned %d, expected
DISP_CHANGE_SUCCESSFUL\n", res);
ok(dm.dmDriverExtra == 1, "ChangeDisplaySettingsExA shouldn't reset
dmDriverExtra to 0\n");
memset(&dmW, 0, sizeof(dmW));
@@ -201,7 +201,7 @@
if (GetLastError() != ERROR_CALL_NOT_IMPLEMENTED)
{
ok(res == DISP_CHANGE_SUCCESSFUL,
- "ChangeDisplaySettingsExW returned %d, expected
DISP_CHANGE_BADMODE\n", res);
+ "ChangeDisplaySettingsExW returned %d, expected
DISP_CHANGE_SUCCESSFUL\n", res);
ok(dmW.dmDriverExtra == 1, "ChangeDisplaySettingsExW shouldn't reset
dmDriverExtra to 0\n");
}
Modified: trunk/rostests/winetests/user32/scroll.c
URL:
http://svn.reactos.org/svn/reactos/trunk/rostests/winetests/user32/scroll.c…
==============================================================================
--- trunk/rostests/winetests/user32/scroll.c [iso-8859-1] (original)
+++ trunk/rostests/winetests/user32/scroll.c [iso-8859-1] Tue Sep 4 02:13:48 2012
@@ -375,7 +375,7 @@
ret = EnableScrollBar( hwnd, SB_HORZ, ESB_ENABLE_BOTH);
ok( !ret, "Horizontal window scroll bar was not enabled\n");
DestroyWindow( hwnd);
- /* finally, check if adding a WS_[HV]SColl style of a window makes the scroll info
+ /* finally, check if adding a WS_[HV]SCROLL style of a window makes the scroll info
* available */
if( style & (WS_HSCROLL | WS_VSCROLL)) return;/* only test if not yet set */
/* Start with a clean window */
Modified: trunk/rostests/winetests/user32/win.c
URL:
http://svn.reactos.org/svn/reactos/trunk/rostests/winetests/user32/win.c?re…
==============================================================================
--- trunk/rostests/winetests/user32/win.c [iso-8859-1] (original)
+++ trunk/rostests/winetests/user32/win.c [iso-8859-1] Tue Sep 4 02:13:48 2012
@@ -1172,7 +1172,7 @@
ok(!ret, "third call to SetShellWindow(hwnd1)\n"); */
SetWindowLong(hwnd1, GWL_EXSTYLE, GetWindowLong(hwnd1,GWL_EXSTYLE)|WS_EX_TOPMOST);
- ret = GetWindowLong(hwnd1,GWL_EXSTYLE)&WS_EX_TOPMOST? TRUE: FALSE;
+ ret = (GetWindowLong(hwnd1,GWL_EXSTYLE) & WS_EX_TOPMOST) != 0;
ok(!ret, "SetWindowExStyle(hwnd1, WS_EX_TOPMOST)\n");
ret = DestroyWindow(hwnd1);
@@ -2157,6 +2157,14 @@
DestroyWindow(hwnd_grandchild);
DestroyWindow(hwnd_child);
DestroyWindow(hwnd_child2);
+
+ hwnd_child = create_tool_window(WS_CHILD|WS_POPUP|WS_SYSMENU, hwnd2);
+ ok(!!hwnd_child, "Failed to create child window (%d)\n", GetLastError());
+ ret = SetWindowPos(hwnd_child, NULL, 0, 0, 0, 0,
SWP_NOSIZE|SWP_NOMOVE|SWP_NOACTIVATE|SWP_SHOWWINDOW);
+ ok(ret, "Got %d\n", ret);
+ flush_events( TRUE );
+ todo_wine check_active_state(hwnd2, hwnd2, hwnd2);
+ DestroyWindow(hwnd_child);
}
static void test_SetMenu(HWND parent)
@@ -6680,7 +6688,7 @@
{
HWND hwnd;
FLASHWINFO finfo;
- BOOL ret;
+ BOOL prev, ret;
if (!pFlashWindowEx)
{
@@ -6749,8 +6757,7 @@
"FlashWindowEx returned with %d\n", GetLastError());
SetLastError(0xdeadbeef);
- ret = pFlashWindowEx(&finfo);
- ok(ret, "previous window state should be active\n");
+ prev = pFlashWindowEx(&finfo);
ok(finfo.cbSize == sizeof(FLASHWINFO), "FlashWindowEx modified cdSize to
%x\n", finfo.cbSize);
ok(finfo.hwnd == hwnd, "FlashWindowEx modified hwnd to %p\n", finfo.hwnd);
@@ -6762,7 +6769,7 @@
SetLastError(0xdeadbeef);
ret = pFlashWindowEx(&finfo);
todo_wine
- ok(!ret, "previous window state should not be active\n");
+ ok(prev != ret, "previous window state should be different\n");
DestroyWindow( hwnd );
}
Modified: trunk/rostests/winetests/user32/winstation.c
URL:
http://svn.reactos.org/svn/reactos/trunk/rostests/winetests/user32/winstati…
==============================================================================
--- trunk/rostests/winetests/user32/winstation.c [iso-8859-1] (original)
+++ trunk/rostests/winetests/user32/winstation.c [iso-8859-1] Tue Sep 4 02:13:48 2012
@@ -371,6 +371,110 @@
ok(GetLastError() == 0xdeadbeef, "LastError is set to %08x\n",
GetLastError());
}
+/* Miscellaneous tests */
+
+static void test_getuserobjectinformation(void)
+{
+ HDESK desk;
+ WCHAR bufferW[20];
+ char buffer[20];
+ WCHAR foobarTestW[] =
{'f','o','o','b','a','r','T','e','s','t',0};
+ WCHAR DesktopW[] =
{'D','e','s','k','t','o','p',0};
+ DWORD size;
+ BOOL ret;
+
+ desk = CreateDesktop("foobarTest", NULL, NULL, 0, DESKTOP_ALL_ACCESS,
NULL);
+ ok(desk != 0, "open foobarTest desktop failed\n");
+
+ strcpy(buffer, "blahblah");
+
+ /** Tests for UOI_NAME **/
+
+ /* Get size, test size and return value/error code */
+ SetLastError(0xdeadbeef);
+ size = 0xdeadbeef;
+ ret = GetUserObjectInformationA(desk, UOI_NAME, NULL, 0, &size);
+
+ ok(!ret, "GetUserObjectInformationA returned %x\n", ret);
+ ok(GetLastError() == ERROR_INSUFFICIENT_BUFFER, "LastError is set to
%08x\n", GetLastError());
+ ok(size == 22, "size is set to %d\n", size); /* Windows returns Unicode
length (11*2) */
+
+ /* Get string */
+ SetLastError(0xdeadbeef);
+ size = 0xdeadbeef;
+ ret = GetUserObjectInformationA(desk, UOI_NAME, buffer, sizeof(buffer), &size);
+
+ ok(ret, "GetUserObjectInformationA returned %x\n", ret);
+ ok(GetLastError() == 0xdeadbeef, "LastError is set to %08x\n",
GetLastError());
+
+ ok(strcmp(buffer, "foobarTest") == 0, "Buffer is set to
'%s'\n", buffer);
+ ok(size == 11, "size is set to %d\n", size); /* 11 bytes in
'foobarTest\0' */
+
+ /* Get size, test size and return value/error code (Unicode) */
+ SetLastError(0xdeadbeef);
+ size = 0xdeadbeef;
+ ret = GetUserObjectInformationW(desk, UOI_NAME, NULL, 0, &size);
+
+ ok(!ret, "GetUserObjectInformationW returned %x\n", ret);
+ ok(GetLastError() == ERROR_INSUFFICIENT_BUFFER, "LastError is set to
%08x\n", GetLastError());
+ ok(size == 22, "size is set to %d\n", size); /* 22 bytes in
'foobarTest\0' in Unicode */
+
+ /* Get string (Unicode) */
+ SetLastError(0xdeadbeef);
+ size = 0xdeadbeef;
+ ret = GetUserObjectInformationW(desk, UOI_NAME, bufferW, sizeof(bufferW),
&size);
+
+ ok(ret, "GetUserObjectInformationW returned %x\n", ret);
+ ok(GetLastError() == 0xdeadbeef, "LastError is set to %08x\n",
GetLastError());
+
+ ok(lstrcmpW(bufferW, foobarTestW) == 0, "Buffer is not set to
'foobarTest'\n");
+ ok(size == 22, "size is set to %d\n", size); /* 22 bytes in
'foobarTest\0' in Unicode */
+
+ /** Tests for UOI_TYPE **/
+
+ /* Get size, test size and return value/error code */
+ SetLastError(0xdeadbeef);
+ size = 0xdeadbeef;
+ ret = GetUserObjectInformationA(desk, UOI_TYPE, NULL, 0, &size);
+
+ ok(!ret, "GetUserObjectInformationA returned %x\n", ret);
+ ok(GetLastError() == ERROR_INSUFFICIENT_BUFFER, "LastError is set to
%08x\n", GetLastError());
+ ok(size == 16, "size is set to %d\n", size); /* Windows returns Unicode
length (8*2) */
+
+ /* Get string */
+ SetLastError(0xdeadbeef);
+ size = 0xdeadbeef;
+ ret = GetUserObjectInformationA(desk, UOI_TYPE, buffer, sizeof(buffer), &size);
+
+ ok(ret, "GetUserObjectInformationA returned %x\n", ret);
+ ok(GetLastError() == 0xdeadbeef, "LastError is set to %08x\n",
GetLastError());
+
+ ok(strcmp(buffer, "Desktop") == 0, "Buffer is set to
'%s'\n", buffer);
+ ok(size == 8, "size is set to %d\n", size); /* 8 bytes in
'Desktop\0' */
+
+ /* Get size, test size and return value/error code (Unicode) */
+ size = 0xdeadbeef;
+ SetLastError(0xdeadbeef);
+ ret = GetUserObjectInformationW(desk, UOI_TYPE, NULL, 0, &size);
+
+ ok(!ret, "GetUserObjectInformationW returned %x\n", ret);
+ ok(GetLastError() == ERROR_INSUFFICIENT_BUFFER, "LastError is set to
%08x\n", GetLastError());
+ ok(size == 16, "size is set to %d\n", size); /* 16 bytes in
'Desktop\0' in Unicode */
+
+ /* Get string (Unicode) */
+ SetLastError(0xdeadbeef);
+ size = 0xdeadbeef;
+ ret = GetUserObjectInformationW(desk, UOI_TYPE, bufferW, sizeof(bufferW),
&size);
+
+ ok(ret, "GetUserObjectInformationW returned %x\n", ret);
+ ok(GetLastError() == 0xdeadbeef, "LastError is set to %08x\n",
GetLastError());
+
+ ok(lstrcmpW(bufferW, DesktopW) == 0, "Buffer is not set to
'Desktop'\n");
+ ok(size == 16, "size is set to %d\n", size); /* 16 bytes in
'Desktop\0' in Unicode */
+
+ ok(CloseDesktop(desk), "CloseDesktop failed\n");
+}
+
START_TEST(winstation)
{
/* Check whether this platform supports WindowStation calls */
@@ -386,4 +490,5 @@
test_enumstations();
test_enumdesktops();
test_handles();
-}
+ test_getuserobjectinformation();
+}