Alexandre Julliard : user32: Fix FindWindow to not match an empty class name.

Alexandre Julliard julliard at winehq.org
Mon Nov 17 09:14:24 CST 2008


Module: wine
Branch: master
Commit: 025daaf0e8c62d0f53a1af04824ed83f183d628c
URL:    http://source.winehq.org/git/wine.git/?a=commit;h=025daaf0e8c62d0f53a1af04824ed83f183d628c

Author: Alexandre Julliard <julliard at winehq.org>
Date:   Mon Nov 17 14:14:05 2008 +0100

user32: Fix FindWindow to not match an empty class name.

---

 dlls/user32/win.c |    8 ++++++--
 1 files changed, 6 insertions(+), 2 deletions(-)

diff --git a/dlls/user32/win.c b/dlls/user32/win.c
index 2fc00c4..730b2c2 100644
--- a/dlls/user32/win.c
+++ b/dlls/user32/win.c
@@ -223,6 +223,10 @@ static HWND *list_window_children( HDESK desktop, HWND hwnd, LPCWSTR class, DWOR
 {
     HWND *list;
     int size = 128;
+    ATOM atom = get_int_atom_value( class );
+
+    /* empty class is not the same as NULL class */
+    if (!atom && class && !class[0]) return NULL;
 
     for (;;)
     {
@@ -235,8 +239,8 @@ static HWND *list_window_children( HDESK desktop, HWND hwnd, LPCWSTR class, DWOR
             req->desktop = desktop;
             req->parent = hwnd;
             req->tid = tid;
-            if (!(req->atom = get_int_atom_value( class )) && class)
-                wine_server_add_data( req, class, strlenW(class)*sizeof(WCHAR) );
+            req->atom = atom;
+            if (!atom && class) wine_server_add_data( req, class, strlenW(class)*sizeof(WCHAR) );
             wine_server_set_reply( req, list, (size-1) * sizeof(HWND) );
             if (!wine_server_call( req )) count = reply->count;
         }




More information about the wine-cvs mailing list