Commit Graph

980 Commits

Author SHA1 Message Date
Zebediah Figura 1e750b5b44 ntdll: Write a null terminator in NtQueryDirectoryObject.
Signed-off-by: Zebediah Figura <zfigura@codeweavers.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2022-04-13 16:27:47 +02:00
Zebediah Figura 4b57ae1674 ntdll: Don't return STATUS_BUFFER_OVERFLOW if the buffer is too small to hold one entry.
Signed-off-by: Zebediah Figura <zfigura@codeweavers.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2022-04-13 16:26:09 +02:00
Zebediah Figura 0c7dcd9088 ntdll: Return the required length from NtQueryDirectoryObject().
Signed-off-by: Zebediah Figura <zfigura@codeweavers.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2022-04-13 16:25:44 +02:00
Alexandre Julliard d53bc38d34 ntdll: Initialize the system locale on the Unix side.
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2022-04-13 16:03:14 +02:00
Paul Gofman 8c931c7129 ntdll: Remove unused PTHREAD_STACK_MIN definition.
Signed-off-by: Paul Gofman <pgofman@codeweavers.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2022-04-13 11:00:38 +02:00
Paul Gofman dfd5f109fb ntdll: Increase kernel stack size.
Signed-off-by: Paul Gofman <pgofman@codeweavers.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2022-04-13 11:00:33 +02:00
Zebediah Figura ccf706b456 ntdll: Do not write the "ret_size" parameter of NtQueryDirectoryObject on failure.
Signed-off-by: Zebediah Figura <zfigura@codeweavers.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2022-04-12 22:13:05 +02:00
Zebediah Figura 07d93d9f68 ntdll: Do not write the "context" parameter of NtQueryDirectoryObject on failure.
Signed-off-by: Zebediah Figura <zfigura@codeweavers.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2022-04-12 22:13:05 +02:00
Eric Pouech eff83cd4e0 kernelbase: Provide a pseudo console environment for initial CUI processes not tied to a Unix tty.
Wine-Bug: https://bugs.winehq.org/show_bug.cgi?id=52771
Wine-Bug: https://bugs.winehq.org/show_bug.cgi?id=52761
Wine-Bug: https://bugs.winehq.org/show_bug.cgi?id=52743
Signed-off-by: Eric Pouech <eric.pouech@gmail.com>
Signed-off-by: Jacek Caban <jacek@codeweavers.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2022-04-12 21:39:42 +02:00
Jacek Caban b4d91adb16 kernelbase: Add support for CREATE_NO_WINDOW flag in CreateProcess.
Based on patches by Eric Pouech and Torge Matthies.

Signed-off-by: Eric Pouech <eric.pouech@gmail.com>
Signed-off-by: Jacek Caban <jacek@codeweavers.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2022-04-12 21:39:42 +02:00
Alexandre Julliard 6eae7a24e2 ntdll: Export a few more codepage functions from ntdll.so.
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2022-04-12 21:39:41 +02:00
Alexandre Julliard deab47be6e ntdll: Use the standard CPTABLEINFO structure for the Unix codepage.
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2022-04-11 11:54:54 +02:00
Alexandre Julliard 61edb81649 ntdll: Move more codepage conversion functions to the common header.
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2022-04-11 11:54:54 +02:00
Alexandre Julliard d966c45e06 ntdll: Move some duplicated locale definitions to a common header.
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2022-04-11 11:54:54 +02:00
Daniel Lehman 1a18f3b916 ntdll: Return success for magic handles.
Wine-Bug: https://bugs.winehq.org/show_bug.cgi?id=51529
Signed-off-by: Daniel Lehman <dlehman25@gmail.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2022-04-07 22:44:39 +02:00
Alexandre Julliard 4a757e2d20 ntdll: Recognize more script names in Unix locales.
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2022-04-01 20:30:57 +02:00
Jinoh Kang 731a968003 server: Replace redundant send_socket status fields with force_async boolean field.
The 'status' field of send_socket_request is always either
STATUS_PENDING or STATUS_DEVICE_NOT_READY, and the 'total' field is
always zero.

Replace the 'status' field with 'force_async' boolean field, and get rid
of the 'total' field entirely.

Also, clean up the send_socket handler code a bit.

Signed-off-by: Jinoh Kang <jinoh.kang.kr@gmail.com>
Signed-off-by: Zebediah Figura <zfigura@codeweavers.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2022-03-25 18:30:28 +01:00
Jinoh Kang 74059d12b8 ntdll: Don't call try_send before server call in sock_send.
Otherwise, try_send() call from sock_send() may race against try_send()
call from async_send_proc(), shuffling the packet order.

Wine-Bug: https://bugs.winehq.org/show_bug.cgi?id=52401
Signed-off-by: Jinoh Kang <jinoh.kang.kr@gmail.com>
Signed-off-by: Zebediah Figura <zfigura@codeweavers.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2022-03-25 18:30:28 +01:00
Jinoh Kang 65d12984f2 server: Attempt to complete I/O request immediately in send_socket.
Make send_socket alert the async immediately if poll() call detects that
there are incoming data in the socket, bypassing the wineserver's main
polling loop.

For sock_transmit, we always mark the async as pending and set the IOSB
(unless async allocation has failed).

Signed-off-by: Jinoh Kang <jinoh.kang.kr@gmail.com>
Signed-off-by: Zebediah Figura <zfigura@codeweavers.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2022-03-25 18:30:28 +01:00
Rémi Bernon bb17583239 kernelbase: Fix GlobalMemoryStatusEx counters.
Signed-off-by: Rémi Bernon <rbernon@codeweavers.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2022-03-25 17:56:36 +01:00
Jinoh Kang be9a875fc1 server: Add mark_pending field to set_async_direct_result request.
The client can set mark_pending to indicate that the full-blown I/O
completion mechanism shall be triggered (asynchronous completion) even
if the status indicates failure.

Signed-off-by: Jinoh Kang <jinoh.kang.kr@gmail.com>
Signed-off-by: Zebediah Figura <zfigura@codeweavers.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2022-03-22 18:38:18 +01:00
Alexandre Julliard 5ed078dc14 ntdll: Implement NtInitializeNlsFiles().
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2022-03-21 14:28:10 +01:00
Alexandre Julliard cd4fcf9a11 ntdll: Add a helper function to map a section.
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2022-03-21 14:28:10 +01:00
Eric Pouech bd3c533f29 include: Fix prototype of NtQueryInformationFile.
Signed-off-by: Eric Pouech <eric.pouech@gmail.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2022-03-10 09:31:50 +01:00
Martin Storsjö 482b6a6dea ntdll: Zero-initialize the syscall_frame used for starting threads on ARM/ARM64.
This fixes an inconsistency since
fed7e7a78b (ntdll: Simulate a syscall
return when starting a thread); in that commit, on i386 and
x86_64, the syscall_frame used for starting the thread was
zeroed with a memset, while it wasn't on arm and arm64.

This had a noticable effect on float maths, where the
uninitialized frame->restore_flags field could have the
CONTEXT_FLOATING_POINT bit set. (call_init_thunk only ORs in
CONTEXT_INTEGER into the restore_flags field, on all architectures).
If that bit was set, it would restore uninitialized data into the
fpscr register, possibly setting the FPU in a nondefault rounding
mode.

Signed-off-by: Martin Storsjö <martin@martin.st>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2022-03-04 19:14:59 +01:00
Brendan Shanks a906f13f77 ntdll: Ensure CONTEXT_EX on exception stack is initialized.
On non-AVX CPUs, CONTEXT_EX is not being initialized.
In WOW64 mode, this results in invalid exception records when
dispatch_wow_exception() uses RtlCopyContext().

Signed-off-by: Brendan Shanks <bshanks@codeweavers.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2022-03-04 10:50:33 +01:00
Brendan Shanks 1b9d48a7b0 ntdll: Don't require equal Length and MaximumLength when setting ThreadNameInformation.
Signed-off-by: Brendan Shanks <bshanks@codeweavers.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2022-03-03 21:32:49 +01:00
Paul Gofman 3033e09070 ntdll: Do not force 2G stack limit for the main thread of 64 bit process.
Signed-off-by: Paul Gofman <pgofman@codeweavers.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2022-02-23 17:31:42 +01:00
Alexandre Julliard 31e151362b ntdll: Map imported apiset dlls to their target library.
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2022-02-22 18:20:23 +01:00
Alexandre Julliard e3c9d73cd1 ntdll: Load the apiset schema at startup.
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2022-02-21 22:33:54 +01:00
Alexandre Julliard a31f3374e6 ntdll: Add a global variable for the WoW PEB.
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2022-02-21 18:55:22 +01:00
Jinoh Kang dea1499ac0 server: Replace redundant recv_socket status fields with force_async boolean field.
The 'status' field of recv_socket_request is always either
STATUS_PENDING or STATUS_DEVICE_NOT_READY, and the 'total' field is
always zero.

Replace the 'status' field with 'force_async' boolean field, and get rid
of the 'total' field entirely.

Also, clean up the recv_socket handler code a bit.

Signed-off-by: Jinoh Kang <jinoh.kang.kr@gmail.com>
Signed-off-by: Zebediah Figura <zfigura@codeweavers.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2022-02-10 20:18:39 +01:00
Jinoh Kang 160eb74fdf ntdll: Don't call try_recv before server call in sock_recv.
Otherwise, try_recv() call from sock_recv() may race against try_recv()
call from async_recv_proc(), shuffling the packet order.

Wine-Bug: https://bugs.winehq.org/show_bug.cgi?id=52401
Signed-off-by: Jinoh Kang <jinoh.kang.kr@gmail.com>
Signed-off-by: Zebediah Figura <zfigura@codeweavers.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2022-02-10 20:18:39 +01:00
Jinoh Kang e5ce4fa917 server: Attempt to complete I/O request immediately in recv_socket.
Make recv_socket alert the async immediately if poll() call detects that
there are incoming data in the socket, bypassing the wineserver's main
polling loop.

Signed-off-by: Jinoh Kang <jinoh.kang.kr@gmail.com>
Signed-off-by: Zebediah Figura <zfigura@codeweavers.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2022-02-10 20:18:39 +01:00
Alexandre Julliard abfa6bf860 ntdll: Consistently use time_t in timezone matching.
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2022-02-02 18:43:10 +01:00
Alexandre Julliard 3527230c46 include: Remove the wine_ prefix on rbtree functions.
Add defines for frequently-used functions.

For compatibility with vkd3d.

Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2022-01-26 21:53:55 +01:00
Damjan Jovanovic 7a6ef5c2df ntdll: Use the correct amd64 trap codes on *BSD.
Fix the *BSD trap codes on amd64 like 148120f21e
did on i386.

Signed-off-by: Damjan Jovanovic <damjan.jov@gmail.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2022-01-25 20:50:49 +01:00
Alexandre Julliard 868af0c500 server: Don't depend on the TOKEN_GROUPS structure on the server side.
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2022-01-25 12:35:54 +01:00
Jinoh Kang 938783cac9 ntdll/unix: Zero-extend IP_TOS byte to INT.
The IP_TOS control data is 1 byte on Unix, but 4 bytes on Windows.
Properly zero-extend the value instead of copying 3 bytes of garbage.

Signed-off-by: Jinoh Kang <jinoh.kang.kr@gmail.com>
Signed-off-by: Zebediah Figura <zfigura@codeweavers.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2022-01-19 10:40:07 +01:00
Dmitry Timoshkov 58bf1112df ntdll: Use full registry key name in NtQueryLicenseValue.
Signed-off-by: Dmitry Timoshkov <dmitry@baikal.ru>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2022-01-12 11:59:20 +01:00
Alexandre Julliard e16ccaf05d ntdll: Support debugger attach from a 64-bit process to a 32-bit process.
This is needed until 64-bit ntdll can be mapped in all
processes. Partial revert of 8dc6987ba5.

Wine-Bug: https://bugs.winehq.org/show_bug.cgi?id=52157
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2022-01-03 17:46:39 +01:00
Alexandre Julliard 15101bae7b ntdll: Fix current directory initialization on removable devices.
Fix a regression caused by 3e73437ae8.

Wine-Bug: https://bugs.winehq.org/show_bug.cgi?id=52311
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2022-01-02 21:26:17 +01:00
Alexandre Julliard 3e73437ae8 ntdll: Preserve the startup Unix directory unless it's on a removable device.
Wine-Bug: https://bugs.winehq.org/show_bug.cgi?id=52256
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2021-12-27 18:51:16 +01:00
Paul Gofman 652dc00578 ntdll: Don't set socket IO status after queuing async.
Signed-off-by: Paul Gofman <pgofman@codeweavers.com>
Signed-off-by: Zebediah Figura <zfigura@codeweavers.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2021-12-17 19:33:14 +01:00
Jacek Caban d0413d833f ntdll: Don't use inline assembly in do_cpuid.
Avoids problems on old GCC.

Wine-Bug: https://bugs.winehq.org/show_bug.cgi?id=51862
Signed-off-by: Jacek Caban <jacek@codeweavers.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2021-12-17 17:17:54 +01:00
Eric Pouech 594036d620 ntdll: Use proper names for magic constants.
Signed-off-by: Eric Pouech <eric.pouech@gmail.com>
Signed-off-by: Jacek Caban <jacek@codeweavers.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2021-12-17 17:17:49 +01:00
Paul Gofman e36c6f04ce ntdll: Add stub for NtSetDebugFilterState().
Eternal Return benefited from this function present as .spec file
stub which was removed by 52202224d9.

Signed-off-by: Paul Gofman <pgofman@codeweavers.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2021-12-14 14:18:53 +01:00
Zebediah Figura 4b00dd097d server: Handle the entire IOCTL_AFD_POLL ioctl on the server side.
Signed-off-by: Zebediah Figura <zfigura@codeweavers.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2021-12-10 22:00:17 +01:00
Zebediah Figura 7747bf9551 ntdll: Make the afd_transmit_params structure WoW64-compatible.
Signed-off-by: Zebediah Figura <zfigura@codeweavers.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2021-12-10 22:00:17 +01:00
Zebediah Figura b3fd1ca20e ntdll: Handle WoW64 translation in IOCTL_AFD_WINE_SENDMSG.
Signed-off-by: Zebediah Figura <zfigura@codeweavers.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2021-12-10 22:00:17 +01:00