Commit 547d3a77 authored by Paul Gofman's avatar Paul Gofman Committed by Alexandre Julliard

ntdll: Set exception reporting flags in NtGetContextThread().

parent e1a816a3
......@@ -11146,8 +11146,8 @@ static void test_context_exception_request(void)
c.ContextFlags = CONTEXT_CONTROL | CONTEXT_EXCEPTION_REQUEST;
ret = GetThreadContext( GetCurrentThread(), &c );
ok( ret, "got error %lu.\n", GetLastError() );
todo_wine ok( c.ContextFlags == expected_flags || broken( c.ContextFlags == 0x10001 ) /* Win7 WoW64 */,
"got %#lx.\n", c.ContextFlags );
ok( c.ContextFlags == expected_flags || broken( c.ContextFlags == 0x10001 ) /* Win7 WoW64 */,
"got %#lx.\n", c.ContextFlags );
if (c.ContextFlags == 0x10001)
{
win_skip( "Old WoW64 behaviour, skipping tests.\n" );
......@@ -11161,14 +11161,14 @@ static void test_context_exception_request(void)
c.ContextFlags = CONTEXT_CONTROL | CONTEXT_EXCEPTION_REQUEST;
ret = GetThreadContext( thread, &c );
ok( ret, "got error %lu.\n", GetLastError() );
todo_wine ok( c.ContextFlags == expected_flags, "got %#lx.\n", c.ContextFlags );
ok( c.ContextFlags == expected_flags, "got %#lx.\n", c.ContextFlags );
CloseHandle( thread );
c.ContextFlags = CONTEXT_CONTROL | CONTEXT_EXCEPTION_REQUEST | CONTEXT_EXCEPTION_REPORTING | CONTEXT_SERVICE_ACTIVE
| CONTEXT_EXCEPTION_ACTIVE;
ret = GetThreadContext( GetCurrentThread(), &c );
ok( ret, "got error %lu.\n", GetLastError() );
todo_wine ok( c.ContextFlags == expected_flags, "got %#lx.\n", c.ContextFlags );
ok( c.ContextFlags == expected_flags, "got %#lx.\n", c.ContextFlags );
p.event = CreateEventW( NULL, FALSE, FALSE, NULL );
thread = CreateThread( NULL, 0, test_context_exception_request_thread, &p, CREATE_SUSPENDED, NULL );
......
......@@ -513,6 +513,7 @@ NTSTATUS WINAPI NtGetContextThread( HANDLE handle, CONTEXT *context )
memcpy( context->D, frame->d, sizeof(frame->d) );
context->ContextFlags |= CONTEXT_FLOATING_POINT;
}
set_context_exception_reporting_flags( &context->ContextFlags, CONTEXT_SERVICE_ACTIVE );
return STATUS_SUCCESS;
}
......
......@@ -433,6 +433,7 @@ NTSTATUS WINAPI NtGetContextThread( HANDLE handle, CONTEXT *context )
context->ContextFlags |= CONTEXT_FLOATING_POINT;
}
if (needed_flags & CONTEXT_DEBUG_REGISTERS) FIXME( "debug registers not supported\n" );
set_context_exception_reporting_flags( &context->ContextFlags, CONTEXT_SERVICE_ACTIVE );
return STATUS_SUCCESS;
}
......@@ -640,6 +641,7 @@ NTSTATUS get_thread_wow64_context( HANDLE handle, void *ctx, ULONG size )
context->Dr7 = wow_frame->Dr7;
}
/* FIXME: CONTEXT_I386_XSTATE */
set_context_exception_reporting_flags( &context->ContextFlags, CONTEXT_SERVICE_ACTIVE );
break;
}
......@@ -679,6 +681,7 @@ NTSTATUS get_thread_wow64_context( HANDLE handle, void *ctx, ULONG size )
memcpy( context->D, wow_frame->D, sizeof(wow_frame->D) );
context->ContextFlags |= CONTEXT_FLOATING_POINT;
}
set_context_exception_reporting_flags( &context->ContextFlags, CONTEXT_SERVICE_ACTIVE );
break;
}
......
......@@ -1153,6 +1153,7 @@ NTSTATUS WINAPI NtGetContextThread( HANDLE handle, CONTEXT *context )
x86_thread_data()->dr6 = context->Dr6;
x86_thread_data()->dr7 = context->Dr7;
}
set_context_exception_reporting_flags( &context->ContextFlags, CONTEXT_SERVICE_ACTIVE );
}
if (context->ContextFlags & (CONTEXT_INTEGER & ~CONTEXT_i386))
......
......@@ -1186,6 +1186,7 @@ NTSTATUS WINAPI NtGetContextThread( HANDLE handle, CONTEXT *context )
amd64_thread_data()->dr6 = context->Dr6;
amd64_thread_data()->dr7 = context->Dr7;
}
set_context_exception_reporting_flags( &context->ContextFlags, CONTEXT_SERVICE_ACTIVE );
return STATUS_SUCCESS;
}
......@@ -1390,6 +1391,7 @@ NTSTATUS get_thread_wow64_context( HANDLE handle, void *ctx, ULONG size )
frame->restore_flags |= CONTEXT_XSTATE;
}
}
set_context_exception_reporting_flags( &context->ContextFlags, CONTEXT_SERVICE_ACTIVE );
return STATUS_SUCCESS;
}
......
......@@ -215,6 +215,17 @@ extern int server_pipe( int fd[2] );
extern void fpux_to_fpu( I386_FLOATING_SAVE_AREA *fpu, const XSAVE_FORMAT *fpux );
extern void fpu_to_fpux( XSAVE_FORMAT *fpux, const I386_FLOATING_SAVE_AREA *fpu );
static inline void set_context_exception_reporting_flags( DWORD *context_flags, DWORD reporting_flag )
{
if (!(*context_flags & CONTEXT_EXCEPTION_REQUEST))
{
*context_flags &= ~(CONTEXT_EXCEPTION_REPORTING | CONTEXT_SERVICE_ACTIVE | CONTEXT_EXCEPTION_ACTIVE);
return;
}
*context_flags = (*context_flags & ~(CONTEXT_SERVICE_ACTIVE | CONTEXT_EXCEPTION_ACTIVE))
| CONTEXT_EXCEPTION_REPORTING | reporting_flag;
}
extern BOOL xstate_compaction_enabled;
extern UINT64 xstate_supported_features_mask;
extern UINT64 xstate_features_size;
......
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