Alexandre Julliard : server: Increment the usage count of the global table also when starting a local hook .

Alexandre Julliard julliard at winehq.org
Thu Feb 24 11:43:24 CST 2011


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

Author: Alexandre Julliard <julliard at winehq.org>
Date:   Wed Feb 23 20:25:05 2011 +0100

server: Increment the usage count of the global table also when starting a local hook.

---

 server/hook.c |    9 +++++----
 1 files changed, 5 insertions(+), 4 deletions(-)

diff --git a/server/hook.c b/server/hook.c
index 7b889d8..7c0ae0f 100644
--- a/server/hook.c
+++ b/server/hook.c
@@ -497,6 +497,7 @@ DECL_HANDLER(start_hook_chain)
 {
     struct hook *hook;
     struct hook_table *table = get_queue_hooks( current );
+    struct hook_table *global_table = get_global_hooks( current );
 
     if (req->id < WH_MINHOOK || req->id > WH_WINEVENT)
     {
@@ -510,9 +511,8 @@ DECL_HANDLER(start_hook_chain)
                                                  req->window, req->object_id, req->child_id )))
     {
         /* try global table */
-        if (!(table = get_global_hooks( current )) ||
-            !(hook = get_first_valid_hook( table, req->id - WH_MINHOOK, req->event,
-                                           req->window, req->object_id, req->child_id )))
+        if (!global_table || !(hook = get_first_valid_hook( global_table, req->id - WH_MINHOOK, req->event,
+                                                            req->window, req->object_id, req->child_id )))
             return;  /* no hook set */
     }
 
@@ -529,7 +529,8 @@ DECL_HANDLER(start_hook_chain)
     reply->proc    = hook->proc;
     reply->handle  = hook->handle;
     reply->unicode = hook->unicode;
-    table->counts[hook->index]++;
+    if (table) table->counts[hook->index]++;
+    if (global_table) global_table->counts[hook->index]++;
     if (hook->module) set_reply_data( hook->module, hook->module_size );
 }
 




More information about the wine-cvs mailing list