Commit Graph

5648 Commits

Author SHA1 Message Date
Michael Stefaniuc cdf1b61a47 ntdll: Print the correct debug string and not a random global variable.
Signed-off-by: Michael Stefaniuc <mstefani@winehq.org>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2020-12-04 09:36:14 +01:00
Akihiro Sagawa 22612bcff5 ntdll: Add a timezone mapping rule for North Korea Standard Time.
Otherwise, another UTC+9 timezone matches to the timezone.

Wine-Bug: https://bugs.winehq.org/show_bug.cgi?id=50213
Signed-off-by: Akihiro Sagawa <sagawa.aki@gmail.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2020-12-01 13:43:07 +01:00
Daniel Lehman bd02a82d9c ntdll: Handle 64-bit addresses in +seh traces on x64.
Signed-off-by: Daniel Lehman <dlehman25@gmail.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2020-12-01 13:15:31 +01:00
Damjan Jovanovic 6d829f2baf ntdll: Fix backward compatibility for struct link_map on FreeBSD.
Checking for the _rtld_version_laddr_offset symbol only works when
header and library versions match. Checking for the offset of l_addr
instead lets us use the older header with the new library too.

Signed-off-by: Damjan Jovanovic <damjan.jov@gmail.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2020-11-30 22:18:20 +01:00
Francois Gouget dcdd98f5c1 ntdll/tests: Don't check the load address in the WoW64 case.
It could sometimes be NULL, such as win32k.sys on Win <= 7.

Signed-off-by: Francois Gouget <fgouget@codeweavers.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2020-11-30 21:36:12 +01:00
Rémi Bernon 141c55a72d ntdll: Initialize local variable (valgrind).
Signed-off-by: Rémi Bernon <rbernon@codeweavers.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2020-11-30 19:01:56 +01:00
Alexandre Julliard 4e6c1dff58 ntdll: Avoid closing an invalid handle on process creation failure.
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2020-11-27 15:57:07 +01:00
Paul Gofman 44e135a7bd ntdll/tests: Test noname named pipe uniqueness.
Signed-off-by: Paul Gofman <pgofman@codeweavers.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2020-11-26 23:25:38 +01:00
Paul Gofman 1f3064c5d5 server: Allow client pipe creation with server pipe as root directory.
Signed-off-by: Paul Gofman <pgofman@codeweavers.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2020-11-26 23:25:38 +01:00
Paul Gofman aa5c1e871b server: Return STATUS_OBJECT_PATH_INVALID for noname pipe name query.
Signed-off-by: Paul Gofman <pgofman@codeweavers.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2020-11-26 23:25:38 +01:00
Paul Gofman a2ffa8ef7e server: Allow named pipes creation with device file as root directory.
Signed-off-by: Paul Gofman <pgofman@codeweavers.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2020-11-26 23:25:38 +01:00
Paul Gofman ae106feed2 server: Do not dereference symlinks specified as root directory.
Signed-off-by: Paul Gofman <pgofman@codeweavers.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2020-11-26 23:25:38 +01:00
Alexandre Julliard ce5e1c12c3 ntdll/tests: Fix a trace format on ARM64.
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2020-11-26 23:25:38 +01:00
Alexandre Julliard baec5f1eca ntdll: Store the syscall dispatcher also in the WOW32Reserved TEB field.
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2020-11-26 21:31:53 +01:00
Alexandre Julliard b636f9816f krnl386: Move the 16-bit stack out of the WOW32Reserved field.
Based on a patch by Sebastian Lackner.

Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2020-11-26 21:31:53 +01:00
Rémi Bernon 97825b9c53 ntdll: Return failure from RtlQueryProcessDebugInformation.
Some DRM call it with GetCurrentThreadId(), although they don't seem to
mind about the result.

Signed-off-by: Rémi Bernon <rbernon@codeweavers.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2020-11-26 21:31:53 +01:00
Rémi Bernon e0a1bdf2bc server: Return STATUS_INVALID_CID from NtOpenProcess.
When appropriate, instead of STATUS_INVALID_PARAMETER.

Signed-off-by: Rémi Bernon <rbernon@codeweavers.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2020-11-26 21:31:53 +01:00
Rémi Bernon 3326c578f3 ntdll/tests: Add tests for NtOpenProcess return status.
Signed-off-by: Rémi Bernon <rbernon@codeweavers.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2020-11-26 21:31:53 +01:00
Alexandre Julliard 043489456c ntdll: Make x86_64 syscall thunks position independent.
Based on a patch by Paul Gofman.

Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2020-11-25 21:39:19 +01:00
Erich E. Hoover 773b97bb2b ntdll: Fix converting large 32-bit time_t when time_t is signed.
Signed-off-by: Erich E. Hoover <erich.e.hoover@gmail.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2020-11-24 22:09:30 +01:00
Alexandre Julliard 9dc2892785 include: Use proper dllimports for kernel32 functions.
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2020-11-24 18:41:13 +01:00
Kevin Puetz 029ec25e54 ntdll: Don't access empty IMAGE_FILE_IMPORT_DIRECTORY.
Signed-off-by: Kevin Puetz <PuetzKevinA@JohnDeere.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2020-11-24 16:53:52 +01:00
Zebediah Figura 74ec9773dd ntdll: Use a dynamically allocated buffer in find_forwarded_export() if necessary.
Wine-Bug: https://bugs.winehq.org/show_bug.cgi?id=50105
Signed-off-by: Zebediah Figura <z.figura12@gmail.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2020-11-23 21:05:04 +01:00
Rémi Bernon 255270373e ntdll: Raise debug exceptions when invalid heap is destroyed.
And when PEB->BeingDebugged is set to 1. Lords Of The Fallen anti-tamper
does this and only continues if a DBG_PRINTEXCEPTION_C is received.

Signed-off-by: Rémi Bernon <rbernon@codeweavers.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2020-11-20 19:01:04 +01:00
Rémi Bernon c5129d6fc0 ntdll: Reimplement DbgPrint* using DBG_PRINTEXCEPTION_C.
Signed-off-by: Rémi Bernon <rbernon@codeweavers.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2020-11-20 19:01:04 +01:00
Rémi Bernon 1425363bbd ntdll/tests: Add tests for DbgPrint* functions.
Signed-off-by: Rémi Bernon <rbernon@codeweavers.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2020-11-20 19:01:04 +01:00
Rémi Bernon ad24187de8 ntdll: Stub ThreadEnableAlignmentFaultFixup info class.
Wine-Bug: https://bugs.winehq.org/show_bug.cgi?id=46216
Signed-off-by: Rémi Bernon <rbernon@codeweavers.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2020-11-20 19:01:04 +01:00
Paul Gofman 03cebb22d8 ntdll: Fix SMT CPU flag reporting.
Signed-off-by: Paul Gofman <pgofman@codeweavers.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2020-11-20 19:01:04 +01:00
Paul Gofman 2002aa15f4 ntdll: Avoid overwriting parameters with context in call_user_apc_dispatcher() on x86.
Fixes crash in 32 bit kernel32 file test. The crash is not always reproducible
as the issue depends on stack layout.

Signed-off-by: Paul Gofman <pgofman@codeweavers.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2020-11-17 21:16:43 +01:00
David Torok 74f95d9ff2 ntdll: Add NtDebugActiveProcess stub.
Wine-Bug: https://bugs.winehq.org/show_bug.cgi?id=47198
Signed-off-by: Gijs Vermeulen <gijsvrm@gmail.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2020-11-16 21:06:18 +01:00
Damjan Jovanovic 2f90b17ab2 ntdll: Document a few other filesystem case-sensitivity cases.
Signed-off-by: Damjan Jovanovic <damjan.jov@gmail.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2020-11-10 17:19:44 +01:00
Damjan Jovanovic eba4f333b9 ntdll: Treat smbfs as case-insensitive on FreeBSD.
Signed-off-by: Damjan Jovanovic <damjan.jov@gmail.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2020-11-10 17:19:44 +01:00
Damjan Jovanovic 9ba13fbca6 ntdll: Msdosfs was case-insensitive since FreeBSD 8 or even earlier.
Signed-off-by: Damjan Jovanovic <damjan.jov@gmail.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2020-11-10 17:19:44 +01:00
Damjan Jovanovic d1c8611886 ntdll: FAT filesystems are called "msdosfs" on FreeBSD >= 5.
Signed-off-by: Damjan Jovanovic <damjan.jov@gmail.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2020-11-10 17:19:44 +01:00
Damjan Jovanovic 4e6621f3a6 ntdll: Fix wrong return values in get_dir_case_sensitivity_stat().
It should be returning TRUE (= case sensitive) on failure as case
sensitive is the safe assumption, but some returns are FALSE on
failure and even TRUE when case insensitive. Fix that.

Signed-off-by: Damjan Jovanovic <damjan.jov@gmail.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2020-11-10 17:19:44 +01:00
Damjan Jovanovic bf8da00ee0 ntdll: Improve character device type detection on FreeBSD and macOS.
Signed-off-by: Damjan Jovanovic <damjan.jov@gmail.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2020-11-09 20:15:11 +01:00
Damjan Jovanovic a563f584f5 ntdll: Implement get_thread_times() on FreeBSD.
Signed-off-by: Damjan Jovanovic <damjan.jov@gmail.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2020-11-09 20:15:11 +01:00
Brendan Shanks f40195cd92 dbghelp: Use PEB->CloudFileFlags instead of PEB->Reserved for debug base address.
Wine-Bug: https://bugs.winehq.org/show_bug.cgi?id=50077
Signed-off-by: Brendan Shanks <bshanks@codeweavers.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2020-11-02 22:06:52 +01:00
Zebediah Figura ebd92b980a ntdll: Semi-stub SystemModuleInformationEx.
Wine-Bug: https://bugs.winehq.org/show_bug.cgi?id=45666
Signed-off-by: Zebediah Figura <z.figura12@gmail.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2020-10-27 09:51:32 +01:00
Zebediah Figura bf9235aa56 ntdll/tests: Add more tests for SystemModuleInformation[Ex].
Signed-off-by: Zebediah Figura <z.figura12@gmail.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2020-10-27 09:51:27 +01:00
Zebediah Figura 6257da8b42 ntdll: Don't check "info" for NULL in NtQuerySystemInformation(SystemModuleInformation).
Signed-off-by: Zebediah Figura <z.figura12@gmail.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2020-10-27 09:51:25 +01:00
Myah Caron d453db5ba2 ntdll: Stub NtAllocateVirtualMemoryEx.
Signed-off-by: Myah Caron <qsniyg@protonmail.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2020-10-26 20:34:19 +01:00
Zebediah Figura ab1469597a ntdll: Stub NtQuerySystemInformation(SystemExtendedProcessInformation).
Wine-Bug: https://bugs.winehq.org/show_bug.cgi?id=46870
Signed-off-by: Zebediah Figura <z.figura12@gmail.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2020-10-26 20:27:44 +01:00
Joachim Priesner e533a26dcf ntdll: Fix read buffer overflow in find_file_in_dir().
Signed-off-by: Joachim Priesner <joachim.priesner@web.de>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2020-10-22 22:02:03 +02:00
Paul Gofman 36dcb69651 ntdll: Fix xmm registers copy offset in call_consolidate_callback() on x86_64.
Wine-Bug: https://bugs.winehq.org/show_bug.cgi?id=50010
Signed-off-by: Paul Gofman <pgofman@codeweavers.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2020-10-22 22:02:03 +02:00
Nikolay Sivov d3ce5fff85 ntdll/actctx: Handle empty <dependency> element.
Signed-off-by: Nikolay Sivov <nsivov@codeweavers.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2020-10-20 22:54:01 +02:00
Alexandre Julliard 54c31d5332 ntdll: Make NtGetNlsSectionPtr() into a proper Nt syscall.
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2020-10-15 20:18:01 +02:00
Paul Gofman fa409a91b0 ntdll/tests: Test AVX context with debugger.
Signed-off-by: Paul Gofman <pgofman@codeweavers.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2020-10-13 22:30:05 +02:00
Paul Gofman 4e52f7ca86 ntdll/tests: Test getting and setting AVX registers for the other thread.
Signed-off-by: Paul Gofman <pgofman@codeweavers.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2020-10-13 22:30:05 +02:00
Paul Gofman 419abd49a1 ntdll: Support AVX registers for other thread in Nt{Get|Set}ContextThread().
Signed-off-by: Paul Gofman <pgofman@codeweavers.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2020-10-13 22:30:05 +02:00
Paul Gofman ec1ea1ea1b ntdll: Call FLS callbacks.
Signed-off-by: Paul Gofman <pgofman@codeweavers.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2020-10-13 22:30:05 +02:00
Paul Gofman 7341f4ad1e ntdll: Zero all FLS slots instances in RtlFlsFree().
Signed-off-by: Paul Gofman <pgofman@codeweavers.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2020-10-13 20:44:38 +02:00
Paul Gofman 53f7cb3c08 ntdll: Always align stack in call_user_apc_dispatcher() on x86_64.
Wine-Bug: https://bugs.winehq.org/show_bug.cgi?id=49860
Signed-off-by: Paul Gofman <pgofman@codeweavers.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2020-10-13 11:31:39 +02:00
Paul Gofman 4039c5ad47 ntdll: Don't use PEB lock for FLS data.
Signed-off-by: Paul Gofman <pgofman@codeweavers.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2020-10-08 12:40:30 +02:00
Paul Gofman 87ea7698ab ntdll: Allocate TEB FLS data in LdrInitializeThunk().
Signed-off-by: Paul Gofman <pgofman@codeweavers.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2020-10-08 12:40:30 +02:00
Paul Gofman 905deff5da ntdll: Reimplement FLS data management on top of up to date structures.
Win10 18132 introduced increased FLS data limit and entirely changed
underlying structure.

Signed-off-by: Paul Gofman <pgofman@codeweavers.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2020-10-08 12:40:29 +02:00
Paul Gofman 36981ad033 ntdll: Introduce RtlProcessFlsData() and use it for FLS data destruction.
Signed-off-by: Paul Gofman <pgofman@codeweavers.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2020-10-08 12:40:29 +02:00
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
Alexandre Julliard 72b97eeba0 ntdll: Add a helper function for memory allocations through mmap().
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2020-09-03 10:52:11 +02:00
Alexandre Julliard 74deee7df0 ntdll: Add a helper function for fixed anonymous mmaps.
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2020-09-03 10:51:09 +02:00
Paul Gofman 61f3b3dcdf ntdll/tests: Add tests for capturing context with xstate.
Signed-off-by: Paul Gofman <pgofman@codeweavers.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2020-09-02 16:30:04 +02:00
Paul Gofman 30e5250622 ntdll: Implement saving AVX registers in NtGetContextThread().
Signed-off-by: Paul Gofman <pgofman@codeweavers.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2020-09-02 16:30:04 +02:00
Alexandre Julliard 5b4b877488 ntdll: Move the reserved area functions to avoid forward declarations.
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2020-09-02 16:30:03 +02:00
Alexandre Julliard 7b96e82fd5 ntdll: Make the reserved area functions static.
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2020-09-02 16:30:03 +02:00
Alexandre Julliard 4c45348f78 ntdll: Get rid of the exec_process() Unix library callback.
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2020-09-02 15:24:01 +02:00
Alexandre Julliard f51cd0a1b5 ntdll: Use the process parameters directly in exec_process().
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2020-09-02 15:09:33 +02:00
Alexandre Julliard 52e9baddbc ntdll: Move the NT path conversion for exec process to the Unix library.
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2020-09-02 14:46:14 +02:00
Alexandre Julliard 9e973954fd ntdll: Get rid of the server_init_process_done() Unix library callback.
This time without setting Eip to 0.

Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2020-09-01 18:40:08 +02:00
Alexandre Julliard f7e4fd0cf8 kernel32: Remove the no longer used __wine_start_process() function.
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2020-09-01 16:41:03 +02:00
Alexandre Julliard c2c330532e ntdll: Call the process entry point through RtlUserThreadStart().
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2020-09-01 16:41:03 +02:00
Alexandre Julliard 1a9558cf9b ntdll: Call the thread entry point through BaseThreadInitThunk().
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2020-09-01 16:41:03 +02:00
Paul Gofman 81a08cea79 kernel32: Implement CopyContext().
Signed-off-by: Paul Gofman <pgofman@codeweavers.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2020-09-01 12:34:43 +02:00
Paul Gofman 85a33ff731 kernel32: Implement GetXStateFeaturesMask().
Signed-off-by: Paul Gofman <pgofman@codeweavers.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2020-09-01 12:33:47 +02:00
Paul Gofman 541b06747a kernel32: Implement SetXStateFeaturesMask().
Signed-off-by: Paul Gofman <pgofman@codeweavers.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2020-09-01 12:33:44 +02:00
Louis Lenders 518d06404a ntdll: RtlConvertToAutoInheritSecurityObject is NTSTATUS, not BOOL.
Signed-off-by: Louis Lenders <xerox.xerox2000x@gmail.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2020-08-31 22:09:20 +02:00
Paul Gofman 8aa370e991 ntdll: Clear CONTEXT_XSTATE flag in RtlUnwindEx().
Wine-Bug: https://bugs.winehq.org/show_bug.cgi?id=49749
Signed-off-by: Paul Gofman <pgofman@codeweavers.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2020-08-31 21:41:07 +02:00
Paul Gofman 3803997349 ntdll: Implement RtlLocateLegacyContext().
Signed-off-by: Paul Gofman <pgofman@codeweavers.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2020-08-31 21:41:06 +02:00
Paul Gofman ff88ed8b06 kernel32: Implement LocateXStateFeature().
Signed-off-by: Paul Gofman <pgofman@codeweavers.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2020-08-31 21:41:06 +02:00
Paul Gofman 2d544ff8a0 kernel32: Implement InitializeContext[2]().
Signed-off-by: Paul Gofman <pgofman@codeweavers.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2020-08-31 21:41:06 +02:00
Paul Gofman 2de4f12b33 ntdll: Implement RtlGetExtendedContextLength().
Signed-off-by: Paul Gofman <pgofman@codeweavers.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2020-08-31 21:41:06 +02:00
Alexandre Julliard 2b40969c58 kernel32: Move the initial process breakpoint to LdrInitializeThunk().
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2020-08-31 11:36:24 +02:00
Alexandre Julliard 2b9a0550bc Revert "ntdll: Get rid of the server_init_process_done() Unix library callback."
This partially reverts commit 1581fb619b.
Steam wants Eip to be valid even before LdrInitializeThunk.

Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2020-08-28 21:08:45 +02:00
Alexandre Julliard 3863b243fe ntdll: Clear the thread stack by hand instead of remapping zero pages.
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2020-08-27 12:24:05 +02:00
Alexandre Julliard 75e616d52b ntdll: Clear the syscall frame on return instead of popping the previous one.
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2020-08-27 12:14:35 +02:00
Alexandre Julliard 65c37cee24 ntdll: Use exported APIs instead of virtual_map_section() to load PE modules.
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2020-08-26 14:16:54 +02:00
Alexandre Julliard 1581fb619b ntdll: Get rid of the server_init_process_done() Unix library callback.
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2020-08-26 13:04:09 +02:00
Martin Storsjo a9639dd605 ntdll: Capture vector registers in arm64 RtlCaptureContext.
Since 5b3842451b we set the flag indicating that the context
contained float registers, but we didn't actually populate them yet.

Signed-off-by: Martin Storsjo <martin@martin.st>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2020-08-25 19:31:44 +02:00
Martin Storsjo 99a6ae5b86 ntdll: Fix arm64 jump buffer float restoration.
Fix a typo in copying fields from the jump buffer to the context,
use the right type of long in the struct.

Signed-off-by: Martin Storsjo <martin@martin.st>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2020-08-25 19:31:44 +02:00
Alexandre Julliard a8ddcf7dfe ntdll: Use syscalls for a couple of Wine internal functions.
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2020-08-25 19:31:43 +02:00
Alexandre Julliard af1a328fa0 ntdll: Use syscalls for the Wine version functions.
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2020-08-25 19:31:43 +02:00
Alexandre Julliard 482b64effd ntdll: Use syscalls for the file path conversion functions.
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2020-08-25 13:57:19 +02:00
Alexandre Julliard 4e5811637a ntdll: Use syscalls for the server functions.
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2020-08-25 13:55:40 +02:00
Martin Storsjo a12e308eba ntdll/tests: Add a larger testcase covering most arm64 unwinding opcodes.
These all seem to be implemented correctly as no changes to the
wine implementation is needed.

Signed-off-by: Martin Storsjo <martin@martin.st>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2020-08-25 13:34:31 +02:00
Martin Storsjo bc3284f818 ntdll: Implement the arm64 machine frame and context unwind opcodes.
Signed-off-by: Martin Storsjo <martin@martin.st>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2020-08-25 13:34:31 +02:00
Martin Storsjo 41d1fd3229 ntdll/tests: Support testing float registers in the arm64 virtual unwind test.
Only testing d0-d15, not d16-d31, for keeping the test references
a bit smaller.

Signed-off-by: Martin Storsjo <martin@martin.st>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2020-08-25 13:34:31 +02:00
Martin Storsjo 8c0c70dd0f ntdll/tests: Add defines for the complete set of arm64 unwidning opcodes.
Also correct the previous definition of UWOP_NOP which was a typo
(but it wasn't used in any testcase yet).

Signed-off-by: Martin Storsjo <martin@martin.st>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2020-08-25 13:21:07 +02:00
Martin Storsjo a729af0e9c ntdll: Set handler_data correctly in arm64 RtlVirtualUnwind.
This matches what tests show is done on actual windows, in the
current testcases; in all currently tested cases, handler_data is
reset to NULL when no handler is returned.

Signed-off-by: Martin Storsjo <martin@martin.st>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2020-08-25 13:21:01 +02:00
Zebediah Figura aaea13a128 server: Report named pipe device files as type "File".
Signed-off-by: Zebediah Figura <z.figura12@gmail.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2020-08-24 22:14:44 +02:00
Arkadiusz Hiler 9012096b47 Revert "ntdll/tests: Add test to check if GetTickCount is updated after sleeping.".
This reverts commit 4617f83fcf.

The assumption that GetTickCount() gets updated after Sleep(1) holds only
when there is no other software running on the system. If any program uses
timeBeginPeriod() with values 1-15 then this assumption breaks.

A lot of common user software calls timeBeginPeriod() - this includes browsers,
media players, voice communicators, IDEs and store fronts.

Signed-off-by: Arkadiusz Hiler <ahiler@codeweavers.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2020-08-24 22:14:44 +02:00
Alexandre Julliard 97847eeee8 ntdll: Avoid referencing winecrt0 exception handlers from the Unix library.
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2020-08-24 22:14:44 +02:00
Alexandre Julliard 6844ff8a0b ntdll: Stop resolving imports for the Unix library.
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2020-08-24 22:14:44 +02:00
Alexandre Julliard 0b3db9dfa2 ntdll: Handle page faults happening during a syscall without dispatching the exception.
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2020-08-24 11:46:22 +02:00
Zebediah Figura 8bd95a80f2 ntdll: Read the condition variable and manipulate the lock on the PE side.
Wine-Bug: https://bugs.winehq.org/show_bug.cgi?id=49712
Signed-off-by: Zebediah Figura <z.figura12@gmail.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2020-08-24 11:17:04 +02:00
Paul Gofman 057e7f1940 ntdll: Also save unwind info for rbp in call_consolidate_callback() on x64.
Fixes Bloons TD 6 crash on start.

Signed-off-by: Paul Gofman <pgofman@codeweavers.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2020-08-24 11:16:40 +02:00
Martin Storsjo 32c618b7c5 ntdll: Add initial tests for arm64 RtlVirtualUnwind.
Signed-off-by: Martin Storsjo <martin@martin.st>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2020-08-24 11:16:03 +02:00
Paul Gofman 601175822e ntdll: Restore AVX registers in NtSetContextThread() on i386.
Signed-off-by: Paul Gofman <pgofman@codeweavers.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2020-08-21 16:54:39 +02:00
Paul Gofman 9aa885bf37 ntdll: Support AVX context in fault exceptions on Linux i386.
Signed-off-by: Paul Gofman <pgofman@codeweavers.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2020-08-21 16:54:38 +02:00
Paul Gofman 2c3719c7a9 ntdll: Restore AVX registers in NtSetContextThread() on x86_64.
Signed-off-by: Paul Gofman <pgofman@codeweavers.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2020-08-21 16:54:38 +02:00
Paul Gofman 16ed88a952 ntdll: Support AVX context in fault exceptions on Linux x86_64.
Signed-off-by: Paul Gofman <pgofman@codeweavers.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2020-08-21 16:54:38 +02:00
Paul Gofman 3f562e0b91 ntdll/tests: Add test for xstate in extended context.
Signed-off-by: Paul Gofman <pgofman@codeweavers.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2020-08-21 15:36:49 +02:00
Martin Storsjo 5b3842451b include: Update ARM64 context flag definitions to match current SDKs.
CONTEXT_FLOATING_POINT should be included in CONTEXT_FULL, and
there's a new flag CONTEXT_ARM64_X18 (not available without
the arch specific prefix) that only is part of CONTEXT_ALL.

Signed-off-by: Martin Storsjo <martin@martin.st>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2020-08-21 15:01:56 +02:00
Paul Gofman a4af2b2b70 kernel32: Implement GetEnabledXStateFeatures().
Signed-off-by: Paul Gofman <pgofman@codeweavers.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2020-08-20 21:14:15 +02:00
Paul Gofman 97b5ad7597 wineboot: Initialize XState features in user_shared_data.
Signed-off-by: Paul Gofman <pgofman@codeweavers.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2020-08-20 18:50:02 +02:00
Paul Gofman de1cb029f6 include: Define _XSAVE_FORMAT structure.
The structure is defined for both x86_64 and i386 (along with
M128A) in (newer) Windows SDK.

Signed-off-by: Paul Gofman <pgofman@codeweavers.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2020-08-20 18:49:38 +02:00
Paul Gofman 25d4c50db3 ntdll: Remove redundant ldmxcsr in set_full_cpu_context() on x86_64.
Mxcsr will be overwritten anyway by consequent fxrstor.

Signed-off-by: Paul Gofman <pgofman@codeweavers.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2020-08-20 18:49:26 +02:00
Alexandre Julliard 77fbf3a9fd ntdll: Unwind the syscall frame in NtSetContextThread().
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2020-08-20 18:45:53 +02:00
Alexandre Julliard a686759f1d ntdll: Unwind the syscall frame when calling KiUserApcDispatcher().
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2020-08-20 18:45:53 +02:00
Alexandre Julliard 53e0bf2f9f ntdll: Don't expect LdrInitializeThunk() to return to the Unix side.
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2020-08-20 18:45:53 +02:00
Alexandre Julliard 4a7cd0f492 ntdll: Call NtContinue() from LdrInitializeThunk() instead of returning.
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2020-08-20 18:23:44 +02:00
Paul Gofman f332f2e4e2 ntdll: Don't transfer xmm registers explicitly during context save and restore on x64.
fxsave / fxrstor already do that.

Signed-off-by: Paul Gofman <pgofman@codeweavers.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2020-08-19 10:16:57 +02:00
Paul Gofman 525e7078a8 ntdll: Report newer vector processor features on x86 / x64.
Signed-off-by: Paul Gofman <pgofman@codeweavers.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2020-08-19 10:15:45 +02:00
Martin Storsjo 8f3bd63b52 ntdll: Fix arm64 sigcontext access for darwin.
Signed-off-by: Martin Storsjo <martin@martin.st>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2020-08-18 22:33:39 +02:00
Martin Storsjo 7f8224411c ntdll: Fix the arm64 use of libunwind for macOS.
MacOS uses the LLVM libunwind, which doesn't expose quite as much
internals of the cursor as GNU libunwind, and uses slightly different
names for the arch specific register enums (for get/set registers).

Signed-off-by: Martin Storsjo <martin@martin.st>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2020-08-18 22:33:34 +02:00
Martin Storsjo cffd06ea67 ntdll: Trust libunwind's returned pc value on arm64.
Use this instead of manually copying LR to PC. With GNU libunwind,
both registers are equal after unw_step.

With the LLVM libunwind (which Apple uses), the return address isn't
reflected at all in LR, only in UNW_REG_IP.

Signed-off-by: Martin Storsjo <martin@martin.st>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2020-08-18 22:32:27 +02:00
Serge Gautherie 743ed29af5 winapi_test: Update generated.c files.
Signed-off-by: Serge Gautherie <winehq-git_serge_180711@gautherie.fr>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2020-08-14 22:04:03 +02:00
Martin Storsjo e8f2c2464a ntdll: Only call putenv() if we are going to call exec().
If we aren't going to exec (if pre_exec() returns zero), we will
continue using the envp pointer we got from the caller. However,
the putenv() call does update the environment, and this can in
some cases overwrite the array that the old (stale, potentially
dangling) envp pointer points to.

Signed-off-by: Martin Storsjo <martin@martin.st>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2020-08-14 22:04:02 +02:00
Martin Storsjo 00b4a51fcc ntdll: Remove a stray duplicate instruction.
Signed-off-by: Martin Storsjo <martin@martin.st>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2020-08-14 22:02:04 +02:00
Paul Gofman 71090bdc2f ntdll: Don't mind epilog in RtlVirtualUnwind() in case of zero op count on x64.
Signed-off-by: Paul Gofman <pgofman@codeweavers.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2020-08-14 22:02:04 +02:00
Paul Gofman ae07938ba6 ntdll: Support nested exceptions on x64.
Signed-off-by: Paul Gofman <pgofman@codeweavers.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2020-08-14 22:02:04 +02:00
Paul Gofman c76dc32fef ntdll: Fix unwind from call_consolidate_callback() for PE build on x64.
Wine-Bug: https://bugs.winehq.org/show_bug.cgi?id=49698
Signed-off-by: Paul Gofman <pgofman@codeweavers.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2020-08-13 12:28:32 +02:00
Paul Gofman 76556bc588 ntdll: Support UWOP_PUSH_MACHFRAME opcode in RtlVirtualUnwind() on x64.
Signed-off-by: Paul Gofman <pgofman@codeweavers.com>
Signed-off-by: Rémi Bernon <rbernon@codeweavers.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2020-08-13 12:27:03 +02:00
Paul Gofman d4052e0d70 ntdll/tests: Always remove hook trampoline in test_kiuserexceptiondispatcher().
As it is not removed by the hook itself if the hook is not called in the last
test.

Fixes test failures on Win 2003.

Signed-off-by: Paul Gofman <pgofman@codeweavers.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2020-08-13 12:26:34 +02:00
Rémi Bernon 26c078a2a6 ntdll/tests: Run RtlRaiseException tests on x86_64.
Signed-off-by: Rémi Bernon <rbernon@codeweavers.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2020-08-12 11:04:40 +02:00
Rémi Bernon 94ee270972 ntdll/tests: Add broken FltSave results for w2008 / w8.
Signed-off-by: Rémi Bernon <rbernon@codeweavers.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2020-08-12 11:00:46 +02:00
Rémi Bernon f804d1ac70 ntdll/tests: Fix w2008 debugger test results.
Changing Eip has an effect there, so offset it just a little bit so that
it still falls within code.

Signed-off-by: Rémi Bernon <rbernon@codeweavers.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2020-08-12 11:00:42 +02:00
Brendan Shanks fd80e0300c ntdll: Pad HEAP structure so 'flags' offset matches recent Windows.
Needed for Red Dead Redemption 2 to pass anti-debugger checks, it
accesses 'flags' and 'force_flags' at a fixed offset of the ProcessHeap.

Wine-Bug: https://bugs.winehq.org/show_bug.cgi?id=49666
Signed-off-by: Brendan Shanks <bshanks@codeweavers.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2020-08-11 18:20:20 +02:00
Alexandre Julliard 9b7f14f1b4 ntdll: Unwind the syscall frame when calling KiRaiseUserExceptionDispatcher().
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2020-08-11 17:56:10 +02:00
Alexandre Julliard 1e7e21534e ntdll: Unwind the syscall frame when calling KiUserExceptionDispatcher().
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2020-08-11 17:56:10 +02:00
Alexandre Julliard 13abe9e2bd ntdll/tests: Run exception tests under the debugger on all platforms.
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2020-08-11 17:56:10 +02:00
Serge Gautherie 99c0ab2ea1 winapi_test: Restore horizontal alignment of macro defines.
Signed-off-by: Serge Gautherie <winehq-git_serge_180711@gautherie.fr>
Signed-off-by: Francois Gouget <fgouget@free.fr>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2020-08-10 21:26:15 +02:00
Serge Gautherie c26d7470cc winapi_test: Horizontally align TEST_TYPE_SIGNED() parameter.
Signed-off-by: Serge Gautherie <reactos-git_serge_171003@gautherie.fr>
Signed-off-by: Francois Gouget <fgouget@free.fr>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2020-08-10 21:25:56 +02:00
Alexandre Julliard 7a71f98640 ntdll: Use KiUserApcDispatcher() to call user APCs.
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2020-08-06 19:31:24 +02:00
Alexandre Julliard 2a08e0e290 ntdll: Implement KiUserApcDispatcher().
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2020-08-06 19:31:06 +02:00
Mikołaj Zalewski 9014dae8fb ntdll: Return from Thumb to ARM mode after assembling raise_func_trampoline_thumb.
Without it, Raspbian gcc thinks the next function
(raise_func_trampoline_arm) is in Thumb and will create its own
trampoline to to execute it as Thumb (bad).

Signed-off-by: Mikołaj Zalewski <mikolaj@zalewski.pl>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2020-08-06 11:39:48 +02:00
Daniel Lehman 93fa2e0ab8 ntdll/tests: Handle 32 cores.
Signed-off-by: Daniel Lehman <dlehman25@gmail.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2020-08-06 11:38:48 +02:00
Brendan Shanks f7895ef25a ntdll: Generate "system boot information" SMBIOS table.
Signed-off-by: Brendan Shanks <bshanks@codeweavers.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2020-08-05 22:52:03 +02:00
Brendan Shanks 734a7120b6 ntdll: Add additional fields to generated SMBIOS chassis info table.
Signed-off-by: Brendan Shanks <bshanks@codeweavers.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2020-08-05 22:52:00 +02:00
Brendan Shanks d29c33a35c ntdll: Add additional fields to generated SMBIOS baseboard info table.
Signed-off-by: Brendan Shanks <bshanks@codeweavers.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2020-08-05 22:51:57 +02:00
Alexandre Julliard 1d3e3a1c8d ntdll: Avoid importing RtlEnterCriticalSection/RtlLeaveCriticalSection from the Unix side.
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2020-08-05 15:28:31 +02:00
Brendan Shanks 2b76b9f234 ntdll: End generated SMBIOS tables with the end-of-table structure.
Signed-off-by: Brendan Shanks <bshanks@codeweavers.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2020-08-04 22:08:13 +02:00
Brendan Shanks 0720c6cfd0 ntdll: Use unique handle numbers in generated SMBIOS tables.
Signed-off-by: Brendan Shanks <bshanks@codeweavers.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2020-08-04 22:08:11 +02:00
Jacek Caban b59bf31f61 ntdll: Move InterlockedCompareExchange128 support to winnt.h.
Also properly declare intrinsic on msvc.

Signed-off-by: Jacek Caban <jacek@codeweavers.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2020-08-04 20:22:38 +02:00
Evgeny Litvinenko 69f1b12a30 ntdll: Add check for totalram, mem_unit in struct sysinfo.
Signed-off-by: Evgeny Litvinenko <evgeny.v.litvinenko@gmail.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2020-08-03 15:52:15 +02:00
Alexandre Julliard 2c903e9e9b ntdll: Move the critical section fallback code out of the Unix library.
This partially reverts commit ff19f21913.

Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2020-08-03 15:52:15 +02:00
Alexandre Julliard 647c54e539 ntdll: Fix wcsncpy() implementation now that length is unsigned.
Wine-Bug: https://bugs.winehq.org/show_bug.cgi?id=49206
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2020-08-03 13:00:53 +02:00
Zebediah Figura 31800a1414 server: Use a separate object for each opened mailslot device file.
This is essentially a straight port of 2600ecd4ed.

Signed-off-by: Zebediah Figura <z.figura12@gmail.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2020-08-03 10:20:03 +02:00
Zebediah Figura f4e5556547 ntdll/tests: Add more tests for object names.
Signed-off-by: Zebediah Figura <z.figura12@gmail.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2020-08-01 10:02:16 +02:00
Zebediah Figura b7e51a1653 ntdll: Append ntdll.dll to the builtin_modules list.
Wine-Bug: https://bugs.winehq.org/show_bug.cgi?id=49626
Signed-off-by: Zebediah Figura <z.figura12@gmail.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2020-07-29 21:28:31 +02:00
Zebediah Figura 3f8d60e2ac ntdll: Compare builtins by their device and inode number directly.
Signed-off-by: Zebediah Figura <z.figura12@gmail.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2020-07-29 21:27:49 +02:00
Alexandre Julliard eee92591bc ntdll/tests: Add thread context test for ARM platforms.
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2020-07-28 14:16:53 +02:00
Alexandre Julliard 06c09fca31 ntdll/tests: Add tests for RtlCaptureContext() and NtGetContextThread() on x86_64.
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2020-07-28 14:13:48 +02:00
Alexandre Julliard 8e5c11b964 ntdll/tests: Enable more exception tests on ARM platforms.
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2020-07-28 14:13:48 +02:00
Alexandre Julliard 94ca95a6d4 ntdll/tests: Fix vectored exception handler usage.
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2020-07-28 14:13:48 +02:00
Alexandre Julliard d775b9fd93 ntdll: Reimplement RtlRaiseException() to build a correct context on ARM.
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2020-07-28 13:51:44 +02:00
Alexandre Julliard 57f419993e ntdll: Use a syscall thunk for NtGetContextThread().
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2020-07-28 13:51:44 +02:00
Alexandre Julliard 15b3584603 winebuild: Store the syscall frame in the thread data on ARM64.
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2020-07-28 13:35:30 +02:00
Alexandre Julliard 28e443d9e2 winebuild: Store the syscall frame in the thread data on ARM.
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2020-07-28 13:31:59 +02:00
Alexandre Julliard 9a7c56d9e7 winebuild: Store the syscall frame in the thread data on x86_64.
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2020-07-28 13:10:28 +02:00
Alexandre Julliard 8e3b5183cc winebuild: Store the syscall frame in the thread data on i386.
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2020-07-28 13:00:50 +02:00
Matteo Bruni b37371bf20 ntdll: Don't read current CPU frequency on Linux.
On the Linux boxes I tested, reading scaling_cur_freq usually takes
about 12 ms per core.

Wine-Bug: https://bugs.winehq.org/show_bug.cgi?id=47128
Signed-off-by: Matteo Bruni <mbruni@codeweavers.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2020-07-24 18:26:18 +02:00
Alexandre Julliard d18b566995 ntdll: Store the filesystem redirection flag in the 64-bit TEB.
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2020-07-24 18:26:18 +02:00
Alexandre Julliard a865a4f61d ntdll: Allocate 64-bit TEB and PEB in WoW64 mode.
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2020-07-24 18:26:18 +02:00
Alexandre Julliard e3b059b5ba ntdll: Store the thread startup info in the ntdll_thread_data structure.
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2020-07-24 18:26:18 +02:00
Alexandre Julliard 0bf52b09f2 ntdll: Update the TEB and PEB structures for newer Windows versions.
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2020-07-23 23:21:08 +02:00
Alexandre Julliard 9018a37735 ntdll: Call virtual_set_large_address_space() directly from the Unix side.
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2020-07-22 14:38:40 +02:00
Alexandre Julliard 131e53a1fc ntdll: Avoid private Unix functions in RtlCreateUserStack().
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2020-07-22 14:38:40 +02:00
Alexandre Julliard 1372d8fc2c ntdll: Implement NtSetInformationProcess(ProcessThreadStackAllocation).
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2020-07-22 14:22:16 +02:00
Alexandre Julliard d41b1c28c3 ntdll: Avoid private Unix functions in RtlExitUserThread().
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2020-07-22 14:22:16 +02:00
Alexandre Julliard 78c772e9d8 ntdll: Use a syscall thunk for NtQueryPerformanceCounter().
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2020-07-21 18:30:08 +02:00
Alexandre Julliard 4752e252ea ntdll: Use a syscall thunk for NtClose().
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2020-07-21 18:30:08 +02:00
Alexandre Julliard 5eefbc6db9 ntdll: Implement KiRaiseUserExceptionDispatcher().
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2020-07-21 18:30:08 +02:00
Alexandre Julliard 688799b1f7 ntdll: Map errno to a status also in directory functions.
Wine-Bug: https://bugs.winehq.org/show_bug.cgi?id=49523
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2020-07-21 18:30:08 +02:00
Alexandre Julliard f8d42a31c6 ntdll: Set a better exit status when the main image fails to load.
Wine-Bug: https://bugs.winehq.org/show_bug.cgi?id=49593
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2020-07-21 15:23:28 +02:00
Alexandre Julliard 9def213de3 ntdll: Move the locale system calls to the Unix library.
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2020-07-20 20:14:41 +02:00
Alexandre Julliard 0e45f7b4cd ntdll: Move various stub functions to the Unix library.
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2020-07-20 20:14:41 +02:00
Alexandre Julliard f298db7254 ntdll: Move the security system calls to the Unix library.
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2020-07-20 20:14:18 +02:00
Alexandre Julliard dd77ff754b ntdll: Move the token functions to the Unix library.
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2020-07-20 17:58:12 +02:00
Alexandre Julliard a47f4daf8f ntdll: Move the LPC port syscall stubs to the Unix library.
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2020-07-20 17:58:12 +02:00
Zebediah Figura ff9ce43c01 ntdll/tests: Make info.c less verbose by default.
Signed-off-by: Zebediah Figura <z.figura12@gmail.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2020-07-20 11:47:36 +02:00
Zebediah Figura 17785690c0 ntdll/tests: Remove some unnecessary checks in test_query_logicalprocex().
Signed-off-by: Zebediah Figura <z.figura12@gmail.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2020-07-20 11:47:34 +02:00
Zebediah Figura 9dd1eaab44 ntdll/tests: Return early if ThreadHideFromDebugger isn't supported.
We're not testing anything interesting in this case.

Signed-off-by: Zebediah Figura <z.figura12@gmail.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2020-07-20 11:47:29 +02:00
Zebediah Figura 519f86d5aa ntdll/tests: Remove todo_wine for tests that now succeed.
Signed-off-by: Zebediah Figura <z.figura12@gmail.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2020-07-20 11:47:26 +02:00
Zebediah Figura 8ac77cfbf9 ntdll/tests: Remove some workarounds for no longer supported versions of Windows.
Signed-off-by: Zebediah Figura <z.figura12@gmail.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2020-07-20 11:47:22 +02:00
Gerald Pfeifer f3ca16379d ntdll: Include <signal.h> for sigset_t.
Signed-off-by: Gerald Pfeifer <gerald@pfeifer.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2020-07-20 11:46:20 +02:00
Alexandre Julliard b1af31b47a ntdll: Fix a memory leak.
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2020-07-20 11:45:58 +02:00
Jacek Caban 180f7cf412 ntdll: Always use GNU _CI* functions implementation on clang.
Signed-off-by: Jacek Caban <jacek@codeweavers.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2020-07-17 23:16:52 +02:00
Alexandre Julliard e0a2f85b78 ntdll: Move some power stub functions to the Unix library.
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2020-07-17 23:16:51 +02:00
Alexandre Julliard e7c60141d6 ntdll: Move some timer stub functions to the Unix library.
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2020-07-17 23:16:51 +02:00
Alexandre Julliard 398cfe4807 ntdll: Move some system stub functions to the Unix library.
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2020-07-17 23:16:51 +02:00
Alexandre Julliard 0eae5d3abc ntdll: Move the atom system calls to the Unix library.
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2020-07-17 23:16:51 +02:00
Alexandre Julliard 76e48978a9 ntdll: Move more object manager functions to the Unix library.
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2020-07-17 23:16:51 +02:00
Alexandre Julliard 28bf959c5c ntdll: Move the remaining file functions to the Unix library.
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2020-07-17 23:16:51 +02:00
Alexandre Julliard 7053b7c615 ntdll: Move the registry system calls to the Unix library.
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2020-07-17 23:16:51 +02:00
Zebediah Figura de1eaee480 ntdll/tests: Fix a copy-paste error.
Signed-off-by: Zebediah Figura <z.figura12@gmail.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2020-07-17 11:00:57 +02:00
Zebediah Figura 2a53947028 ntdll/tests: Use wide character string literals in om.c.
Signed-off-by: Zebediah Figura <z.figura12@gmail.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2020-07-17 11:00:55 +02:00
Zebediah Figura 5e240cdf50 ntdll/tests: Convert DIR_TEST_CREATE_OPEN into a function.
Signed-off-by: Zebediah Figura <z.figura12@gmail.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2020-07-17 11:00:53 +02:00
Zebediah Figura d7e12831b0 ntdll/tests: Remove some workarounds for no longer supported versions of Windows.
Signed-off-by: Zebediah Figura <z.figura12@gmail.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2020-07-17 11:00:52 +02:00
Paul Gofman 2aa58e43a0 ntdll/tests: Test KiUserExceptionDispatcher with RtlUnwind on i386.
Signed-off-by: Paul Gofman <pgofman@codeweavers.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2020-07-17 00:04:13 +02:00
Paul Gofman 12dba1b2ae ntdll: Fix PE unwind info for %rsi, %rdi in KiUserExceptionDispatcher.
Fixes StarCraft crash on start.

Signed-off-by: Paul Gofman <pgofman@codeweavers.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2020-07-17 00:04:13 +02:00
Zebediah Figura 77e74fb1db ntdll: Implement NtMakeTemporaryObject().
Signed-off-by: Zebediah Figura <z.figura12@gmail.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2020-07-17 00:04:13 +02:00
Alexandre Julliard 0534beb331 ntdll: Use syscall thunks for object manager functions.
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2020-07-17 00:04:13 +02:00
Alexandre Julliard 40d403c926 ntdll: Use syscall thunks for system functions.
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2020-07-17 00:04:13 +02:00
Alexandre Julliard e3e477e6a1 ntdll: Use syscall thunks for virtual memory functions.
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2020-07-17 00:04:13 +02:00
Alexandre Julliard 3b4c2ffb7b ntdll: Use syscall thunks for file functions.
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2020-07-17 00:04:13 +02:00
Alexandre Julliard 635e914bde ntdll: Use syscall thunks for process functions.
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2020-07-17 00:04:13 +02:00
Alexandre Julliard 00e7d50f8b ntdll: Use syscall thunks for thread functions.
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2020-07-17 00:04:13 +02:00
Alexandre Julliard c5f66fc784 ntdll: Use syscall thunks for I/O completion functions.
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2020-07-17 00:04:13 +02:00
Alexandre Julliard eb45a75a2e ntdll: Use syscall thunks for keyed event functions.
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2020-07-17 00:04:13 +02:00
Alexandre Julliard 9f8acda167 ntdll: Use syscall thunks for wait functions.
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2020-07-17 00:04:13 +02:00
Alexandre Julliard aa08e15415 ntdll: Use syscall thunks for timer functions.
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2020-07-17 00:04:13 +02:00
Alexandre Julliard 66e6d87ab8 ntdll: Use syscall thunks for job functions.
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2020-07-17 00:04:13 +02:00
Alexandre Julliard 3f51cb6304 ntdll: Use syscall thunks for mutex functions.
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2020-07-17 00:04:13 +02:00
Alexandre Julliard f4c403d1f2 ntdll: Use syscall thunks for event functions.
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2020-07-17 00:04:13 +02:00
Alexandre Julliard bc2164e074 ntdll: Use syscall thunks for semaphore functions.
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2020-07-17 00:04:13 +02:00
Alexandre Julliard 14994715e9 ntdll: Avoid buffer underflow in find_dos_device().
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2020-07-17 00:04:13 +02:00
Jacek Caban 42cb7d2ad1 ntdll: Silence server_ioctl_file debug traces.
Signed-off-by: Jacek Caban <jacek@codeweavers.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2020-07-15 22:57:57 +02:00
Alexandre Julliard 704d0662be ntdll: Fix RtlSizeHeap() error value for 64-bit.
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2020-07-15 16:33:02 +02:00
Alexandre Julliard 82dc024a35 ntdll: Use separate handlers for SIGSEGV/SIGILL/SIGBUS on ARM64.
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2020-07-15 16:33:02 +02:00
Alexandre Julliard 7b79532448 ntdll: Send debug event before pushing exception data on x86_64.
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2020-07-15 15:22:36 +02:00
Alexandre Julliard 3889c374a1 ntdll: Send debug event before pushing exception data on x86.
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2020-07-15 15:22:36 +02:00
Alexandre Julliard ae15a4ca5a ntdll: Send debug event before pushing exception data on ARM64.
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2020-07-15 15:22:30 +02:00
Alexandre Julliard adb4e74b47 ntdll: Send debug event before pushing exception data on ARM.
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2020-07-15 10:36:23 +02:00
Alexandre Julliard 1e4865ffcf ntdll: Handle signals on the signal stack also on ARM.
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2020-07-15 10:34:18 +02:00
Alexandre Julliard 485c8566f1 ntdll: Build the exception record on the signal stack first.
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2020-07-15 10:31:19 +02:00
Alexandre Julliard ca45eda758 ntdll: Add a helper function to push the exception data to the thread stack.
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2020-07-15 10:30:45 +02:00
Alexandre Julliard 9a9fb47e24 ntdll: Also handle stack guard page faults in virtual_handle_fault().
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2020-07-15 10:29:50 +02:00
Alexandre Julliard f1e4c54104 ntdll: Add a helper function to grow the stack on guard page faults.
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2020-07-15 10:28:57 +02:00
Alexandre Julliard 432d504118 ntdll: Pass the stack address to the virtual_handle_fault() function.
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2020-07-15 10:28:26 +02:00
Alexandre Julliard 5a68254c13 ntdll: Handle faults inside the signal handler also on ARM.
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2020-07-15 10:23:52 +02:00
Alexandre Julliard f30ba2cf25 ntdll: Add support for FPU registers in signal context on ARM.
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2020-07-15 10:23:34 +02:00
Alexandre Julliard 99851ca4c2 ntdll: Initialize the thread signal stack in the common code.
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2020-07-15 10:23:00 +02:00
Myah Caron 4617f83fcf ntdll/tests: Add test to check if GetTickCount is updated after sleeping.
Wine-Bug: https://bugs.winehq.org/show_bug.cgi?id=49564
Signed-off-by: Myah Caron <qsniyg@protonmail.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2020-07-14 18:27:59 +02:00
Piotr Caban a6fb7be678 ntdll: Ignore L length specifier in printf.
Signed-off-by: Piotr Caban <piotr@codeweavers.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2020-07-14 18:27:59 +02:00
Alexandre Julliard 20bc32cddc ntdll: Use malloc() to allocate temporary system information.
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2020-07-14 10:35:27 +02:00
Alexandre Julliard 242dc8989a ntdll: Use malloc() to allocate the system processor information.
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2020-07-14 10:35:14 +02:00
Alexandre Julliard fe7b8d70d5 ntdll: Use malloc() to allocate the logical processor information.
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2020-07-14 10:34:31 +02:00
Alexandre Julliard 42a2ad202e ntdll: Use malloc() to allocate temporary process data.
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2020-07-14 10:33:57 +02:00
Alexandre Julliard 83f9e784e4 ntdll: Use malloc() to allocate temporary filename buffers.
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2020-07-14 10:33:47 +02:00
Alexandre Julliard e9abe3f739 ntdll: Use malloc() to allocate the directory cache.
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2020-07-14 10:33:18 +02:00
Alexandre Julliard b2d38f1531 ntdll: Use malloc() to allocate the buffer in get_device_mount_point().
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2020-07-14 10:33:05 +02:00
Alexandre Julliard 9ec5be2cea ntdll: Use malloc() to allocate the buffer in server_get_unix_name().
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2020-07-14 10:32:55 +02:00