Commit Graph

6283 Commits

Author SHA1 Message Date
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
Eric Pouech 1297ccb370 ntdll/tests: Fix erroneous ok parameters.
Signed-off-by: Eric Pouech <eric.pouech@gmail.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2022-03-02 20:17:25 +01:00
Alexandre Julliard bf3ef684e2 ntdll/tests: Avoid referencing a global variable from inline asm.
It breaks on old gccs.

Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2022-03-01 22:41:15 +01:00
Saulius Krasuckas f72978ad07 ntdll: Check __WINE_PE_BUILD instead of compiler macros.
Fixes compilation on Cygwin, undeclared identifiers: _alldiv, _allmul,
_allrem, _aulldiv, _aullrem.

Wine-Bug: https://bugs.winehq.org/show_bug.cgi?id=52607
Signed-off-by: Saulius Krasuckas <saulius2@ar-fi.lt>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2022-03-01 10:35:00 +01:00
Mohamad Al-Jaf 25839fffc8 ntdll: Fix the spelling of a comment.
Signed-off-by: Mohamad Al-Jaf <mohamadaljaf@gmail.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2022-02-23 20:19:29 +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 cb2fb8c25e ntdll: Implement ApiSetQueryApiSetPresence/Ex().
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2022-02-22 18:20:23 +01:00
Alexandre Julliard 7b233f3032 ntdll: Map explicitly loaded apiset dlls to their target library.
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2022-02-22 18:20:23 +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
Eric Pouech 37a830916b kernel32/test: Fully allocate KEY_VALUE_*_INFORMATION.
This prevents a warning on mingw-gcc version 11 (-Warray-bounds).

Signed-off-by: Eric Pouech <eric.pouech@gmail.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2022-02-17 22:16:03 +01:00
Eric Pouech 0c85e59bea ntdll/tests: Fully allocate SYSTEM_FIRMWARE_TABLE_INFORMATION.
This prevents a warning on mingw-gcc version 11 (-Warray-bounds).

Signed-off-by: Eric Pouech <eric.pouech@gmail.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2022-02-17 22:16:03 +01:00
Zebediah Figura 615a2ab53c ntdll: Use YieldProcessor() in RtlEnterCriticalSection().
Signed-off-by: Zebediah Figura <zfigura@codeweavers.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2022-02-15 10:34:31 +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
André Zwing 8cfe529a59 ntdll: Fix some spec file entries.
Signed-off-by: André Zwing <nerv@dawncrow.de>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2022-02-03 17:20:19 +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
Eric Pouech 310d7c6883 ntdll: Use correct integral type.
Signed-off-by: Eric Pouech <eric.pouech@gmail.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2022-01-31 18:38:55 +01:00
Zebediah Figura a524ab5004 ntdll: Implement wcsnlen().
Signed-off-by: Zebediah Figura <zfigura@codeweavers.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2022-01-31 18:38:54 +01:00
Fabian Maurer 0ea07db6ae ntdll/tests: Avoid "misleading indentation" warnings.
Signed-off-by: Fabian Maurer <dark.shadow4@web.de>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2022-01-27 22:04:05 +01:00
Alexandre Julliard f0cd33c69e include: Add support for defining Win32 types as 'long' where possible.
Add -DWINE_NO_LONG_TYPES to modules that still have compilation
warnings with long types.

Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2022-01-27 20:38:22 +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
Nikolay Sivov c89ce41ec9 version: Use same Windows 10 build number for version information.
Signed-off-by: Nikolay Sivov <nsivov@codeweavers.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2022-01-25 20:50:49 +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
Ben Shefte 9d1ac957b4 ntdll: Use case insensitive comparison in is_import_dll_system().
Fixes a regression introduced by commit 250c113169.

Wine-Bug: https://bugs.winehq.org/show_bug.cgi?id=52446
Signed-off-by: Paul Gofman <pgofman@codeweavers.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
Jacek Caban b6dc839908 ntdll/tests: Remove workarounds for old Windows versions.
Signed-off-by: Jacek Caban <jacek@codeweavers.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2021-12-30 23:09:45 +01:00
Jacek Caban 32b81bfaff ntdll: Fix handling \\.\CON path in RtlDosPathNameToNtPathName.
Wine-Bug: https://bugs.winehq.org/show_bug.cgi?id=32183
Signed-off-by: Jacek Caban <jacek@codeweavers.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2021-12-30 23:09:45 +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 aee405e2cb ntdll: Always try searching apiset DLLs in the default directories.
This is a temporary workaround until we have a correct apisets
implementation.

Signed-off-by: Paul Gofman <pgofman@codeweavers.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2021-12-23 10:55:30 +01:00
Andrey Gusev 93b7c335d6 ntdll: Fix a variable name in TRACE() message.
Signed-off-by: Andrey Gusev <andrey.goosev@gmail.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2021-12-21 16:52:22 +01:00
Paul Gofman 6b78bcff92 ntdll: Restore FP status words from MSVCRT_JUMP_BUFFER on x64.
Signed-off-by: Paul Gofman <pgofman@codeweavers.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2021-12-21 16:52:07 +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
Alexandre Julliard b75caec103 ntdll/tests: Mark a failing test as todo.
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2021-12-16 16:17:21 +01:00
Alexandre Julliard 311c0e91c0 ntdll/tests: Fix some wow64 test failures on Windows.
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2021-12-15 17:01:53 +01:00
Alexandre Julliard 1887df5cd8 ntdll/tests: Fix some directory test failures on Windows.
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2021-12-15 16:19:08 +01:00
Alexandre Julliard c372d155ec ntdll/tests: Fix some exception test failures on Windows.
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2021-12-15 15:57:01 +01:00
Alexandre Julliard 8125687441 ntdll: Fix the RtlCreateTimer() argument order.
Found by Dávid Török.

Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2021-12-14 21:48:44 +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