You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
63 lines
2.1 KiB
63 lines
2.1 KiB
From c3fac6e36caab168974dd04a60ae1bbb1a0fd919 Mon Sep 17 00:00:00 2001
|
|
From: Jacek Caban <jacek@codeweavers.com>
|
|
Date: Sat, 25 Apr 2020 21:13:33 +0200
|
|
Subject: [PATCH] server: Fix setting context flags in get_thread_context.
|
|
|
|
Wine-Bug: https://bugs.winehq.org/show_bug.cgi?id=49011
|
|
Signed-off-by: Jacek Caban <jacek@codeweavers.com>
|
|
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
|
|
---
|
|
dlls/kernel32/tests/thread.c | 15 +++++++++++++++
|
|
server/thread.c | 2 +-
|
|
2 files changed, 16 insertions(+), 1 deletion(-)
|
|
|
|
diff --git a/dlls/kernel32/tests/thread.c b/dlls/kernel32/tests/thread.c
|
|
index b6a65a4207..e068797ff5 100644
|
|
--- a/dlls/kernel32/tests/thread.c
|
|
+++ b/dlls/kernel32/tests/thread.c
|
|
@@ -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;
|
|
@@ -2452,6 +2466,7 @@
|
|
#ifdef __i386__
|
|
test_SetThreadContext();
|
|
test_GetThreadSelectorEntry();
|
|
+ test_GetThreadContext();
|
|
test_NtSetLdtEntries();
|
|
#endif
|
|
test_QueueUserWorkItem();
|
|
diff --git a/server/thread.c b/server/thread.c
|
|
index cfdf42c756..7c1c1108eb 100644
|
|
--- a/server/thread.c
|
|
+++ b/server/thread.c
|
|
@@ -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 );
|
|
--
|
|
2.20.1
|
|
|