Commit a10da8a4 authored by Paul Gofman's avatar Paul Gofman Committed by Alexandre Julliard

ntdll: Preserve untouched parts of xstate in NtSetContextThread().

parent 7ae23ad7
......@@ -1004,9 +1004,11 @@ NTSTATUS WINAPI NtSetContextThread( HANDLE handle, const CONTEXT *context )
{
CONTEXT_EX *context_ex = (CONTEXT_EX *)(context + 1);
XSAVE_AREA_HEADER *xs = (XSAVE_AREA_HEADER *)((char *)context_ex + context_ex->XState.Offset);
UINT64 mask = frame->xstate.Mask;
if (xstate_compaction_enabled) frame->xstate.CompactionMask |= xstate_extended_features();
copy_xstate( &frame->xstate, xs, xs->Mask );
if (xs->CompactionMask) frame->xstate.Mask |= mask & ~xs->CompactionMask;
}
frame->restore_flags |= flags & ~CONTEXT_INTEGER;
......
......@@ -1050,9 +1050,11 @@ NTSTATUS WINAPI NtSetContextThread( HANDLE handle, const CONTEXT *context )
{
CONTEXT_EX *context_ex = (CONTEXT_EX *)(context + 1);
XSAVE_AREA_HEADER *xs = (XSAVE_AREA_HEADER *)((char *)context_ex + context_ex->XState.Offset);
UINT64 mask = frame->xstate.Mask;
if (xstate_compaction_enabled) frame->xstate.CompactionMask |= xstate_extended_features();
copy_xstate( &frame->xstate, xs, xs->Mask );
if (xs->CompactionMask) frame->xstate.Mask |= mask & ~xs->CompactionMask;
}
frame->restore_flags |= flags & ~CONTEXT_INTEGER;
......
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