Jinoh Kang (@iamahuman) commented about server/thread.c:
+ context_t *ctx = &thread->context->regs[CTX_NATIVE]; + flags = contexts[CTX_NATIVE].flags & ~native_flags; + copy_context( ctx, &contexts[CTX_NATIVE], flags ); + ctx->flags |= flags; } - flags = context->flags; - if (native_flags && ctx != CTX_NATIVE) /* some regs are always set from the native context */ + if (is_pending || (ctx_count == 2 && thread->context->regs[CTX_WOW].machine)) { - copy_context( &thread->context->regs[CTX_NATIVE], &contexts[CTX_NATIVE], native_flags ); - thread->context->regs[CTX_NATIVE].flags |= native_flags; - flags &= ~native_flags; + context_t *ctx = &thread->context->regs[CTX_WOW]; + flags = contexts[CTX_WOW].flags & ~native_flags; + ctx->machine = contexts[CTX_WOW].machine; + copy_context( &thread->context->regs[CTX_WOW], &contexts[CTX_WOW], flags ); This does not use the `ctx` alias, inconsistent with the native case above.
copy_context( ctx, &contexts[CTX_WOW], flags );
-- https://gitlab.winehq.org/wine/wine/-/merge_requests/3566#note_43294