Commit Graph

298 Commits

Author SHA1 Message Date
Alexandre Julliard 5f10545b19 ntdll: Don't use virtual_uninterrupted_read_memory() for invalid %gs check.
It doesn't work for code in system libraries. This is a partial revert
of 58139dcb12.

Wine-Bug: https://bugs.winehq.org/show_bug.cgi?id=47769
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2019-09-17 16:50:44 +02:00
Alexandre Julliard 944c4e8f76 ntdll: Use virtual_uninterrupted_read_memory() to read code inside signal handler on i386.
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2019-09-13 19:34:19 +02:00
Alexandre Julliard 17c82ddc95 ntdll: Avoid calling init_handler() twice in signal handler on i386.
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2019-09-13 19:34:19 +02:00
Alexandre Julliard d9ec920fd9 ntdll: Remove no longer needed function argument from setup_raise_exception() on i386.
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2019-09-12 22:47:44 +02:00
Alexandre Julliard 5501055ed5 ntdll: Handle ATL thunk emulation in signal handler on i386.
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2019-09-12 22:47:44 +02:00
Alexandre Julliard df3fad6383 ntdll: Handle page faults in signal handler on i386.
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2019-09-12 21:07:05 +02:00
Alexandre Julliard 58139dcb12 ntdll: Handle invalid %gs fault in signal handler on i386.
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2019-09-12 20:32:30 +02:00
Alexandre Julliard 0bd2465326 ntdll: Handle breakpoint interrupt in signal handler on i386.
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2019-09-12 20:32:28 +02:00
Alexandre Julliard 846de4aef8 ntdll: Handle alignment fault in signal handler on i386.
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2019-09-12 20:28:19 +02:00
Alexandre Julliard 5e2b0585cd ntdll: Handle single step exception in signal handler on i386.
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2019-09-12 20:27:39 +02:00
Alexandre Julliard 41509c0d5b ntdll: Factor out setup_raise_exception() on i386.
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2019-09-12 20:27:38 +02:00
Alexandre Julliard 04c73a8930 ntdll: Use a stack_layout structure to build exception data on i386.
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2019-09-12 20:25:39 +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
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
Alexandre Julliard 170bd8f361 include: Pass function name directly to the __ASM_STDCALL macro.
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2019-05-16 19:00:10 +02:00
Paul Gofman bd9cdb3b65 ntdll: Mark 'float_status' as input operand in save_fpu().
Signed-off-by: Paul Gofman <gofmanp@gmail.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2019-03-06 18:28:20 +01:00
Paul Gofman c6cd92bedd ntdll: Avoid resetting x87 FPU state when saving context.
'FNSAVE' x87 instruction resets the FPU state to default values
(like FINIT). This results in FPU state reset to default in any
ntdll call which is getting x87 FPU state, e. g. obtaining context
or raising an exception.

Signed-off-by: Paul Gofman <gofmanp@gmail.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2019-03-04 14:49:51 +01:00
Alexandre Julliard 20a2cc9751 ntdll: Store extended FPU state and debug registers in RtlRaiseException().
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2019-02-14 19:53:25 +01:00
Alexandre Julliard edbdec441b ntdll: Store extended FPU context in NtGetContextThread().
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2019-02-14 19:53:25 +01: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
Alexandre Julliard dc80a00329 ntdll: Also store FPU registers in RtlRaiseException().
Wine-Bug: https://bugs.winehq.org/show_bug.cgi?id=44485
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2019-01-02 23:02:25 +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
Alexandre Julliard 342e2cabd2 ntdll: Avoid pushl %esp instruction in RtlUnwind prolog.
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2018-03-09 13:47:01 -06: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 7ccae68f6c ntdll: Fix crash on nested thread exit.
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2018-02-06 19:38:30 +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
Alexandre Julliard a83532d8dd ntdll: Store the context on the thread stack after the initial suspend.
The initial stack pointer may have been modified during suspend.

Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2018-01-22 22:26:45 +01:00
Alexandre Julliard 5020fb7c47 ntdll: Don't set floating point registers from initial context.
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2018-01-02 15:52:21 +01:00
Alexandre Julliard c2f34d1b24 ntdll: Reset the exit frame when switching back to it.
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2017-12-15 12:36:16 +01:00
Alexandre Julliard 7e9f1878db ntdll: Run the thread/process detach code on the thread stack.
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2017-12-14 10:54:56 +01:00
Alexandre Julliard b526a48a24 ntdll: Pass the stack pointer to virtual_clear_thread_stack().
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2017-12-04 15:03:55 +01:00
Alexandre Julliard 23ec3ce2a3 ntdll: Start process execution directly at the kernel32 process entry point.
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2017-12-04 15:03:55 +01:00
Alexandre Julliard f64d2688d2 ntdll: Move suspending a thread on startup into attach_dlls().
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2017-12-01 20:32:12 +01:00
Alexandre Julliard a89fdd58ec ntdll: Run the entire thread initialization code on the thread stack on i386.
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2017-12-01 19:18:57 +01:00
Alexandre Julliard 70b69f3e5f ntdll: Don't return from attach_dlls on failure.
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2017-11-30 19:06:44 +01:00
Alexandre Julliard 6c61ea6a13 ntdll: Suspend a thread with its start context explicitly before attaching dlls.
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2017-11-30 12:15:51 +01:00
Alexandre Julliard 53e4c36ef8 ntdll: Add a platform-specific helper for starting a thread.
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2017-11-29 20:15:30 +01:00
Alexandre Julliard afb16abc0f ntdll: Add a platform-specific helper for starting a process.
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2017-11-29 17:18:23 +01:00
Alexandre Julliard 93eceba03e ntdll: Move freeing the thread stack to a common helper.
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2017-11-29 10:43:39 +01:00
Alexandre Julliard 8b929bd759 ntdll: Set the initial process context on i386.
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2017-09-19 12:14:11 +02:00
Alexandre Julliard 8c103f298b ntdll: Add support for setting a platform-specific initial context.
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2017-09-19 12:10:14 +02:00
Alexandre Julliard 3bfd7973a4 ntdll: Don't do partial writes in virtual_uninterrupted_write_memory.
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2017-09-06 17:31:00 +02:00
Sebastian Lackner dee9eaa248 ntdll: Fix a TRACE in NtGetContextThread.
Signed-off-by: Sebastian Lackner <sebastian@fds-team.de>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2017-08-12 11:11:55 +09:00
Alexandre Julliard bab6ece637 ntdll: Set thread context directly in assembly instead of using generated code.
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2017-07-26 10:22:05 +02:00
Alexandre Julliard 38d45cbcc8 ntdll: Mark function that are only called from assembly as hidden.
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2017-07-25 11:48:24 +02:00
Alexandre Julliard dc63fbf98d ntdll: Use RtlCaptureContext also in RtlUnwind.
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2017-07-24 18:58:30 +02:00
Alexandre Julliard 2bb668b1da ntdll: Get some values from the parent stackframe in RtlCaptureContext.
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2017-07-24 18:58:30 +02:00