ntdll: Initialize MxCsr for new threads on x86.

Signed-off-by: Alexandre Julliard <julliard@winehq.org>
This commit is contained in:
Alexandre Julliard 2019-11-02 14:34:17 +01:00
parent 42cf6cce4b
commit 1b3fa02190

View file

@ -2716,6 +2716,7 @@ static void init_thread_context( CONTEXT *context, LPTHREAD_START_ROUTINE entry,
context->Eip = (DWORD)relay; context->Eip = (DWORD)relay;
context->FloatSave.ControlWord = 0x27f; context->FloatSave.ControlWord = 0x27f;
((XMM_SAVE_AREA32 *)context->ExtendedRegisters)->ControlWord = 0x27f; ((XMM_SAVE_AREA32 *)context->ExtendedRegisters)->ControlWord = 0x27f;
((XMM_SAVE_AREA32 *)context->ExtendedRegisters)->MxCsr = 0x1f80;
} }
@ -2741,7 +2742,7 @@ PCONTEXT DECLSPEC_HIDDEN attach_thread( LPTHREAD_START_ROUTINE entry, void *arg,
ctx = (CONTEXT *)((char *)NtCurrentTeb()->Tib.StackBase - 16) - 1; ctx = (CONTEXT *)((char *)NtCurrentTeb()->Tib.StackBase - 16) - 1;
init_thread_context( ctx, entry, arg, relay ); init_thread_context( ctx, entry, arg, relay );
} }
ctx->ContextFlags = CONTEXT_FULL; ctx->ContextFlags = CONTEXT_FULL | CONTEXT_FLOATING_POINT | CONTEXT_EXTENDED_REGISTERS;
LdrInitializeThunk( ctx, (void **)&ctx->Eax, 0, 0 ); LdrInitializeThunk( ctx, (void **)&ctx->Eax, 0, 0 );
return ctx; return ctx;
} }