Commit Graph

854 Commits

Author SHA1 Message Date
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
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 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
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
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
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
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
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
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
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
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
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