Commit Graph

213 Commits

Author SHA1 Message Date
Paul Gofman 6b78bcff92 ntdll: Restore FP status words from MSVCRT_JUMP_BUFFER on x64.
Signed-off-by: Paul Gofman <pgofman@codeweavers.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2021-12-21 16:52:07 +01:00
Alexandre Julliard c372d155ec ntdll/tests: Fix some exception test failures on Windows.
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2021-12-15 15:57:01 +01:00
Alexandre Julliard 40d706caba ntdll/tests: Mark a failing test as todo.
Wine-Bug: https://bugs.winehq.org/show_bug.cgi?id=51380
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2021-12-12 15:41:02 +01:00
Paul Gofman 3f20261eaf ntdll: Set rcx on exit from syscall dispatcher on x64.
Signed-off-by: Paul Gofman <pgofman@codeweavers.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2021-12-03 19:31:55 +01:00
Paul Gofman 4094767634 ntdll/tests: Fix iret to invalid selector test on x64.
Signed-off-by: Paul Gofman <pgofman@codeweavers.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2021-12-01 18:13:53 +01:00
Martin Storsjö 0dc34ad87a ntdll/tests: Add tests for RtlVirtualUnwind for arm.
Signed-off-by: Martin Storsjö <martin@martin.st>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2021-11-09 22:02:55 +01:00
Martin Storsjö e9939c9301 ntdll/tests: Remove an accidental, unused macro in arm64 exception tests.
Signed-off-by: Martin Storsjö <martin@martin.st>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2021-11-09 22:02:55 +01:00
Alexandre Julliard 8a8889340f ntdll: Fix exception information for SSE floating point faults.
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2021-08-20 11:32:17 +02:00
Alexandre Julliard b7323b4b3e ntdll/tests: Don't mark Wow64 floating point behavior as broken.
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2021-08-19 15:07:25 +02:00
Alexandre Julliard 0883dafe6a ntdll/tests: Don't mark Wow64 behavior as broken.
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2021-08-18 20:03:31 +02:00
Alexandre Julliard daa1886a2c ntdll: Add a stub for NtCallbackReturn().
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2021-08-17 11:52:35 +02:00
Biswapriyo Nath d60c450c7b winecrt0: Add missing members in _JUMP_BUFFER for SJLJ.
Signed-off-by: Biswapriyo Nath <nathbappai@gmail.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2021-07-19 20:09:58 +02:00
Alexandre Julliard 8ac411ed6d server: Support both native and wow64 register contexts.
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2021-06-27 11:42:32 +02:00
Zebediah Figura 10cc82827e ntdll/tests: Mark a test as conditionally succeeding under Wine.
The stack handler doesn't return ExceptionContinueExecution if test_stage == 2.

Signed-off-by: Zebediah Figura <z.figura12@gmail.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2021-06-24 21:59:26 +02:00
Zebediah Figura 9eade0d245 ntdll/tests: Fix a failure in test_thread_context() under Wine.
Follow-up to 94ee270972.

Signed-off-by: Zebediah Figura <z.figura12@gmail.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2021-06-24 21:59:23 +02:00
Zebediah Figura 2554daf1bf ntdll/tests: Fix AVX tests on processors that don't support XSAVEOPT.
Signed-off-by: Zebediah Figura <z.figura12@gmail.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2021-06-24 21:59:17 +02:00
Paul Gofman 4e4847dd71 ntdll/tests: Do not write to fs, gs when testing cleared segment regs on x64.
Wine-Bug: https://bugs.winehq.org/show_bug.cgi?id=51152
Signed-off-by: Paul Gofman <pgofman@codeweavers.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2021-06-23 21:45:08 +02:00
Alexandre Julliard 9ae2b046ef ntdll/tests: Add more tests for Wow64 contexts.
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2021-06-22 17:57:46 +02:00
Alexandre Julliard 03fe2b36cd ntdll/tests: Add more tests for segment registers in 64-bit mode.
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2021-06-22 17:48:45 +02:00
Alexandre Julliard 15b18f4830 ntdll/tests: Adapt some of the i386 tests to run on x86-64 as well.
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2021-06-18 16:48:48 +02:00
Alexandre Julliard a2fce84a8b ntdll: Fix some exception test failures on ARM64.
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2021-06-10 19:54:33 +02:00
Alexandre Julliard 4e74038749 ntdll: Fix some exception test failures on ARM.
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2021-06-10 19:54:33 +02:00
Alexandre Julliard d08f42b68c kernelbase: Move CopyContext() implementation to ntdll.
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2021-06-03 17:42:19 +02:00
Alexandre Julliard 3f1f58f19a ntdll: Use appropriate context constants where possible.
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2021-06-03 13:03:20 +02:00
Zebediah Figura f47a09b917 ntdll/tests: Fix a copy-paste error in an ok message.
Signed-off-by: Zebediah Figura <z.figura12@gmail.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2021-05-18 09:56:43 +02:00
Alexandre Julliard 5ba8f0d73b ntdll: Store the Wow64 context at the top of the 64-bit stack.
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2021-05-17 18:49:09 +02:00
Alexandre Julliard a8ff0c12f4 ntdll: Allocate a separate 64-bit stack for Wow64 threads.
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2021-05-17 18:49:09 +02:00
Michael Stefaniuc 8163dcb6c8 ntdll/tests: Remove superfluous casts to self.
Signed-off-by: Michael Stefaniuc <mstefani@winehq.org>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2021-04-09 20:37:14 +02:00
Zebediah Figura 195c57eeb7 ntdll: Report SegDs to be identical to SegSs in x86_64 exception handlers.
Based on a patch by Dávid Török.

Wine-Bug: https://bugs.winehq.org/show_bug.cgi?id=47970
Signed-off-by: Zebediah Figura <z.figura12@gmail.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2021-03-29 22:44:35 +02:00
Zebediah Figura 10d7a804c1 ntdll/tests: Add a test for segment register contents in x86_64 exception handlers.
Signed-off-by: Zebediah Figura <z.figura12@gmail.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2021-03-29 22:44:35 +02:00
Rafał Harabień 77481d36d3 ntdll: Allow getting/setting x86_64 context of x86 processes in wine64.
WoW64 process has two separate contexts:
- x86 context used most of the time (e.g. by application code)
- x86_64 context used by system when it quits x86 emulation and jumps to
  the kernel code
A notable exception are debug registers - their state is shared. Some
debuggers make use of that fact and sets/gets debug registers of x86
processes using x86_64 thread context.

Add support for setting and getting debug registers using x86_64
thread context. Getting other registers is allowed too and will return
values from x86 thread context.

Fixes hardware breakpoints in IDA 7.0 disassembler (x86_64 app) when
debugging x86 (32 bit) applications.

Signed-off-by: Rafał Harabień <rafalh92@outlook.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2021-03-09 21:33:43 +01:00
Rafał Harabień bee9f0126f ntdll/tests: Test getting/setting x86_64 context of x86 processes in wine64.
Signed-off-by: Rafał Harabień <rafalh92@outlook.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2021-03-09 21:33:43 +01:00
Jacek Caban af74bd3122 ntdll: Use syscall dispatcher to restore context in NtSetContextThread.
Signed-off-by: Jacek Caban <jacek@codeweavers.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2021-03-02 20:41:39 +01:00
Alexandre Julliard 4ef8e946f1 winebuild: Set Thumb bit in CPSR register on syscall entry.
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2021-02-24 22:01:42 +01:00
Jacek Caban fadd22ed5a ntdll/tests: Don't assume 32-bit test module base.
Signed-off-by: Jacek Caban <jacek@codeweavers.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2021-01-22 18:33:32 +01:00
Rémi Bernon c414f232e6 server: Accept DBG_EXCEPTION_HANDLED parameter in continue_debug_event.
Wine-Bug: https://bugs.winehq.org/show_bug.cgi?id=50453
Signed-off-by: Rémi Bernon <rbernon@codeweavers.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2021-01-06 20:18:50 +01:00
Jefferson Carpenter 93c4852620 ntdll/tests: Clear AC flag in align check test.
Wine-Bug: https://bugs.winehq.org/show_bug.cgi?id=49771
Signed-off-by: Jefferson Carpenter <jeffersoncarpenter2@gmail.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2020-12-28 12:27:14 +01:00
Paul Gofman 175a3649ba ntdll: Always copy context in call_user_apc_dispatcher() on x86.
Signed-off-by: Paul Gofman <pgofman@codeweavers.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2020-12-22 21:25:34 +01:00
Paul Gofman 71a43335ab ntdll: Save unwind information in KiUserApcDispatcher() on x64.
Signed-off-by: Paul Gofman <pgofman@codeweavers.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2020-12-17 10:35:46 +01:00
Paul Gofman 183a8cf380 ntdll: Restore non-volatile registers in call_user_exception_dispatcher() on x86_64.
Required to correctly restore non-volatile registers during unwind.

Signed-off-by: Paul Gofman <pgofman@codeweavers.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2020-12-07 22:35:29 +01:00
Paul Gofman c073b1ad40 ntdll/tests: Add a broken result for Win7u in test_extended_context().
Fixes test failures on w7u testbot machines.

Signed-off-by: Paul Gofman <pgofman@codeweavers.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2020-12-07 22:35:29 +01:00
Alexandre Julliard ce5e1c12c3 ntdll/tests: Fix a trace format on ARM64.
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2020-11-26 23:25:38 +01:00
Paul Gofman fa409a91b0 ntdll/tests: Test AVX context with debugger.
Signed-off-by: Paul Gofman <pgofman@codeweavers.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2020-10-13 22:30:05 +02:00
Paul Gofman 4e52f7ca86 ntdll/tests: Test getting and setting AVX registers for the other thread.
Signed-off-by: Paul Gofman <pgofman@codeweavers.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2020-10-13 22:30:05 +02:00
Francois Gouget cdfec11e42 ntdll/tests: Fix the spelling of a couple of ok_() messages.
Signed-off-by: Francois Gouget <fgouget@free.fr>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2020-09-21 19:24:19 +02:00
Paul Gofman 0c857e92cb ntdll/tests: Fix exception test failures on win10pro.
Signed-off-by: Paul Gofman <pgofman@codeweavers.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2020-09-07 21:09:31 +02:00
Martin Storsjo 3395ee3631 ntdll: Fix more corner cases for arm64 packed info unwinding.
Make sure to restore sp from fp for CR == 3.

Fix unwinding of partial prologues/epilogues - the previous logic
had an off-by-one for the pos/skip handling; fix a few more
corner cases with odd number of saved registers.

Functions with the H flag set (saving x0-x7 on the stack) should
be considred having 4 nops (for the instructions saving the
registers) in the prologue for unwind purposes. When unwinding
through a partial epilogue, the same 4 nops should also be
considered to be there (even though no sane epilogue would restore
the registers there) based on how windows handles partial epilogue
unwinding in those cases.

Uncomment prologue/epilogue cases in an existing test and add
tests for many more cases.

Signed-off-by: Martin Storsjo <martin@martin.st>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2020-09-07 21:08:26 +02:00
Paul Gofman 61f3b3dcdf ntdll/tests: Add tests for capturing context with xstate.
Signed-off-by: Paul Gofman <pgofman@codeweavers.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2020-09-02 16:30:04 +02:00
Paul Gofman 81a08cea79 kernel32: Implement CopyContext().
Signed-off-by: Paul Gofman <pgofman@codeweavers.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2020-09-01 12:34:43 +02:00
Paul Gofman 85a33ff731 kernel32: Implement GetXStateFeaturesMask().
Signed-off-by: Paul Gofman <pgofman@codeweavers.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2020-09-01 12:33:47 +02:00