[PATCH 2/3] server: Only set system regs updated in set_thread_context in select handler.

Paul Gofman pgofman at codeweavers.com
Mon May 24 05:51:47 CDT 2021


Signed-off-by: Paul Gofman <pgofman at codeweavers.com>
---
 server/thread.c | 11 +++++++----
 1 file changed, 7 insertions(+), 4 deletions(-)

diff --git a/server/thread.c b/server/thread.c
index eb8b0de84b1..d56ecd51a80 100644
--- a/server/thread.c
+++ b/server/thread.c
@@ -117,9 +117,10 @@ static const struct object_ops thread_apc_ops =
 
 struct context
 {
-    struct object   obj;        /* object header */
-    unsigned int    status;     /* status of the context */
-    context_t       regs;       /* context data */
+    struct object   obj;          /* object header */
+    unsigned int    status;       /* status of the context */
+    context_t       regs;         /* context data */
+    unsigned int    update_flags; /* updated context parts */
 };
 
 static void dump_context( struct object *obj, int verbose );
@@ -285,6 +286,7 @@ static struct context *create_thread_context( struct thread *thread )
     context->status = STATUS_PENDING;
     memset( &context->regs, 0, sizeof(context->regs) );
     context->regs.machine = thread->process->machine;
+    context->update_flags = 0;
     return context;
 }
 
@@ -1654,7 +1656,7 @@ DECL_HANDLER(select)
         if (current->context->regs.flags)
         {
             unsigned int system_flags = get_context_system_regs(current->process->machine) &
-                                        current->context->regs.flags;
+                                        current->context->update_flags;
             if (system_flags) set_thread_context( current, &current->context->regs, system_flags );
             set_reply_data( &current->context->regs, sizeof(context_t) );
         }
@@ -1868,6 +1870,7 @@ DECL_HANDLER(set_thread_context)
         {
             copy_context( &thread->context->regs, context, context->flags );
             thread->context->regs.flags |= context->flags;
+            thread->context->update_flags |= context->flags;
         }
     }
     else if (context->machine == IMAGE_FILE_MACHINE_AMD64 &&
-- 
2.31.1




More information about the wine-devel mailing list