Added patch to allow to set debug registers separately in NtSetContextThread.

This commit is contained in:
Sebastian Lackner 2015-11-29 00:36:33 +01:00
parent cd0241f0e2
commit b14f029f04
5 changed files with 85 additions and 1 deletions

View File

@ -34,9 +34,10 @@ Wine. All those differences are also documented on the
Included bug fixes and improvements
-----------------------------------
**Bug fixes and features included in the next upcoming release [7]:**
**Bug fixes and features included in the next upcoming release [8]:**
* Add information for delayed end of DST in Europe/Istanbul
* Allow to set debug registers separately in NtSetContextThread ([Wine Bug #39454](https://bugs.winehq.org/show_bug.cgi?id=39454))
* Also send WM_CAPTURECHANGE when capture has not changed ([Wine Bug #13683](https://bugs.winehq.org/show_bug.cgi?id=13683))
* Check handle type for HSPFILEQ handles ([Wine Bug #12332](https://bugs.winehq.org/show_bug.cgi?id=12332))
* Fix font loading in Capella ([Wine Bug #12377](https://bugs.winehq.org/show_bug.cgi?id=12377))

View File

@ -0,0 +1,61 @@
From f70ddf43d18cfeae70f0021005048c628b08c2b3 Mon Sep 17 00:00:00 2001
From: Sebastian Lackner <sebastian@fds-team.de>
Date: Sun, 29 Nov 2015 00:34:04 +0100
Subject: ntdll: Allow to set debug registers separately in NtSetContextThread.
---
dlls/ntdll/signal_x86_64.c | 28 ++++++++++++++++++++++++++--
1 file changed, 26 insertions(+), 2 deletions(-)
diff --git a/dlls/ntdll/signal_x86_64.c b/dlls/ntdll/signal_x86_64.c
index 524de68..abe2072 100644
--- a/dlls/ntdll/signal_x86_64.c
+++ b/dlls/ntdll/signal_x86_64.c
@@ -1800,11 +1800,12 @@ __ASM_GLOBAL_FUNC( RtlCaptureContext,
"ret" );
/***********************************************************************
- * set_cpu_context
+ * __wine_restore_regs
*
* Set the new CPU context.
*/
-__ASM_GLOBAL_FUNC( set_cpu_context,
+extern void __wine_restore_regs( const CONTEXT *context );
+__ASM_GLOBAL_FUNC( __wine_restore_regs,
"subq $40,%rsp\n\t"
__ASM_CFI(".cfi_adjust_cfa_offset 40\n\t")
"ldmxcsr 0x34(%rdi)\n\t" /* context->MxCsr */
@@ -1852,6 +1853,29 @@ __ASM_GLOBAL_FUNC( set_cpu_context,
"movq 0xb0(%rdi),%rdi\n\t" /* context->Rdi */
"iretq" );
+
+/***********************************************************************
+ * set_cpu_context
+ *
+ * Set the new CPU context. Used by NtSetContextThread.
+ */
+void set_cpu_context( const CONTEXT *context )
+{
+ DWORD flags = context->ContextFlags & ~CONTEXT_AMD64;
+
+ if (flags & CONTEXT_DEBUG_REGISTERS)
+ FIXME( "setting debug registers not supported\n" );
+
+ if (flags & CONTEXT_FULL)
+ {
+ if (!(flags & CONTEXT_CONTROL))
+ FIXME( "setting partial context (%x) not supported\n", flags );
+ else
+ __wine_restore_regs( context );
+ }
+}
+
+
/***********************************************************************
* copy_context
*
--
2.6.2

View File

@ -0,0 +1 @@
Fixes: [39454] Allow to set debug registers separately in NtSetContextThread

View File

@ -220,6 +220,7 @@ patch_enable_all ()
enable_ntdll_WinSqm="$1"
enable_ntdll_WriteWatches="$1"
enable_ntdll_Zero_mod_name="$1"
enable_ntdll_x86_64_set_cpu_context="$1"
enable_ntoskrnl_DriverTest="$1"
enable_ntoskrnl_Stubs="$1"
enable_nvapi_Stub_DLL="$1"
@ -771,6 +772,9 @@ patch_enable ()
ntdll-Zero_mod_name)
enable_ntdll_Zero_mod_name="$2"
;;
ntdll-x86_64_set_cpu_context)
enable_ntdll_x86_64_set_cpu_context="$2"
;;
ntoskrnl-DriverTest)
enable_ntoskrnl_DriverTest="$2"
;;
@ -4495,6 +4499,21 @@ if test "$enable_ntdll_Zero_mod_name" -eq 1; then
) >> "$patchlist"
fi
# Patchset ntdll-x86_64_set_cpu_context
# |
# | This patchset fixes the following Wine bugs:
# | * [#39454] Allow to set debug registers separately in NtSetContextThread
# |
# | Modified files:
# | * dlls/ntdll/signal_x86_64.c
# |
if test "$enable_ntdll_x86_64_set_cpu_context" -eq 1; then
patch_apply ntdll-x86_64_set_cpu_context/0001-ntdll-Allow-to-set-debug-registers-separately-in-NtS.patch
(
echo '+ { "Sebastian Lackner", "ntdll: Allow to set debug registers separately in NtSetContextThread.", 1 },';
) >> "$patchlist"
fi
# Patchset ntoskrnl-DriverTest
# |
# | Modified files:

View File

@ -17,6 +17,8 @@ wine-staging (1.8~rc2) UNRELEASED; urgency=low
* Added patch to send WM_CAPTURECHANGE also when capture has not changed.
* Added patch to silence repeated FIXME message in surface_cpu_blt.
* Added patch to start SERVICE_FILE_SYSTEM_DRIVER services with winedevice.
* Added patch to allow to set debug registers separately in
NtSetContextThread.
-- Sebastian Lackner <sebastian@fds-team.de> Wed, 25 Nov 2015 20:21:46 +0100
wine-staging (1.8~rc1) unstable; urgency=low