Commit Graph

489 Commits

Author SHA1 Message Date
Zebediah Figura 0c7dcd9088 ntdll: Return the required length from NtQueryDirectoryObject().
Signed-off-by: Zebediah Figura <zfigura@codeweavers.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2022-04-13 16:25:44 +02:00
Jinoh Kang 731a968003 server: Replace redundant send_socket status fields with force_async boolean field.
The 'status' field of send_socket_request is always either
STATUS_PENDING or STATUS_DEVICE_NOT_READY, and the 'total' field is
always zero.

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

Also, clean up the send_socket handler code a bit.

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

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

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

Signed-off-by: Jinoh Kang <jinoh.kang.kr@gmail.com>
Signed-off-by: Zebediah Figura <zfigura@codeweavers.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2022-03-22 18:38:18 +01:00
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 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
Jinoh Kang 15483b1a12 server: Allow calling async_handoff() with status code STATUS_ALERTED.
If the server detects that an I/O request could be completed immediately
(e.g. the socket to read from already has incoming data), it can now
return STATUS_ALERTED to allow opportunistic synchronous I/O.  The Unix
side will then attempt to perform I/O in nonblocking mode and report
back the I/O status to the server via the new server request
"set_async_direct_result".  If the operation returns e.g. EAGAIN
or EWOULDBLOCK, the client can opt to either abandon the request (by
specifying an error status) or poll for it in the server as usual (by
waiting on the wait handle).

Without such mechanism in place, the client cannot safely perform
immediately satiable I/O operations synchronously, since it can
potentially conflict with other pending I/O operations that have already
been queued.

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:38 +01:00
Jacek Caban f139b06651 server: Store all 64 bits of window id.
Signed-off-by: Jacek Caban <jacek@codeweavers.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2022-02-10 18:15:04 +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
Alexandre Julliard 7d7322671c server: Define a server-side structure for LUID_AND_ATTRIBUTES.
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2022-01-25 11:55:40 +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
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
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
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
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
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 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 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 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 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 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 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 cc63b76833 server: Remove the no longer used pid/tid fields in the init_thread request.
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2021-06-29 15:25:42 +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
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 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 f7ffd71f3c server: Remove the no longer used get_socket_event request.
Signed-off-by: Zebediah Figura <z.figura12@gmail.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2021-06-24 10:27:05 +02:00
Zebediah Figura 5b47e4ac0b server: Remove the no longer used get_socket_info request.
Signed-off-by: Zebediah Figura <z.figura12@gmail.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2021-06-21 10:45:15 +02:00
Zebediah Figura 9827081305 server: Remove the no longer used set_socket_deferred request.
Signed-off-by: Zebediah Figura <z.figura12@gmail.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2021-06-18 10:12:41 +02:00
Zebediah Figura 43e67ebddc server: Remove the no longer used set_socket_event request.
Signed-off-by: Zebediah Figura <z.figura12@gmail.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2021-06-15 20:43:18 +02:00
Zebediah Figura 830fc41fbb server: Do not return the socket state from get_socket_event.
Signed-off-by: Zebediah Figura <z.figura12@gmail.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2021-06-11 10:52:39 +02:00
Zebediah Figura 810a9da935 server: Remove the no longer used enable_socket_event request.
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
Rémi Bernon fc64aa7e7c server: Send HID report data with the WM_INPUT messages.
Wine-Bug: https://bugs.winehq.org/show_bug.cgi?id=50506
Signed-off-by: Rémi Bernon <rbernon@codeweavers.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2021-05-31 12:31:21 +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 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
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 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
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
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 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
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 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 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 828077e3b3 server: Pass the NT process flags to the new_process request.
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2021-04-16 12:07:51 +02:00
Rémi Bernon 6444e4fade server: Remove tid from set_key_state request.
As it is always set to GetCurrentThreadId().

Wine-Bug: https://bugs.winehq.org/show_bug.cgi?id=26269
Wine-Bug: https://bugs.winehq.org/show_bug.cgi?id=27238
Wine-Bug: https://bugs.winehq.org/show_bug.cgi?id=31899
Wine-Bug: https://bugs.winehq.org/show_bug.cgi?id=35907
Wine-Bug: https://bugs.winehq.org/show_bug.cgi?id=45385
Signed-off-by: Rémi Bernon <rbernon@codeweavers.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2021-04-02 22:51:50 +02:00
Rémi Bernon 626870abe2 server: Remove tid from get_key_state request.
And replace it with an async param if we want the global async keystate.

Wine-Bug: https://bugs.winehq.org/show_bug.cgi?id=26269
Wine-Bug: https://bugs.winehq.org/show_bug.cgi?id=27238
Wine-Bug: https://bugs.winehq.org/show_bug.cgi?id=31899
Wine-Bug: https://bugs.winehq.org/show_bug.cgi?id=35907
Wine-Bug: https://bugs.winehq.org/show_bug.cgi?id=45385
Signed-off-by: Rémi Bernon <rbernon@codeweavers.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2021-04-02 22:51:21 +02:00