Commit c3fac6e3 authored by Jacek Caban's avatar Jacek Caban Committed by Alexandre Julliard

server: Fix setting context flags in get_thread_context.

parent c2854d8b
......@@ -1175,6 +1175,20 @@ static void test_SetThreadContext(void)
CloseHandle( thread );
}
static void test_GetThreadContext(void)
{
CONTEXT ctx;
BOOL ret;
memset(&ctx, 0xcc, sizeof(ctx));
ctx.ContextFlags = CONTEXT_DEBUG_REGISTERS;
ret = GetThreadContext(GetCurrentThread(), &ctx);
ok(ret, "GetThreadContext failed: %u\n", GetLastError());
ok(ctx.ContextFlags == CONTEXT_DEBUG_REGISTERS, "ContextFlags = %x\n", ctx.ContextFlags);
ok(!ctx.Dr0, "Dr0 = %x\n", ctx.Dr0);
ok(!ctx.Dr1, "Dr0 = %x\n", ctx.Dr0);
}
static void test_GetThreadSelectorEntry(void)
{
LDT_ENTRY entry;
......@@ -2379,6 +2393,7 @@ START_TEST(thread)
#ifdef __i386__
test_SetThreadContext();
test_GetThreadSelectorEntry();
test_GetThreadContext();
#endif
test_QueueUserWorkItem();
test_RegisterWaitForSingleObject();
......
......@@ -1848,7 +1848,7 @@ DECL_HANDLER(get_thread_context)
{
assert( reply->self );
memset( context, 0, sizeof(context_t) );
context->cpu = thread_context->regs.cpu;
context->cpu = thread->process->cpu;
if (req->flags & system_flags)
{
get_thread_context( thread, context, req->flags & system_flags );
......
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