[ros-diffs] [cwittich] 43752: -sync user32_winetest with wine 1.1.32

cwittich at svn.reactos.org cwittich at svn.reactos.org
Sun Oct 25 21:32:13 CET 2009


Author: cwittich
Date: Sun Oct 25 21:32:13 2009
New Revision: 43752

URL: http://svn.reactos.org/svn/reactos?rev=43752&view=rev
Log:
-sync user32_winetest with wine 1.1.32

Modified:
    trunk/rostests/winetests/user32/class.c
    trunk/rostests/winetests/user32/dde.c
    trunk/rostests/winetests/user32/input.c
    trunk/rostests/winetests/user32/listbox.c
    trunk/rostests/winetests/user32/menu.c
    trunk/rostests/winetests/user32/msg.c
    trunk/rostests/winetests/user32/win.c

Modified: trunk/rostests/winetests/user32/class.c
URL: http://svn.reactos.org/svn/reactos/trunk/rostests/winetests/user32/class.c?rev=43752&r1=43751&r2=43752&view=diff
==============================================================================
--- trunk/rostests/winetests/user32/class.c [iso-8859-1] (original)
+++ trunk/rostests/winetests/user32/class.c [iso-8859-1] Sun Oct 25 21:32:13 2009
@@ -831,9 +831,41 @@
     }
 }
 
+static const struct
+{
+    const char name[9];
+    int value;
+    int badvalue;
+} extra_values[] =
+{
+    {"#32770",30,30}, /* Dialog */
+#ifdef _WIN64
+    {"Edit",8,8},
+#else
+    {"Edit",6,8},     /* Windows XP 64-bit returns 8 also to 32-bit applications */
+#endif
+};
+
+static void test_extra_values(void)
+{
+    int i;
+    for(i=0; i< sizeof(extra_values)/sizeof(extra_values[0]); i++)
+    {
+        WNDCLASSEX wcx;
+        BOOL ret = GetClassInfoEx(NULL,extra_values[i].name,&wcx);
+
+        ok( ret, "GetClassInfo (0) failed for global class %s\n", extra_values[i].name);
+        if (!ret) continue;
+        ok(extra_values[i].value == wcx.cbWndExtra || broken(extra_values[i].badvalue == wcx.cbWndExtra),
+           "expected %d, got %d\n", extra_values[i].value, wcx.cbWndExtra);
+    }
+}
+
 START_TEST(class)
 {
     HANDLE hInstance = GetModuleHandleA( NULL );
+
+    test_extra_values();
 
     if (!GetModuleHandleW(0))
     {

Modified: trunk/rostests/winetests/user32/dde.c
URL: http://svn.reactos.org/svn/reactos/trunk/rostests/winetests/user32/dde.c?rev=43752&r1=43751&r2=43752&view=diff
==============================================================================
--- trunk/rostests/winetests/user32/dde.c [iso-8859-1] (original)
+++ trunk/rostests/winetests/user32/dde.c [iso-8859-1] Sun Oct 25 21:32:13 2009
@@ -211,7 +211,7 @@
 
         executed = TRUE;
 
-        lparam = ReuseDDElParam(lparam, WM_DDE_EXECUTE, WM_DDE_ACK, DDE_FACK, HIWORD(lparam));
+        lparam = ReuseDDElParam(lparam, WM_DDE_EXECUTE, WM_DDE_ACK, DDE_FACK, lparam);
         PostMessageA(client, WM_DDE_ACK, (WPARAM)hwnd, lparam);
 
         break;

Modified: trunk/rostests/winetests/user32/input.c
URL: http://svn.reactos.org/svn/reactos/trunk/rostests/winetests/user32/input.c?rev=43752&r1=43751&r2=43752&view=diff
==============================================================================
--- trunk/rostests/winetests/user32/input.c [iso-8859-1] (original)
+++ trunk/rostests/winetests/user32/input.c [iso-8859-1] Sun Oct 25 21:32:13 2009
@@ -904,7 +904,12 @@
     SetWindowPos( window, HWND_TOPMOST, 0, 0, 0, 0, SWP_NOSIZE|SWP_NOMOVE );
     SetForegroundWindow( window );
 
-    hook = SetWindowsHookExA(WH_KEYBOARD_LL, hook_proc, GetModuleHandleA( NULL ), 0);
+    if (!(hook = SetWindowsHookExA(WH_KEYBOARD_LL, hook_proc, GetModuleHandleA( NULL ), 0)))
+    {
+        DestroyWindow(window);
+        win_skip("WH_KEYBOARD_LL is not supported\n");
+        return;
+    }
 
     /* must process all initial messages, otherwise X11DRV_KeymapNotify unsets
      * key state set by SendInput(). */

Modified: trunk/rostests/winetests/user32/listbox.c
URL: http://svn.reactos.org/svn/reactos/trunk/rostests/winetests/user32/listbox.c?rev=43752&r1=43751&r2=43752&view=diff
==============================================================================
--- trunk/rostests/winetests/user32/listbox.c [iso-8859-1] (original)
+++ trunk/rostests/winetests/user32/listbox.c [iso-8859-1] Sun Oct 25 21:32:13 2009
@@ -303,6 +303,7 @@
     hLB = create_listbox(LBS_OWNERDRAWFIXED | WS_CHILD | WS_VISIBLE, parent);
     assert(hLB);
 
+    SetForegroundWindow(hLB);
     UpdateWindow(hLB);
 
     /* make height short enough */

Modified: trunk/rostests/winetests/user32/menu.c
URL: http://svn.reactos.org/svn/reactos/trunk/rostests/winetests/user32/menu.c?rev=43752&r1=43751&r2=43752&view=diff
==============================================================================
--- trunk/rostests/winetests/user32/menu.c [iso-8859-1] (original)
+++ trunk/rostests/winetests/user32/menu.c [iso-8859-1] Sun Oct 25 21:32:13 2009
@@ -150,10 +150,12 @@
 static LRESULT WINAPI menu_ownerdraw_wnd_proc(HWND hwnd, UINT msg,
         WPARAM wparam, LPARAM lparam)
 {
+    static HMENU hmenupopup;
     switch (msg)
     {
         case WM_INITMENUPOPUP:
             gflag_initmenupopup++;
+            hmenupopup = (HMENU) wparam;
             break;
         case WM_ENTERMENULOOP:
             gflag_entermenuloop++;
@@ -229,6 +231,11 @@
             {
                 ok( lparam || broken(!lparam), /* win9x, nt4 */
                     "Menu window handle is NULL!\n");
+                if( lparam) {
+                    HMENU hmenu = (HMENU)SendMessageA( (HWND)lparam, MN_GETHMENU, 0, 0);
+                    ok( hmenupopup == hmenu, "MN_GETHMENU returns %p expected %p\n",
+                        hmenu, hmenupopup);
+                }
                 PostMessage(hwnd, WM_CANCELMODE, 0, 0);
                 return TRUE;
             }

Modified: trunk/rostests/winetests/user32/msg.c
URL: http://svn.reactos.org/svn/reactos/trunk/rostests/winetests/user32/msg.c?rev=43752&r1=43751&r2=43752&view=diff
==============================================================================
--- trunk/rostests/winetests/user32/msg.c [iso-8859-1] (original)
+++ trunk/rostests/winetests/user32/msg.c [iso-8859-1] Sun Oct 25 21:32:13 2009
@@ -6870,6 +6870,36 @@
     { WM_CONTEXTMENU, sent|lparam, /*hwnd*/0, (LPARAM)-1 },
     { 0 }
 };
+static const struct message WmVkF10Seq[] = {
+    { HCBT_KEYSKIPPED, hook|wparam|lparam|optional, VK_F10, 1 }, /* XP */
+    { WM_SYSKEYDOWN, wparam|lparam, VK_F10, 1 },
+    { WM_SYSKEYDOWN, sent|wparam|lparam, VK_F10, 0x00000001 },
+    { HCBT_KEYSKIPPED, hook|wparam|lparam|optional, VK_F10, 0xc0000001 }, /* XP */
+    { WM_SYSKEYUP, wparam|lparam, VK_F10, 0xc0000001 },
+    { WM_SYSKEYUP, sent|wparam|lparam, VK_F10, 0xc0000001 },
+    { WM_SYSCOMMAND, sent|defwinproc|wparam, SC_KEYMENU },
+    { HCBT_SYSCOMMAND, hook },
+    { WM_ENTERMENULOOP, sent|defwinproc|wparam|lparam, 0, 0 },
+    { EVENT_SYSTEM_CAPTURESTART, winevent_hook|wparam|lparam, 0, 0 },
+    { WM_INITMENU, sent|defwinproc },
+    { EVENT_SYSTEM_MENUSTART, winevent_hook|wparam|lparam, OBJID_SYSMENU, 0 },
+    { WM_MENUSELECT, sent|defwinproc|wparam, MAKEWPARAM(0,MF_SYSMENU|MF_POPUP|MF_HILITE) },
+    { EVENT_OBJECT_FOCUS, winevent_hook|wparam|lparam, OBJID_SYSMENU, 1 },
+
+    { HCBT_KEYSKIPPED, hook|wparam|lparam|optional, VK_F10, 0x10000001 }, /* XP */
+
+    { HCBT_KEYSKIPPED, hook|wparam|lparam|optional, VK_F10, 1 }, /* XP */
+    { EVENT_OBJECT_FOCUS, winevent_hook|wparam|lparam, OBJID_SYSMENU, 0 },
+    { EVENT_SYSTEM_CAPTUREEND, winevent_hook|wparam|lparam, 0, 0, },
+    { WM_CAPTURECHANGED, sent|defwinproc },
+    { WM_MENUSELECT, sent|defwinproc|wparam|optional, MAKEWPARAM(0,0xffff) },
+    { EVENT_SYSTEM_MENUEND, winevent_hook|wparam|lparam, OBJID_SYSMENU, 0 },
+    { WM_EXITMENULOOP, sent|defwinproc },
+    { HCBT_KEYSKIPPED, hook|wparam|lparam|optional, VK_F10, 0xc0000001 }, /* XP */
+    { WM_SYSKEYUP, wparam|lparam, VK_F10, 0xc0000001 },
+    { WM_SYSKEYUP, sent|wparam|lparam, VK_F10, 0xc0000001 },
+    { 0 }
+};
 
 static void pump_msg_loop(HWND hwnd, HACCEL hAccel)
 {
@@ -7081,6 +7111,14 @@
     keybd_event(VK_APPS, 0, KEYEVENTF_KEYUP, 0);
     pump_msg_loop(hwnd, 0);
     ok_sequence(WmVkAppsSeq, "VK_APPS press/release", FALSE);
+
+    trace("testing VK_F10 press/release\n");
+    keybd_event(VK_F10, 0, 0, 0);
+    keybd_event(VK_F10, 0, KEYEVENTF_KEYUP, 0);
+    keybd_event(VK_F10, 0, 0, 0);
+    keybd_event(VK_F10, 0, KEYEVENTF_KEYUP, 0);
+    pump_msg_loop(hwnd, 0);
+    ok_sequence(WmVkF10Seq, "VK_F10 press/release", TRUE);
 
     trace("testing Shift+MouseButton press/release\n");
     /* first, move mouse pointer inside of the window client area */

Modified: trunk/rostests/winetests/user32/win.c
URL: http://svn.reactos.org/svn/reactos/trunk/rostests/winetests/user32/win.c?rev=43752&r1=43751&r2=43752&view=diff
==============================================================================
--- trunk/rostests/winetests/user32/win.c [iso-8859-1] (original)
+++ trunk/rostests/winetests/user32/win.c [iso-8859-1] Sun Oct 25 21:32:13 2009
@@ -569,6 +569,60 @@
     DestroyWindow( owner );
 }
 
+static BOOL CALLBACK enum_proc( HWND hwnd, LPARAM lParam)
+{
+    (*(LPINT)lParam)++;
+    if (*(LPINT)lParam > 2) return FALSE;
+    return TRUE;
+}
+static DWORD CALLBACK enum_thread( void *arg )
+{
+    INT count;
+    HWND hwnd[3];
+    BOOL ret;
+    MSG msg;
+
+    PeekMessage( &msg, 0, 0, 0, PM_NOREMOVE );  /* make sure we have a message queue */
+
+    count = 0;
+    ret = EnumThreadWindows( GetCurrentThreadId(), enum_proc, (LPARAM)&count );
+    ok( ret, "EnumThreadWindows should have returned TRUE\n" );
+    ok( count == 0, "count should be 0 got %d\n", count );
+
+    hwnd[0] = CreateWindowExA(0, "ToolWindowClass", "Tool window 1", WS_POPUP,
+                              0, 0, 100, 100, 0, 0, 0, NULL );
+    count = 0;
+    ret = EnumThreadWindows( GetCurrentThreadId(), enum_proc, (LPARAM)&count );
+    ok( ret, "EnumThreadWindows should have returned TRUE\n" );
+    if (count != 2)  /* Vista gives us two windows for the price of one */
+    {
+        ok( count == 1, "count should be 1 got %d\n", count );
+        hwnd[2] = CreateWindowExA(0, "ToolWindowClass", "Tool window 2", WS_POPUP,
+                                  0, 0, 100, 100, 0, 0, 0, NULL );
+    }
+    else hwnd[2] = 0;
+
+    hwnd[1] = CreateWindowExA(0, "ToolWindowClass", "Tool window 3", WS_POPUP,
+                              0, 0, 100, 100, 0, 0, 0, NULL );
+    count = 0;
+    ret = EnumThreadWindows( GetCurrentThreadId(), enum_proc, (LPARAM)&count );
+    ok( !ret, "EnumThreadWindows should have returned FALSE\n" );
+    ok( count == 3, "count should be 3 got %d\n", count );
+
+    if (hwnd[2]) DestroyWindow(hwnd[2]);
+    DestroyWindow(hwnd[1]);
+    DestroyWindow(hwnd[0]);
+    return 0;
+}
+
+/* test EnumThreadWindows in a separate thread */
+static void test_enum_thread_windows(void)
+{
+    DWORD id;
+    HANDLE handle = CreateThread( NULL, 0, enum_thread, 0, 0, &id );
+    ok( !WaitForSingleObject( handle, 10000 ), "wait failed\n" );
+    CloseHandle( handle );
+}
 
 static LRESULT WINAPI main_window_procA(HWND hwnd, UINT msg, WPARAM wparam, LPARAM lparam)
 {
@@ -5762,6 +5816,7 @@
     test_CreateWindow();
     test_parent_owner();
     test_SetParent();
+    test_enum_thread_windows();
 
     test_mdi();
     test_icons();




More information about the Ros-diffs mailing list