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
437a8384
Commit
437a8384
authored
Apr 05, 2011
by
Alexandre Julliard
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
server: Don't run low-level hooks in debugged processes.
parent
bb411cfb
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
12 additions
and
13 deletions
+12
-13
hook.c
server/hook.c
+12
-13
No files found.
server/hook.c
View file @
437a8384
...
...
@@ -191,19 +191,6 @@ static inline struct hook *get_first_hook( struct hook_table *table, int index )
return
elem
?
HOOK_ENTRY
(
elem
)
:
NULL
;
}
/* check if a given hook should run in the current thread */
static
inline
int
run_hook_in_current_thread
(
struct
hook
*
hook
)
{
if
((
!
hook
->
process
||
hook
->
process
==
current
->
process
)
&&
(
!
(
hook
->
flags
&
WINEVENT_SKIPOWNPROCESS
)
||
hook
->
process
!=
current
->
process
))
{
if
((
!
hook
->
thread
||
hook
->
thread
==
current
)
&&
(
!
(
hook
->
flags
&
WINEVENT_SKIPOWNTHREAD
)
||
hook
->
thread
!=
current
))
return
1
;
}
return
0
;
}
/* check if a given hook should run in the owner thread instead of the current thread */
static
inline
int
run_hook_in_owner_thread
(
struct
hook
*
hook
)
{
...
...
@@ -213,6 +200,18 @@ static inline int run_hook_in_owner_thread( struct hook *hook )
return
0
;
}
/* check if a given hook should run in the current thread */
static
inline
int
run_hook_in_current_thread
(
struct
hook
*
hook
)
{
if
(
hook
->
process
&&
hook
->
process
!=
current
->
process
)
return
0
;
if
((
hook
->
flags
&
WINEVENT_SKIPOWNPROCESS
)
&&
hook
->
process
==
current
->
process
)
return
0
;
if
(
hook
->
thread
&&
hook
->
thread
!=
current
)
return
0
;
if
((
hook
->
flags
&
WINEVENT_SKIPOWNTHREAD
)
&&
hook
->
thread
==
current
)
return
0
;
/* don't run low-level hooks in debugged processes */
if
(
run_hook_in_owner_thread
(
hook
)
&&
hook
->
owner
->
process
->
debugger
)
return
0
;
return
1
;
}
/* find the first non-deleted hook in the chain */
static
inline
struct
hook
*
get_first_valid_hook
(
struct
hook_table
*
table
,
int
index
,
int
event
,
user_handle_t
win
,
...
...
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