Alexandre Julliard : server: Make sure that last error doesn' t get set during thread cleanup.

Alexandre Julliard julliard at winehq.org
Tue Dec 1 09:19:44 CST 2009


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

Author: Alexandre Julliard <julliard at winehq.org>
Date:   Tue Dec  1 15:10:23 2009 +0100

server: Make sure that last error doesn't get set during thread cleanup.

---

 server/clipboard.c |    6 ++++--
 server/hook.c      |    5 +++--
 server/process.c   |    2 ++
 3 files changed, 9 insertions(+), 4 deletions(-)

diff --git a/server/clipboard.c b/server/clipboard.c
index 065dd2d..0c39319 100644
--- a/server/clipboard.c
+++ b/server/clipboard.c
@@ -30,6 +30,7 @@
 #define WIN32_NO_STATUS
 #include "request.h"
 #include "object.h"
+#include "process.h"
 #include "user.h"
 #include "winuser.h"
 #include "winternl.h"
@@ -112,9 +113,10 @@ static struct clipboard *get_process_clipboard(void)
 void cleanup_clipboard_thread(struct thread *thread)
 {
     struct clipboard *clipboard;
-    struct winstation *winstation = get_process_winstation( thread->process, WINSTA_ACCESSCLIPBOARD );
+    struct winstation *winstation;
 
-    if (!winstation) return;
+    if (!thread->process->winstation) return;
+    if (!(winstation = get_process_winstation( thread->process, WINSTA_ACCESSCLIPBOARD ))) return;
 
     if ((clipboard = winstation->clipboard))
     {
diff --git a/server/hook.c b/server/hook.c
index f5ebc2b..7b889d8 100644
--- a/server/hook.c
+++ b/server/hook.c
@@ -114,9 +114,10 @@ static struct hook_table *alloc_hook_table(void)
 static struct hook_table *get_global_hooks( struct thread *thread )
 {
     struct hook_table *table;
-    struct desktop *desktop = get_thread_desktop( thread, 0 );
+    struct desktop *desktop;
 
-    if (!desktop) return NULL;
+    if (!thread->desktop) return NULL;
+    if (!(desktop = get_thread_desktop( thread, 0 ))) return NULL;
     table = desktop->global_hooks;
     release_object( desktop );
     return table;
diff --git a/server/process.c b/server/process.c
index 630abe6..51193b7 100644
--- a/server/process.c
+++ b/server/process.c
@@ -632,6 +632,8 @@ static void process_killed( struct process *process )
     handles = process->handles;
     process->handles = NULL;
     if (handles) release_object( handles );
+    process->winstation = 0;
+    process->desktop = 0;
 
     /* close the console attached to this process, if any */
     free_console( process );




More information about the wine-cvs mailing list