Commit Graph

6360 Commits

Author SHA1 Message Date
Jinoh Kang 3e2f443003 server: Fix querying debug port with restricted DACL.
Today, Wine uses NtQueryInformationProcess/ProcessDebugPort to detect
whether the current process is being debugged.  If it is, the process
issues a breakpoint to yield control to the debugger.

Some debuggers (e.g. latest CDB) appear to create debug handles with
restricted DACL, which causes querying debug port to fail with
STATUS_ACCESS_DENIED.  This results in the debuggee erroneously
skipping the initial breakpoint.

Fix this by not requiring DEBUG_ALL_ACCESS when opening the debug port
object.  Instead, use MAXIMUM_ALLOWED for the access mask.

Wine-Bug: https://bugs.winehq.org/show_bug.cgi?id=52184
Signed-off-by: Jinoh Kang <jinoh.kang.kr@gmail.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2021-12-09 17:14:59 +01:00
Jinoh Kang ee4d38c3b1 ntdll/tests: Add tests for DebugPort* info query with security checks.
Signed-off-by: Jinoh Kang <jinoh.kang.kr@gmail.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2021-12-09 17:14:59 +01:00
Jacek Caban 1facdbbdcb ntdll: Temporarily allow KeUserModeCallback calls from client stack.
Signed-off-by: Jacek Caban <jacek@codeweavers.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2021-12-09 10:47:41 +01:00
Paul Gofman d2e35b04fb ntdll: Remove a special case for entry point not in executable section in map_image_into_view().
Signed-off-by: Paul Gofman <pgofman@codeweavers.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2021-12-08 22:14:44 +01:00
Alexandre Julliard 0b3d65f822 ntdll: Don't restore the %fs register for exceptions happening inside system calls.
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2021-12-08 15:02:58 +01:00
Alexandre Julliard cdafebed15 include: Document remaining fields in the SYSTEM_PROCESS_INFORMATION structure.
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2021-12-08 13:19:48 +01:00
Damjan Jovanovic 36af18a4f1 ntdll: Implement fill_battery_state() on FreeBSD.
Signed-off-by: Damjan Jovanovic <damjan.jov@gmail.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2021-12-07 21:54:57 +01:00
Alexandre Julliard 456e76185d ntdll: Don't return a default Unix handle for modules that don't have a Unix library.
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2021-12-07 16:19:48 +01:00
Bernhard Übelacker c488f29122 server: Return ReadDataAvailable value for FilePipeLocalInformation.
Makes Cygwin mintty.exe or script.exe show output, if the
stack issues got worked around.

Wine-Bug: https://bugs.winehq.org/show_bug.cgi?id=47808
Signed-off-by: Bernhard Übelacker <bernhardu@mailbox.org>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2021-12-06 22:55:07 +01:00
Jactry Zeng 03649e5fb4 ntdll: Fix compilation for ARM64 Apple platform.
Signed-off-by: Jinoh Kang <jinoh.kang.kr@gmail.com>
Signed-off-by: Jactry Zeng <jzeng@codeweavers.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2021-12-06 16:36:51 +01:00
Paul Gofman c338a6ff99 ntdll: Support THREAD_CREATE_FLAGS_HIDE_FROM_DEBUGGER thread creation flag.
Signed-off-by: Paul Gofman <pgofman@codeweavers.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2021-12-06 12:20:34 +01:00
Paul Gofman 3f20261eaf ntdll: Set rcx on exit from syscall dispatcher on x64.
Signed-off-by: Paul Gofman <pgofman@codeweavers.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2021-12-03 19:31:55 +01:00
Brendan Shanks e7afddd2c1 ntdll: Rename THREAD_DESCRIPTION_INFORMATION to THREAD_NAME_INFORMATION.
Signed-off-by: Brendan Shanks <bshanks@codeweavers.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2021-12-02 20:20:40 +01:00
Brendan Shanks 65dd060a67 ntdll: Rename ThreadDescription to ThreadNameInformation.
Signed-off-by: Brendan Shanks <bshanks@codeweavers.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2021-12-02 20:20:40 +01:00
Vijay Kiran Kamuju 78fbea1672 ntdll: Add stub RtlLookupElementGenericTable function.
Wine-Bug: https://bugs.winehq.org/show_bug.cgi?id=49426
Signed-off-by: Vijay Kiran Kamuju <infyquest@gmail.com>
Signed-off-by: Alex Henrie <alexhenrie24@gmail.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2021-12-02 20:20:39 +01:00
Vijay Kiran Kamuju 87c7648f15 ntdll: Add stub RtlGetElementGenericTable function.
Wine-Bug: https://bugs.winehq.org/show_bug.cgi?id=49426
Signed-off-by: Vijay Kiran Kamuju <infyquest@gmail.com>
Signed-off-by: Alex Henrie <alexhenrie24@gmail.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2021-12-02 20:20:39 +01:00
Vijay Kiran Kamuju df678a4ec6 ntdll: Implement RtlNumberGenericTableElements.
Signed-off-by: Vijay Kiran Kamuju <infyquest@gmail.com>
Signed-off-by: Alex Henrie <alexhenrie24@gmail.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2021-12-02 20:20:39 +01:00
Vijay Kiran Kamuju 82a4f2e0ec ntdll: Implement RtlInitializeGenericTable.
Signed-off-by: Vijay Kiran Kamuju <infyquest@gmail.com>
Signed-off-by: Alex Henrie <alexhenrie24@gmail.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2021-12-02 20:20:39 +01:00
Alexandre Julliard a041075cd2 makefiles: Support per-platform values for EXTRADLLFLAGS.
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2021-12-02 20:20:39 +01:00
Alexandre Julliard d10410eac2 ntdll: Add fallback implementations for the Unix library functions.
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2021-12-02 20:20:39 +01:00
Alexandre Julliard 1b447409cb ntdll: Set the TEB offset for Wow64 mode also in 64-bit.
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2021-12-02 20:20:39 +01:00
Alexandre Julliard 679a2f531b ntdll: Don't try to convert binaries to 64-bit in Wow64 mode.
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2021-12-02 20:20:39 +01:00
Paul Gofman 4094767634 ntdll/tests: Fix iret to invalid selector test on x64.
Signed-off-by: Paul Gofman <pgofman@codeweavers.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2021-12-01 18:13:53 +01:00
Alexandre Julliard 47f59be21f ntdll: Don't clear x86-64 registers when receiving a 32-bit context.
They can still be valid if running in Wow64 mode.

Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2021-12-01 18:13:53 +01:00
Alexandre Julliard e5e857c290 ntdll: Add support for dispatching exception from 32-bit code in Wow64 mode.
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2021-12-01 18:13:53 +01:00
Zebediah Figura 518a175cba ntdll: Remove the no longer used "mutex" argument to server_select().
Signed-off-by: Zebediah Figura <zfigura@codeweavers.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2021-12-01 09:59:37 +01:00
Huw Davies 3ac41371f9 ntdll: Move the FILE ptr into the blocks that use it.
This is to prevent compiler warnings on non-linux platforms.

Signed-off-by: Huw Davies <huw@codeweavers.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2021-11-30 22:07:21 +01:00
Alexandre Julliard 035f8ad8ad ntdll: Export some Unicode string functions for use in other Unix libraries.
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2021-11-30 22:07:20 +01:00
Jinoh Kang a4ffa1e7e2 ntdll: Implement NtCompareObjects.
Signed-off-by: Jinoh Kang <jinoh.kang.kr@gmail.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2021-11-29 23:25:46 +01:00
Jinoh Kang 47c365606f ntdll/tests: Add tests for NtCompareObjects.
Signed-off-by: Jinoh Kang <jinoh.kang.kr@gmail.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2021-11-29 23:25:46 +01:00
Jinoh Kang 3b37584316 server: Implement the \??\GLOBALROOT symbolic link.
\??\GLOBALROOT is a well-known NT symbolic link that allows applications
to access the NT object manager's root namespace via Win32 APIs.

Signed-off-by: Jinoh Kang <jinoh.kang.kr@gmail.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2021-11-25 21:43:49 +01:00
Jinoh Kang 9f0df41a6c ntdll: Save/restore FPU context in arm64 signal handlers.
Wine-Bug: https://bugs.winehq.org/show_bug.cgi?id=51996
Signed-off-by: Jinoh Kang <jinoh.kang.kr@gmail.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2021-11-25 21:35:20 +01:00
Paul Gofman 6747ecdefd ntdll: Fix context arch flag cleanup for AMD64 in context_from_server().
Signed-off-by: Paul Gofman <pgofman@codeweavers.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2021-11-25 21:24:59 +01:00
Zebediah Figura bfbccf1a03 ntdll: Prevent loading Wine system dependencies in place of identically named application DLLs.
That is, load Wine system dependencies only when they are imported from Wine
builtins or other system dependencies, and do not match a Wine system dependency
by its base name when looking for already-loaded modules.

The reasoning is that it is possible for an application to ship, and expect to
use, a newer version of a MinGW-compiled library, or one with custom patches, or
possibly an unrelated library with the same name. We don't want to offer Wine's
system dependencies in place of the application's, or vice versa.

Signed-off-by: Zebediah Figura <zfigura@codeweavers.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2021-11-24 15:30:10 +01:00
Zebediah Figura 7e926a9aa9 ntdll: Allow loading system DLLs from a path specified at configure time.
Many distributions provide MinGW-compiled system DLLs which are currently
bundled with Wine. Unfortunately, while MinGW pkg-config can be used to detect
the linking path, there is no standardized runtime path, and many distributions
in fact use different paths.

Signed-off-by: Zebediah Figura <zfigura@codeweavers.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2021-11-24 15:30:09 +01:00
Alexandre Julliard f10a85de60 ntdll: Merge the calls to find_builtin_without_file().
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2021-11-24 14:58:12 +01:00
Alexandre Julliard afb6f1696e ntdll: Add a helper function to append .dll to a module name.
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2021-11-24 14:58:12 +01:00
Alexandre Julliard eb6a9151d6 ntdll: Add a helper function to build an import dll name.
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2021-11-24 14:58:12 +01:00
Alexandre Julliard 95931fcd36 ntdll: Fix a buffer overflow in environment variable expansion.
Wine-Bug: https://bugs.winehq.org/show_bug.cgi?id=52093
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2021-11-23 21:02:11 +01:00
Nick Fox ef26f7bd5c ntdll: Fix LdrGetDllPath with LOAD_WITH_ALTERED_SEARCH_PATH without a path.
Wine-Bug: https://bugs.winehq.org/show_bug.cgi?id=26350
Wine-Bug: https://bugs.winehq.org/show_bug.cgi?id=51821
Signed-off-by: Nick Fox <nick@foxsec.net>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2021-11-22 22:20:50 +01:00
Jan Sikorski 064dd051d8 ntdll: Save status from attaching dependencies in process_attach().
Signed-off-by: Jan Sikorski <jsikorski@codeweavers.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2021-11-22 22:20:50 +01:00
Matteo Bruni e86b4015ff ntdll: Call usleep() instead of NtYieldExecution() in NtDelayExecution().
This implements the general fix from
b1a79c6b9c (in particular, making sure
that Sleep(0) will not immediately resume execution of the thread if
there are no other runnable threads) while preserving the existing
behavior of NtYieldExecution() / SwitchToThread(). Thanks Rémi for the
idea.

Signed-off-by: Matteo Bruni <mbruni@codeweavers.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2021-11-22 22:20:50 +01:00
Matteo Bruni 3203f05668 Revert "ntdll: Implement NtYieldExecution() as usleep().".
Rémi found a regression caused by that patch. His analysis suggests
that it's probably correct for NtYieldExecution() to map to
sched_yield().

Let's revert the patch and fix the issue in a slightly different way.

This reverts commit b1a79c6b9c.

Signed-off-by: Matteo Bruni <mbruni@codeweavers.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2021-11-22 22:20:50 +01:00
Alexandre Julliard 0907d8cc6d ntdll/tests: Fix a test failure on older Windows versions.
Wine-Bug: https://bugs.winehq.org/show_bug.cgi?id=52069
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2021-11-22 22:20:50 +01:00
Alexandre Julliard 62d335053f makefiles: Don't append .fake extension to fake dlls.
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2021-11-20 13:07:47 +01:00
Alexandre Julliard 470ac022f2 ntdll: Fix a compiler warning on macOS.
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2021-11-19 15:36:30 +01:00
Alexandre Julliard 7d2a7b94aa ntdll: Fix handling of zero size with MEM_DECOMMIT.
Wine-Bug: https://bugs.winehq.org/show_bug.cgi?id=52023
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2021-11-19 11:17:24 +01:00
Henri Verbeet deff68bb72 ntdll: Only add a module dependency if import_dll() returned a modref.
In particular, if import_dll() skips an unused import, it will return TRUE,
but set *pwm to NULL. This fixes a regression in 3DMark03 version 3.4.0,
introduced by commit 0dd37b02f9.

Signed-off-by: Henri Verbeet <hverbeet@codeweavers.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2021-11-18 20:15:19 +01:00
Zebediah Figura f3e9498740 ntdll: Reimplement SRW locks on top of Win32 futexes.
Signed-off-by: Zebediah Figura <zfigura@codeweavers.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2021-11-18 11:09:25 +01:00
Zebediah Figura 87164ee333 ntdll: Get rid of the direct futex path for condition variables.
Signed-off-by: Zebediah Figura <zfigura@codeweavers.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2021-11-18 11:09:16 +01:00
Zebediah Figura c577ce2671 ntdll: Reimplement the critical section fast path on top of Win32 futexes.
Signed-off-by: Zebediah Figura <zfigura@codeweavers.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2021-11-18 11:09:07 +01:00
Zebediah Figura 6bdb914a25 ntdll: Reimplement Win32 futexes on top of thread-ID alerts.
Signed-off-by: Zebediah Figura <zfigura@codeweavers.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2021-11-18 11:08:49 +01:00
Zebediah Figura 842ecb45f4 ntdll: Implement thread-ID alerts using Mach semaphores on Mac.
Signed-off-by: Zebediah Figura <zfigura@codeweavers.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2021-11-18 11:08:16 +01:00
Zebediah Figura 9d79f72142 ntdll: Implement thread-ID alerts using futexes if possible.
Signed-off-by: Zebediah Figura <zfigura@codeweavers.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2021-11-17 17:59:26 +01:00
Zebediah Figura 6d19056a8c ntdll/tests: Add basic tests for thread-id alert functions.
Signed-off-by: Zebediah Figura <zfigura@codeweavers.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2021-11-17 17:59:26 +01:00
Zebediah Figura 0e931fa5fd ntdll: Implement NtAlertThreadByThreadId and NtWaitForAlertByThreadId.
These will be used to implement RtlWaitOnAddress() and other in-process
synchronization primitives, as they are on Windows.

These patches went through quite a few revisions in order to ensure that they
had sufficient performance and correctness compared to the current
implementation. I am particularly grateful to Etienne Juvigny and Dmitry
Skvortsov for performing extensive testing.

Signed-off-by: Zebediah Figura <zfigura@codeweavers.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2021-11-17 16:36:01 +01:00
Martin Storsjö 1fb4ce83f4 ntdll: Subtract an offset from pc if dispatch->ControlPcIsUnwound on arm.
This fixes unwinding from functions ending with a call to a function
that won't return. This matches what is done on the PE side in the
call to lookup_function_info.

Signed-off-by: Martin Storsjö <martin@martin.st>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2021-11-15 19:59:54 +01:00
Martin Storsjö d00c897749 ntdll: Error out if unwinding isn't progressing on arm.
In PE builds of wine, there's no unwind info (as LLVM hasn't
implemented generating SEH unwind info for ARM yet).

On startup of wine, an exception of the type RPC_S_SERVER_UNAVAILABLE
is raised. In a PE build of Wine, the unwind would get stuck in
an infinite loop.

This still loops for a short while; after returning the error
STATUS_INVALID_DISPOSITION, KiUserExceptionDispatcher ends up
calling RtlRaiseStatus with this status, which then tries to
unwind again, getting stuck similarly. However by recursively
trying to unwind multiple times, the process crashes fairly soon
after running out of stack.

Signed-off-by: Martin Storsjö <martin@martin.st>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2021-11-15 19:59:44 +01:00
Dmitry Timoshkov 33bc90e687 ntdll: Return correct status when manifest could not be loaded from file.
Signed-off-by: Dmitry Timoshkov <dmitry@baikal.ru>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2021-11-12 22:42:51 +01:00
Martin Storsjö 3ef9a04f91 ntdll: Implement __C_specific_handler and __jump_unwind for arm.
Signed-off-by: Martin Storsjö <martin@martin.st>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2021-11-09 22:02:56 +01:00
Martin Storsjö bdb3608811 ntdll: Implement stack unwinding on arm.
This is a very close copy of the arm64 implementation.

Signed-off-by: Martin Storsjö <martin@martin.st>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2021-11-09 22:02:56 +01:00
Martin Storsjö 77e9095435 ntdll: Remove stack gap in syscalls on arm.
Store the original stack pointer (on entry to the syscall dispatcher)
in syscall_frame; the stack pointer itself is incremented by
"pop {r0-r3}" right before calling the syscall itself.

This fixes unwinding from functions set up by syscalls, like
KiUserExceptionDispatcher.

Signed-off-by: Martin Storsjö <martin@martin.st>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2021-11-09 22:02:56 +01:00
Martin Storsjö b2934dd98f ntdll: Include d0-d15 in RtlCaptureContext.
We ideally should back up all of d0-d31, but when building in ELF
form, only d0-d15 are normally available (with common distributions'
default compilers), unless object files are built with flags to enable
support for d16-d31 (with e.g. -mfpu=neon).

Signed-off-by: Martin Storsjö <martin@martin.st>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2021-11-09 22:02:56 +01:00
Martin Storsjö 611911ca05 ntdll: Save context->Lr in the arm version of RtlRaiseException.
RtlCaptureContext doesn't set context->Lr, which is needed for
being able to unwind from the context.

This matches what is done in the arm64 version.

Signed-off-by: Martin Storsjö <martin@martin.st>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2021-11-09 22:02:56 +01:00
Martin Storsjö 324150c0ae ntdll: Fix arm call_user_exception_dispatcher with kernel stack for syscalls.
This does the same as 23b44e8df6,
but for arm:

Don't call KiUserExceptionDispatcher directly on the stack pointer
stored in the CONTEXT, but use the one stored in syscall_frame
(which includes the stack allocation in e.g. RtlRaiseException).

Signed-off-by: Martin Storsjö <martin@martin.st>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2021-11-09 22:02:56 +01:00
Martin Storsjö 0dc34ad87a ntdll/tests: Add tests for RtlVirtualUnwind for arm.
Signed-off-by: Martin Storsjö <martin@martin.st>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2021-11-09 22:02:55 +01:00
Martin Storsjö dd1c560752 ntdll: Implement RtlVirtualUnwind for arm.
Signed-off-by: Martin Storsjö <martin@martin.st>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2021-11-09 22:02:55 +01:00
Martin Storsjö 7b7a2af5ee ntdll: Don't blindly increment Sp by 8 in leaf functions on arm64.
This doesn't fix (or break) any case known to me, but the code seems
wrong.

Leaf functions on arm (either 32 or 64) don't generally have any
default/implicit stack allocation.

Signed-off-by: Martin Storsjö <martin@martin.st>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2021-11-09 22:02:55 +01:00
Martin Storsjö 4463ccb267 ntdll: Print an error if unable to unwind due to missing libunwind on arm64.
Signed-off-by: Martin Storsjö <martin@martin.st>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2021-11-09 22:02:55 +01:00
Martin Storsjö e9939c9301 ntdll/tests: Remove an accidental, unused macro in arm64 exception tests.
Signed-off-by: Martin Storsjö <martin@martin.st>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2021-11-09 22:02:55 +01:00
Alexandre Julliard 8dc6987ba5 ntdll: Create a remote thread in DbgUiIssueRemoteBreakin().
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2021-11-09 22:02:54 +01:00
Paul Gofman 1722615b06 ntdll: Don't constraint TEB address to 2GB for native x64 process.
Signed-off-by: Paul Gofman <pgofman@codeweavers.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2021-11-04 22:36:28 +01:00
Damjan Jovanovic fbb633750f ntdll: Populate MEMORY_WORKING_SET_EX_INFORMATION on FreeBSD.
Signed-off-by: Damjan Jovanovic <damjan.jov@gmail.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2021-11-03 21:06:48 +01:00
Damjan Jovanovic c67c50f282 ntdll: Implement vm counters on FreeBSD.
Signed-off-by: Damjan Jovanovic <damjan.jov@gmail.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2021-11-03 21:06:48 +01:00
Damjan Jovanovic 26d8701ae2 ntdll: Implement get_device_mount_point() on FreeBSD.
Signed-off-by: Damjan Jovanovic <damjan.jov@gmail.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2021-11-03 21:06:48 +01:00
Damjan Jovanovic d5406d028b ntdll: Implement setting SYSTEM_PERFORMANCE_INFORMATION.IdleTime on FreeBSD.
Signed-off-by: Damjan Jovanovic <damjan.jov@gmail.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2021-11-03 21:06:48 +01:00
Damjan Jovanovic 478a7dbc90 ntdll: Implement setting SYSTEM_PROCESSOR_PERFORMANCE_INFORMATION.IdleTime on FreeBSD.
Signed-off-by: Damjan Jovanovic <damjan.jov@gmail.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2021-11-03 21:06:48 +01:00
Paul Gofman aa234f3a58 ntdll: Don't add dependencies for system dlls.
Signed-off-by: Paul Gofman <pgofman@codeweavers.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2021-11-03 21:06:48 +01:00
Paul Gofman 250c113169 ntdll: Factor out is_import_dll_system() function.
Signed-off-by: Paul Gofman <pgofman@codeweavers.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2021-11-03 21:06:48 +01:00
Paul Gofman 0dd37b02f9 ntdll: Store module dependencies in DDAG structure.
Signed-off-by: Paul Gofman <pgofman@codeweavers.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2021-11-03 21:06:48 +01:00
Paul Gofman 06f925c599 ntdll: Pass DDAG node to process_attach().
Signed-off-by: Paul Gofman <pgofman@codeweavers.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2021-11-03 21:06:48 +01:00
Paul Gofman 41c7652bbe ntdll: Allocate DDAG node for module.
Signed-off-by: Paul Gofman <pgofman@codeweavers.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2021-11-03 21:06:48 +01:00
Huw Davies 6fdae1979b configure: Stop checking for poll.h and sys/poll.h - always use poll.h.
Signed-off-by: Huw Davies <huw@codeweavers.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2021-10-31 17:56:54 +01:00
Paul Gofman 98a5466380 ntdll: Implement SystemExtendedProcessInformation system info class.
Signed-off-by: Paul Gofman <pgofman@codeweavers.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2021-10-27 22:40:50 +02:00
Paul Gofman bb6aa6c773 ntdll: Factor out get_system_process_info() function.
Signed-off-by: Paul Gofman <pgofman@codeweavers.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2021-10-27 22:40:50 +02:00
Paul Gofman b5f3ddd185 ntdll: Return sufficient info size at once from NtQuerySystemInformation(SystemProcessInformation).
Signed-off-by: Paul Gofman <pgofman@codeweavers.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2021-10-27 22:40:50 +02:00
Zebediah Figura 17f6252849 ntdll/tests: Add some tests for Rtl* resources.
Signed-off-by: Zebediah Figura <zfigura@codeweavers.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2021-10-27 22:40:50 +02:00
Zebediah Figura 127ad286ce ntdll/tests: Move some tests to a new sync.c file.
Signed-off-by: Zebediah Figura <zfigura@codeweavers.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2021-10-27 22:40:50 +02:00
Zebediah Figura f4672a6f0f ntdll: Merge critsection.c into sync.c.
Signed-off-by: Zebediah Figura <zfigura@codeweavers.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2021-10-27 11:37:39 +02:00
Paul Gofman e73bb07ff5 ntdll: Fix alignment mask size in RtlInitializeExtendedContext2().
Signed-off-by: Paul Gofman <pgofman@codeweavers.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2021-10-26 22:52:00 +02:00
Alexandre Julliard 1b9ada6cab ntdll: Remove math functions from the unixlib interface.
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2021-10-26 10:39:34 +02:00
Alexandre Julliard 2e4c090c5e ntdll: Copy sqrt() implementation from msvcrt.
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2021-10-26 10:39:34 +02:00
Alexandre Julliard 140cd3553c ntdll: Copy pow() implementation from msvcrt.
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2021-10-26 10:39:34 +02:00
Alexandre Julliard 0c0915e985 ntdll: Copy log() implementation from msvcrt.
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2021-10-26 10:39:34 +02:00
Alexandre Julliard 90bd048786 ntdll: Copy tan() implementation from msvcrt.
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2021-10-26 10:39:34 +02:00
Alexandre Julliard e4737d285b ntdll: Copy sin() and cos() implementation from msvcrt.
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2021-10-26 10:39:34 +02:00
Alexandre Julliard 9eb3adbc85 ntdll: Copy fabs() implementation from msvcrt.
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2021-10-26 10:39:34 +02:00
Alexandre Julliard f0d3a7d33b ntdll: Copy floor() implementation from msvcrt.
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2021-10-26 10:39:34 +02:00
Alexandre Julliard fca34420f6 ntdll: Copy ceil() implementation from msvcrt.
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2021-10-26 10:39:34 +02:00
Alexandre Julliard bb9e068bab ntdll: Copy atan() implementation from msvcrt.
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2021-10-26 10:39:34 +02:00
Alexandre Julliard c7454eef0b ntdll: Move math functions to a separate file.
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2021-10-26 10:39:34 +02:00
Rémi Bernon a602bdd326 ntdll: Use the unrolled memset from msvcrt.
Although less frequently used, heap allocations are zeroed out with
ntdll memset and they don't benefit from the msvcrt memset optimisation.

Signed-off-by: Rémi Bernon <rbernon@codeweavers.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2021-10-25 21:16:50 +02:00
Damjan Jovanovic 70f486c28f ntdll: Use sysctl instead of /proc/curproc/file on FreeBSD.
Signed-off-by: Damjan Jovanovic <damjan.jov@gmail.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2021-10-25 18:50:59 +02:00
Alexandre Julliard 747b97539b ntdll: Use the standard va_list instead of __ms_va_list.
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2021-10-22 11:12:17 +02:00
Paul Gofman 1ab32c6b3b ntdll: Store module check sum in WINE_MODREF.
Signed-off-by: Paul Gofman <pgofman@codeweavers.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2021-10-20 20:19:32 +02:00
Paul Gofman c310c8050d ntdll: Fix size comparison in NtQuerySystemInformation(SystemCodeIntegrityInformation).
Signed-off-by: Paul Gofman <pgofman@codeweavers.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2021-10-20 20:11:23 +02:00
Alexandre Julliard 832724282b ntdll: Avoid including wine/port.h.
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2021-10-20 16:16:07 +02:00
Jacek Caban 8f31eb1edb ntdll: Export RtlNtStatusToDosError from Unix lib.
Signed-off-by: Jacek Caban <jacek@codeweavers.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2021-10-12 18:29:22 +02:00
Jacek Caban 116cf7dfcb ntdll: Move error mapping to a header file.
Signed-off-by: Jacek Caban <jacek@codeweavers.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2021-10-12 18:29:22 +02:00
Alexandre Julliard edba76c826 include: Don't define math functions or constants in wine/port.h.
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2021-10-11 11:25:35 +02:00
Alexandre Julliard ea2c743668 configure: Define _GNU_SOURCE in config.h.
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2021-10-11 11:22:53 +02:00
Huw Davies 5689ec7bba ntdll: Return a failure if the unix call funcs don't exist.
Signed-off-by: Huw Davies <huw@codeweavers.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2021-10-08 16:55:20 +02:00
Matteo Bruni b1a79c6b9c ntdll: Implement NtYieldExecution() as usleep().
Signed-off-by: Matteo Bruni <mbruni@codeweavers.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2021-10-07 18:03:11 +02:00
Jacek Caban e0a934d0ef ntdll: Handle Unix lib exception outside Unix stack.
Signed-off-by: Jacek Caban <jacek@codeweavers.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2021-10-07 18:03:11 +02:00
Jacek Caban 2ec2e136bf ntdll: Allow Unix libraries to use exception macros.
Signed-off-by: Jacek Caban <jacek@codeweavers.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2021-10-07 18:03:11 +02:00
Jacek Caban 1be12eaa94 ntdll: Provide some Unicode helpers for Unix libs.
Signed-off-by: Jacek Caban <jacek@codeweavers.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2021-10-07 13:52:42 +02:00
Jacek Caban 65ce784ffa ntdll: Introduce ntdll_get_build_dir and ntdll_get_data_dir.
To expose build and data dirs for Unix libs.

Signed-off-by: Jacek Caban <jacek@codeweavers.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2021-10-07 13:52:42 +02:00
Alexandre Julliard 97479d3d32 ntdll: Move some exception definitions to winternl.h.
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2021-10-07 13:52:42 +02:00
Alexandre Julliard 9df976766f libport: Remove the obsolete O_LARGEFILE define.
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2021-10-06 20:29:34 +02:00
Nikolay Sivov ed38d12833 ntdll: Double dll name buffer size for relay traces.
Signed-off-by: Nikolay Sivov <nsivov@codeweavers.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2021-10-05 21:46:17 +02:00
Alex Henrie f45bc4f238 ws2_32: Hook up IP_RECVTOS.
Signed-off-by: Alex Henrie <alexhenrie24@gmail.com>
Signed-off-by: Zebediah Figura <zfigura@codeweavers.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2021-09-29 21:38:12 +02:00
Alex Henrie 0853573caf ws2_32: Hook up IP_RECVTTL.
Signed-off-by: Alex Henrie <alexhenrie24@gmail.com>
Signed-off-by: Zebediah Figura <zfigura@codeweavers.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2021-09-29 21:38:12 +02:00
Paul Gofman 39a3549093 ntdll: Implement LdrGetDllFullName() function.
Based on a patch by Alex Henrie.

Signed-off-by: Paul Gofman <pgofman@codeweavers.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2021-09-29 08:52:46 +02:00
Paul Gofman bcdb28a563 ntdll: Optimize get_vprot_range_size() for big ranges.
Signed-off-by: Paul Gofman <pgofman@codeweavers.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2021-09-28 21:59:15 +02:00
Paul Gofman 1f28e92e7c ntdll: Scan pages only once in get_basic_memory_info().
Signed-off-by: Paul Gofman <pgofman@codeweavers.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2021-09-28 21:55:01 +02:00
Paul Gofman b7fafabc77 ntdll: Factor out get_vprot_range_size() function.
Signed-off-by: Paul Gofman <pgofman@codeweavers.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2021-09-28 21:51:22 +02:00
Zebediah Figura f5fef036fd ntdll: Also print %ss in dispatch_exception().
Signed-off-by: Zebediah Figura <zfigura@codeweavers.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2021-09-28 21:48:59 +02:00
Alex Henrie 9561ba33cd ws2_32: Remove outer preprocessor checks from control message functions.
The checks were ugly and unnecessary. Furthermore, these functions are
used for both IPv4 and IPv6 options, and it's conceivable that a system
could be stripped down to only provide IPv6 support and not IPv4
support.

Signed-off-by: Alex Henrie <alexhenrie24@gmail.com>
Signed-off-by: Zebediah Figura <zfigura@codeweavers.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2021-09-27 20:39:15 +02:00
Paul Gofman cf0a828b02 ntdll: Implement LdrGetDllHandleEx() function.
Signed-off-by: Paul Gofman <pgofman@codeweavers.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2021-09-27 17:40:15 +02:00
Alexandre Julliard c1b3d6eb10 ntdll: Add a __wine_unix_spawnvp syscall.
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2021-09-27 17:40:14 +02:00
Alexandre Julliard a851703ed7 ntdll: Return a cleaner Unix path for z: drive in wine_nt_to_unix_file_name().
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2021-09-27 17:40:14 +02:00
Alexandre Julliard 15d5cb2256 ntdll: Copy __wine_setjmpex/longjmp implementation to avoid importing winecrt0.
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2021-09-23 10:39:24 +02:00
Guillaume Charifi 5990f19bdc ntdll: Implement exclusive flag for IOCTL_AFD_POLL.
Signed-off-by: Guillaume Charifi <guillaume.charifi@sfr.fr>
Signed-off-by: Zebediah Figura <zfigura@codeweavers.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2021-09-23 10:28:16 +02:00
Guillaume Charifi a215324c6b ws2_32: Add tests for IOCTL_AFD_POLL exclusive flag.
Signed-off-by: Guillaume Charifi <guillaume.charifi@sfr.fr>
Signed-off-by: Zebediah Figura <zfigura@codeweavers.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2021-09-23 10:27:25 +02:00
Zebediah Figura 4f4fee53a6 ntdll: Return STATUS_DEVICE_NOT_READY instead of STATUS_PENDING from try_transmit().
async_transmit_proc() expects the former.

Fixes: 1eb56b20ba
Signed-off-by: Zebediah Figura <zfigura@codeweavers.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2021-09-23 10:27:15 +02:00
Zebediah Figura 455b707ea2 ntdll: Return STATUS_PENDING when restarting asyncs.
Fixes: 1eb56b20ba
Signed-off-by: Zebediah Figura <zfigura@codeweavers.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2021-09-23 10:27:03 +02:00
Gerald Pfeifer cac8c971a7 ntdll: Fix init_builtin_dll for FreeBSD again.
Commit e9cfc97d46

    Revert "ntdll: Add a Wine-specific class in NtQueryVirtualMemory
    to retrieve the init functions of a module."

    This reverts commits e5339ecbc6 and
    18408b18f3.

broke the build on FreeBSD.

Adjust the return value for FreeBSD as well.

Signed-off-by: Gerald Pfeifer <gerald@pfeifer.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2021-09-23 10:26:29 +02:00
Alexandre Julliard 5e0479c497 makefiles: Don't use winegcc to build native Unix libraries.
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2021-09-22 11:50:26 +02:00
Alexandre Julliard ab5664a5e6 makefiles: Explicitly name the Unix library in the makefile instead of using --subsystem unixlib.
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2021-09-21 17:49:48 +02:00
Brendan Shanks d49822c8a1 ntdll: Generate SMBIOS tables on Apple Silicon Macs.
Wine-Bug: https://bugs.winehq.org/show_bug.cgi?id=51557
Signed-off-by: Brendan Shanks <bshanks@codeweavers.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2021-09-20 22:45:49 +02:00
Brendan Shanks fb675cefbd ntdll: Factor out get_smbios_from_iokit().
Signed-off-by: Brendan Shanks <bshanks@codeweavers.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2021-09-20 22:45:49 +02:00
Brendan Shanks 2868881c63 ntdll: Factor out SMBIOS table creation.
Signed-off-by: Brendan Shanks <bshanks@codeweavers.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2021-09-20 22:45:49 +02:00
Alexandre Julliard 088a787a2c makefiles: Make -mno-cygwin the default.
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2021-09-20 22:45:48 +02:00
Charles Davis dd882794d2 ntdll: Use posix_fallocate() instead of fallocate().
Signed-off-by: Chip Davis <cdavis@codeweavers.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2021-09-15 19:34:21 +02:00
Gabriel Ivăncescu 2fe70331d9 ntdll: Implement JobObjectBasicProcessIdList for NtQueryInformationJobObject.
Signed-off-by: Gabriel Ivăncescu <gabrielopcode@gmail.com>
Signed-off-by: Huw Davies <huw@codeweavers.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2021-09-14 21:24:14 +02:00
Zebediah Figura 1eb56b20ba ntdll: Explicitly return whether an async is complete in async_callback_t.
Signed-off-by: Zebediah Figura <zfigura@codeweavers.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2021-09-14 18:31:20 +02:00
Zebediah Figura 5af74129bd ntdll: Do not fill the IOSB if a device IRP failed synchronously.
Signed-off-by: Zebediah Figura <zfigura@codeweavers.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2021-09-14 18:30:17 +02:00
Zebediah Figura 1ee382c706 server: Pass the async result size as part of apc_call_t.
Only really an optimization (plus it makes the code a little conceptually simpler).

Signed-off-by: Zebediah Figura <zfigura@codeweavers.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2021-09-14 18:30:09 +02:00
Alexandre Julliard 1649785bec Revert "ntdll: Stub power request APIs."
This reverts commit ca2b701249.

Wine-Bug: https://bugs.winehq.org/show_bug.cgi?id=51741
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2021-09-10 23:21:21 +02:00
Alexandre Julliard e9cfc97d46 Revert "ntdll: Add a Wine-specific class in NtQueryVirtualMemory to retrieve the init functions of a module."
This reverts commits e5339ecbc6 and
18408b18f3.

Wine-Bug: https://bugs.winehq.org/show_bug.cgi?id=51596
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2021-09-10 20:22:11 +02:00
Alex Henrie d5a8a5e199 ntdll/tests: Remove unused variable sbi from test_query_process.
The code that used it was removed in commit
8ac77cfbf9.

Signed-off-by: Alex Henrie <alexhenrie24@gmail.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2021-09-06 14:54:23 +02:00
Zebediah Figura dd9eacff4e server: Fill the TimeZoneBias member of KSHARED_USER_DATA.
Signed-off-by: Zebediah Figura <zfigura@codeweavers.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2021-09-06 14:53:27 +02:00
Alexandre Julliard 5a7505e839 ntdll: Don't use winebuild for the Unix part.
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2021-08-30 22:49:58 +02:00
Alexandre Julliard ea6308e364 ntdll: Declare the syscall functions array explicitly.
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2021-08-30 22:49:58 +02:00
Alexandre Julliard 7ae1c396ac ntdll: Store the syscall argument table on the PE side.
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2021-08-30 22:49:58 +02:00
Alexandre Julliard d017c704f0 ntdll: Add a helper function to set a syscall table.
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2021-08-30 22:49:58 +02:00
Alexandre Julliard 411a8858ac ntdll/tests: Fix a size check for older Windows versions.
Wine-Bug: https://bugs.winehq.org/show_bug.cgi?id=51693
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2021-08-30 22:49:58 +02:00
Akihiro Sagawa 8a3e0d686e ntdll: Fix use-after-free.
Fixes a regression introduced by 76f949577a.
nt_name or redir is used in open_unix_file() because attr.ObjectName
points to either of them.

Wine-Bug: https://bugs.winehq.org/show_bug.cgi?id=51702
Signed-off-by: Akihiro Sagawa <sagawa.aki@gmail.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2021-08-30 22:49:58 +02:00
Zebediah Figura a5b1d51594 ntdll/tests: Also test the IOSB status in test_volume_info().
Signed-off-by: Zebediah Figura <zfigura@codeweavers.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2021-08-27 20:25:05 +02:00
Francois Gouget 167c7a524f ntdll: Fix the spelling of a comment.
Signed-off-by: Francois Gouget <fgouget@free.fr>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2021-08-27 20:25:05 +02:00
Huw Davies dd37c3c4a0 ntdll: Remove unnecessary casts on macOS registers.
Signed-off-by: Huw Davies <huw@codeweavers.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2021-08-27 18:06:29 +02:00
Huw Davies 3fa8503de5 ntdll: Remove old macOS register names.
Signed-off-by: Huw Davies <huw@codeweavers.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2021-08-27 18:06:29 +02:00
Alexandre Julliard ff04d8a4c2 ntdll: Move the syscall dispatcher implementation to the platform-specific files.
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2021-08-26 11:25:38 +02:00
Alexandre Julliard 847db3c1d3 ntdll: Store the syscall table in the syscall frame on all platforms.
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2021-08-26 10:47:38 +02:00
Alexandre Julliard 77f5e2963f ntdll: Store the syscall flags in the syscall frame on all platforms.
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2021-08-26 10:47:38 +02:00
Alistair Leslie-Hughes 16a7976de9 ntdll: Add NtTraceControl/ZwTraceControl stubs.
Signed-off-by: Alistair Leslie-Hughes <leslie_alistair@hotmail.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2021-08-25 10:49:13 +02:00
Alexandre Julliard 88c5184b4d ntdll: Consistently fixup the machine type for IL-only binaries.
Wine-Bug: https://bugs.winehq.org/show_bug.cgi?id=51668
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2021-08-24 17:40:40 +02:00
Alexandre Julliard ee99bd4bc1 ntdll: Always send a Wow context to the server for Wow64 processes.
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2021-08-20 11:34:49 +02:00
Alexandre Julliard 6da06c1541 ntdll: Fix floating point exception codes in Wow64 mode.
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2021-08-20 11:33:46 +02:00
Alexandre Julliard 2736fabc58 ntdll: Don't handle breakpoint interrupts in Wow64 mode.
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2021-08-20 11:33:32 +02:00
Alexandre Julliard 8a8889340f ntdll: Fix exception information for SSE floating point faults.
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2021-08-20 11:32:17 +02:00
Alexandre Julliard b7323b4b3e ntdll/tests: Don't mark Wow64 floating point behavior as broken.
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2021-08-19 15:07:25 +02:00
Gerald Pfeifer 6468e445bd ntdll: Always return a value in get_builtin_init_funcs.
This only showed up in the #ifdef __FreeBSD__ case, so did not appear
on other platforms during testing.

Signed-off-by: Gerald Pfeifer <gerald@pfeifer.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2021-08-19 11:16:08 +02:00
Alex Henrie cf43c365ce ws2_32: Re-add support for getting IP_HDRINCL on raw sockets.
This reverts most of commit e001319304.

My previous diagnosis was incorrect: Windows does support both getting
and setting IP_HDRINCL, but only on raw sockets. Very old versions of
Windows also accept it on UDP sockets.

Signed-off-by: Alex Henrie <alexhenrie24@gmail.com>
Signed-off-by: Zebediah Figura <zfigura@codeweavers.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2021-08-18 20:08:01 +02:00
Alex Henrie 169553916e ntdll: Check for unsupported socket protocol+option combinations.
Windows supports none of these options on TCP. Linux supports all of
them on TCP. Mac OS supports some of them on TCP, but sets EOPNOTSUPP
instead of EINVAL for the ones that it doesn't support. So, Wine needs
to do its own check for whether the option may be used with the socket.

Signed-off-by: Alex Henrie <alexhenrie24@gmail.com>
Signed-off-by: Zebediah Figura <zfigura@codeweavers.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2021-08-18 20:07:59 +02:00
Alexandre Julliard 0883dafe6a ntdll/tests: Don't mark Wow64 behavior as broken.
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2021-08-18 20:03:31 +02:00
Alex Henrie e001319304 ws2_32: Drop support for getting the IP_HDRINCL socket option.
Windows only supports setting this option, not getting it.

Signed-off-by: Alex Henrie <alexhenrie24@gmail.com>
Signed-off-by: Zebediah Figura <zfigura@codeweavers.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2021-08-17 20:02:23 +02:00
Alexandre Julliard 94f63ea23f ntdll: Add support for user callbacks.
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2021-08-17 18:16:43 +02:00
Alexandre Julliard b56a4b3efc ntdll: Implement KiUserCallbackDispatcher().
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2021-08-17 11:55:39 +02:00
Alexandre Julliard daa1886a2c ntdll: Add a stub for NtCallbackReturn().
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2021-08-17 11:52:35 +02:00
Alex Henrie f68923dca0 ws2_32: Hook up IPV6_RECVTCLASS.
Signed-off-by: Alex Henrie <alexhenrie24@gmail.com>
Signed-off-by: Zebediah Figura <zfigura@codeweavers.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2021-08-16 18:40:29 +02:00
Alexandre Julliard faaad36429 ntdll: Make get_builtin_unix_funcs() static.
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2021-08-13 11:38:25 +02:00
Zebediah Figura a8d2de6092 ntdll: Make wine_build a hidden symbol.
Signed-off-by: Zebediah Figura <zfigura@codeweavers.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2021-08-13 11:36:36 +02:00
Zebediah Figura 7c10730e04 ntdll: Make alloc_fs_sel() a hidden symbol.
Signed-off-by: Zebediah Figura <zfigura@codeweavers.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2021-08-13 11:36:33 +02:00
Alexandre Julliard e309bad98c include: Add a private header for Unix libraries definitions.
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2021-08-12 17:30:21 +02:00
Gerald Pfeifer 59da79021a ntdll: Only use sysinfo function when present.
On some systems <sys/sysinfo.h> may be present while the sysinfo
function may not, or at least not as part of standard libraries,
so check whether the function is actually available before using
it.

This fixes builds on FreeBSD with the devel/libsysinfo present.

Signed-off-by: Gerald Pfeifer <gerald@pfeifer.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2021-08-11 23:00:50 +02:00
Alexandre Julliard 2941e51855 ntdll: Avoid CDECL on internal functions.
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2021-08-11 23:00:50 +02:00
Alexandre Julliard d7add38218 ntdll: Make __wine_unix_call() WINAPI to follow syscall conventions.
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2021-08-11 23:00:49 +02:00
Alexandre Julliard 572817948a ntdll: Add a custom type for the Unix functions table handle.
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2021-08-10 18:07:32 +02:00
Alexandre Julliard d91d05b80a ntdll: Add a Wine-specific NtQueryVirtualMemory() query to retrieve the Unix call table.
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2021-08-10 18:06:50 +02:00
Alexandre Julliard c29f650474 ntdll: Load the Unix dll at the same time as the PE one, but don't map it yet.
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2021-08-10 17:53:55 +02:00
Alexandre Julliard ccd9008d8d ntdll: Don't try to load .so dlls for a different machine.
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2021-08-10 17:53:55 +02:00
Alexandre Julliard 18408b18f3 ntdll: Make release_builtin_module() static.
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2021-08-10 17:53:55 +02:00
Alex Henrie 21752cc956 ntdll: Add missing break to case IPV6_PKTINFO.
Signed-off-by: Alex Henrie <alexhenrie24@gmail.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2021-08-06 10:40:35 +02:00
Martin Storsjö 29922c2276 loader: Add support for ARM linux in the preloader.
Since 28fe84da45, the main exe image
must be mappable at its desired base address, which essentially
requires the preloader.

Wine-Bug: https://bugs.winehq.org/show_bug.cgi?id=51539
Signed-off-by: Martin Storsjö <martin@martin.st>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2021-08-05 23:11:23 +02:00
Alexandre Julliard 61b123fae9 ntdll: Set the I/O status block through the 32-bit pointer for Wow64 processes.
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2021-08-05 23:11:20 +02:00
Alexandre Julliard 28754a04ef ntdll: Only update the I/O status block at function exit.
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2021-08-05 23:11:15 +02:00
Alexandre Julliard 156c34ea03 ntdll: Add a helper function to get the iosb pointer to pass to the server.
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2021-08-05 20:43:28 +02:00
Alexandre Julliard 460755a007 ntdll: Avoid some duplicate async definitions.
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2021-08-05 20:43:28 +02:00
Alex Henrie cade5944be ws2_32: Hook up IPV6_PKTINFO.
Signed-off-by: Alex Henrie <alexhenrie24@gmail.com>
Signed-off-by: Zebediah Figura <zfigura@codeweavers.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2021-08-04 23:20:40 +02:00