Commit Graph

4863 Commits (e0138c4a6a7a87f1d25badd43e05490e706bc666)

Author SHA1 Message Date
Matteo Bruni 2e5c2c7cdb ntdll: Use memcpy() in set_float_reg().
The source address might not be aligned although the compiler can
expect alignment when using a plain assignment.

Signed-off-by: Matteo Bruni <mbruni@codeweavers.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2020-05-25 20:20:09 +02:00
Gijs Vermeulen 676b6b0fd7 ntdll: Fix number of arguments passed to mmap_remove_reserved_area in apple_create_wine_thread.
This fixes a regression introduced by 625209433f

Signed-off-by: Gijs Vermeulen <gijsvrm@gmail.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2020-05-22 19:50:48 +02:00
Alexandre Julliard 9b8fabf4b0 ntdll: Silence a va_start compiler warning.
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2020-05-22 14:32:02 +02:00
Alexandre Julliard 6bed2b427b kernel32: Move the *PreferredUILanguages functions to kernelbase and ntdll.
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2020-05-22 14:31:55 +02:00
Alexandre Julliard 75e2f79b68 ntdll: Implement SystemTimeAdjustmentInformation class.
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2020-05-22 14:31:55 +02:00
Alexandre Julliard 7cc9ccbd22 kernel32: Move GetProcessTimes() implementation to kernelbase and ntdll.
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2020-05-22 14:31:55 +02:00
Alexandre Julliard cd215bb49b kernel32: Use the user shared data to implement GetTickCount().
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2020-05-21 19:36:52 +02:00
Alexandre Julliard 9b12068c6c ntdll: Use the user shared data to implement RtlQueryUnbiasedInterruptTime().
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2020-05-21 19:36:52 +02:00
Alexandre Julliard cc5953048e ntdll: Use the user shared data to implement NtGetTickCount().
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2020-05-21 19:36:52 +02:00
Alexandre Julliard 0936606c38 ntdll: Centralize initialization of the user shared data.
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2020-05-21 19:36:52 +02:00
Alexandre Julliard ab350866e4 ntdll: Add some more CPU feature flags.
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2020-05-21 17:06:04 +02:00
Alexandre Julliard ca13f489e1 ntdll: Make the windows directory a global variable.
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2020-05-21 17:06:04 +02:00
Alexandre Julliard acd209d603 ntdll: Move setting the process name to the Unix library.
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2020-05-20 16:16:40 +02:00
Alexandre Julliard 3d3545b12f ntdll: Move the Unix codepage initialization to the Unix library.
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2020-05-20 16:16:40 +02:00
Alexandre Julliard dec38ffb07 ntdll: Move the wineserver exec support to the Unix library.
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2020-05-19 17:40:08 +02:00
Alexandre Julliard 67bc4a6d76 ntdll: Don't use libwine during the Unix library initialization.
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2020-05-19 14:08:30 +02:00
Alexandre Julliard fb310724f6 ntdll: Move the wineloader exec support to the Unix library.
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2020-05-19 14:08:16 +02:00
Alexandre Julliard e619429035 ntdll: Move configuration paths setup to the Unix library.
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2020-05-19 12:35:54 +02:00
Zebediah Figura 4cb95848fd ntdll: Remove extraneous newline from debugstr_ObjectAttributes().
Signed-off-by: Zebediah Figura <z.figura12@gmail.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2020-05-19 11:04:46 +02:00
Alon Barzilai 058f86958c ntdll: Add missing RtlQueryEnvironmentVariable function.
Wine-Bug: https://bugs.winehq.org/show_bug.cgi?id=48773
Signed-off-by: Alon Barzilai <alon.barzilai@gmail.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2020-05-18 19:48:34 +02:00
Martin Storsjo 5f14b6357b ntdll: Properly restore x29/x30 for arm64 packed unwind data with local stack.
For the CR == 3 case, x29/x30 should be restored from x29, not from
sp, which may have been decremented further for local stack storage.

This fixes uwinding the stack for C++ exceptions in code generated
by MSVC.

Signed-off-by: Martin Storsjo <martin@martin.st>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2020-05-18 15:12:49 +02:00
Martin Storsjo 93ecc54ae5 ntdll: Pass a nonnull handler_data when continuing after a collided unwind on arm64.
This fixes crashes when handling GNU/mingw style SEH based C++
exceptions on arm64; in these cases unwind_full_data ended up
where it tries to write handler_rva + 1 to *handler_data.

Signed-off-by: Martin Storsjo <martin@martin.st>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2020-05-18 15:12:45 +02:00
Martin Storsjo 93082b3d52 ntdll: Fix arm64 unwind across ELF/PE boundaries.
The previous implementation might have given the impression of
working, as long in some cases where the PE code actually used frame
pointers, but turned out to be subly wrong.

This essentially reverts the functional aspects of 1c9fdaab0f.

Use the new value of the Lr register, after fetching the registers
from unw_step, as the return value.

To make single-stepping unwinding work properly, treat the registers
consistently:

- Make RtlCaptureContext store the current values of x29/Fp and x30/Lr
from within the function, not the ones backed up from the stack.

- After unwinding one step, first fetch the new values of all registers,
including the new value of Lr - then use this value of Lr to set the
new value of Pc (the address to actually return to).

This makes the unwinding actually coherent in reading unwind opcodes and
return addresses from one single function; previously these were out of
sync where the return address ended up being read from the function
one step further up in the call stack.

This fixes unwinding for setjmp for binaries compiled with clang
(in mingw mode).

Signed-off-by: Martin Storsjo <martin@martin.st>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2020-05-18 15:12:41 +02:00
André Hentschel 44274d172b ntdll: Fix SystemRecommendedSharedDataAlignment on ARM.
Wine-Bug: https://bugs.winehq.org/show_bug.cgi?id=43961
Signed-off-by: André Hentschel <nerv@dawncrow.de>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2020-05-18 12:09:08 +02:00
Damjan Jovanovic 0fd3f0266e ntdll: Fix ELF initializer address calculations on FreeBSD.
dlinfo() doesn't conform to a standard, each platform implements in differently,
if at all. On GNU and NetBSD its l_addr field returned is the "relocbase",
the relative offset between addresses wanted by the file and addresses obtained
in memory (==0 when no relocation occurred), which we add to d_un.d_ptr to
obtain the memory address where the initializer is. On FreeBSD (and possibly
Solaris) this won't work, as l_addr is the "mapbase" instead, the absolute
starting memory address where the binary was loaded, resulting in wrong
calculations and crashes on startup as we call into wrong addresses.

Wine-Bug: https://bugs.winehq.org/show_bug.cgi?id=49139
Signed-off-by: Damjan Jovanovic <damjan.jov@gmail.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2020-05-18 12:08:36 +02:00
Alexandre Julliard 45a63e5b3c ntdll: Store main() arguments in the Unix library.
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2020-05-17 16:54:39 +02:00
Alexandre Julliard 50134cce82 ntdll: Do the pre-exec checks in the Unix library.
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2020-05-17 16:54:39 +02:00
Alexandre Julliard 9b8afa0f83 ntdll: Move the Wine version functions to the Unix library.
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2020-05-17 16:54:39 +02:00
Alexandre Julliard 2424742d07 ntdll: Move the debug functions to the Unix library.
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2020-05-17 11:09:52 +02:00
Alexandre Julliard aaa654abd6 ntdll: Store reserved areas in the Unix library.
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2020-05-17 11:07:44 +02:00
Alexandre Julliard 625209433f ntdll: Move the mmap reserved area functions to the Unix library.
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2020-05-17 11:07:39 +02:00
Dmitry Timoshkov a0772da5cf ntdll: Don't try to map the PE file past the size of the backing file.
Wine-Bug: https://bugs.winehq.org/show_bug.cgi?id=42125
Signed-off-by: Dmitry Timoshkov <dmitry@baikal.ru>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2020-05-15 11:42:22 +02:00
Alexandre Julliard 7e6a67d8c9 ntdll: Set up virtual memory layout in the Unix library.
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2020-05-14 23:12:31 +02:00
Alexandre Julliard b7150570d3 ntdll: Allow ntdll.so to be loaded before wine_init() has run.
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2020-05-14 23:12:31 +02:00
Alexandre Julliard b7b1ad0962 ntdll: Initial version of the ntdll.so Unix library.
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2020-05-14 23:12:31 +02:00
Alexandre Julliard 6a12d93b88 ntdll: Handle already relocated .dynamic entries.
Wine-Bug: https://bugs.winehq.org/show_bug.cgi?id=49139
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2020-05-14 20:59:36 +02:00
Alexandre Julliard adb52247e3 ntdll: Fix __sync_bool_compare_and_swap() usage.
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2020-05-14 20:59:36 +02:00
Alexandre Julliard 604e49056b ntdll: Initialize server directory on macOS when sending Mach port.
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2020-05-14 20:59:36 +02:00
Alex Henrie 474d1f0b2d ntdll: Implement RtlIpv6StringToAddress(Ex)[AW].
Signed-off-by: Alex Henrie <alexhenrie24@gmail.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2020-05-14 20:59:36 +02:00
Brendan Shanks b11afa1725 ntdll: Fix length calculation of generated SMBIOS tables.
An extra byte for a null-terminator was added for every string, but not
used when the string was empty. This resulted in extra bytes at the end
of the buffer, causing parse errors in dmidecode.

Signed-off-by: Brendan Shanks <bshanks@codeweavers.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2020-05-14 11:40:25 +02:00
Alexandre Julliard 3214ca84d0 ntdll/tests: Add tests for RtlFormatMessage().
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2020-05-13 20:22:26 +02:00
Alexandre Julliard 497358bbb9 ntdll/tests: Add some printf tests.
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2020-05-13 14:43:27 +02:00
Alexandre Julliard 5bb9f86dbe ntdll: Implement RtlFormatMessage().
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2020-05-13 14:43:27 +02:00
Alexandre Julliard b3a0a39356 ntdll: Merge new features from msvcrt's printf implementation.
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2020-05-13 09:37:14 +02:00
Alexandre Julliard f44e90d284 ntdll: Add a few printf functions.
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2020-05-12 23:07:06 +02:00
Rémi Bernon 16e32e3b77 ntdll: Reduce USD section size to 0x1000.
Signed-off-by: Rémi Bernon <rbernon@codeweavers.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2020-05-12 10:58:07 +02:00
Rémi Bernon a1c46c3806 server: Add USD support with timestamp updates.
The USD page is created when the first process (wineboot.exe) completes
its creation, using its provided user_shared_data for initialization.

The server maps the page write-only and the clients map it read-only,
then the server updates the timestamps every 16 ms.

Wine-Bug: https://bugs.winehq.org/show_bug.cgi?id=29168
Signed-off-by: Rémi Bernon <rbernon@codeweavers.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2020-05-12 10:57:56 +02:00
Rémi Bernon dadf93f409 ntdll/tests: Add tests for USD memory basic info.
Signed-off-by: Rémi Bernon <rbernon@codeweavers.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2020-05-12 10:57:54 +02:00
Rémi Bernon 89c242840d ntdll/tests: Add tests for USD timestamp updates.
Signed-off-by: Rémi Bernon <rbernon@codeweavers.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2020-05-12 10:48:38 +02:00
Alexandre Julliard 8045167117 ntdll/tests: Enable RtlDowncaseUnicodeString() test.
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2020-05-11 21:24:58 +02:00