Commit graph

7020 commits

Author SHA1 Message Date
Billy Laws
954bf9e050 ntdll: Avoid using SOL_IPX to detect whether IPX is supported.
4.18+ Linux kernels remove support for IPX but keep SOL_IPX defined, which
causes compilation errors as wine unconditionally uses IPX structures if
this is the case. Instead check for IPX_MTU to determine IPX support as it is
defined within the ipx.h header itself.
2023-07-04 20:52:17 +02:00
Ally Sommers
7b2e7c8075 ntdll/unix: Skip address conversion for SOCK_STREAM sockets in try_send(). 2023-07-03 22:15:42 +02:00
Alexandre Julliard
959dea0c09 ntdll: Implement RtlIsCurrentProcess/Thread. 2023-07-03 22:15:42 +02:00
Alexandre Julliard
a5ff427acb ntdll: Implement NtQueryVirtualMemory(MemoryImageInformation). 2023-07-03 12:16:49 +02:00
Alexandre Julliard
9bdd08579e ntdll/tests: Add some tests for NtQueryVirtualMemory(MemoryImageInformation). 2023-06-29 21:06:49 +02:00
Joel Holdsworth
1ccd037e00 ntdll: Implement FILE_DISPOSITION_POSIX_SEMANTICS.
Both the Msys2 and Cygwin runtimes make use of
FILE_DISPOSITON_POSIX_SEMANTICS in their implementations of the unlink()
system call. This enables these routines to behave similarly to POSIX where are
unlisted from the directory, if handles are still open.

https://github.com/msys2/msys2-runtime/blob/msys2-3.4.3/winsup/cygwin/syscalls.cc#L722
https://www.cygwin.com/git/?p=newlib-cygwin.git;a=blob;f=winsup/cygwin/syscalls.cc#l724

Signed-off-by: Joel Holdsworth <joel@airwebreathe.org.uk>
2023-06-27 22:14:15 +02:00
Joel Holdsworth
0e6b5811c8 ntdll/tests: Add tests for FILE_DISPOSITION_POSIX_SEMANTICS.
Signed-off-by: Joel Holdsworth <joel@airwebreathe.org.uk>
2023-06-27 22:14:15 +02:00
Joel Holdsworth
146333fed2 ntdll: Implement FILE_DISPOSITION_ON_CLOSE.
The FILE_DELETE_ON_CLOSE can be used with the FILE_DISPOSITION_ON_CLOSE flag
of FileDispositionInformationEx.

Signed-off-by: Joel Holdsworth <joel@airwebreathe.org.uk>
2023-06-27 22:14:15 +02:00
Joel Holdsworth
d89ee7c030 ntdll/tests: Add tests for FILE_DISPOSITION_ON_CLOSE.
Signed-off-by: Joel Holdsworth <joel@airwebreathe.org.uk>
2023-06-27 22:14:15 +02:00
Joel Holdsworth
91e442b060 ntdll: Implement FILE_DISPOSITION_IGNORE_READONLY_ATTRIBUTE.
Both the Msys2 and Cygwin runtimes make use of
FILE_DISPOSITION_IGNORE_READONLY_ATTRIBUTE in their implementations of the
unlink() system call. This enables these routines to delete a read-only file
without first modifying the attributes.

https://github.com/msys2/msys2-runtime/blob/msys2-3.4.3/winsup/cygwin/syscalls.cc#L724
https://www.cygwin.com/git/?p=newlib-cygwin.git;a=blob;f=winsup/cygwin/syscalls.cc#l726

Wine-Bug: https://bugs.winehq.org/show_bug.cgi?id=50771
Signed-off-by: Joel Holdsworth <joel@airwebreathe.org.uk>
2023-06-27 22:14:15 +02:00
Joel Holdsworth
cbc1e4423e ntdll/tests: Add tests for FILE_DISPOSITION_IGNORE_READONLY_ATTRIBUTE.
Signed-off-by: Joel Holdsworth <joel@airwebreathe.org.uk>
2023-06-27 22:14:15 +02:00
Joel Holdsworth
cc1d0e493d ntdll: Initial implementation of FileDispositionInformationEx.
This is required by Msys2 when running gpg-agent.

Wine-Bug: https://bugs.winehq.org/show_bug.cgi?id=54996
Signed-off-by: Joel Holdsworth <joel@airwebreathe.org.uk>
2023-06-27 22:14:15 +02:00
Joel Holdsworth
dedd130d9e include: Define FILE_DISPOSITION_INFORMATION_EX and friends.
Signed-off-by: Joel Holdsworth <joel@airwebreathe.org.uk>
2023-06-27 12:05:05 +02:00
Jacek Caban
dcf0bf1f38 ntdll: Inherit ConsoleHandle only by CUI processes. 2023-06-26 15:04:26 +02:00
Tim Clem
1b310a5aba ntdll: Treat read faults on readable pages as write faults on macOS.
Working around a Rosetta bug on Apple Silicon - faults for certain
instructions (e.g. lock cmpxchg8b) are misreported, which can break
VPROT_WRITEWATCH handling.
2023-06-22 10:10:55 +02:00
Alexandre Julliard
bef61e293c ntdll: Implement _errno(). 2023-06-21 18:15:43 +02:00
Alexandre Julliard
2b6e32f358 ntdll: Don't define stdcall functions on non-i386. 2023-06-14 18:53:36 +02:00
Alexandre Julliard
3c4be9856d ntdll: Make only the necessary pages writable in the ARM64EC code map. 2023-06-13 22:10:56 +02:00
Alexandre Julliard
f473e31341 ntdll: Load modules with a high base address in high memory. 2023-06-13 22:10:56 +02:00
Alexandre Julliard
a82238fad5 ntdll: Allocate 64-bit and kernel stacks in high memory. 2023-06-13 22:10:56 +02:00
Alexandre Julliard
11cd51139d ntdll: Support the lower memory limit in MEM_ADDRESS_REQUIREMENTS. 2023-06-13 22:10:56 +02:00
Etaash Mathamsetty
6ecca8cf63 ntdll: Allow RtlAllocateHeap to crash with invalid handle. 2023-06-12 21:21:35 +02:00
Alexandre Julliard
931292f1a6 ntdll: Use the sysv ABI for __wine_syscall_dispatcher_return().
Missing from b337c5b1a1, spotted by Fan
WenJie.
2023-06-09 23:37:14 +02:00
Alexandre Julliard
d12b125b4e ntdll: Update the reserved range on 64-bit to match the preloader.
cf. 6b0836e3f1.
2023-06-08 13:29:39 +02:00
Alexandre Julliard
bf1606cf35 ntdll: Use the full 4Gb for large address aware applications on Wow64. 2023-06-08 13:21:45 +02:00
Alexandre Julliard
78ffde79fe ntdll: Report the remaining part of the 64K after a view as free.
To avoid returning non-aligned reserved regions.
2023-06-08 13:21:10 +02:00
Alexandre Julliard
8b992fecad ntdll: Reimplement virtual_release_address_space() without using a callback. 2023-06-08 13:20:45 +02:00
Alexandre Julliard
800fc4164f ntdll: Reimplement fill_basic_memory_info() without using a callback.
And merge reported free areas.
2023-06-08 13:20:04 +02:00
Alexandre Julliard
b0aaa2f869 ntdll: Reimplement allocation of the virtual heap without using a callback. 2023-06-08 13:04:31 +02:00
Alexandre Julliard
47404fb36c ntdll: Reimplement allocation inside a reserved area without using a callback.
And make the allocation limits more explicit.
2023-06-07 22:48:27 +02:00
Alexandre Julliard
33240c5465 ntdll: Reimplement map_fixed_area() to avoid recursion and callbacks. 2023-06-07 22:48:27 +02:00
Alexandre Julliard
4cdc2f75f7 ntdll: Reimplement unmap_area() to avoid recursion and callbacks. 2023-06-07 22:48:27 +02:00
Alexandre Julliard
4c827cefbc ntdll: Add a helper function to unmap memory above the user space limit. 2023-06-07 22:48:27 +02:00
Alexandre Julliard
d5b22ae085 ntdll: Support adding overlapping ranges in mmap_add_reserved_area(). 2023-06-07 22:48:27 +02:00
Alexandre Julliard
6b5561b601 server: Send the APC call data as vararg in the select request. 2023-06-06 21:51:43 +02:00
Alexandre Julliard
e3049f11fa server: Send the APC call data as vararg in the queue_apc request.
To make it possible to support a larger structure.
2023-06-06 21:51:37 +02:00
Zebediah Figura
ead421b744 ntdll: Simplify critical section timeout logic.
Make it more consistent, as well. Currently we alternate between 5 seconds and
60; instead just make it a consistent 60 after the first wait.

When +relay is on, always wait for 300 seconds, instead of alternating between
60 and 300.
2023-06-05 14:01:07 +02:00
Zebediah Figura
7520294840 ntdll: Do not throw deadlock exceptions for Wine critical sections.
This is actually a public debugging facility, but currently applies exclusively
to Wine internal locks. While we could expand this feature to all critical
sections, no application is known to depend on it, and the fact that it is a
debugging feature means it is not very likely we will ever find one.

As far as Wine is concerned, I believe this feature is unused. I have not heard
any mention of it in at least five years.

Moreover, we have a different tool for debugging critical section timeouts,
namely, the ERR messages in the same function. These messages provide just as
much information while being less destructive to the process state.
2023-06-05 14:01:07 +02:00
Alexandre Julliard
b337c5b1a1 ntdll: Use the default ABI for all functions on the Unix side. 2023-06-02 09:50:50 +02:00
Alexandre Julliard
48537f4e1e ntdll: Use the sysv ABI for setjmp/longjmp on the Unix side. 2023-06-02 09:35:10 +02:00
Alexandre Julliard
e2fac05854 ntdll: Use the sysv ABI for the %fs allocation function. 2023-06-02 09:32:59 +02:00
Paul Gofman
e7845fc330 kernelbase: Don't modify non-volatile regs in RaiseException() on x64. 2023-06-01 22:00:19 +02:00
Alexandre Julliard
1aa2f0d128 ntdll: Store the PE function pointers as simple void pointers.
Their prototypes are not meaningful on the Unix side.
2023-06-01 17:24:06 +02:00
Alexandre Julliard
231f1854f5 ntdll: Don't use WINAPI for KeUserModeCallback(). 2023-06-01 15:56:13 +02:00
Alexandre Julliard
091513ffaa ntdll: Don't pass arguments on the stack for user callbacks on ARM. 2023-06-01 15:56:08 +02:00
Alexandre Julliard
d8c39b3d5a ntdll: Don't pass arguments on the stack for user callbacks on i386. 2023-06-01 15:56:08 +02:00
Alexandre Julliard
50ac25554c ntdll: Don't pass arguments on the stack for user callbacks on x86-64.
And convert to the sysv ABI.
2023-06-01 14:26:14 +02:00
Alexandre Julliard
efa99eab0b ntdll: Don't pass arguments on the stack for user callbacks on ARM64. 2023-06-01 12:44:31 +02:00
Jacek Caban
cd61eee30f ntdll: Get rid of hacks for direct unix calls. 2023-05-30 16:42:12 +02:00
Paul Gofman
fce615a2c3 ntdll: Support MEM_PRESERVE_PLACEHOLDER in NtUnmapViewOfSectionEx(). 2023-05-30 12:12:09 +02:00