Commit Graph

4683 Commits

Author SHA1 Message Date
Alexandre Julliard 331947c993 kernel32: Move some initialization code to ntdll.
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2019-12-04 16:03:48 +01:00
Alexandre Julliard d33504b9bb kernel32: Use the Rtl UTF8 conversion functions.
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2019-12-04 16:03:48 +01:00
Alexandre Julliard f46fa9c92d ntdll: Use the Rtl UTF8 conversion functions.
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2019-12-04 16:03:48 +01:00
Alexandre Julliard 27f0426b6f ntdll: Implement RtlUTF8ToUnicodeN.
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2019-12-04 16:03:48 +01:00
Alexandre Julliard 0b39344ef0 ntdll: Reimplement RtlUnicodeToUTF8N.
This avoids relying on wine_utf8_wcstombs().

Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2019-12-04 16:03:48 +01:00
Nikolay Sivov b0951ba860 ntdll: Add support for querying thread suspend count.
Signed-off-by: Nikolay Sivov <nsivov@codeweavers.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2019-12-03 21:27:14 +01:00
Nikolay Sivov 7082ebc608 ntdll: Use better type for thread description info structure.
Signed-off-by: Nikolay Sivov <nsivov@codeweavers.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2019-12-03 21:27:14 +01:00
Alexandre Julliard bba33e5391 ntdll: Get rid of __wine_init_codepages().
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2019-12-03 09:30:43 +01:00
Alexandre Julliard 3ebe447507 ntdll: Reimplement Unicode case mapping functions using the Win32-format tables.
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2019-12-03 09:30:43 +01:00
Alexandre Julliard dd572e9a2d ntdll: Reimplement Unicode to multibyte conversion functions using the Win32-format tables.
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2019-12-03 09:30:43 +01:00
Alexandre Julliard e13c4d859e ntdll: Reimplement multibyte to Unicode conversion functions using the Win32-format tables.
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2019-12-03 09:30:43 +01:00
Alexandre Julliard b7fcb956ef ntdll: Avoid memory allocations in RtlUpcaseUnicodeString functions.
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2019-12-03 09:30:43 +01:00
Alexandre Julliard 0e97fe86fd ntdll: Implement custom codepage conversion functions.
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2019-12-03 09:30:43 +01:00
Anastasios Simeonidis 0b6c3a4460 ntdll/tests: Add relationship tests for NtQuerySystemInformationEx.
Signed-off-by: Anastasios Simeonidis <symeonidis@csd.auth.gr>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2019-12-02 22:02:56 +01:00
Anastasios Simeonidis 440a06f7f5 ntdll: Implement relationship filtering for create_logical_proc_info on linux.
Also calculate all_cpus_mask on first pass.

Signed-off-by: Anastasios Simeonidis <symeonidis@csd.auth.gr>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2019-12-02 22:02:56 +01:00
Anastasios Simeonidis 9885b0acbb ntdll: Move relationship filtering to create_logical_proc_info.
Signed-off-by: Anastasios Simeonidis <symeonidis@csd.auth.gr>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2019-12-02 22:02:56 +01:00
Alexandre Julliard dd73223289 ntdll: Remove trailing \n in fatal_perror() calls.
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2019-11-29 17:50:48 +01:00
Chip Davis 289d456dd6 ntdll: Fix tick count calculation on Mac.
Inspired by a patch by Andrew Eikum.

macOS's mach_absolute_time() stops counting when the computer goes to
sleep/suspend/hibernate/etc. However, Windows's GetTickCount() does not
stop counting. mach_continuous_time() matches Windows's behavior.

BSD's CLOCK_MONOTONIC already counts asleep time.

Unfortunately, there is no clock source on Linux which does exactly what
we want. CLOCK_MONOTONIC_RAW is unaffected by NTP adjustment, but like
mach_absolute_time() doesn't keep ticking when the computer is asleep.
CLOCK_BOOTTIME does keep ticking, but it is affected by NTP adjustments.
CLOCK_MONOTONIC has both problems. What's needed is a
CLOCK_BOOTTIME_RAW, which would not be slewed by adjtimex(2) and would
count time spent asleep.

To avoid issues with skew and performance, this patch falls back to
mach_absolute_time() on macOS if mach_continuous_time() is unavailable.
Note that mach_continuous_time() was introduced in macOS 10.12, meaning
that if the minimum version required is less than that, it will be
linked weakly. Therefore we must check that it is nonnull before
attempting to call it.

Signed-off-by: Chip Davis <cdavis@codeweavers.com>
Signed-off-by: Huw Davies <huw@codeweavers.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2019-11-28 20:45:46 +01:00
Alexandre Julliard f206081241 ntdll: Keep a valid DOS name if the initial current directory is a Unix dir.
Wine-Bug: https://bugs.winehq.org/show_bug.cgi?id=48114
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2019-11-28 20:45:46 +01:00
Alexandre Julliard 1902ab4d85 ntdll: Don't fail to load data file when the registry key is missing.
Wine-Bug: https://bugs.winehq.org/show_bug.cgi?id=48188
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2019-11-28 10:06:25 +01:00
Gijs Vermeulen 9bd292127e ntdll: Fix implicit declaration of mach_port_deallocate.
Signed-off-by: Gijs Vermeulen <gijsvrm@codeweavers.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2019-11-27 22:05:09 +01:00
Chip Davis 0d1029e829 ntdll: Fix macOS build.
Signed-off-by: Chip Davis <cdavis@codeweavers.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2019-11-26 22:49:03 +01:00
Alexandre Julliard ea20035272 ntdll: Generate a Windows format codepage table using the libwine data.
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2019-11-26 20:43:52 +01:00
Alexandre Julliard c0ff49061f ntdll Implement RtlInitNlsTables() and RtlResetRtlTranslations().
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2019-11-26 20:43:52 +01:00
Alexandre Julliard 9ae5717ba6 ntdll: Implement RtlInitCodePageTable().
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2019-11-26 20:43:52 +01:00
Alexandre Julliard f5c4a89cf2 ntdll: Implement NtGetNlsSectionPtr().
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2019-11-26 18:03:16 +01:00
Nikolay Sivov b934f6626e ntdll: Implement thread description as information class.
Signed-off-by: Nikolay Sivov <nsivov@codeweavers.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2019-11-26 16:32:32 +01:00
Chip Davis eea87600d2 ntdll: Implement SystemBatteryState for Mac OS.
Signed-off-by: Chip Davis <cdavis@codeweavers.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2019-11-25 20:47:43 +01:00
Francois Gouget ca577af1bc ntdll: S/4Gb/4GB/ in a comment since it refers to bytes.
Signed-off-by: Francois Gouget <fgouget@free.fr>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2019-11-21 19:01:10 +01:00
Alexandre Julliard c77cb5a5f7 ntdll: Handle version parsing in Unicode.
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2019-11-21 19:01:10 +01:00
Alexandre Julliard fd588a22b7 kernel32: Move string normalization functions to ntdll.
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2019-11-21 10:43:46 +01:00
Alexandre Julliard f1bfd2c0b1 ntdll: Initialize the system and user locales directly in ntdll.
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2019-11-20 16:25:16 +01:00
Alexandre Julliard 599deed91c ntdll: Fix counting of environment strings.
Wine-Bug: https://bugs.winehq.org/show_bug.cgi?id=48141
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2019-11-20 16:25:16 +01:00
Alexandre Julliard 7ac7a902c8 ntdll: Implement RtlLocaleNameToLcid().
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2019-11-19 23:15:04 +01:00
Alexandre Julliard 4538a137e0 ntdll: Move locale functions to a new locale.c file.
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2019-11-19 23:15:04 +01:00
Alexandre Julliard dad14ab833 ntdll: Support SystemPerformanceInformation on non-Linux platforms.
Based on the GlobalMemoryStatusEx implementation.
2019-11-19 23:15:04 +01:00
Alexandre Julliard eee3a4e84a kernel32: Move support for starting Unix processes to ntdll.
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2019-11-12 22:05:58 +01:00
Alexandre Julliard 1deefb84ee kernel32: Use RtlCreateUserProcess() to start new processes.
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2019-11-12 22:05:58 +01:00
Alexandre Julliard 83e520f556 kernel32: Move exec process functionality to ntdll.
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2019-11-11 22:58:00 +01:00
Piotr Caban b4ec402859 ntdll: Work around futimens weak linking problem in set_file_times.
Newer XCode versions are weak linking to futimens function. Because of
that Wine will crash trying to execute the function on Mac OS <= 10.12.

Signed-off-by: Piotr Caban <piotr@codeweavers.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2019-11-07 21:49:53 +01:00
Alexandre Julliard b0199ea2fe ntdll: Load the main binary directly in ntdll when possible.
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2019-11-07 19:24:19 +01:00
Alexandre Julliard 608d086f1b ntdll: Move some initializations out of thread_init().
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2019-11-07 17:05:56 +01:00
Alexandre Julliard b7db0b52ce ntdll: Initialize earlier things that need the executable name.
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2019-11-07 16:54:31 +01:00
Zebediah Figura 3ede217e5c ntdll: Fix a typo.
Signed-off-by: Zebediah Figura <z.figura12@gmail.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2019-11-07 14:10:14 +01:00
Alexandre Julliard 051a8ddd04 ntdll: Support running .exe.so binaries in RtlCreateUserProcess().
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2019-11-07 12:34:28 +01:00
Zebediah Figura 87307de217 ntdll: Set the ProgramFiles(x86) and CommonProgramFiles(x86) environment variables.
Wine-Bug: https://bugs.winehq.org/show_bug.cgi?id=40950
Signed-off-by: Zebediah Figura <z.figura12@gmail.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2019-11-06 09:32:38 +01:00
Alexandre Julliard 3dadd980bf ntdll: Directly allocate the final process parameters structure.
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2019-11-05 13:25:03 +01:00
Alexandre Julliard e5354008f4 kernel32: Move initialization of the WoW64 environment to ntdll.
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2019-11-05 13:25:02 +01:00
Alexandre Julliard 461b5e56f9 kernel32: Move support for running wineboot to ntdll.
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2019-11-05 13:25:02 +01:00
Alexandre Julliard 326df4c180 ntdll: Support running a builtin without corresponding file in RtlCreateUserProcess().
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2019-11-05 11:03:54 +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 0b2e65f53a ntdll: Fix FPU initialization for new threads on x86-64.
Wine-Bug: https://bugs.winehq.org/show_bug.cgi?id=48019
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2019-11-04 09:45:53 +01:00
Alexandre Julliard 1b3fa02190 ntdll: Initialize MxCsr for new threads on x86.
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2019-11-02 14:46:02 +01:00
Alistair Leslie-Hughes 4a1bbff61b ntdll: Fix compile error on macos.
Signed-off-by: Alistair Leslie-Hughes <leslie_alistair@hotmail.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2019-11-01 10:31:10 +01:00
Alex Henrie 63ddf0343b ntdll: Implement NtPowerInformation(SystemBatteryState) on Linux.
Signed-off-by: Alex Henrie <alexhenrie24@gmail.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2019-10-31 19:38:42 +01:00
Andrew Eikum 9e817f8f8b ntdll: Add missing spec file entry for EtwEventWriteString.
Signed-off-by: Andrew Eikum <aeikum@codeweavers.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2019-10-31 17:44:06 +01:00
Andrew Eikum 364d654ba3 advapi32: Add EventRegister and EventUnregister tests.
Signed-off-by: Andrew Eikum <aeikum@codeweavers.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2019-10-31 17:43:58 +01:00
Piotr Caban 92731ccbbe ntdll: Use SIZE_T to store passed buffer size in sprintf.
Signed-off-by: Piotr Caban <piotr@codeweavers.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2019-10-31 00:33:46 +01:00
Sven Baars e8f4251423 ntdll/tests: Fix some test failures on Windows 10.
Signed-off-by: Sven Baars <sven.wine@gmail.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2019-10-28 21:58:32 +01:00
Brendan Shanks aa51aee1a9 ntdll: Enable WoW64 filesystem redirection when loading libraries.
This matches the behavior seen on Windows 7/2008R2 and newer.

Wine-Bug: https://bugs.winehq.org/show_bug.cgi?id=47912
Signed-off-by: Brendan Shanks <bshanks@codeweavers.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2019-10-28 21:11:48 +01:00
Alexandre Julliard 5b1fc81908 ntdll: Hardcode address space limits for ARM platforms.
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2019-10-28 21:07:53 +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 fd3735cf4d kernel32: Move dll load path initialization to ntdll.
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2019-10-22 23:04:26 +02:00
Alexandre Julliard 2607bfa28f kernel32: Move command line initialization to ntdll.
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2019-10-22 23:04:26 +02:00
Alexandre Julliard ee56be3fcd kernel32: Move Unicode argv initialization to ntdll.
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2019-10-22 23:04:26 +02:00
Alexandre Julliard 075741b681 kernel32: Move image path name initialization to ntdll.
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2019-10-22 23:04:26 +02:00
Alexandre Julliard 6b528d526d kernel32: Move additional environment initialization to ntdll.
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2019-10-22 23:04:26 +02:00
Alexandre Julliard 628ca4aafe kernel32: Move registry environment initialization to ntdll.
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2019-10-22 23:04:26 +02:00
Alexandre Julliard a511057f7e kernel32: Move Unix environment initialization to ntdll.
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2019-10-22 23:04:26 +02:00
Alexandre Julliard cac9599207 kernel32: Move process name initialization to ntdll.
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2019-10-22 23:04:26 +02:00
Alexandre Julliard 305b5a44c5 kernel32: Move current directory initialization to ntdll.
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2019-10-22 23:04:26 +02:00
Alexandre Julliard e4595a0ce8 ntdll: Always add path separator when looking for a relative path name.
Wine-Bug: https://bugs.winehq.org/show_bug.cgi?id=47979
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2019-10-22 09:57:23 +02:00
Vijay Kiran Kamuju 1aff1e6a37 ntdll: Fix the SYSTEM_MODULE struct field names.
Based on https://www.geoffchappell.com/studies/windows/km/ntoskrnl/api/rtl/ldrreloc/process_module_information.htm?ts=0,44

Signed-off-by: Vijay Kiran Kamuju <infyquest@gmail.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2019-10-21 19:56:26 +02:00
Alexandre Julliard 6d8c58d7cc kernel32: Retrieve the Unix codepage from ntdll.
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2019-10-19 14:19:32 +02:00
Alexandre Julliard 4f42088762 ntdll: Initialize Unix codepage early during startup.
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2019-10-19 14:16:19 +02:00
Alexandre Julliard 98238aa873 ntdll: Disallow changing DEP flags on 64-bit.
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2019-10-16 16:51:21 +02:00
Evgeny Litvinenko 893e9d1b72 ntdll: Solaris requires sys/regset.h.
Signed-off-by: Evgeny Litvinenko <evgeny.v.litvinenko@gmail.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2019-10-08 10:58:09 +02:00
Piotr Caban fd60406e91 ntdll: Try to handle write watches while we're on the signal stack (x86_64).
Signed-off-by: Piotr Caban <piotr@codeweavers.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2019-10-03 22:58:07 +02:00
Akihiro Sagawa aade0bf7e3 ntdll: Add exception handling around DbgBreakPoint.
Wine-Bug: https://bugs.winehq.org/show_bug.cgi?id=47509
Signed-off-by: Akihiro Sagawa <sagawa.aki@gmail.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2019-10-03 22:58:07 +02:00
Alexandre Julliard a5d45e9ae5 kernel32: Move exe path functions to ntdll.
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2019-10-03 22:58:06 +02:00
Alexandre Julliard 619bd16e7a kernel32: Move dll path functions to ntdll.
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2019-10-03 22:56:14 +02:00
Alexandre Julliard a0a2b25a44 kernel32: Move Get/SetDllDirectory() implementation to ntdll.
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2019-10-01 15:14:08 +02:00
Alexandre Julliard 5f938bb51b ntdll: Implement RtlGetSearchPath().
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2019-10-01 15:14:08 +02:00
Alexandre Julliard 444933ae04 ntdll: Implement RtlSetSearchPathMode().
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2019-10-01 09:43:27 +02:00
Zebediah Figura d1a259d1a6 ntdll: Implement NtQueryInformationFile(FileAttributeTagInformation).
Wine-Bug: https://bugs.winehq.org/show_bug.cgi?id=47813
Signed-off-by: Zebediah Figura <z.figura12@gmail.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2019-09-26 21:02:37 +02:00
Alex Henrie 34e15e5a1d ntdll/tests: Add tests for NtPowerInformation(SystemBatteryState).
Signed-off-by: Alex Henrie <alexhenrie24@gmail.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2019-09-26 21:00:13 +02:00
Sebastian Lackner b45d612549 ntdll: Execute queued APCs before starting a process.
Wine-Bug: https://bugs.winehq.org/show_bug.cgi?id=35561
Signed-off-by: Zebediah Figura <z.figura12@gmail.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2019-09-23 19:44:17 +02:00
Piotr Caban a69762541a ntdll: Ignore ExceptionFlags changes done by exception handlers.
Fixes exceptions rethrowing in 64-bit .Net.

Signed-off-by: Piotr Caban <piotr@codeweavers.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2019-09-23 19:44:17 +02:00
Alex Henrie eb699821d0 ntdll: Ensure that performance information is initialized (scan-build).
Signed-off-by: Alex Henrie <alexhenrie24@gmail.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2019-09-19 22:07:53 +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 7ee66b29cb ntdll: Send first chance debug event while on signal stack on i386.
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2019-09-18 18:16:54 +02:00
Alexandre Julliard d299087d30 ntdll: Don't send the first chance debug event twice.
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2019-09-18 17:19:34 +02:00
Alexandre Julliard af4c7e6e61 ntdll: Fix usage of libunwind on x86-64 on non-macOS platforms.
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2019-09-18 17:07:46 +02:00
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
Ken Thomases bed4291336 ntdll: Fix the Mac build with SDKs older than 10.14.
Also, fix some warnings with the 10.14 SDK.
Thanks to Gijs Vermeulen for reporting the issue.

Signed-off-by: Ken Thomases <ken@codeweavers.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2019-09-16 22:58:41 +02:00
Alex Henrie 6ea282c7e1 ntdll: Avoid dead initialization (scan-build).
Signed-off-by: Alex Henrie <alexhenrie24@gmail.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2019-09-16 10:14:02 +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
Ken Thomases 84760a8fb2 ntdll: On Mac, use the Mach API as preferred approach to get a thread's GS.base.
The previous technique was a gross hack peeking at the internals of the pthreads
implementation.

Signed-off-by: Ken Thomases <ken@codeweavers.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2019-09-13 10:36:06 +02:00
Dmitry Timoshkov 3b2937f7c7 ntdll: Implement RtlUnicodeToUTF8N.
Signed-off-by: Dmitry Timoshkov <dmitry@baikal.ru>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2019-09-12 22:47:45 +02:00
Dmitry Timoshkov 65e1ed3480 ntdll/tests: Fix compilation with PSDK compiler.
Signed-off-by: Dmitry Timoshkov <dmitry@baikal.ru>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2019-09-12 22:47:45 +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 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 6e6711d773 ntdll: Use a stack_layout structure to build exception data on x86-64.
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2019-09-12 17:46:39 +02:00
Alexandre Julliard 24876bf17e ntdll: Use virtual_uninterrupted_read_memory() to read code inside signal handler on x86-64.
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2019-09-12 16:44:54 +02:00
Alexandre Julliard 0617b490b3 ntdll: Add partial implementation for IOCTL_SERIAL_GET_PROPERTIES.
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2019-09-09 21:05:01 +02:00
Daniel Lehman 3462b4d1f2 ntdll/tests: Adjust timing on RtlWaitOnAddress tests.
Signed-off-by: Daniel Lehman <dlehman25@gmail.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2019-09-09 16:25:55 +02:00
Alexandre Julliard 44efb1a026 ntdll: Allocate environment blocks from the process heap.
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2019-09-09 16:25:55 +02:00
Alexandre Julliard a311140f93 kernel32: Move QueryPerformanceCounter/Frequency functions to ntdll.
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2019-09-09 16:25:55 +02:00
Jacek Caban 649be380b1 ntdll: Call send_debug_event from debug handler on x86_64.
Signed-off-by: Jacek Caban <jacek@codeweavers.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2019-09-04 20:03:30 +02:00
Jacek Caban 200490b36c ntdll: Remove no longer needed func argument from setup_raise_exception.
Signed-off-by: Jacek Caban <jacek@codeweavers.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2019-09-04 20:03:24 +02:00
Jacek Caban 00f8790799 ntdll: Call virtual_handle_fault from signal handler on x86_64.
Signed-off-by: Jacek Caban <jacek@codeweavers.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2019-09-04 20:03:19 +02:00
Jacek Caban 2fff34493f ntdll: Handle interrupt exceptions in signal handler on x86_64.
Signed-off-by: Jacek Caban <jacek@codeweavers.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2019-09-04 20:03:16 +02:00
Jacek Caban b76df7fa6d ntdll: Handle single step exception in setup_raise_exception on x86_64.
Signed-off-by: Jacek Caban <jacek@codeweavers.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2019-09-04 20:03:14 +02:00
Jacek Caban be7a8d6b7a ntdll: Factor out setup_raise_exception.
Signed-off-by: Jacek Caban <jacek@codeweavers.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2019-09-04 20:03:12 +02:00
Jacek Caban bd836a6f3e ntdll: Move setup_exception implementation.
Signed-off-by: Jacek Caban <jacek@codeweavers.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2019-09-04 20:03:08 +02:00
Alex Henrie 363b8809f3 ntdll: Implement RtlIpv4StringToAddress(Ex)A.
Wine-Bug: https://bugs.winehq.org/show_bug.cgi?id=46149
Signed-off-by: Alex Henrie <alexhenrie24@gmail.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2019-09-03 20:45:18 +02:00
Alex Henrie e9ee0df5d2 ntdll: Implement RtlIpv4StringToAddress(Ex)W.
Wine-Bug: https://bugs.winehq.org/show_bug.cgi?id=46149
Signed-off-by: Alex Henrie <alexhenrie24@gmail.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2019-09-03 20:43:07 +02:00
André Hentschel 9220772d28 ntdll: Add RtlUnwindEx spec entry for ARM64.
Signed-off-by: André Hentschel <nerv@dawncrow.de>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2019-08-30 21:24:26 +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 d2e4a6fae0 configure: Add support for using an external libunwind.
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2019-08-29 20:08:14 +02:00
Alexandre Julliard 2002c22afa ntdll: Add a helper function for calling RtlVirtualUnwind() on x86-64.
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2019-08-29 13:09:52 +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
Hans Leidekker 4e71e86747 ntdll: Read the chassis type from sysfs.
Signed-off-by: Hans Leidekker <hans@codeweavers.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2019-08-27 20:23:43 +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
Alex Henrie 56f96c17f2 ntdll/tests: Add more tests for RtlIpv4StringToAddress.
Signed-off-by: Alex Henrie <alexhenrie24@gmail.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2019-08-23 19:38:00 +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 b96d15e1b0 ntdll: Add .seh annotations for x86_64.
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2019-08-21 11:56:13 +02:00
Richard Yao 8d55542473 advapi32: Add EventWriteString stub.
"Are You Ready for Valve Index?" needs this to work.

Signed-off-by: Richard Yao <ryao@gentoo.org>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2019-08-19 16:13:26 +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 44a6043388 ntdll: Move some exception definitions to winnt.h.
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2019-08-19 13:17:37 +02:00
Zebediah Figura 08fc532033 ntdll: Handle UWOP_EPILOG directives in x86_64 unwind info.
Signed-off-by: Zebediah Figura <z.figura12@gmail.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2019-08-19 11:29:28 +02:00
Zebediah Figura 7ea3a14792 ntdll: Handle version 2 unwind info on x86_64.
It seems this is identical to version 1, but with an additional UWOP_EPILOG
opcode.

Signed-off-by: Zebediah Figura <z.figura12@gmail.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2019-08-19 11:29:28 +02:00
Naveen Narayanan de5392bfe7 ntdll: Set pthread stack guard size to 0 for NetBSD.
pthread_attr_setstack(3) in NetBSD 8.0 and newer sets the guard size
to 65536 and extends the stack beyond the specified range.

Signed-off-by: Naveen Narayanan <zerous@nocebo.space>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2019-08-13 20:27:06 +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