From f0396489e66b6184b483b9c803573cb8869eea61 Mon Sep 17 00:00:00 2001 From: Alexandre Julliard Date: Wed, 23 Feb 2011 20:25:05 +0100 Subject: [PATCH] server: Increment the usage count of the global table also when starting a local hook. --- server/hook.c | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/server/hook.c b/server/hook.c index 7b889d8c398..7c0ae0f2d9f 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 ); }