Commit Graph

78 Commits

Author SHA1 Message Date
Alexandre Julliard 39e4b788d6 ntdll: Use the standard Interlocked* functions.
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2020-05-02 15:10:04 +02:00
Alexandre Julliard bd9a1e23f2 ntdll: Move TEB allocation to the common code.
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2020-04-28 14:03:26 +02:00
Alexandre Julliard 9650f1d3a1 ntdll: Move signal stack size computation to the common code.
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2020-04-28 13:34:06 +02:00
Alexandre Julliard ffb7c595c6 ntdll: Add a helper for platform-specific threading initialization.
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2020-04-28 13:17:07 +02:00
Zebediah Figura feeb1c7c24 include: Rename LDR_MODULE to LDR_DATA_TABLE_ENTRY.
This name is used in Microsoft's public winternl.h.

Signed-off-by: Zebediah Figura <z.figura12@gmail.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2020-04-24 10:13:39 +02:00
Martin Storsjo ea9f47a767 ntdll: Properly return errors when failing to unwind.
If libunwind is unavailable, make libunwind_virtual_unwind return an
error. Likewise if there was no PE exception info and we didn't try
unwinding using libunwind, we need to return an error when realizing
we were unable to unwind, instead of just warning and returning
success.

This fixes hangs/infinite loops on crashes when unwinding fails.

Signed-off-by: Martin Storsjo <martin@martin.st>
Signed-off-by: André Hentschel <nerv@dawncrow.de>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2020-04-22 17:23:39 +02:00
Alexandre Julliard 0187310966 ntdll: Implement NtSetLdtEntries().
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2020-04-01 12:38:50 +02:00
Alexandre Julliard 6169cacd0d ntdll: Move support for getting LDT entries to the platform-specific files.
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2020-04-01 12:33:29 +02:00
Alexandre Julliard d96331d830 ntdll: Make loop counter signed.
Spotted by Gianfranco Costamagna.

Wine-Bug: https://bugs.winehq.org/show_bug.cgi?id=48398
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2020-01-04 11:22:08 +01:00
Alexandre Julliard 6a0e0001ef ntdll: Initialize FPU context on ARM64.
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2019-11-04 09:58:45 +01:00
Alexandre Julliard 85f1fbdb7e server: Clarify naming of ARM64 floating-point registers.
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2019-11-04 09:58:45 +01:00
Alexandre Julliard 5c101ed58f ntdll: Fix unwinding of leaf functions on ARM64.
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2019-10-23 21:09:38 +02:00
Henri Verbeet d82f06c075 ntdll: Properly handle 0 returns from unw_step().
Signed-off-by: Henri Verbeet <hverbeet@codeweavers.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2019-10-22 23:04:27 +02:00
Alexandre Julliard 82c753a273 ntdll: Send first chance debug event while on signal stack on ARM64.
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2019-09-19 22:07:53 +02:00
Alexandre Julliard afe8467110 ntdll: Avoid server call when possible in NtSetContextThread() on ARM64.
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2019-09-19 22:07:53 +02:00
Alexandre Julliard 2201229086 ntdll: Remove no longer needed function argument from setup_raise_exception() on ARM64.
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2019-09-12 22:47:45 +02:00
Alexandre Julliard 60eb37c6be ntdll: Handle page fault in signal handler on ARM64.
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2019-09-12 22:47:44 +02:00
Alexandre Julliard a7459d0c99 ntdll: Handle trap exception in signal handler on ARM64.
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2019-09-12 22:47:44 +02:00
Alexandre Julliard 769c333c6c ntdll: Factor out setup_raise_exception() on ARM64.
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2019-09-12 22:47:44 +02:00
Alexandre Julliard 7736f3837e ntdll: Use a stack_layout structure to build exception data on ARM64.
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2019-09-12 22:47:44 +02:00
Alexandre Julliard 5e8234b3c4 ntdll: Implement stack unwinding on ARM64.
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2019-08-29 20:08:14 +02:00
Alexandre Julliard a9755d286e ntdll: Implement RtlVirtualUnwind() for ARM64.
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2019-08-29 12:01:52 +02:00
Alexandre Julliard 87d9fef2ae ntdll: Take stack guarantee into account when handling stack overflows.
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2019-08-26 12:04:25 +02:00
Alexandre Julliard 59f1c98e2c ntdll: Run signal handlers on the signal stack on ARM64.
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2019-08-22 14:45:03 +02:00
Alexandre Julliard 14e34bedbf ntdll: Share dynamic exception table functions across platforms.
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2019-08-19 13:21:47 +02:00
Alexandre Julliard fc97373f62 ntdll: Fix support for breakpoint exceptions on ARM64.
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2019-08-13 15:41:55 +02:00
Alexandre Julliard 3027c266fc ntdll: Don't run exception handlers on the signal stack on ARM64.
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2019-08-13 15:41:25 +02:00
Alexandre Julliard 94a98cf5a2 ntdll: Implement setting the thread context on ARM64.
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2019-08-13 14:53:07 +02:00
Alexandre Julliard 1c9fdaab0f ntdll: Save the context from the caller stack frame in RtlCaptureContext() on ARM64.
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2019-08-13 14:52:23 +02:00
Alexandre Julliard 84783ed74f ntdll: Preserve the stack red zone on ARM64.
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2019-08-13 14:51:47 +02:00
Alexandre Julliard 85c01202ac ntdll: Use the exception fault code to detect write access on ARM64.
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2019-08-13 14:47:17 +02:00
Alexandre Julliard 07f37f2137 ntdll: Add support for saving/restoring FPU state on ARM64.
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2019-08-13 14:44:41 +02:00
Alexandre Julliard e91e6cc9bd ntdll: Reimplement thread initialization in assembler on ARM64.
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2019-08-07 00:12:25 +02:00
Rémi Bernon 00451d5edf ntdll: Clarify NtAllocateVirtualMemory zero_bits parameter semantics.
This parameter was misinterpreted as an alignment parameter for the
lower bits of the allocated memory region, although it is a constraint
on the higher bits.

Signed-off-by: Rémi Bernon <rbernon@codeweavers.com>
Signed-off-by: Huw Davies <huw@codeweavers.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2019-06-13 20:55:35 +02:00
André Hentschel 0e26aaa3ed ntdll: Add stub for RtlInstallFunctionTableCallback on ARM/ARM64.
Signed-off-by: André Hentschel <nerv@dawncrow.de>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2019-04-01 23:25:49 +02:00
Alexandre Julliard 9f0d669239 ntdll: Rename attach_dlls() to LdrInitializeThunk().
Based on a patch by Andrew Wesie.

Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2019-02-14 17:57:09 +01:00
Nikolay Sivov 067f6d7463 ntdll: Implement growable unwind tables API.
Wine-Bug: https://bugs.winehq.org/show_bug.cgi?id=46479
Signed-off-by: Nikolay Sivov <nsivov@codeweavers.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2019-01-23 17:17:18 +01:00
André Hentschel 1b5b311cce ntdll: Use correct PC for instruction decoding on ARM64.
Wine-Bug: https://bugs.winehq.org/show_bug.cgi?id=46194
Signed-off-by: André Hentschel <nerv@dawncrow.de>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2018-12-24 20:12:25 +01:00
Alex Henrie c9109309c8 ntdll: Add RtlGrowFunctionTable stub.
Signed-off-by: Alex Henrie <alexhenrie24@gmail.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2018-12-03 22:27:05 +01:00
Austin English 80991720de ntdll: Add RtlAddGrowableFunctionTable stub.
Wine-Bug: https://bugs.winehq.org/show_bug.cgi?id=42255
Signed-off-by: Alex Henrie <alexhenrie24@gmail.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2018-12-03 22:27:05 +01:00
André Hentschel b78a5db2dc ntdll: Add more traces to raise_exception on ARM64.
Wine-Bug: https://bugs.winehq.org/show_bug.cgi?id=46126
Signed-off-by: André Hentschel <nerv@dawncrow.de>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2018-11-16 14:58:41 +01:00
André Hentschel ebc80ad1c4 ntdll: Add stubs for RtlAddFunctionTable and RtlDeleteFunctionTable on ARM64.
Wine-Bug: https://bugs.winehq.org/show_bug.cgi?id=46143
Signed-off-by: André Hentschel <nerv@dawncrow.de>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2018-11-15 09:57:28 +01:00
Alexandre Julliard da60ea1c33 ntdll: Add a wrapper to call the unhandled exception filter.
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2018-10-09 14:42:30 +02:00
Michael Stefaniuc 10f23ddb58 ntdll: Use the ARRAY_SIZE() macro.
Signed-off-by: Michael Stefaniuc <mstefani@winehq.org>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2018-08-14 10:15:59 +02:00
Alexandre Julliard 36371075f8 ntdll: Pass the server context to get/set_thread_context().
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2018-06-12 14:01:35 +02:00
Martin Storsjo e0780c258f ntdll: Update the ARM64 CONTEXT struct to match Win SDK 10.0.16299.0.
Signed-off-by: Martin Storsjo <martin@martin.st>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2018-03-19 13:13:59 +01:00
Alexandre Julliard 39c8875ff8 ntdll: Add support for running IL-only .NET executables.
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2018-02-21 09:55:05 +01:00
Alexandre Julliard e7202687fc ntdll: Remove support for vm86 mode.
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2018-02-01 22:24:57 +01:00
Alexandre Julliard 9d911a5736 ntdll: Move suspending a thread on startup back to the platform-specific files.
This partially reverts f64d2688d2.

Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2018-01-22 22:26:46 +01:00
André Hentschel dfe813e34f ntdll: Determine write fault based on failed instruction on ARM64.
Based on code from Qemu. Reported by Stefan Dösinger.

Signed-off-by: André Hentschel <nerv@dawncrow.de>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2018-01-22 10:20:07 +01:00