Commit graph

5341 commits

Author SHA1 Message Date
Martin Storsjo 0a6e46e436 ntdll: Fix nested exceptions on arm64.
This mirrors ae07938ba6 (from x86_64)
to arm64.

Signed-off-by: Martin Storsjo <martin@martin.st>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2020-10-06 11:57:05 +02:00
Martin Storsjo b09acd526d ntdll: Clear ExceptionFlags on arm64 after running an exception handler.
This applies the beahviour from a69762541a
(on x86_64) to arm64 as well.

Signed-off-by: Martin Storsjo <martin@martin.st>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2020-10-06 11:57:03 +02:00
Sven Baars 973b0e1dfc ntdll: Fix a memory leak (Valgrind).
Wine-Bug: https://bugs.winehq.org/show_bug.cgi?id=49904
Signed-off-by: Sven Baars <sbaars@codeweavers.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2020-10-05 20:54:23 +02:00
Martin Storsjo dcf3874e00 ntdll: Restore the original Lr value when unwinding through raise_func_trampoline on arm64.
When a signal is raised in a leaf function (that hasn't backed up
the Lr register itself), we need to restore both Pc and Lr separately.
This doesn't seem to be possible via libunwind, so add a special case
unwinding rule for this function.

As we have a special case for the function, we could also just as well
skip normal dwarf unwinding for this function altogether and just
restore the full context from the stack.

Signed-off-by: Martin Storsjo <martin@martin.st>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2020-10-05 12:33:31 +02:00
Martin Storsjo df794f3425 ntdll: Unwind to the LR register if no unwind info is available.
Try to keep the behaviour from ea9f47a767 of erroring out if
unwinding ends up out of bounds (with pc==lr, where setting pc
to lr doesn't progress the unwind), but support unwinding from
functions without unwind info.

Signed-off-by: Martin Storsjo <martin@martin.st>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2020-10-05 12:33:31 +02:00
Paul Gofman defcbc8b97 kernelbase: Move FlsGetValue() implementation to ntdll.RtlFlsGetValue().
Signed-off-by: Paul Gofman <pgofman@codeweavers.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2020-10-01 11:43:53 +02:00
Paul Gofman e596f4047b kernelbase: Move FlsSetValue() implementation to ntdll.RtlFlsSetValue().
Signed-off-by: Paul Gofman <pgofman@codeweavers.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2020-10-01 11:43:07 +02:00
Paul Gofman 0627fa9d92 kernelbase: Move FlsFree() implementation to ntdll.RtlFlsFree().
Signed-off-by: Paul Gofman <pgofman@codeweavers.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2020-10-01 11:43:03 +02:00
Paul Gofman c955eee9e8 kernelbase: Move FlsAlloc() implementation to ntdll.RtlFlsAlloc().
Signed-off-by: Paul Gofman <pgofman@codeweavers.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2020-10-01 11:42:58 +02:00
Alexandre Julliard 0167e195e9 ntdll: Fix handle/module confusion in Unix module loading.
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2020-09-30 15:38:08 +02:00
Alexandre Julliard e5c0e8e296 ntdll: Use load_dll() to load kernel32 to support PE format.
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2020-09-28 19:38:42 +02:00
Alexandre Julliard 7cec3dc284 ntdll: Use the standard code path to load ntdll.dll.
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2020-09-28 19:38:42 +02:00
Alexandre Julliard 20e0fd6e99 ntdll: Delay ntdll.dll loading until more initialization is done.
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2020-09-28 19:38:42 +02:00
Alexandre Julliard e055a3ee05 configure: Require 64-bit compare-and-swap support from gcc.
Wine-Bug: https://bugs.winehq.org/show_bug.cgi?id=49191
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2020-09-28 17:03:57 +02:00
Louis Lenders 595600b6c1 ntdll: Bump Win 10 version to 17763.
Signed-off-by: Louis Lenders <xerox.xerox2000x@gmail.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2020-09-28 13:23:44 +02:00
Michael Müller d0bea3d702 server: Implement support for creating a process with a specified token.
Signed-off-by: Zebediah Figura <z.figura12@gmail.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2020-09-24 15:21:43 +02:00
Zebediah Figura 6cf3561ff3 ntdll: Pass the token to NtCreateUserProcess().
Signed-off-by: Zebediah Figura <z.figura12@gmail.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2020-09-24 15:18:44 +02:00
Michael Müller 8c5638aa5e ntdll: Implement NtFilterToken.
Signed-off-by: Zebediah Figura <z.figura12@gmail.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2020-09-23 15:58:10 +02:00
Alexandre Julliard 96dcee6430 server: Implement object name information for registry keys.
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2020-09-22 21:35:35 +02:00
Alexandre Julliard bdb2fe0cad server: Return the device name for named pipe files.
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2020-09-22 21:35:34 +02:00
Alexandre Julliard 7b79c8059d server: Return the device name for mailslot files.
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2020-09-22 21:35:34 +02:00
Nikolay Sivov c58a10c163 server: Implement inherited handles list.
Signed-off-by: Nikolay Sivov <nsivov@codeweavers.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2020-09-22 14:04:45 +02:00
Paul Gofman ba2924a64d ntdll/tests: Test named pipe with empty name.
Signed-off-by: Paul Gofman <pgofman@codeweavers.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2020-09-22 13:18:48 +02:00
Alexandre Julliard 9c8dce2155 ntdll: Don't lock mutexes during process exit.
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2020-09-22 11:28:41 +02:00
Alexandre Julliard d8f7d54573 ntdll: Add inline wrappers for pthread mutex locking.
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2020-09-22 11:28:25 +02:00
Jacek Caban 54e117018c kernelbase: Use conhost to handle Unix consoles.
Signed-off-by: Jacek Caban <jacek@codeweavers.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2020-09-21 19:24:19 +02:00
Jacek Caban 0957f9302c ntdll: Fill console size in get_initial_console.
Signed-off-by: Jacek Caban <jacek@codeweavers.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2020-09-21 19:24:19 +02:00
Jacek Caban 6bcc1b9225 ntdll: Pass RTL_USER_PROCESS_PARAMETERS to get_initial_console.
Signed-off-by: Jacek Caban <jacek@codeweavers.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2020-09-21 19:24:19 +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
Francois Gouget a9722145a8 ntdll: Fix the spelling of the arch_context_parameters variable.
Signed-off-by: Francois Gouget <fgouget@free.fr>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2020-09-21 19:24:19 +02:00
Alexandre Julliard a014f413d6 ntdll: Add support for loading a Unix helper library from builtin dlls.
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2020-09-21 13:41:28 +02:00
Sven Baars 123a4a884f ntdll: Fix some memory leaks (Valgrind).
Signed-off-by: Sven Baars <sbaars@codeweavers.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2020-09-21 12:57:37 +02:00
Alexandre Julliard 2eed0cdb8f include: Don't use IsBadStringPtr in debug functions for Unix libraries.
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2020-09-18 15:13:42 +02:00
Martin Storsjo 2693e6662d ntdll: Implement __C_specific_handler and _local_unwind for arm64.
Signed-off-by: Martin Storsjo <martin@martin.st>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2020-09-17 20:54:16 +02:00
Stefan Dösinger 4d33a0410e ntdll: Use the MacOS file handle limit workaround from libs/wine/loader.c.
Wine-Bug: https://bugs.winehq.org/show_bug.cgi?id=49624
Signed-off-by: Stefan Dösinger <stefan@codeweavers.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2020-09-14 19:42:40 +02:00
Alexandre Julliard 3cd3b77522 ntdll: Update argc when changing process name.
Wine-Bug: https://bugs.winehq.org/show_bug.cgi?id=49834
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2020-09-14 19:42:40 +02:00
Alexandre Julliard 1dd3051cca makefiles: Generate a single non-recursive makefile at the top level.
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2020-09-14 19:42:39 +02:00
Chao Long 655ab7a84f ntdll: Fix a ImagePathName memory leak (Valgrind).
Signed-off-by: Chao Long <longchao@uniontech.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2020-09-10 21:56:34 +02:00
Chao Long d0946955ec ntdll: Fix a memory leak (Valgrind).
Signed-off-by: Chao Long <longchao@uniontech.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2020-09-09 20:30:50 +02:00
Hans Leidekker ec02224941 ntdll: Return buffer filled with random values from NtQuerySystemInformation(SystemInterruptInformation).
Based on a patch by Sebastian Lackner.

Signed-off-by: Hans Leidekker <hans@codeweavers.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2020-09-09 20:30:31 +02:00
Alexandre Julliard a204ad557d makefiles: Expand makedep path at compile time.
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2020-09-09 20:30:31 +02:00
Paul Gofman 7ec069d85f ntdll/tests: Fix virtual 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:36 +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
Alexandre Julliard cc9d69b20b ntdll: Pop the Unix stack completely in call_user_apc_dispatcher().
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2020-09-04 21:16:49 +02:00
Martin Storsjo 36ebdfc6b6 ntdll: Add ARM64 SEH unwind directives for assembly functions in PE builds.
This fixes unwinding through RtlRaiseException and
call_consolidate_callback in PE builds.

Adjust the call_consolidate_callback function to store the whole
context on the stack, and use the seh "context" opcode for
unwinding to that context instead of the parent. Adjust the dwarf
escape codes for reading from the context on the stack.

Signed-off-by: Martin Storsjo <martin@martin.st>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2020-09-04 15:47:27 +02:00
Martin Storsjo 5bbd8130ad ntdll: Don't truncate SP in arm64 handle_syscall_fault.
This seems to be a copypaste typo from 0b3db9dfa2.

Signed-off-by: Martin Storsjo <martin@martin.st>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2020-09-04 15:42:18 +02:00
Martin Storsjo d99a454a6b ntdll: Fix arm64 regression from "Clear the syscall frame on return".
The restoring of registers in call_user_exception_dispatcher
was broken in 75e616d52b.

Signed-off-by: Martin Storsjo <martin@martin.st>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2020-09-04 15:42:15 +02:00
Alexandre Julliard 2d91f7def1 ntdll: Load libwine dynamically.
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2020-09-03 12:30:41 +02:00
Alexandre Julliard 4e80f2ea5e ntdll: Add a helper function to try an mmap at a fixed address.
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2020-09-03 10:54:17 +02:00