Commit Graph

2892 Commits

Author SHA1 Message Date
Jacek Caban 30de5feca7 server: Use console_add_queue for console output.
Signed-off-by: Jacek Caban <jacek@codeweavers.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2022-01-24 21:44:51 +01:00
Zebediah Figura 7b32a327f8 server: Allocate enough space for the backslash in dup_nt_name() (Valgrind).
Signed-off-by: Zebediah Figura <zfigura@codeweavers.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2022-01-21 09:23:25 +01:00
Rémi Bernon 095204a9f3 server: Return error when hardware message is too large.
So that the client allocates a larger receive buffer when needed and not
trigger the assert below when setting the reply message data.

Signed-off-by: Rémi Bernon <rbernon@codeweavers.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2022-01-12 17:27:50 +01:00
Zebediah Figura 51e5995d47 server: Avoid reporting POLLOUT on connection failure in poll_single_socket().
Ideally we should be using sock_get_poll_events() and sock_poll_event() instead,
but that seems like an overly risky change for this late in code freeze.

Wine-Bug: https://bugs.winehq.org/show_bug.cgi?id=51442
Signed-off-by: Zebediah Figura <zfigura@codeweavers.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2022-01-07 11:57:00 +01:00
Zebediah Figura 9632048c68 server: Set the event in IOCTL_AFD_EVENT_SELECT if the socket becomes signaled.
Wine-Bug: https://bugs.winehq.org/show_bug.cgi?id=52335
Signed-off-by: Zebediah Figura <zfigura@codeweavers.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2022-01-06 11:34:47 +01:00
Jinoh Kang 9ef5c9c009 server: Reselect only after dequeueing async request.
Otherwise, async_waiting() returns 0, leading the socket object to
believe that the previous async request has not yet been acknowledged.
This results in I/O hang for subsequent reads (until shutdown).

Also, async_destroy() calls async_reselect() only after removing the
async request from the queue.  Make async_set_result() consistent with
this behaviour.

Wine-Bug: https://bugs.winehq.org/show_bug.cgi?id=52332
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-04 18:49:32 +01:00
Alexandre Julliard 14645b06a7 server: Don't return image information for terminating processes.
Fixes a test failure caused by 8eacd3e507.

Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2022-01-03 17:00:24 +01:00
Paul Gofman 8eacd3e507 server: Store PE image info in process structure.
Wine-Bug: https://bugs.winehq.org/show_bug.cgi?id=51829
Signed-off-by: Paul Gofman <pgofman@codeweavers.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2022-01-02 13:53:08 +01:00
Zebediah Figura b1a2238a10 server: Reselect the socket returned from accept_socket().
Wine-Bug: https://bugs.winehq.org/show_bug.cgi?id=52024
Signed-off-by: Zebediah Figura <zfigura@codeweavers.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2021-12-30 23:09:45 +01:00
Zebediah Figura 674d70a611 server: Avoid using the long double type on non-x86 platforms.
We especially may want to support x86 on ARM, where long double is not an 80-bit
type.

Signed-off-by: Zebediah Figura <zfigura@codeweavers.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2021-12-22 10:23:35 +01:00
Eric Pouech 751a3325a6 server/console: Ensure conhost has created the TTY input stream before waiting.
Some PE executables (like mingw's gdb port) just do something like:
- WaitForSingleObject(GetStdHandle(STD_INPUT_HANDLE), INFINITE) and hang
  for ever (the read operations are done *after* the wait operation
  succeeds)
(of course, the real wait operation is more complex, but the problematic
part boils down to that)

This hangs for ever because conhost's main input thread hasn't been started
yet.

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 18:33:45 +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 06fdbd6eda server: Rename the "flags" field of struct poll_req to "mask".
Signed-off-by: Zebediah Figura <zfigura@codeweavers.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2021-12-10 22:00:17 +01:00
Francois Gouget 7afb9b7d0c server: Fix the spelling of a comment.
Signed-off-by: Francois Gouget <fgouget@free.fr>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2021-12-10 22:00:17 +01:00
Alexandre Julliard 411592bf45 configure: Assume that sys/wait.h is available on Unix.
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2021-12-09 18:43:51 +01:00
Alexandre Julliard e5d69d9ee6 configure: Assume that sys/ioctl.h is available on Unix.
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2021-12-09 18:43:51 +01:00
Alexandre Julliard a7ac3de3b3 configure: Assume that sys/socket.h is available on Unix.
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2021-12-09 18:43:51 +01:00
Alexandre Julliard e3001b6a7c configure: Assume that sys/mman.h is available on Unix.
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2021-12-09 18:43:51 +01:00
Alexandre Julliard 7d5af65591 configure: Assume that termios.h is available on Unix.
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2021-12-09 18:43:50 +01:00
Jinoh Kang 3e2f443003 server: Fix querying debug port with restricted DACL.
Today, Wine uses NtQueryInformationProcess/ProcessDebugPort to detect
whether the current process is being debugged.  If it is, the process
issues a breakpoint to yield control to the debugger.

Some debuggers (e.g. latest CDB) appear to create debug handles with
restricted DACL, which causes querying debug port to fail with
STATUS_ACCESS_DENIED.  This results in the debuggee erroneously
skipping the initial breakpoint.

Fix this by not requiring DEBUG_ALL_ACCESS when opening the debug port
object.  Instead, use MAXIMUM_ALLOWED for the access mask.

Wine-Bug: https://bugs.winehq.org/show_bug.cgi?id=52184
Signed-off-by: Jinoh Kang <jinoh.kang.kr@gmail.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2021-12-09 17:14:59 +01:00
Damjan Jovanovic 316a358b0f server: FreeBSD 14-CURRENT's sched_setaffinity() needs _WITH_CPU_SET_T defined.
FreeBSD 14-CURRENT got the non-standard sched_setaffinity() function, but
it uses FreeBSD's cpuset_t type instead of Linux's cpu_set_t (also
non-standard). This breaks the build. We have to define _WITH_CPU_SET_T
before including <sched.h> to get that type named cpu_set_t instead.

Signed-off-by: Damjan Jovanovic <damjan.jov@gmail.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2021-12-07 21:55:16 +01:00
Bernhard Übelacker c488f29122 server: Return ReadDataAvailable value for FilePipeLocalInformation.
Makes Cygwin mintty.exe or script.exe show output, if the
stack issues got worked around.

Wine-Bug: https://bugs.winehq.org/show_bug.cgi?id=47808
Signed-off-by: Bernhard Übelacker <bernhardu@mailbox.org>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2021-12-06 22:55:07 +01:00
Paul Gofman c338a6ff99 ntdll: Support THREAD_CREATE_FLAGS_HIDE_FROM_DEBUGGER thread creation flag.
Signed-off-by: Paul Gofman <pgofman@codeweavers.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2021-12-06 12:20:34 +01:00
Brendan Shanks f6cefaa9e0 server: Remove workarounds for Mac OS X 10.4.
Signed-off-by: Brendan Shanks <bshanks@codeweavers.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2021-12-02 09:50:46 +01:00
Jinoh Kang a4ffa1e7e2 ntdll: Implement NtCompareObjects.
Signed-off-by: Jinoh Kang <jinoh.kang.kr@gmail.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2021-11-29 23:25:46 +01:00
Jinoh Kang 3b37584316 server: Implement the \??\GLOBALROOT symbolic link.
\??\GLOBALROOT is a well-known NT symbolic link that allows applications
to access the NT object manager's root namespace via Win32 APIs.

Signed-off-by: Jinoh Kang <jinoh.kang.kr@gmail.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2021-11-25 21:43:49 +01:00
Damjan Jovanovic 93852599c2 server: Implement vm counters on FreeBSD.
Signed-off-by: Damjan Jovanovic <damjan.jov@gmail.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2021-11-19 18:59:02 +01:00
Ismael Luceno c35df50c30 server: Fix missing include for uid_t.
Explicitly include <sys/types.h> to make uid_t available to users of
server/security.h.

This is a problem on musl, and possibly other non-glibc systems.

Signed-off-by: Ismael Luceno <ismael@iodev.co.uk>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2021-11-15 12:07:44 +01:00
Rémi Bernon c37a6e8e40 server: Wait for process exit more often and using increasing delay.
Instead of waiting for 1s before considering it dead, when most of the
time the process dies quickly, delaying desktop or wineserver shutdown.

Signed-off-by: Rémi Bernon <rbernon@codeweavers.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2021-11-12 22:42:51 +01:00
Alexandre Julliard 37c0f5c690 makefiles: Substitute all defined variables in the main makefile.
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2021-11-10 13:44:44 +01:00
Alexandre Julliard 8dc6987ba5 ntdll: Create a remote thread in DbgUiIssueRemoteBreakin().
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2021-11-09 22:02:54 +01:00
Ziqing Hui 77f1658393 server: Also queue hotkey message for WM_SYSKEYDOWN.
ALT and F10 key generate WM_SYSKEYDOWN message.
They should also have the ability to queue hotkey message.

Signed-off-by: Ziqing Hui <zhui@codeweavers.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2021-11-02 17:09:39 +01:00
Huw Davies 6fdae1979b configure: Stop checking for poll.h and sys/poll.h - always use poll.h.
Signed-off-by: Huw Davies <huw@codeweavers.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2021-10-31 17:56:54 +01:00
Rémi Bernon 75bccf99d1 server: Remove dr7 PTRACE_POKEUSER workaround.
It is needed for Linux Kernel version 4.18, and has been fixed in 4.19.

Also see https://bugzilla.kernel.org/show_bug.cgi?id=200965 for a more
detailed description of the regression and the fix.

Wine-Bug: https://bugs.winehq.org/show_bug.cgi?id=46472
Signed-off-by: Rémi Bernon <rbernon@codeweavers.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2021-10-29 21:24:46 +02:00
Rémi Bernon 4db8cdc267 server: Clear dr7 before setting other registers.
Resetting their length to make sure we pass alignment checks both for
their current values and for the new values we'll write.

Wine-Bug: https://bugs.winehq.org/show_bug.cgi?id=46472
Signed-off-by: Rémi Bernon <rbernon@codeweavers.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2021-10-29 21:24:42 +02:00
Paul Gofman 98a5466380 ntdll: Implement SystemExtendedProcessInformation system info class.
Signed-off-by: Paul Gofman <pgofman@codeweavers.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2021-10-27 22:40:50 +02:00
Paul Gofman b5f3ddd185 ntdll: Return sufficient info size at once from NtQuerySystemInformation(SystemProcessInformation).
Signed-off-by: Paul Gofman <pgofman@codeweavers.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2021-10-27 22:40:50 +02:00
Damjan Jovanovic e224d74a57 server: Use sysctl instead of /proc/curproc/file on FreeBSD.
Signed-off-by: Damjan Jovanovic <damjan.jov@gmail.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2021-10-25 18:50:59 +02:00
Paul Gofman 5f916f7f35 server: Use SO_BINDTODEVICE in bind_to_index() if possible.
Signed-off-by: Paul Gofman <pgofman@codeweavers.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2021-10-18 17:04:01 +02:00
Zebediah Figura e6009c5b55 server: Avoid touching the poll_req structure after calling async_request_complete() (Valgrind).
Fixes: 567beb6b2e
Signed-off-by: Zebediah Figura <zfigura@codeweavers.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2021-10-13 13:05:23 +02:00
Zebediah Figura f393ab2636 server: Zero-initialize rawinput_message structures before passing them to queue_rawinput_message() (Valgrind).
Signed-off-by: Zebediah Figura <zfigura@codeweavers.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2021-10-13 13:05:23 +02:00
Alexandre Julliard 1381be977b server: Add sys/types.h include in a few more files.
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2021-10-11 11:44:02 +02:00
Alexandre Julliard ea2c743668 configure: Define _GNU_SOURCE in config.h.
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2021-10-11 11:22:53 +02:00
Zebediah Figura 567beb6b2e server: Avoid leaking the poll output buffer if the request is terminated irregularly (Valgrind).
Signed-off-by: Zebediah Figura <zfigura@codeweavers.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2021-10-08 11:27:57 +02:00
Zebediah Figura 60dd202fbd server: Do not allocate a connect_req structure for nonblocking sockets (Valgrind).
Signed-off-by: Zebediah Figura <zfigura@codeweavers.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2021-10-08 11:27:52 +02:00
Piotr Caban fd60414fce user32: Fix window style while CBT_CREATEWND hook is called.
Signed-off-by: Piotr Caban <piotr@codeweavers.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2021-10-07 18:03:12 +02:00
Alexandre Julliard c954e5b9e6 server: Avoid using wine/port.h.
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2021-10-07 18:03:11 +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
Alexandre Julliard 93609869c8 server: Avoid mkstemps().
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2021-10-05 11:53:08 +02:00
Alexandre Julliard 6a7c4947a0 server: Avoid using getopt_long().
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2021-10-05 11:53:08 +02:00
Alexandre Julliard 5a19769245 configure: Remove no longer needed poll() checks.
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2021-10-04 15:26: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
Zebediah Figura c3b32dbccf server: Factor out a complete_async_poll() helper.
Signed-off-by: Zebediah Figura <zfigura@codeweavers.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2021-09-23 10:27:33 +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 cc7e3ec8e2 server: Create pseudo-fds as initially signaled.
Signed-off-by: Zebediah Figura <zfigura@codeweavers.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2021-09-14 18:30:29 +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
Zebediah Figura 4a73fbbd40 server: Do not signal completion if the async failed synchronously.
Signed-off-by: Zebediah Figura <zfigura@codeweavers.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2021-09-13 11:33:22 +02:00
Zebediah Figura 097685aa9e ntoskrnl: Report separately whether an IRP was marked pending.
Signed-off-by: Zebediah Figura <zfigura@codeweavers.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2021-09-13 11:33:19 +02:00
Zebediah Figura 484b78bda0 ntoskrnl: Report the initial status of an IRP separately from the IOSB status.
Based on a patch by Chip Davis.

Wine-Bug: https://bugs.winehq.org/show_bug.cgi?id=30155
Signed-off-by: Zebediah Figura <zfigura@codeweavers.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2021-09-13 11:32:18 +02:00
Zebediah Figura 69ea35a954 ntoskrnl: Report IRP completion via get_next_device_request if possible.
Although there is arguably an advantage to saving a server request, the impetus
for this patch is make it easier for the server to process the IRP return status
before (or at the same time as) it processes the IOSB status. This allows
simpler handling of the case where the IRP handler returns STATUS_PENDING but
completes the IRP before returning.

Signed-off-by: Zebediah Figura <zfigura@codeweavers.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2021-09-13 11:31:17 +02:00
Zebediah Figura a1c42293a2 server: Don't wake up always-blocking asyncs.
Signed-off-by: Zebediah Figura <zfigura@codeweavers.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2021-09-09 22:30:45 +02:00
Zebediah Figura 386c4bcf2f server: Use a separate field to track whether an async is blocking.
Signed-off-by: Zebediah Figura <zfigura@codeweavers.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2021-09-09 22:30:45 +02:00
Zebediah Figura 32347fcf08 server: Queue a cancel IRP in the device file cancel_async callback.
Signed-off-by: Zebediah Figura <zfigura@codeweavers.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2021-09-09 22:30:45 +02:00
Zebediah Figura 4f1c7ba5f9 server: Cancel asyncs through fd_ops.
Signed-off-by: Zebediah Figura <zfigura@codeweavers.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2021-09-09 22:30:45 +02:00
Zebediah Figura 08eaf8f481 server: Make sure that async_request_complete() is called in the case of a failed connection as well.
Wine-Bug: https://bugs.winehq.org/show_bug.cgi?id=51726
Signed-off-by: Zebediah Figura <zfigura@codeweavers.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2021-09-07 10:16:27 +02:00
Zebediah Figura dd9eacff4e server: Fill the TimeZoneBias member of KSHARED_USER_DATA.
Signed-off-by: Zebediah Figura <zfigura@codeweavers.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2021-09-06 14:53:27 +02:00
Zebediah Figura 09dd801291 server: Add helper functions to perform atomic stores.
Signed-off-by: Zebediah Figura <zfigura@codeweavers.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2021-09-06 14:53:11 +02:00
Zebediah Figura b1e4d920c3 server: Return void from the ioctl callback.
Signed-off-by: Zebediah Figura <zfigura@codeweavers.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2021-09-03 23:19:43 +02:00
Zebediah Figura a36e2769c9 server: Return void from the flush callback.
Signed-off-by: Zebediah Figura <zfigura@codeweavers.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2021-09-03 23:19:41 +02:00
Zebediah Figura 377d18c7b1 server: Return void from the write callback.
Signed-off-by: Zebediah Figura <zfigura@codeweavers.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2021-09-03 23:19:41 +02:00
Zebediah Figura 6d49991188 server: Return void from the read callback.
Signed-off-by: Zebediah Figura <zfigura@codeweavers.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2021-09-03 23:19:40 +02:00
Zebediah Figura 6cc36a46ff server: Return void from the get_volume_info callback.
Signed-off-by: Zebediah Figura <zfigura@codeweavers.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2021-09-03 23:19:39 +02:00
Zebediah Figura 15b8f91e24 server: Check the status code to determine whether the async has failed.
Instead of manually specifying success or failure.

Based on test_return_status() in ntoskrnl. The changes in this patch don't
affect device IRPs, but the tests show the heuristic that Windows uses, and in
practice it turns out to be correct for all known asyncs.

Signed-off-by: Zebediah Figura <zfigura@codeweavers.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2021-09-03 23:19:36 +02:00
Zebediah Figura 285700a526 server: Mark the async as pending in IOCTL_AFD_EVENT_SELECT.
Signed-off-by: Zebediah Figura <zfigura@codeweavers.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2021-09-03 21:43:04 +02:00
Zebediah Figura be3ff3d658 server: Mark the async as pending in IOCTL_AFD_BIND.
Signed-off-by: Zebediah Figura <zfigura@codeweavers.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2021-09-03 21:43:04 +02:00
Zebediah Figura dd58bf9ce2 server: Use a separate function and flag to communicate that the initial status of an async is not known yet.
Mostly just to simplify the interface, so that we don't need to use the return
value to communicate this.

Signed-off-by: Zebediah Figura <zfigura@codeweavers.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2021-09-03 21:43:04 +02:00
Zebediah Figura 298a1b296b server: Move the STATUS_ALERTED logic from async_request_complete() to async_terminate().
In particular, don't mark asyncs with output data as "alerted", i.e.
restartable.

Signed-off-by: Zebediah Figura <zfigura@codeweavers.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2021-09-02 10:23:12 +02:00
Zebediah Figura 19d3923975 server: Use async_request_complete() in message_queue_read().
Signed-off-by: Zebediah Figura <zfigura@codeweavers.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2021-09-02 10:23:00 +02:00
Zebediah Figura 559a8cea57 server: Add a helper to call async_request_complete() while allocating new memory.
Signed-off-by: Zebediah Figura <zfigura@codeweavers.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2021-09-02 10:22:49 +02:00
Zebediah Figura 96593370cd server: Introduce a helper to fill an iosb and terminate the async.
For convenience, and to centralize the STATUS_ALERTED logic into one place.

Signed-off-by: Zebediah Figura <zfigura@codeweavers.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2021-09-02 10:22:16 +02:00
Zebediah Figura fd4e7703e9 server: Do not create an iosb for IRP calls not associated with an async.
Signed-off-by: Zebediah Figura <zfigura@codeweavers.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2021-09-02 10:21:18 +02:00
Zebediah Figura c4682cd928 server: Allow completing non-alerted asyncs with STATUS_PENDING.
Signed-off-by: Zebediah Figura <zfigura@codeweavers.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2021-09-02 10:20:47 +02:00
Zebediah Figura 0f332fc039 server: Allow calling async_terminate() with STATUS_PENDING.
We still don't quite handle this completely correctly, but we should at least
avoid crashing the server due to a failed assertion.

Signed-off-by: Zebediah Figura <zfigura@codeweavers.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2021-09-02 10:20:39 +02:00
Zebediah Figura 6cb5f66079 server: Use a simple boolean to track whether the async has been terminated.
Signed-off-by: Zebediah Figura <zfigura@codeweavers.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2021-09-01 10:00:19 +02:00
Zebediah Figura da838c2ae5 server: Use a separate field to track whether the async has been alerted.
Signed-off-by: Zebediah Figura <zfigura@codeweavers.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2021-09-01 10:00:11 +02:00
Zebediah Figura 8e7a5ec817 server: Use async->iosb->status instead of async->status in async_satisfied().
Signed-off-by: Zebediah Figura <zfigura@codeweavers.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2021-09-01 10:00:06 +02:00
Zebediah Figura be07015407 server: Do not call async_terminate() when restarting an already terminated async.
At best this is a no-op. At worst this will emit an extra APC_ASYNC_IO where
the termination (e.g. cancellation) should already have emitted one.

Signed-off-by: Zebediah Figura <zfigura@codeweavers.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2021-09-01 09:59:48 +02:00
Zebediah Figura e4a2bca47b server: Remove the async from the queue in async_set_result().
Signed-off-by: Zebediah Figura <zfigura@codeweavers.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2021-09-01 09:59:33 +02:00
Luke Deller a87bafc5b9 server: Implement file access hints using posix_fadvise.
Signed-off-by: Luke Deller <luke@deller.id.au>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2021-08-24 20:51:42 +02:00
Zebediah Figura d4b13ef9d6 server: Remove a redundant NULL check for async->fd.
If the async has not been terminated yet, async->fd cannot be NULL.

Signed-off-by: Zebediah Figura <zfigura@codeweavers.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2021-08-23 11:51:26 +02:00
Zebediah Figura 10ca57f4f5 server: Remove support for waiting on an IRP object.
This was initially used to let the client wait on IRP completion;
c56c42ff79 changed it to use the async handle
instead.

Signed-off-by: Zebediah Figura <zfigura@codeweavers.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2021-08-23 11:49:44 +02:00
Alexandre Julliard d9ca9d455e server: Also set extended registers from the native context even in Wow64 mode.
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2021-08-19 15:20:19 +02:00
Zebediah Figura eec47af638 ws2_32: Properly implement getsockopt(SO_CONNECT_TIME).
Signed-off-by: Zebediah Figura <zfigura@codeweavers.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2021-08-19 11:33:47 +02:00
Huw Davies 68b840953d server: Remove check for macOS version < 10.5.
Our stated minimum requirement is 10.8.

Signed-off-by: Huw Davies <huw@codeweavers.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2021-08-19 11:16:59 +02:00
Alexandre Julliard 6c478c304c server: Set YMM registers from the native context even in Wow64 mode.
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2021-08-17 18:16:49 +02:00
Zebediah Figura 70e95447f9 server: Create the special Perflib\009 key.
Signed-off-by: Zebediah Figura <zfigura@codeweavers.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2021-08-10 17:53:55 +02:00
Zebediah Figura acc1861ed0 server: Fix the parameter size check for IOCTL_AFD_EVENT_SELECT.
Signed-off-by: Zebediah Figura <zfigura@codeweavers.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2021-08-10 17:53:55 +02:00
Francois Gouget a716b13974 server: Remove obsolete synthesized formats in release_clipboard().
Synthesized formats must be removed too if the format they depend on has
been removed.

Wine-Bug: https://bugs.winehq.org/show_bug.cgi?id=51496
Signed-off-by: Francois Gouget <fgouget@codeweavers.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2021-08-10 17:53:55 +02:00
Alexandre Julliard b08b4b8213 server: Store the entry point as image-relative in pe_image_info_t.
Wine-Bug: https://bugs.winehq.org/show_bug.cgi?id=51539
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2021-07-30 12:14:30 +02:00