server: Changed the get_next_hook request to allow retrieving the current hook too.
diff --git a/server/hook.c b/server/hook.c
index 14ad968..e8a72a81 100644
--- a/server/hook.c
+++ b/server/hook.c
@@ -536,10 +536,10 @@
 }
 
 
-/* get the next hook to call */
-DECL_HANDLER(get_next_hook)
+/* get the hook information */
+DECL_HANDLER(get_hook_info)
 {
-    struct hook *hook, *next;
+    struct hook *hook;
 
     if (!(hook = get_user_object( req->handle, USER_HOOK ))) return;
     if (hook->thread && (hook->thread != current))
@@ -547,22 +547,23 @@
         set_error( STATUS_INVALID_HANDLE );
         return;
     }
-    if ((next = get_next_hook( current, hook, req->event, req->window, req->object_id, req->child_id )))
+    if (req->get_next && !(hook = get_next_hook( current, hook, req->event, req->window,
+                                                 req->object_id, req->child_id )))
+        return;
+
+    reply->handle  = hook->handle;
+    reply->id      = hook->index + WH_MINHOOK;
+    reply->unicode = hook->unicode;
+    if (hook->module) set_reply_data( hook->module, min(hook->module_size,get_reply_max_size()) );
+    if (run_hook_in_owner_thread( hook ))
     {
-        reply->next = next->handle;
-        reply->id   = next->index + WH_MINHOOK;
-        reply->unicode = next->unicode;
-        if (next->module) set_reply_data( next->module, next->module_size );
-        if (run_hook_in_owner_thread( next ))
-        {
-            reply->pid  = get_process_id( next->owner->process );
-            reply->tid  = get_thread_id( next->owner );
-        }
-        else
-        {
-            reply->pid  = 0;
-            reply->tid  = 0;
-        }
-        reply->proc = next->proc;
+        reply->pid  = get_process_id( hook->owner->process );
+        reply->tid  = get_thread_id( hook->owner );
     }
+    else
+    {
+        reply->pid  = 0;
+        reply->tid  = 0;
+    }
+    reply->proc = hook->proc;
 }
diff --git a/server/protocol.def b/server/protocol.def
index 583c757..285da96 100644
--- a/server/protocol.def
+++ b/server/protocol.def
@@ -2369,19 +2369,20 @@
 @END
 
 
-/* Get the next hook to call */
-@REQ(get_next_hook)
+/* Get the hook information */
+@REQ(get_hook_info)
     user_handle_t  handle;         /* handle to the current hook */
+    int            get_next;       /* do we want info about current or next hook? */
     int            event;          /* signalled event */
     user_handle_t  window;         /* handle to the event window */
     int            object_id;      /* object id for out of context winevent */
     int            child_id;       /* child id for out of context winevent */
 @REPLY
-    user_handle_t  next;           /* handle to the next hook */
-    int            id;             /* id of the next hook */
+    user_handle_t  handle;         /* handle to the hook */
+    int            id;             /* id of the hook */
     process_id_t   pid;            /* process id for low-level keyboard/mouse hooks */
     thread_id_t    tid;            /* thread id for low-level keyboard/mouse hooks */
-    void*          proc;           /* next hook procedure */
+    void*          proc;           /* hook procedure */
     int            unicode;        /* is it a unicode hook? */
     VARARG(module,unicode_str);    /* module name */
 @END
diff --git a/server/request.h b/server/request.h
index aad0387..fd805e3 100644
--- a/server/request.h
+++ b/server/request.h
@@ -302,7 +302,7 @@
 DECL_HANDLER(remove_hook);
 DECL_HANDLER(start_hook_chain);
 DECL_HANDLER(finish_hook_chain);
-DECL_HANDLER(get_next_hook);
+DECL_HANDLER(get_hook_info);
 DECL_HANDLER(create_class);
 DECL_HANDLER(destroy_class);
 DECL_HANDLER(set_class_info);
@@ -522,7 +522,7 @@
     (req_handler)req_remove_hook,
     (req_handler)req_start_hook_chain,
     (req_handler)req_finish_hook_chain,
-    (req_handler)req_get_next_hook,
+    (req_handler)req_get_hook_info,
     (req_handler)req_create_class,
     (req_handler)req_destroy_class,
     (req_handler)req_set_class_info,
diff --git a/server/trace.c b/server/trace.c
index 2c5b3e0..6e05882 100644
--- a/server/trace.c
+++ b/server/trace.c
@@ -2951,18 +2951,19 @@
     fprintf( stderr, " id=%d", req->id );
 }
 
-static void dump_get_next_hook_request( const struct get_next_hook_request *req )
+static void dump_get_hook_info_request( const struct get_hook_info_request *req )
 {
     fprintf( stderr, " handle=%p,", req->handle );
+    fprintf( stderr, " get_next=%d,", req->get_next );
     fprintf( stderr, " event=%d,", req->event );
     fprintf( stderr, " window=%p,", req->window );
     fprintf( stderr, " object_id=%d,", req->object_id );
     fprintf( stderr, " child_id=%d", req->child_id );
 }
 
-static void dump_get_next_hook_reply( const struct get_next_hook_reply *req )
+static void dump_get_hook_info_reply( const struct get_hook_info_reply *req )
 {
-    fprintf( stderr, " next=%p,", req->next );
+    fprintf( stderr, " handle=%p,", req->handle );
     fprintf( stderr, " id=%d,", req->id );
     fprintf( stderr, " pid=%04x,", req->pid );
     fprintf( stderr, " tid=%04x,", req->tid );
@@ -3477,7 +3478,7 @@
     (dump_func)dump_remove_hook_request,
     (dump_func)dump_start_hook_chain_request,
     (dump_func)dump_finish_hook_chain_request,
-    (dump_func)dump_get_next_hook_request,
+    (dump_func)dump_get_hook_info_request,
     (dump_func)dump_create_class_request,
     (dump_func)dump_destroy_class_request,
     (dump_func)dump_set_class_info_request,
@@ -3694,7 +3695,7 @@
     (dump_func)dump_remove_hook_reply,
     (dump_func)dump_start_hook_chain_reply,
     (dump_func)0,
-    (dump_func)dump_get_next_hook_reply,
+    (dump_func)dump_get_hook_info_reply,
     (dump_func)0,
     (dump_func)dump_destroy_class_reply,
     (dump_func)dump_set_class_info_reply,
@@ -3911,7 +3912,7 @@
     "remove_hook",
     "start_hook_chain",
     "finish_hook_chain",
-    "get_next_hook",
+    "get_hook_info",
     "create_class",
     "destroy_class",
     "set_class_info",