Commit Graph

6139 Commits

Author SHA1 Message Date
Zebediah Figura e276b99afa ws2_32: Move the getsockopt(IP_MULTICAST_TTL) implementation to ntdll.
Signed-off-by: Zebediah Figura <zfigura@codeweavers.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2021-07-09 11:00:16 +02:00
Zebediah Figura 0debf58b6a ws2_32: Move the setsockopt(IP_MULTICAST_LOOP) implementation to ntdll.
Signed-off-by: Zebediah Figura <zfigura@codeweavers.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2021-07-09 11:00:12 +02:00
Alexandre Julliard 3f9d49809d ntdll: Avoid calling NtReadFile() from the Unix side.
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2021-07-08 16:49:53 +02:00
Alexandre Julliard 07f8b0c84a ntdll: Avoid calling NtCreateFile() from the Unix side.
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2021-07-08 16:49:41 +02:00
Alexandre Julliard 76f949577a ntdll: Avoid calling NtOpenFile() from the Unix side.
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2021-07-08 16:49:23 +02:00
Alexandre Julliard f690266c11 ntdll: Add a helper function to open a file object.
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2021-07-08 16:49:10 +02:00
Alexandre Julliard 92a66c08ba ntdll: Pass a length pointer instead of an IO_STATUS_BLOCK to the async callbacks.
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2021-07-08 16:21:51 +02:00
Zebediah Figura 2de3effee4 ws2_32: Move the getsockopt(IP_MULTICAST_LOOP) implementation to ntdll.
Signed-off-by: Zebediah Figura <zfigura@codeweavers.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2021-07-08 10:49:58 +02:00
Zebediah Figura 9ad2f988c7 ws2_32: Move the setsockopt(IP_MULTICAST_IF) implementation to ntdll.
Signed-off-by: Zebediah Figura <zfigura@codeweavers.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2021-07-08 10:49:56 +02:00
Zebediah Figura 946c4649e0 ws2_32: Move the getsockopt(IP_MULTICAST_IF) implementation to ntdll.
Signed-off-by: Zebediah Figura <zfigura@codeweavers.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2021-07-08 10:49:53 +02:00
Zebediah Figura f0533d9a5a ws2_32: Move the setsockopt(IP_HDRINCL) implementation to ntdll.
Signed-off-by: Zebediah Figura <zfigura@codeweavers.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2021-07-08 10:49:49 +02:00
Zebediah Figura 342795edb3 ws2_32: Move the getsockopt(IP_HDRINCL) implementation to ntdll.
Signed-off-by: Zebediah Figura <zfigura@codeweavers.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2021-07-08 10:49:46 +02:00
Alexandre Julliard 27ecc6ba5f ntdll: Fix iosb handling in NtCancelIoFile().
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2021-07-07 16:33:29 +02:00
Alexandre Julliard 3a32ea8e91 ntdll: Add support for LdrSystemDllInitBlock.
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2021-07-07 16:33:29 +02:00
Alexandre Julliard 390d71b091 ntdll: Also load the Wow64 ntdll for the main exe target machine.
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2021-07-07 16:33:29 +02:00
Alexandre Julliard 3190a5bcdd ntdll: Make the ntdll exports and relocations processing more generic.
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2021-07-07 16:33:29 +02:00
Zebediah Figura e49e79de99 ws2_32: Move the setsockopt(IP_DROP_SOURCE_MEMBERSHIP) implementation to ntdll.
Signed-off-by: Zebediah Figura <zfigura@codeweavers.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2021-07-07 11:33:26 +02:00
Zebediah Figura af3efd38ab ws2_32: Move the setsockopt(IP_DROP_MEMBERSHIP) implementation to ntdll.
Signed-off-by: Zebediah Figura <zfigura@codeweavers.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2021-07-07 11:33:23 +02:00
Alexandre Julliard 216d241178 winebuild: Save/restore the %fs register in the syscall dispatcher on Linux.
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2021-07-06 15:50:26 +02:00
Alexandre Julliard c42384b5a1 ntdll: Switch back to the pthread %fs register in signal handlers.
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2021-07-06 15:50:26 +02:00
Alexandre Julliard a7b6b4f0d0 ntdll: Allocate a 32-bit %fs selector on Linux in Wow64 mode.
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2021-07-06 15:50:25 +02:00
Alexandre Julliard cec3db10f4 ntdll: Store the pthread TEB value on thread init.
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2021-07-06 12:31:53 +02:00
Francois Gouget e72c71d27d ntdll/tests: Improve the RtlWaitOnAddress() timeout checks.
GetTickCount()'s granularity represents 15% of the time we want to
mesure, making it hard to not get failures. So use NtQuerySystemTime()
instead since we already depend on it.
Narrow down the acceptable range again.

Signed-off-by: Francois Gouget <fgouget@codeweavers.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2021-07-05 19:55:37 +02:00
Francois Gouget 4e91180471 ntdll/tests: TZinfo sometimes does not get a MUI string.
RtlQuery*TimeZoneInformation() should return a MUI string but
there are rare cases where it does not in Windows 10 2004.

Signed-off-by: Francois Gouget <fgouget@codeweavers.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2021-07-05 19:55:35 +02:00
Zebediah Figura bedd92ca06 server: Explicitly return whether a select request was immediately signaled.
This fixes a regression introduced by 97afac469f.

If we make a request on an asynchronous device handle, and the IRP handler
returns STATUS_PENDING, wait_async() will return STATUS_PENDING, as intended.
However, if the async object is signaled before the user has a chance to call
wait_async() [e.g. if get_next_device_request is called quickly enough], select
will return STATUS_PENDING immediately, which causes server_select() to think
the object is not signaled, and wait for a select reply forever.

Wine-Bug: https://bugs.winehq.org/show_bug.cgi?id=51277
Wine-Bug: https://bugs.winehq.org/show_bug.cgi?id=51295
Signed-off-by: Zebediah Figura <zfigura@codeweavers.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2021-07-05 19:55:18 +02:00
Alexandre Julliard 5d9586a60b ntdll: Get rid of the almost empty virtual.c.
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2021-07-05 13:44:03 +02:00
Alexandre Julliard 73a281104b ntdll: Get rid of the almost empty directory.c.
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2021-07-05 13:44:03 +02:00
Alexandre Julliard d4509765a6 ntdll: Get rid of the almost empty nt.c.
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2021-07-05 13:44:03 +02:00
Alexandre Julliard 9a224788b7 ntdll: Forward RtlGetNativeSystemInformation() to NtWow64GetNativeSystemInformation() on 32-bit.
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2021-07-05 13:44:03 +02:00
Alexandre Julliard 0426430563 ntdll: Implement NtWow64GetNativeSystemInformation().
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2021-07-05 13:41:30 +02:00
Alexandre Julliard 5071a28743 ntdll: Implement SystemEmulation* information classes.
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2021-07-05 13:41:27 +02:00
Alexandre Julliard c6919423a8 ntdll/tests: Retrieve the actual segment registers for RtlWow64GetThreadSelectorEntry test.
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2021-07-02 12:39:12 +02:00
Zebediah Figura 42e0155f50 ws2_32: Move the setsockopt(IP_DONTFRAGMENT) implementation to ntdll.
Signed-off-by: Zebediah Figura <z.figura12@gmail.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2021-07-02 10:02:08 +02:00
Zebediah Figura f38bb98a49 ws2_32: Move the getsockopt(IP_DONTFRAGMENT) implementation to ntdll.
Signed-off-by: Zebediah Figura <z.figura12@gmail.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2021-07-02 10:02:08 +02:00
Zebediah Figura 1276c73feb ws2_32: Move the setsockopt(IP_BLOCK_SOURCE) implementation to ntdll.
Signed-off-by: Zebediah Figura <z.figura12@gmail.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2021-07-02 10:02:08 +02:00
Zebediah Figura 1749a43cc7 ws2_32: Move the setsockopt(IP_ADD_SOURCE_MEMBERSHIP) implementation to ntdll.
Signed-off-by: Zebediah Figura <z.figura12@gmail.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2021-07-02 10:02:08 +02:00
Alexandre Julliard eb69da2a9c ntdll: Implement NtQueryInformationToken(TokenSessionId).
Wine-Bug: https://bugs.winehq.org/show_bug.cgi?id=46595
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2021-07-01 22:34:31 +02:00
Alexandre Julliard b20cbd0d57 ntdll: Return the session id in NtQuerySystemInformation(SystemProcessInformation).
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2021-07-01 22:34:31 +02:00
Alexandre Julliard bf4105b731 ntdll: Implement NtQueryInformationProcess(ProcessSessionInformation).
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2021-07-01 22:34:31 +02:00
Alexandre Julliard ad93413c71 server: Store session id in the process and return it at process init time.
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2021-07-01 22:34:31 +02:00
Zebediah Figura 151370c478 ntdll/tests: Add more tests for deleted keys.
Signed-off-by: Zebediah Figura <z.figura12@gmail.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2021-07-01 22:34:31 +02:00
Zebediah Figura e759da260e server: Use a separate request to retrieve the object name.
A deleted key returns STATUS_KEY_DELETED when ObjectNameInformation is
requested, but succeeds when ObjectBasicInformation is requested.

Signed-off-by: Zebediah Figura <z.figura12@gmail.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2021-07-01 22:34:31 +02:00
Alexandre Julliard 11d6c52f32 ntdll: Use the CPU area to get/set the Wow64 context on x86-64.
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2021-07-01 12:46:00 +02:00
Alexandre Julliard 4acecd8619 ntdll: Initialize the Wow64 context on x86-64.
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2021-07-01 12:46:00 +02:00
Alexandre Julliard bedfb31d7c ntdll: Add a helper function to retrieve the CPU area context on the Unix side.
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2021-07-01 12:46:00 +02:00
Alexandre Julliard 8794879335 ntdll: Clear the 32-bit TLS for ZeroTlsCell in Wow64 mode.
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2021-07-01 10:32:24 +02:00
Alexandre Julliard 3469ebf90e ntdll: Implement RtlWow64GetThreadSelectorEntry().
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2021-07-01 10:32:24 +02:00
Zebediah Figura 96766e6794 ws2_32: Move the setsockopt(IP_ADD_MEMBERSHIP) implementation to ntdll.
Signed-off-by: Zebediah Figura <z.figura12@gmail.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2021-07-01 08:37:50 +02:00
Roman Pišl 0ec555e58e ntdll: Don't pretend that the whole address space is reserved on non-i386.
This is analogous to 61dcca5dbf.

Wine-Bug: https://bugs.winehq.org/show_bug.cgi?id=50735
Signed-off-by: Roman Pišl <rpisl@seznam.cz>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2021-06-30 20:01:20 +02:00
Alexandre Julliard 17716bc7f3 ntdll: Implement RtlWow64GetCurrentCpuArea().
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2021-06-30 18:46:16 +02:00
Alexandre Julliard c9d23a15ce ntdll/tests: Add tests for RtlWow64GetCurrentCpuArea().
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2021-06-30 18:46:16 +02:00
Alexandre Julliard 7700467a38 ntdll/tests: Add tests for 64-bit modules in Wow64 mode.
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2021-06-30 18:46:16 +02:00
Zebediah Figura 9eea22f724 ws2_32: Move the setsockopt(SO_REUSEADDR) implementation to ntdll.
Signed-off-by: Zebediah Figura <z.figura12@gmail.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2021-06-29 19:55:22 +02:00
Zebediah Figura f7cb96e53c ws2_32: Move the getsockopt(SO_REUSEADDR) implementation to ntdll.
Signed-off-by: Zebediah Figura <z.figura12@gmail.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2021-06-29 19:55:22 +02:00
Alexandre Julliard 7404ef3ef5 ntdll: Don't rely on get_thread_context() updating the context flags.
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2021-06-29 15:25:42 +02:00
Alexandre Julliard 19f19d0e2e ntdll: Implement NtWow64AllocateVirtualMemory64().
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2021-06-29 14:51:25 +02:00
Alexandre Julliard bfd2d1d77d ntdll: Implement NtWow64Read/WriteVirtualMemory64().
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2021-06-29 12:42:57 +02:00
Bernhard Übelacker cbf7a10176 ntdll: Allow 16-bit executables to be loaded from build directory.
Wine-Bug: https://bugs.winehq.org/show_bug.cgi?id=51214
Signed-off-by: Bernhard Übelacker <bernhardu@mailbox.org>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2021-06-29 12:42:22 +02:00
Qian Hong 4e84a553a8 ntdll: Truncate files through the server.
Signed-off-by: Zebediah Figura <z.figura12@gmail.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2021-06-29 12:37:25 +02:00
Qian Hong 73d0bb7740 server: Forbid deleting files with an open mapping.
Signed-off-by: Zebediah Figura <z.figura12@gmail.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2021-06-28 19:43:27 +02:00
Qian Hong 7316122011 ntdll/tests: Test deleting files with an open mapping.
Signed-off-by: Zebediah Figura <z.figura12@gmail.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2021-06-28 19:43:27 +02:00
Alexandre Julliard 364099f528 ntdll: Avoid crash on shutting down partially initialized thread.
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2021-06-27 19:32:48 +02:00
Alexandre Julliard ee65ea88ee ntdll: Only update the data that was requested in the destination context.
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2021-06-27 11:42:32 +02:00
Alexandre Julliard 8ac411ed6d server: Support both native and wow64 register contexts.
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2021-06-27 11:42:32 +02:00
Alexandre Julliard f64d86eb0a ntdll: Support converting server contexts from one machine to another.
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2021-06-26 11:11:01 +02:00
Akihiro Sagawa c94ac2e061 ntdll: Fix null pointer dereference in RtlDosPathNameToNtPathName_U_WithStatus.
Signed-off-by: Akihiro Sagawa <sagawa.aki@gmail.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2021-06-25 22:48:47 +02:00
Alexandre Julliard d66bd3e8b1 ntdll/tests: Move Wow64 tests to a separate file.
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2021-06-25 22:48:47 +02:00
Alexandre Julliard 0ffbec44f3 ntdll: Initialize the RealClientId field in the TEB.
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2021-06-25 22:48:47 +02:00
Zebediah Figura 061e85a548 ws2_32: Move the setsockopt(SO_OOBINLINE) implementation to ntdll.
Signed-off-by: Zebediah Figura <z.figura12@gmail.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2021-06-25 10:23:19 +02:00
Zebediah Figura afa71f9a12 ws2_32: Move the getsockopt(SO_OOBINLINE) implementation to ntdll.
Signed-off-by: Zebediah Figura <z.figura12@gmail.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2021-06-25 10:23:15 +02:00
Zebediah Figura 130b549671 ws2_32: Move the setsockopt(SO_LINGER) implementation to ntdll.
Signed-off-by: Zebediah Figura <z.figura12@gmail.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2021-06-25 10:23:05 +02:00
Zebediah Figura f52df002b0 ws2_32: Move the getsockopt(SO_LINGER) implementation to ntdll.
Signed-off-by: Zebediah Figura <z.figura12@gmail.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2021-06-25 10:23:02 +02:00
Zebediah Figura 10cc82827e ntdll/tests: Mark a test as conditionally succeeding under Wine.
The stack handler doesn't return ExceptionContinueExecution if test_stage == 2.

Signed-off-by: Zebediah Figura <z.figura12@gmail.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2021-06-24 21:59:26 +02:00
Zebediah Figura 9eade0d245 ntdll/tests: Fix a failure in test_thread_context() under Wine.
Follow-up to 94ee270972.

Signed-off-by: Zebediah Figura <z.figura12@gmail.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2021-06-24 21:59:23 +02:00
Zebediah Figura 2554daf1bf ntdll/tests: Fix AVX tests on processors that don't support XSAVEOPT.
Signed-off-by: Zebediah Figura <z.figura12@gmail.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2021-06-24 21:59:17 +02:00
Alexandre Julliard 6b86b41912 server: Simplify the naming of the YMM regs.
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2021-06-24 21:41:21 +02:00
Alexandre Julliard f626349c0a server: Use separate handles for thread and context in get_thread_context.
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2021-06-24 11:00:24 +02:00
Zebediah Figura a7f39e3fbb ws2_32: Move the setsockopt(SO_KEEPALIVE) implementation to ntdll.
Signed-off-by: Zebediah Figura <z.figura12@gmail.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2021-06-24 10:27:17 +02:00
Zebediah Figura 8aaef4cafd ws2_32: Move the getsockopt(SO_KEEPALIVE) implementation to ntdll.
Signed-off-by: Zebediah Figura <z.figura12@gmail.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2021-06-24 10:27:14 +02:00
Paul Gofman 4e4847dd71 ntdll/tests: Do not write to fs, gs when testing cleared segment regs on x64.
Wine-Bug: https://bugs.winehq.org/show_bug.cgi?id=51152
Signed-off-by: Paul Gofman <pgofman@codeweavers.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2021-06-23 21:45:08 +02:00
Zebediah Figura 759408c3ae ws2_32: Move the setsockopt(SO_BROADCAST) implementation to ntdll.
Signed-off-by: Zebediah Figura <z.figura12@gmail.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2021-06-23 20:44:58 +02:00
Zebediah Figura d9b281e5c7 ws2_32: Move the getsockopt(SO_BROADCAST) implementation to ntdll.
Signed-off-by: Zebediah Figura <z.figura12@gmail.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2021-06-23 20:44:58 +02:00
Alexandre Julliard 9ae2b046ef ntdll/tests: Add more tests for Wow64 contexts.
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2021-06-22 17:57:46 +02:00
Alexandre Julliard 03fe2b36cd ntdll/tests: Add more tests for segment registers in 64-bit mode.
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2021-06-22 17:48:45 +02:00
Akihiro Sagawa 0acd98f135 ntdll: Validate directory path when the path name ends with a dos device name.
Wine-Bug: https://bugs.winehq.org/show_bug.cgi?id=51291
Signed-off-by: Akihiro Sagawa <sagawa.aki@gmail.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2021-06-21 23:13:57 +02:00
Akihiro Sagawa 64c4582a40 ntdll/tests: Expand path name tests with path + device name.
Signed-off-by: Akihiro Sagawa <sagawa.aki@gmail.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2021-06-21 23:13:57 +02:00
Alexandre Julliard fed7e7a78b ntdll: Simulate a syscall return when starting a thread.
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2021-06-21 18:35:20 +02:00
Alexandre Julliard db26df5934 ntdll: Go through the syscall return path for syscall faults.
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2021-06-21 18:35:20 +02:00
Alexandre Julliard 15b18f4830 ntdll/tests: Adapt some of the i386 tests to run on x86-64 as well.
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2021-06-18 16:48:48 +02:00
Alexandre Julliard c0012ecdd7 ntdll: Ignore faults caused by alignment check on x86-64.
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2021-06-18 16:48:48 +02:00
Zebediah Figura c82c5e96a9 ntdll/tests: Relax tests for RtlWaitOnAddress() timeout.
RtlWaitOnAddress() shouldn't be waiting for less than 100 ms here, and it isn't,
but using GetTickCount() to measure this can result in up to 15 ms of error,
causing frequent test failures.

Signed-off-by: Zebediah Figura <z.figura12@gmail.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2021-06-17 20:08:16 +02:00
Gijs Vermeulen 836ec1d7ed ntdll: Avoid declaration-after-statement warning.
Signed-off-by: Gijs Vermeulen <gijsvrm@gmail.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2021-06-17 20:02:04 +02:00
Alexandre Julliard de89ce1bfe ntdll: Support growing both 32- and 64-bit stacks.
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2021-06-17 20:01:38 +02:00
Alexandre Julliard e91d19a58a ntdll: Remove special case for setting permissions on stack pages.
We are running on the kernel stack at this point.

Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2021-06-17 20:01:38 +02:00
Alexandre Julliard 7b4ca95ab6 ntdll: Add a helper to get the Wow64 TEB.
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2021-06-17 20:01:37 +02:00
Zebediah Figura 569f1ac018 ws2_32: Move the getpeername() implementation to ntdll.
This adds todo_wine to a couple of tests; however, these are overly zealous
invalid parameter tests, and fixing them is nontrivial.

Signed-off-by: Zebediah Figura <z.figura12@gmail.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2021-06-17 09:19:31 +02:00
Alexandre Julliard b572cf3025 ntdll: Copy the implementation of __wine_dbg_output to the PE side.
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2021-06-16 15:37:46 +02:00
Alexandre Julliard 0702d6b886 ntdll: Don't allow single-stepping through syscalls.
Wine-Bug: https://bugs.winehq.org/show_bug.cgi?id=51273
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2021-06-16 15:05:24 +02:00
Zebediah Figura 02309b72f7 server: Implement IOCTL_AFD_GETSOCKNAME.
Signed-off-by: Zebediah Figura <z.figura12@gmail.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2021-06-16 09:03:20 +02:00
Zebediah Figura f98ea26c67 server: Partially implement IOCTL_AFD_BIND.
Signed-off-by: Zebediah Figura <z.figura12@gmail.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2021-06-16 09:03:20 +02:00
Zebediah Figura 69549fc0c7 server: Implement IOCTL_AFD_GET_EVENTS.
Signed-off-by: Zebediah Figura <z.figura12@gmail.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2021-06-15 20:42:52 +02:00
Alexandre Julliard c2d84da813 ntdll: Copy the implementation of __wine_dbg_strdup and __wine_dbg_header to the PE side.
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2021-06-15 20:42:25 +02:00
Alexandre Julliard 2084fbd93d ntdll: Store the debug info in the TEB block after the 32-bit TEB.
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2021-06-15 20:42:25 +02:00
Alexandre Julliard 588d91aecf ntdll: Store the current PEB in a global variable.
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2021-06-15 20:42:25 +02:00
Alexandre Julliard a5cec4f5fb ntdll: Always use the TEB that was passed to signal_start_thread().
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2021-06-14 18:32:24 +02:00
Alexandre Julliard 9a430dc6db ntdll: Also pass the TEB to signal_exit_thread().
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2021-06-14 18:32:24 +02:00
Alexandre Julliard 2849ca9db4 ntdll: Move the XSTATE definitions to the platform-specific files.
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2021-06-14 18:32:24 +02:00
Alexandre Julliard bcc587887a ntdll: Don't update cached registers if NtGetContextThread() fails.
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2021-06-14 18:32:24 +02:00
Zebediah Figura 79c102d6be ntdll: Reserve space for the whole 64-bit YMM context in struct x86_thread_data.
Fixes a regression introduced by 308a5e7c4d.

This was previously broken, but happened to work until the aforementioned
commit put the YMM state right at the end of a page.

Wine-Bug: https://bugs.winehq.org/show_bug.cgi?id=51262
Signed-off-by: Zebediah Figura <z.figura12@gmail.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2021-06-14 10:08:18 +02:00
Zebediah Figura 9bbf3ab96b server: Implement IOCTL_AFD_EVENT_SELECT.
Signed-off-by: Zebediah Figura <z.figura12@gmail.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2021-06-14 10:07:52 +02:00
Kalen Alwardt 29e1494c72 ntdll: Export ZwFilterToken().
Wine-Bug: https://bugs.winehq.org/show_bug.cgi?id=39142
Signed-off-by: Kalen Alwardt <kalenalwardt@gmail.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2021-06-14 10:05:34 +02:00
Alexandre Julliard fa5759b9ef ntdll: Simplify the platform-specific dispatcher interface.
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2021-06-11 18:45:44 +02:00
Alexandre Julliard 7954b86f6b ntdll: Switch to the kernel stack for syscalls on ARM.
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2021-06-11 18:45:44 +02:00
Alexandre Julliard 08c4419a49 ntdll: Switch to the kernel stack for syscalls on ARM64.
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2021-06-11 18:45:44 +02:00
Alexandre Julliard 25b093f384 ntdll: Switch to the kernel stack for syscalls on x86-64.
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2021-06-11 18:45:44 +02:00
Alexandre Julliard 308a5e7c4d ntdll: Switch to the kernel stack for syscalls on i386.
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2021-06-11 15:49:29 +02:00
Alexandre Julliard 6b277dc89d ntdll: Always allocate extra stack space for the kernel stack.
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2021-06-11 11:06:42 +02:00
Alexandre Julliard e8753b4bc2 ntdll: Allow the dispatcher functions to return to the caller.
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2021-06-11 10:56:23 +02:00
Alexandre Julliard a2fce84a8b ntdll: Fix some exception test failures on ARM64.
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2021-06-10 19:54:33 +02:00
Alexandre Julliard 4e74038749 ntdll: Fix some exception test failures on ARM.
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2021-06-10 19:54:33 +02:00
Alexandre Julliard 1bd4473484 ntdll: Create a thread to run the ctrl-C routine instead of raising an exception.
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2021-06-09 23:38:43 +02:00
Roman Pišl a0425b9610 ntdll: Allow loading of native libraries for Win16.
Wine-Bug: https://bugs.winehq.org/show_bug.cgi?id=51224
Signed-off-by: Roman Pišl <rpisl@seznam.cz>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2021-06-08 22:28:44 +02:00
Zebediah Figura a43c000aef ntdll: Introduce IOCTL_WINE_AFD_KEEPALIVE_VALS.
Signed-off-by: Zebediah Figura <z.figura12@gmail.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2021-06-08 10:17:30 +02:00
Zebediah Figura 67959e9663 ntdll: Introduce IOCTL_AFD_WINE_GET_INTERFACE_LIST.
Signed-off-by: Zebediah Figura <z.figura12@gmail.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2021-06-08 10:17:23 +02:00
Alexandre Julliard 050378d4d7 ntdll: Only restore the modified parts of the syscall frame on i386.
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2021-06-07 17:16:21 +02:00
Alexandre Julliard 32f1bfd0f0 ntdll: Only restore the modified parts of the syscall frame on x86-64.
Based on a patch by Jacek Caban.

Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2021-06-07 17:16:21 +02:00
Alexandre Julliard ba5d73d796 ntdll: Validate the extended context before modifying the other registers.
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2021-06-07 13:31:19 +02:00
Robin Ebert b94fe59422 ntdll: Fix a file descriptor leak.
Signed-off-by: Robin Ebert <ebertrobin2002@gmail.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2021-06-04 10:20:46 +02:00
Zebediah Figura 27609da351 ntdll: Introduce IOCTL_AFD_WINE_SIOCATMARK.
Signed-off-by: Zebediah Figura <z.figura12@gmail.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2021-06-03 17:42:19 +02:00
Zebediah Figura 5917d573b6 ntdll: Introduce IOCTL_AFD_WINE_FIONREAD.
Signed-off-by: Zebediah Figura <z.figura12@gmail.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2021-06-03 17:42:19 +02:00
Alexandre Julliard d08f42b68c kernelbase: Move CopyContext() implementation to ntdll.
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2021-06-03 17:42:19 +02:00
Alexandre Julliard 3f1f58f19a ntdll: Use appropriate context constants where possible.
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2021-06-03 13:03:20 +02:00
Zebediah Figura be8bd6f498 ntdll: Introduce IOCTL_WINE_AFD_COMPLETE_ASYNC.
Signed-off-by: Zebediah Figura <z.figura12@gmail.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2021-06-02 20:16:08 +02:00
Alexandre Julliard e5982993ae ntdll: Get rid of signal_init_syscalls().
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2021-06-02 20:16:07 +02:00
Alexandre Julliard 42e42e9085 ntdll: Use a single syscall dispatcher controlled by global flags on i386.
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2021-06-02 20:16:07 +02:00
Alexandre Julliard 3d9cb5e4f8 ntdll: Use a single syscall dispatcher controlled by global flags on x86-64.
Based on a patch by Jacek Caban.

Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2021-06-02 20:16:07 +02:00
Jacek Caban 1b5ea62e8e ntdll: Introduce wine_unix_call.
Signed-off-by: Jacek Caban <jacek@codeweavers.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2021-06-01 18:00:32 +02:00
Alexandre Julliard aa26f96622 ntdll: Get rid of raise_func_trampoline() on x86-64.
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2021-06-01 17:34:30 +02:00
Alexandre Julliard 1cc0649755 ntdll: Store exception jump buffer in the per-thread data.
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2021-06-01 15:16:23 +02:00
Zebediah Figura 10eba9b2e9 Revert "ntdll: Preserve syscall frame when calling async IO system APC.".
This reverts commit 8b8ddffa21.

ws2_32 no longer uses system APCs.

Signed-off-by: Zebediah Figura <z.figura12@gmail.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2021-06-01 09:12:54 +02:00
Roberto Pungartnik c2351cd9b4 ntdll: Fix IOCTL_AFD_WINE_SENDMSG irda member misreference.
Signed-off-by: Roberto Augusto Pungartnik <rpungartnik@gmail.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2021-05-31 11:34:55 +02:00
Francois Gouget dc94b03799 ntdll/tests: Fix the XState AllFeatureSize check on old CPUs.
On old CPUs lacking XSAVEC, Windows 8+ does not set AllFeatureSize and
AllFeatures.

Wine-Bug: https://bugs.winehq.org//show_bug.cgi?id=51188
Signed-off-by: Francois Gouget <fgouget@codeweavers.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2021-05-28 21:54:03 +02:00
Francois Gouget b6d5f976e3 ntdll: Update the STATUS_NO_SUCH_DEVICE error mapping.
Windows 10 >= 1909 returns ERROR_NO_SUCH_DEVICE.

Signed-off-by: Francois Gouget <fgouget@codeweavers.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2021-05-28 21:53:07 +02:00
Zebediah Figura 0a68921936 ntdll: Introduce IOCTL_AFD_WINE_TRANSMIT.
Signed-off-by: Zebediah Figura <z.figura12@gmail.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2021-05-28 21:53:07 +02:00
Zebediah Figura d8968b955c ntdll: Quiet some noisy ETW FIXMEs.
Signed-off-by: Zebediah Figura <z.figura12@gmail.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2021-05-28 10:50:19 +02:00
Alexandre Julliard 543e49397f winebuild: Store all parameters on the stack for syscall thunks on ARM.
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2021-05-27 21:13:18 +02:00
Paul Gofman eefce9dcb9 ntdll/tests: Don't consider zero 'AllFeatures' value in USD broken.
Both variants are observed on different computers with Win10.

Signed-off-by: Paul Gofman <pgofman@codeweavers.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2021-05-27 16:14:47 +02:00
Zebediah Figura 85a615f136 ntdll: Introduce IOCTL_AFD_WINE_SENDMSG.
Signed-off-by: Zebediah Figura <z.figura12@gmail.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2021-05-27 11:34:56 +02:00
Zebediah Figura ac3ec2d955 ntdll: No longer export __wine_locked_recvmsg().
Signed-off-by: Zebediah Figura <z.figura12@gmail.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2021-05-27 11:34:36 +02:00
Zebediah Figura b108c1373a ntdll: Introduce IOCTL_AFD_WINE_RECVMSG.
Signed-off-by: Zebediah Figura <z.figura12@gmail.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2021-05-27 11:34:27 +02:00
Zebediah Figura e634cc7f48 server: Clear FD_OOB instead of FD_READ when receiving OOB data.
Signed-off-by: Zebediah Figura <z.figura12@gmail.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2021-05-27 11:34:27 +02:00
Jacek Caban 1215c2a6b7 ntdll: Use DECLSPEC_HIDDEN for a few more symbols.
Signed-off-by: Jacek Caban <jacek@codeweavers.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2021-05-26 21:29:38 +02:00
Jacek Caban 4e789932c6 ntdll: Make get_machine_wow64_dir static.
Signed-off-by: Jacek Caban <jacek@codeweavers.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2021-05-26 21:29:38 +02:00
Paul Gofman 2fac2e6b32 ntdll/tests: Do not test old xstate structure details in test_user_shared_data().
Fixes test failures on 32 bit Testbot machines.

Signed-off-by: Paul Gofman <pgofman@codeweavers.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2021-05-26 21:29:37 +02:00
Alexandre Julliard a71cb210f1 ntdll: Remove no longer used syswow64 directory string.
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2021-05-26 21:24:53 +02:00
Alexandre Julliard 2b03b2873e ntdll: Free the initial process parameters once they are copied.
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2021-05-25 21:13:00 +02:00
Alexandre Julliard 78cbc26957 ntdll: Fill the Wow64 PEB and process parameters.
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2021-05-25 21:13:00 +02:00
Alexandre Julliard 72ace07c6f ntdll: Pass an extra context arguments to APC functions on 64-bit.
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2021-05-25 21:13:00 +02:00
Alexandre Julliard 8e01e8763b ntdll: Implement NtTestAlert().
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2021-05-25 21:13:00 +02:00
Alexandre Julliard 1364b11fd4 ntdll: Pass the result status to call_user_apc_dispatcher().
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2021-05-25 21:13:00 +02:00
Alexandre Julliard e1716530d9 server: Use a standard user APC also for timers.
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2021-05-25 21:13:00 +02:00
Alexandre Julliard 118bd9fee3 ntdll: Always put the pthread stack at the top of the 64-bit stack if there's one.
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2021-05-25 21:13:00 +02:00
Zebediah Figura 834e2f04c6 ntdll: Implement IOCTL_AFD_POLL.
Wine-Bug: https://bugs.winehq.org/show_bug.cgi?id=50975
Signed-off-by: Zebediah Figura <z.figura12@gmail.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2021-05-25 09:35:23 +02:00
Alexandre Julliard 1e5eee0fc3 ntdll: Fetch the debug channels from the PEB memory block on the PE side.
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2021-05-24 22:03:44 +02:00
Alexandre Julliard d389da0953 ntdll: Store debug options in the PEB memory block.
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2021-05-24 21:37:49 +02:00
Alexandre Julliard 4e8fcc41ca ntdll: Replace __wine_make_process_system by a Wine-specific NtSetInformationProcess() class.
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2021-05-24 18:31:27 +02:00
Daniel Lehman 1bfa845a67 ntdll: Silence clang warning.
Signed-off-by: Daniel Lehman <dlehman25@gmail.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2021-05-24 11:42:37 +02:00
Daniel Lehman cb6a6bb6cf ntdll/tests: Clean up temp file.
Signed-off-by: Daniel Lehman <dlehman25@gmail.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2021-05-24 11:42:37 +02:00
Zebediah Figura b8f4061df0 ntdll: Implement IOCTL_AFD_RECV.
Wine-Bug: https://bugs.winehq.org/show_bug.cgi?id=50366
Signed-off-by: Zebediah Figura <z.figura12@gmail.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2021-05-24 11:34:32 +02:00
Zebediah Figura 5d3fde087a ntdll: Move struct async_fileio to unix_private.h.
Signed-off-by: Zebediah Figura <z.figura12@gmail.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2021-05-24 11:32:59 +02:00
Zebediah Figura 97afac469f ntdll: Avoid accessing the I/O status block in wait_async().
Steam uses WSASend() with completion ports, reusing OVERLAPPED structures as
soon as they are returned from GetQueuedCompletionStatus(). Since completion is
queued during the select request in wait_async(), the I/O status block can be
reused even before the call to NtDeviceIoControl exits.

This works fine with current Wine, because WSASend() doesn't access the I/O
status block after queuing completion. However, a patch that changes it to use
wait_async() like other async requests causes NtDeviceIoControlFile to
consistently return garbage status codes.

Signed-off-by: Zebediah Figura <z.figura12@gmail.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2021-05-24 11:32:28 +02:00
Alexandre Julliard 771e9260f8 ntdll/tests: Only load RtlWow64GetCpuAreaInfo() on 64-bit.
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2021-05-21 18:08:45 +02:00
Paul Gofman ddd161f339 ntdll: Validate job handles at process creation.
Signed-off-by: Paul Gofman <pgofman@codeweavers.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2021-05-20 21:48:57 +02:00
Alexandre Julliard e8a1341f5c ntdll: Add platform-specific helpers for getting/setting the Wow64 context.
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2021-05-18 17:53:30 +02:00
Alexandre Julliard ee0b909f87 ntdll: Export RtlWow64Get/SetThreadContext() on all 64-bit platforms.
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2021-05-18 17:53:30 +02:00
Alexandre Julliard 8eda3fcc68 ntdll: Pass a server context to server_select().
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2021-05-18 17:53:30 +02:00
Alexandre Julliard f04c2bd4f1 ntdll: Make the server context conversion functions generic.
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2021-05-18 17:46:41 +02:00
Zebediah Figura f47a09b917 ntdll/tests: Fix a copy-paste error in an ok message.
Signed-off-by: Zebediah Figura <z.figura12@gmail.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2021-05-18 09:56:43 +02:00
Alexandre Julliard 5ba8f0d73b ntdll: Store the Wow64 context at the top of the 64-bit stack.
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2021-05-17 18:49:09 +02:00
Alexandre Julliard e40eab977a ntdll: Only check the is_wow64 flag on 32-bit platforms.
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2021-05-17 18:49:09 +02:00
Alexandre Julliard a8ff0c12f4 ntdll: Allocate a separate 64-bit stack for Wow64 threads.
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2021-05-17 18:49:09 +02:00
Alexandre Julliard 711bde7cd1 ntdll: Add a helper function to set the thread id.
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2021-05-17 18:49:09 +02:00
Alexandre Julliard 5864bc88de ntdll: Always send the native PEB pointer to the server.
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2021-05-13 16:45:28 +02:00
Alexandre Julliard 4dca2cc797 ntdll: Always send the native TEB pointer to the server.
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2021-05-13 16:45:28 +02:00
Alexandre Julliard d743c1e6c3 server: Send TEB and PEB in the process_init_done request.
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2021-05-13 16:45:28 +02:00
Alexandre Julliard c2be6ecf0b ntdll/tests: Add tests for Wow64 TEB and PEB information.
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2021-05-13 16:45:28 +02:00
Alexandre Julliard d1e90e1537 ntdll/tests: Don't skip all tests if a function is missing.
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2021-05-13 16:45:28 +02:00
Zebediah Figura 07ea3061e2 ntdll: Use %I64x instead of %lx to trace 64-bit values.
Signed-off-by: Zebediah Figura <z.figura12@gmail.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2021-05-13 10:41:03 +02:00
Alexandre Julliard e97a2c4c0f ntdll: Implement RtlWow64GetCpuAreaInfo().
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2021-05-12 16:56:27 +02:00
Rémi Bernon b44fb883b0 ntdll/tests: Check that creating huge thread stacks works.
Signed-off-by: Rémi Bernon <rbernon@codeweavers.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2021-05-07 22:22:49 +02:00
Alexandre Julliard 6f9562db20 ntdll: Only compute the zero_bits mask when needed.
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2021-05-07 22:22:49 +02:00
Alexandre Julliard 40165dfa58 ntdll: RtlCreateUserThread() also takes a zero_bits parameter.
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2021-05-07 22:22:49 +02:00
Alexandre Julliard 6de7fa1bde ntdll: Take the zero_bits parameter into account in NtCreateThreadEx().
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2021-05-07 22:22:49 +02:00
Alexandre Julliard 6a296592aa server: Send the zero_bits parameter for remote NtCreateThreadEx() calls.
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2021-05-07 22:22:49 +02:00
Alexandre Julliard e9bc48e90a ntdll: Force executing IL-only binaries on the native machine.
Wine-Bug: https://bugs.winehq.org/show_bug.cgi?id=51101
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2021-05-07 22:22:49 +02:00
Francois Gouget c021db5a41 ntdll/tests: Fix the speilling of an ok() message.
Signed-off-by: Francois Gouget <fgouget@free.fr>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2021-05-06 19:49:54 +02:00
Alexandre Julliard a7b5786f70 ntdll: Fix the check for the main exe in get_load_order().
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2021-05-06 18:12:37 +02:00
Jacek Caban fdf568aaae ntdll: Inherit tty std input and output in processes attached to Unix console.
Wine-Bug: https://bugs.winehq.org/show_bug.cgi?id=50117
Signed-off-by: Jacek Caban <jacek@codeweavers.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2021-05-05 21:52:23 +02:00
Alexandre Julliard d47a711e98 ntdll: Open the per-application key for load order at startup.
It avoids accessing process parameters after startup.

Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2021-05-05 21:52:22 +02:00
Alexandre Julliard 75b1db42e5 ntdll: Return the full path to start.exe in load_start_exe().
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2021-05-05 21:52:22 +02:00
Alexandre Julliard 87b7132b37 ntdll: Implement RtlFindExportedRoutineByName().
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2021-05-05 21:52:22 +02:00
Alexandre Julliard b35404aa61 include: Disallow wcsncpy() in Wine, similarly to strncpy().
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2021-05-04 21:33:15 +02:00
Alexandre Julliard e85dee1fb7 ntdll: Don't output thread traces to the seh channel.
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2021-05-04 14:28:13 +02:00
Zebediah Figura beef84721d ntdll: Quiet the FIXME for unmapped NTSTATUS values.
Signed-off-by: Zebediah Figura <z.figura12@gmail.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2021-05-04 09:37:33 +02:00
Louis Lenders 1a02b3f1c6 ntdll: Stub RtlQueryProcessPlaceholderCompatibilityMode().
Wine-Bug: https://bugs.winehq.org/show_bug.cgi?id=50026
Signed-off-by: Louis Lenders <xerox.xerox2000x@gmail.com>
Signed-off-by: Zebediah Figura <z.figura12@gmail.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2021-05-03 20:42:29 +02:00
Sven Baars fc8bf8d33d ntdll/tests: Use FindClose() to close handles returned by FindFirstFileW() (Valgrind).
Signed-off-by: Sven Baars <sbaars@codeweavers.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2021-05-03 20:42:29 +02:00
Sven Baars 2d218c924d ntdll: Fix some memory leaks (Valgrind).
Signed-off-by: Sven Baars <sbaars@codeweavers.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2021-05-03 20:42:29 +02:00
Alexandre Julliard d6a7b35669 ntdll: Sort the info classes by numeric value in NtQuerySystemInformation().
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2021-05-03 20:42:29 +02:00
Alexandre Julliard 8b79c8d41f ntdll: Use the native machine id instead of hardcoded values.
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2021-05-03 20:42:29 +02:00
Alexandre Julliard 7cdb88a5d8 include: Update the SYSTEM_PROCESS_INFORMATION structure.
Spotted by Alex Henrie.

Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2021-04-30 22:59:50 +02:00
Rémi Bernon 24d2a65916 ntdll/tests: Remove Qpc(Interrupt|System)TimeIncrement(Shift) checks.
They are not fixed and are updated from time to time (every few secs),
randomly failing the tests on the testbot.

Signed-off-by: Rémi Bernon <rbernon@codeweavers.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2021-04-29 23:37:45 +02:00
Alexandre Julliard 4f8ede8e76 ntdll: Implement RtlWow64IsWowGuestMachineSupported().
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2021-04-29 23:37:45 +02:00
Alexandre Julliard 6c2f19c0a7 ntdll: Implement RtlWow64GetCurrentMachine().
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2021-04-29 23:37:45 +02:00
Alexandre Julliard f2c1470c7c ntdll: Implement RtlWow64GetProcessMachines().
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2021-04-29 23:37:45 +02:00
Alexandre Julliard b5095a1028 ntdll/tests: Fix a test failure on Windows 8.
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2021-04-29 23:37:45 +02:00
Paul Gofman 02e3327f06 ntdll: Implement NtGetNextThread().
Largely based on a patch by Nikolay Sivov for NtGetNextProcess().

Signed-off-by: Paul Gofman <pgofman@codeweavers.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2021-04-29 10:48:59 +02:00
Alexandre Julliard a5aaa41069 makefiles: Install libwine into the architecture-specific directory.
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2021-04-28 11:41:27 +02:00
Alexandre Julliard 2801d6341c makefiles: Install Unix binaries into an architecture-specific directory.
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2021-04-28 11:40:39 +02:00
Alexandre Julliard 620c0818bf ntdll: Check all supported architectures in is_builtin_path().
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2021-04-28 10:25:02 +02:00
Alexandre Julliard 616415a6df ntdll: Store the debug info for the initial thread next to the PEB.
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2021-04-27 16:52:30 +02:00
Alexandre Julliard 789c1db18a ntdll: Allocate TEBs and stacks in the low 2G.
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2021-04-27 16:52:30 +02:00
Alexandre Julliard 6a9e19344d ntdll: Always allocate space for both 32- and 64-bit TEB.
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2021-04-27 16:52:30 +02:00
Alexandre Julliard cda02cdddb ntdll: Always allocate space for both 32- and 64-bit PEB.
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2021-04-27 16:52:30 +02:00
Alexandre Julliard 79a148e1fa ntdll: Add separate helpers for loading pe and so builtins.
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2021-04-27 16:52:30 +02:00
Alexandre Julliard 339ed57643 server: Get rid of the CPU type and functions.
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2021-04-27 10:42:04 +02:00
Alexandre Julliard 308bd35746 server: Store a machine ID instead of a CPU in the context structure.
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2021-04-27 10:40:53 +02:00
Henri Verbeet b9070e1153 ntdll: Clear ret->Buffer on failure in get_env_var() (Valgrind).
Signed-off-by: Henri Verbeet <hverbeet@codeweavers.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2021-04-26 21:34:02 +02:00
Alexandre Julliard 893febda14 makefiles: Install PE fake dlls in the architecture-specific directory.
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2021-04-26 21:34:02 +02:00
Alexandre Julliard f93713b157 ntdll: Support loading builtins from the architecture-specific PE directory.
Based on a patch by Jacek Caban.

Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2021-04-26 21:34:02 +02:00
Alexandre Julliard df1c03a007 ntdll: Fix drive letter of current directory in get_full_path().
Wine-Bug: https://bugs.winehq.org/show_bug.cgi?id=51057
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2021-04-25 16:38:08 +02:00
Gabriel Ivăncescu ec20f767fb ntdll/tests: Test hard linking a file to a different casing of itself or existing target.
Signed-off-by: Gabriel Ivăncescu <gabrielopcode@gmail.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2021-04-23 20:02:07 +02:00
Alexandre Julliard 2e0a96a483 ntdll: Make sure that the virtual heap doesn't overlap the preloader range.
Wine-Bug: https://bugs.winehq.org/show_bug.cgi?id=50963
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2021-04-23 20:02:06 +02:00
Alexandre Julliard 126a14ac9a ntdll: Implement NtQuerySystemInformationEx(SystemSupportedProcessorArchitectures).
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2021-04-23 20:02:06 +02:00
Alexandre Julliard a51f26badf server: Return the process machine from the main exe instead of a CPU flag.
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2021-04-23 20:02:06 +02:00
Alexandre Julliard 96865eb7e7 server: Return a list of supported machines instead of a CPU bitmask.
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2021-04-23 15:17:54 +02:00
Alexandre Julliard 191fd47e38 server: Get rid of the remaining PowerPC support.
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2021-04-23 12:41:45 +02:00
Alexandre Julliard a639db3e8c configure: Stop building libwine on Android.
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2021-04-22 15:50:39 +02:00
Alexandre Julliard 9f2751ca3f ntdll: Remove no longer used defines from the makefile.
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2021-04-22 15:32:44 +02:00
Rémi Bernon b3f6f21d01 ntdll: Make sure unix_name is zero terminated (valgrind).
In nt_to_unix_file_name_no_root.

Signed-off-by: Rémi Bernon <rbernon@codeweavers.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2021-04-22 10:30:52 +02:00
Gijs Vermeulen 2f2cdc8bb1 ntdll: Don't fail when trying to remove the value of a non-existant variable in RtlSetEnvironmentVariable().
Wine-Bug: https://bugs.winehq.org/show_bug.cgi?id=51035
Signed-off-by: Gijs Vermeulen <gijsvrm@gmail.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2021-04-21 22:11:27 +02:00
Gijs Vermeulen 09879590cb ntdll/tests: Refactor RtlSetEnvironmentVariable() tests.
Signed-off-by: Gijs Vermeulen <gijsvrm@gmail.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2021-04-21 22:11:27 +02:00
Alexandre Julliard aaa501fe93 ntdll: Fix buffer allocation size in get_env_var().
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2021-04-21 17:08:06 +02:00
Rémi Bernon 96f5968a65 ntdll: Clear the first ~1MB of stack in signal_start_thread.
Instead of the whole stack.

Stack creation in virtual_alloc_thread_stack and RtlCreateUserStack, as
well as Windows rounding logic, enforce a minimum reserved size of 1MB.

There's a few guard and canary pages used on the bottom, plus a few more
on the top for initial context, and we have to keep a bit of space if we
ever need a stack while doing this, so we clear a bit less than 1MB to
be safe.

Signed-off-by: Rémi Bernon <rbernon@codeweavers.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2021-04-21 09:42:45 +02:00
Rémi Bernon 94dcca8a0e ntdll/tests: Add committed / reserved thread stack sizes tests.
Signed-off-by: Rémi Bernon <rbernon@codeweavers.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2021-04-21 09:35:04 +02:00
Alexandre Julliard 1cf2ae1907 ntdll: Support a full path name in the loadFrom dll redirection entry.
Wine-Bug: https://bugs.winehq.org/show_bug.cgi?id=50978
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2021-04-21 08:55:38 +02:00
Paul Gofman 6e75cc98e8 ntdll: Release IO thread pool object from ioqueue_thread_proc().
Signed-off-by: Paul Gofman <pgofman@codeweavers.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2021-04-20 21:07:09 +02:00
Alexandre Julliard 870340ee60 ntdll: Load libwine before the main image.
Wine-Bug: https://bugs.winehq.org/show_bug.cgi?id=51018
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2021-04-19 20:08:48 +02:00
Alexandre Julliard e436a40e80 ntdll: Don't bother setting the preloader range for fake dlls.
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2021-04-19 18:28:52 +02:00
Alexandre Julliard 55d98c572c ntdll: Use the loadFrom directory to load dlls from the activation context.
Wine-Bug: https://bugs.winehq.org/show_bug.cgi?id=50978
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2021-04-19 15:39:55 +02:00
Alexandre Julliard 8f3383f741 ntdll: Parse the loadFrom attribute in manifest dll elements.
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2021-04-19 15:39:55 +02:00