Atom Request Fix

Marius Grigoriu <[email protected]> Sun, 22 Aug 2004 19:53:41 -0400
Newsgroups gmane.comp.emulators.winex.devel
Message-ID <[email protected]>
I just found this problem in the find and add atom functions. The data 
is copied over before req->local is initialized so functions like 
FindWindowA cant find windows from other processes because the local 
atom table is used. Swapping the two lines makes things work.

Marius
memory-atom.diff (text/x-patch, 978 B)
Index: memory/atom.c
===================================================================
RCS file: /cvsroot/winex/memory/atom.c,v
retrieving revision 1.3
diff -u -r1.3 atom.c
--- memory/atom.c	18 Feb 2004 22:27:49 -0000	1.3
+++ memory/atom.c	22 Aug 2004 23:46:24 -0000
@@ -431,8 +431,8 @@
         }
         SERVER_START_REQ( add_atom )
         {
-            wine_server_add_data( req, buffer, len * sizeof(WCHAR) );
             req->local = local;
+            wine_server_add_data( req, buffer, len * sizeof(WCHAR) );
             if (!wine_server_call_err(req)) atom = reply->atom;
         }
         SERVER_END_REQ;
@@ -632,8 +632,8 @@
         }
         SERVER_START_REQ( find_atom )
         {
-            wine_server_add_data( req, str, len * sizeof(WCHAR) );
             req->local = local;
+            wine_server_add_data( req, str, len * sizeof(WCHAR) );
             if (!wine_server_call_err( req )) atom = reply->atom;
         }
         SERVER_END_REQ;