Commit 437a8384 authored by Alexandre Julliard's avatar Alexandre Julliard

server: Don't run low-level hooks in debugged processes.

parent bb411cfb
......@@ -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,
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment