Commit Graph

188 Commits

Author SHA1 Message Date
Rémi Bernon 544fd9504a ntdll: Process system APCs while the signals are blocked.
This makes sure that system APC, such as APC_BREAK_PROCESS do not get
interrupted in the middle of their execution, and that the APC
completion notification is always correctly sent back to the caller.

Otherwise DbgBreakProcess sometimes did not return until
WaitForDebugEvent/ContinueDebugEvent are called, because of a race
condition between the APC servicing thread, and the newly created
exception thread.

Signed-off-by: Rémi Bernon <rbernon@codeweavers.com>
Signed-off-by: Jacek Caban <jacek@codeweavers.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2020-02-05 21:28:26 +01:00
Rémi Bernon 2dc99bfb30 ntdll: Handle system APCs in a separate inner loop.
Signed-off-by: Rémi Bernon <rbernon@codeweavers.com>
Signed-off-by: Jacek Caban <jacek@codeweavers.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2020-02-05 21:28:24 +01:00
Rémi Bernon 3ffa355d2b ntdll: Use the status to tell user APC from system APC.
Signed-off-by: Rémi Bernon <rbernon@codeweavers.com>
Signed-off-by: Jacek Caban <jacek@codeweavers.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2020-02-05 21:28:21 +01:00
Rémi Bernon 6cb2336217 ntdll: Reorder code to make the select logic clearer.
The wait_select_reply call may return STATUS_USER_APC/STATUS_KERNEL_APC,
depending on which APC is about to be returned but the apc call will
always be APC_NONE right after the wait. It needs an additional select
request to actually return the call.

Signed-off-by: Rémi Bernon <rbernon@codeweavers.com>
Signed-off-by: Jacek Caban <jacek@codeweavers.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2020-02-05 21:28:18 +01:00
Rémi Bernon 676ad9b0af server: Use STATUS_KERNEL_APC to indicate system APCs.
Signed-off-by: Rémi Bernon <rbernon@codeweavers.com>
Signed-off-by: Jacek Caban <jacek@codeweavers.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2020-02-05 21:28:15 +01:00
Rémi Bernon d03420da12 ntdll: Don't change RtlWaitOnAddress size after user invoke_apc.
This makes the next iteration to immediately return STATUS_SUCCESS
because of compare_addr returning FALSE with size == 0.

Signed-off-by: Rémi Bernon <rbernon@codeweavers.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2020-01-29 20:42:16 +01:00
Francois Gouget 101be282a6 ntdll: Fix the spelling of some comments.
Signed-off-by: Francois Gouget <fgouget@free.fr>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2019-12-12 23:17:05 +01:00
Zebediah Figura 07e86d3c9d ntdll: Try to avoid an unnecessary syscall in fast_release_srw_exclusive().
Signed-off-by: Zebediah Figura <zfigura@codeweavers.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2019-06-11 18:20:31 +02:00
Zebediah Figura e2411ebecb ntdll: Add a futex-based implementation of SRW locks.
Signed-off-by: Zebediah Figura <zfigura@codeweavers.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2019-06-11 18:20:24 +02:00
Zebediah Figura d741296676 ntdll: Remove no longer used interlocked_dec_if_nonzero().
Signed-off-by: Zebediah Figura <zfigura@codeweavers.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2019-06-11 18:19:40 +02:00
Jacek Caban 7ba361b47b ntdll: Add support for returning previous state argument in event functions.
Signed-off-by: Jacek Caban <jacek@codeweavers.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2019-03-12 20:34:35 +01:00
Jacek Caban d3660e5901 ntdll: Fix event op functions declarations.
Signed-off-by: Jacek Caban <jacek@codeweavers.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2019-03-12 20:33:41 +01:00
Paul Gofman ba42efdb14 ntdll: Pass async parameter to add_fd_completion server call.
Signed-off-by: Paul Gofman <gofmanp@gmail.com>
Signed-off-by: Jacek Caban <jacek@codeweavers.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2019-02-21 16:07:07 +01:00
Zebediah Figura be541f1b0c ntdll: Add a direct futex-based implementation of condition variables.
While the current path for condition variables will ultimately use futexes if
they are available, the path for address waits is vulnerable to several
spurious wakes, which can be obviated by using condition variables as futexes
directly.

This greatly improves performance for Path of Exile.

Wine-Bug: https://bugs.winehq.org/show_bug.cgi?id=45524
Signed-off-by: Zebediah Figura <z.figura12@gmail.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2019-02-11 11:52:00 +01:00
Zebediah Figura 954ed39584 ntdll: Reimplement condition variables on top of RtlWaitOnAddress().
Wine-Bug: https://bugs.winehq.org/show_bug.cgi?id=46208
Signed-off-by: Zebediah Figura <z.figura12@gmail.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2019-02-08 22:18:16 +01:00
Zebediah Figura cc8f9b6419 ntdll: Add a futex-based implementation of WaitOnAddress().
Signed-off-by: Zebediah Figura <z.figura12@gmail.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2019-02-06 10:48:04 +01:00
Zebediah Figura 6060d2703c ntdll: Use a critical section to ensure that RtlWaitOnAddress compares and queues atomically.
Currently a wake may occur between calling compare_addr() and performing the
select request; in that case the thread will never be woken. Prevent this by
taking a CS around both operations.

Wine-Bug: https://bugs.winehq.org/show_bug.cgi?id=46099
Signed-off-by: Zebediah Figura <z.figura12@gmail.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2018-12-04 16:13:10 +01:00
Zebediah Figura 0ea963a406 ntdll: Call the select request directly in RtlWaitOnAddress().
Signed-off-by: Zebediah Figura <z.figura12@gmail.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2018-12-04 16:13:10 +01:00
Zebediah Figura e09248d363 ntdll: Don't write more IOCP entries than requested.
Wine-Bug: https://bugs.winehq.org/show_bug.cgi?id=45948
Signed-off-by: Zebediah Figura <z.figura12@gmail.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2018-11-19 10:17:48 +01:00
Zebediah Figura fbde01335f ntdll: Only wait on the completion port if no entries were returned.
Signed-off-by: Zebediah Figura <z.figura12@gmail.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2018-11-19 10:17:48 +01:00
Alexandre Julliard a0050be13f ntdll: Use the default keyed event when the handle is null.
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2018-10-26 12:45:45 +02:00
Daniel Lehman 25acfbb40b ntdll: Implement RtlWaitOnAddress functions.
Signed-off-by: Daniel Lehman <dlehman25@gmail.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2018-10-26 11:16:54 +02:00
Zebediah Figura ef2471ec0f ntdll: Implement NtRemoveIoCompletionEx().
Signed-off-by: Zebediah Figura <z.figura12@gmail.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2018-10-01 19:12:20 -07:00
Alexandre Julliard be40b01c37 server: Align object attributes to a DWORD-boundary.
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2018-09-20 12:59:32 +02:00
Jonathan Doron fbf2631dcb ntdll: Apply owner and group regardless of the SE_OWNER_DEFAULTED or SE_GROUP_DEFAULTED flags.
Signed-off-by: Jonathan Doron <jond@wizery.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2017-09-13 08:41:29 +02:00
Michael Müller 62ae2ae1a1 ntdll: Add stub for JobObjectBasicAccountingInformation and JobObjectBasicProcessIdList.
Signed-off-by: Michael Müller <michael@fds-team.de>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2017-04-24 11:09:46 +02:00
Nikolay Sivov 7de025c970 ntdll: Fix its vs it's typos.
Signed-off-by: Nikolay Sivov <nsivov@codeweavers.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2016-08-01 20:57:23 -05:00
Daniel Lehman 4c89d567f6 ntdll: Remove stub from trace.
Signed-off-by: Daniel Lehman <dlehman25@gmail.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2016-05-05 17:18:32 +09:00
Daniel Lehman ad83e2cd57 ntdll: Add trace for NtQueryEvent/Semaphore.
Signed-off-by: Daniel Lehman <dlehman25@gmail.com>
Signed-off-by: Sebastian Lackner <sebastian@fds-team.de>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2016-05-04 01:03:27 +09:00
Daniel Lehman 7950562e9e ntdll: Fix prev_count from NtReleaseMutant.
Signed-off-by: Daniel Lehman <dlehman25@gmail.com>
Signed-off-by: Sebastian Lackner <sebastian@fds-team.de>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2016-05-04 01:03:27 +09:00
Daniel Lehman 142730ea66 ntdll: Add NtQueryMutant.
Signed-off-by: Daniel Lehman <dlehman25@gmail.com>
Signed-off-by: Sebastian Lackner <sebastian@fds-team.de>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2016-05-04 01:03:26 +09:00
Nikolay Sivov ce093a2acf ntdll: Remove redundant NULL check (Coverity).
Signed-off-by: Nikolay Sivov <nsivov@codeweavers.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2016-02-06 12:26:18 +09:00
Alexandre Julliard 6fe37f35bf ntdll: Add tests for the length of the object attributes structure.
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2016-01-30 00:30:25 +09:00
Alexandre Julliard fe0924625f ntdll: Add a helper to validate attributes in open calls, and use a common pattern in all calls.
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2016-01-29 21:25:11 +09:00
Alexandre Julliard b3064d748b server: Implement NtOpenJobObject.
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2016-01-29 16:38:53 +09:00
Alexandre Julliard 8b2ba27c86 ntdll: Add tests for kernel object names in the various open functions.
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2016-01-29 00:41:30 +09:00
Alexandre Julliard cd6e9c38e4 server: Fix constraints on the length of NT object names.
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2016-01-19 20:48:08 +09:00
Alexandre Julliard 1eb69be36f server: Pass full object attributes in the create_completion request.
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2016-01-18 00:17:30 +09:00
Alexandre Julliard b5245a15a8 server: Pass full object attributes in the create_timer request.
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2016-01-18 00:17:30 +09:00
Alexandre Julliard 4c763a41ee server: Allow the object attributes to be omitted in requests.
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2016-01-16 00:05:57 +09:00
Alexandre Julliard 7350682aa6 server: Store the attributes in the object_attributes structure.
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2016-01-16 00:05:57 +09:00
Alexandre Julliard 3198fb0c1c ntdll: Add a helper function to allocate the full object_attributes structure.
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2016-01-16 00:05:57 +09:00
Michael Müller 75c9da68e2 ntdll: Use helper function for NtWaitForMultipleObjects and NtWaitForSingleObject. 2015-08-24 18:41:34 +09:00
Sebastian Lackner 1050988997 ntdll: Improve stub for NtQueryInformationJobObject. 2015-07-31 12:08:09 +02:00
Andrew Cook 1d359a5827 server: Implement TerminateJobObject. 2015-04-07 23:15:47 +09:00
Andrew Cook 4113fd875c ntdll: Return success for JobObjectBasicUIRestrictions. 2015-04-06 16:06:25 +09:00
Andrew Cook 47ffeaee74 server: Implement io completion messages for job objects. 2015-04-03 00:33:29 +09:00
Andrew Cook ecd41d1de7 server: Implement job limit flags. 2015-04-03 00:33:29 +09:00
Andrew Cook 3affd63b34 server: Implement IsProcessInJob. 2015-04-01 22:34:19 +09:00
Andrew Cook 98132f0364 server: Implement AssignProcessToJobObject. 2015-04-01 22:34:18 +09:00