Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
W
wine-winehq
Project
Project
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Registry
Registry
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
wine
wine-winehq
Commits
2f80fcd8
Commit
2f80fcd8
authored
Oct 05, 2006
by
Alexandre Julliard
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
server: Changed the get_next_hook request to allow retrieving the current hook too.
parent
533f5199
Hide whitespace changes
Inline
Side-by-side
Showing
6 changed files
with
49 additions
and
43 deletions
+49
-43
hook.c
dlls/user/hook.c
+6
-4
server_protocol.h
include/wine/server_protocol.h
+8
-7
hook.c
server/hook.c
+20
-19
protocol.def
server/protocol.def
+6
-5
request.h
server/request.h
+2
-2
trace.c
server/trace.c
+7
-6
No files found.
dlls/user/hook.c
View file @
2f80fcd8
...
...
@@ -527,15 +527,16 @@ LRESULT WINAPI CallNextHookEx( HHOOK hhook, INT code, WPARAM wparam, LPARAM lpar
ZeroMemory
(
&
info
,
sizeof
(
info
)
-
sizeof
(
info
.
module
)
);
SERVER_START_REQ
(
get_
next_hook
)
SERVER_START_REQ
(
get_
hook_info
)
{
req
->
handle
=
thread_info
->
hook
;
req
->
get_next
=
1
;
req
->
event
=
EVENT_MIN
;
wine_server_set_reply
(
req
,
info
.
module
,
sizeof
(
info
.
module
)
-
sizeof
(
WCHAR
)
);
if
(
!
wine_server_call_err
(
req
))
{
info
.
module
[
wine_server_reply_size
(
req
)
/
sizeof
(
WCHAR
)]
=
0
;
info
.
handle
=
reply
->
next
;
info
.
handle
=
reply
->
handle
;
info
.
id
=
reply
->
id
;
info
.
pid
=
reply
->
pid
;
info
.
tid
=
reply
->
tid
;
...
...
@@ -718,9 +719,10 @@ inline static BOOL find_next_hook(DWORD event, HWND hwnd, LONG object_id,
{
BOOL
ret
;
SERVER_START_REQ
(
get_
next_hook
)
SERVER_START_REQ
(
get_
hook_info
)
{
req
->
handle
=
info
->
handle
;
req
->
get_next
=
1
;
req
->
event
=
event
;
req
->
window
=
hwnd
;
req
->
object_id
=
object_id
;
...
...
@@ -730,7 +732,7 @@ inline static BOOL find_next_hook(DWORD event, HWND hwnd, LONG object_id,
if
(
ret
)
{
info
->
module
[
wine_server_reply_size
(
req
)
/
sizeof
(
WCHAR
)]
=
0
;
info
->
handle
=
reply
->
next
;
info
->
handle
=
reply
->
handle
;
info
->
proc
=
reply
->
proc
;
info
->
tid
=
reply
->
tid
;
}
...
...
include/wine/server_protocol.h
View file @
2f80fcd8
...
...
@@ -3375,19 +3375,20 @@ struct finish_hook_chain_reply
struct
get_
next_hook
_request
struct
get_
hook_info
_request
{
struct
request_header
__header
;
user_handle_t
handle
;
int
get_next
;
int
event
;
user_handle_t
window
;
int
object_id
;
int
child_id
;
};
struct
get_
next_hook
_reply
struct
get_
hook_info
_reply
{
struct
reply_header
__header
;
user_handle_t
next
;
user_handle_t
handle
;
int
id
;
process_id_t
pid
;
thread_id_t
tid
;
...
...
@@ -3961,7 +3962,7 @@ enum request
REQ_remove_hook
,
REQ_start_hook_chain
,
REQ_finish_hook_chain
,
REQ_get_
next_hook
,
REQ_get_
hook_info
,
REQ_create_class
,
REQ_destroy_class
,
REQ_set_class_info
,
...
...
@@ -4182,7 +4183,7 @@ union generic_request
struct
remove_hook_request
remove_hook_request
;
struct
start_hook_chain_request
start_hook_chain_request
;
struct
finish_hook_chain_request
finish_hook_chain_request
;
struct
get_
next_hook_request
get_next_hook
_request
;
struct
get_
hook_info_request
get_hook_info
_request
;
struct
create_class_request
create_class_request
;
struct
destroy_class_request
destroy_class_request
;
struct
set_class_info_request
set_class_info_request
;
...
...
@@ -4401,7 +4402,7 @@ union generic_reply
struct
remove_hook_reply
remove_hook_reply
;
struct
start_hook_chain_reply
start_hook_chain_reply
;
struct
finish_hook_chain_reply
finish_hook_chain_reply
;
struct
get_
next_hook_reply
get_next_hook
_reply
;
struct
get_
hook_info_reply
get_hook_info
_reply
;
struct
create_class_reply
create_class_reply
;
struct
destroy_class_reply
destroy_class_reply
;
struct
set_class_info_reply
set_class_info_reply
;
...
...
@@ -4425,6 +4426,6 @@ union generic_reply
struct
query_symlink_reply
query_symlink_reply
;
};
#define SERVER_PROTOCOL_VERSION 25
3
#define SERVER_PROTOCOL_VERSION 25
4
#endif
/* __WINE_WINE_SERVER_PROTOCOL_H */
server/hook.c
View file @
2f80fcd8
...
...
@@ -536,10 +536,10 @@ DECL_HANDLER(finish_hook_chain)
}
/* 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 @@ DECL_HANDLER(get_next_hook)
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
;
}
server/protocol.def
View file @
2f80fcd8
...
...
@@ -2369,19 +2369,20 @@ enum message_type
@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
...
...
server/request.h
View file @
2f80fcd8
...
...
@@ -302,7 +302,7 @@ DECL_HANDLER(set_hook);
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 @@ static const req_handler req_handlers[REQ_NB_REQUESTS] =
(
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
,
...
...
server/trace.c
View file @
2f80fcd8
...
...
@@ -2951,18 +2951,19 @@ static void dump_finish_hook_chain_request( const struct finish_hook_chain_reque
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 @@ static const dump_func req_dumpers[REQ_NB_REQUESTS] = {
(
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 @@ static const dump_func reply_dumpers[REQ_NB_REQUESTS] = {
(
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 @@ static const char * const req_names[REQ_NB_REQUESTS] = {
"remove_hook"
,
"start_hook_chain"
,
"finish_hook_chain"
,
"get_
next_hook
"
,
"get_
hook_info
"
,
"create_class"
,
"destroy_class"
,
"set_class_info"
,
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment