Jacek Caban : server: Delay setting system registers until suspending select is waken.
Alexandre Julliard
julliard at winehq.org
Tue Apr 28 16:32:22 CDT 2020
Module: wine
Branch: master
Commit: 341068aa61a71afecb712feda9aabb3dc1c3ab5f
URL: https://source.winehq.org/git/wine.git/?a=commit;h=341068aa61a71afecb712feda9aabb3dc1c3ab5f
Author: Jacek Caban <jacek at codeweavers.com>
Date: Tue Apr 28 19:38:25 2020 +0200
server: Delay setting system registers until suspending select is waken.
Signed-off-by: Jacek Caban <jacek at codeweavers.com>
Signed-off-by: Alexandre Julliard <julliard at winehq.org>
---
server/thread.c | 15 ++++++++++-----
1 file changed, 10 insertions(+), 5 deletions(-)
diff --git a/server/thread.c b/server/thread.c
index 99ae99b26f..ea545d5c30 100644
--- a/server/thread.c
+++ b/server/thread.c
@@ -1706,7 +1706,13 @@ DECL_HANDLER(select)
else if (get_error() != STATUS_PENDING && get_reply_max_size() == sizeof(context_t) &&
current->context && current->suspend_cookie == req->cookie)
{
- if (current->context->regs.flags) set_reply_data( ¤t->context->regs, sizeof(context_t) );
+ if (current->context->regs.flags)
+ {
+ unsigned int system_flags = get_context_system_regs(current->process->cpu) &
+ current->context->regs.flags;
+ if (system_flags) set_thread_context( current, ¤t->context->regs, system_flags );
+ set_reply_data( ¤t->context->regs, sizeof(context_t) );
+ }
release_object( current->context );
current->context = NULL;
}
@@ -1896,14 +1902,13 @@ DECL_HANDLER(set_thread_context)
else
{
unsigned int system_flags = get_context_system_regs(context->cpu) & context->flags;
- unsigned int client_flags = context->flags & ~system_flags;
- if (system_flags) set_thread_context( thread, context, system_flags );
- if (thread != current && !get_error()) stop_thread( thread );
+ if (thread != current) stop_thread( thread );
+ else if (system_flags) set_thread_context( thread, context, system_flags );
if (thread->context && !get_error())
{
copy_context( &thread->context->regs, context, context->flags );
- thread->context->regs.flags |= client_flags;
+ thread->context->regs.flags |= context->flags;
}
}
More information about the wine-cvs
mailing list