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
6d85f3bf
Commit
6d85f3bf
authored
Jan 27, 2006
by
Alexandre Julliard
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
server: Fixed low-level hardware hooks.
The hook thread field has been reused for win events, so it no longer works for low-level hardward hooks. Use the owner field instead.
parent
ac4de71f
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
20 additions
and
7 deletions
+20
-7
hook.c
server/hook.c
+20
-7
No files found.
server/hook.c
View file @
6d85f3bf
...
@@ -199,6 +199,15 @@ inline static int run_hook_in_current_thread( struct hook *hook )
...
@@ -199,6 +199,15 @@ inline static int run_hook_in_current_thread( struct hook *hook )
return
0
;
return
0
;
}
}
/* check if a given hook should run in the owner thread instead of the current thread */
inline
static
int
run_hook_in_owner_thread
(
struct
hook
*
hook
)
{
if
((
hook
->
index
==
WH_MOUSE_LL
-
WH_MINHOOK
||
hook
->
index
==
WH_KEYBOARD_LL
-
WH_MINHOOK
))
return
hook
->
owner
!=
current
;
return
0
;
}
/* find the first non-deleted hook in the chain */
/* find the first non-deleted hook in the chain */
inline
static
struct
hook
*
get_first_valid_hook
(
struct
hook_table
*
table
,
int
index
,
inline
static
struct
hook
*
get_first_valid_hook
(
struct
hook_table
*
table
,
int
index
,
int
event
,
user_handle_t
win
,
int
event
,
user_handle_t
win
,
...
@@ -389,7 +398,11 @@ DECL_HANDLER(set_hook)
...
@@ -389,7 +398,11 @@ DECL_HANDLER(set_hook)
if
(
req
->
id
==
WH_KEYBOARD_LL
||
req
->
id
==
WH_MOUSE_LL
)
if
(
req
->
id
==
WH_KEYBOARD_LL
||
req
->
id
==
WH_MOUSE_LL
)
{
{
/* low-level hardware hooks are special: always global, but without a module */
/* low-level hardware hooks are special: always global, but without a module */
thread
=
(
struct
thread
*
)
grab_object
(
current
);
if
(
thread
)
{
set_error
(
STATUS_INVALID_PARAMETER
);
goto
done
;
}
module
=
NULL
;
module
=
NULL
;
global
=
1
;
global
=
1
;
}
}
...
@@ -488,10 +501,10 @@ DECL_HANDLER(start_hook_chain)
...
@@ -488,10 +501,10 @@ DECL_HANDLER(start_hook_chain)
return
;
/* no hook set */
return
;
/* no hook set */
}
}
if
(
hook
->
thread
&&
hook
->
thread
!=
current
)
/* must run in other thread */
if
(
run_hook_in_owner_thread
(
hook
))
{
{
reply
->
pid
=
get_process_id
(
hook
->
thread
->
process
);
reply
->
pid
=
get_process_id
(
hook
->
owner
->
process
);
reply
->
tid
=
get_thread_id
(
hook
->
thread
);
reply
->
tid
=
get_thread_id
(
hook
->
owner
);
}
}
else
else
{
{
...
@@ -541,10 +554,10 @@ DECL_HANDLER(get_next_hook)
...
@@ -541,10 +554,10 @@ DECL_HANDLER(get_next_hook)
reply
->
prev_unicode
=
hook
->
unicode
;
reply
->
prev_unicode
=
hook
->
unicode
;
reply
->
next_unicode
=
next
->
unicode
;
reply
->
next_unicode
=
next
->
unicode
;
if
(
next
->
module
)
set_reply_data
(
next
->
module
,
next
->
module_size
);
if
(
next
->
module
)
set_reply_data
(
next
->
module
,
next
->
module_size
);
if
(
next
->
thread
&&
next
->
thread
!=
current
)
if
(
run_hook_in_owner_thread
(
next
)
)
{
{
reply
->
pid
=
get_process_id
(
next
->
thread
->
process
);
reply
->
pid
=
get_process_id
(
next
->
owner
->
process
);
reply
->
tid
=
get_thread_id
(
next
->
thread
);
reply
->
tid
=
get_thread_id
(
next
->
owner
);
}
}
else
else
{
{
...
...
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