Commit Graph

351 Commits

Author SHA1 Message Date
Jacek Caban c4dab9b76e server: Block by waiting on context handle in get_thread_context.
Wine-Bug: https://bugs.winehq.org/show_bug.cgi?id=48052
Wine-Bug: https://bugs.winehq.org/show_bug.cgi?id=45546
Signed-off-by: Jacek Caban <jacek@codeweavers.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2020-04-22 16:47:41 +02:00
Jacek Caban aa0c4bb5e7 server: Don't wait for client thread to enter suspended state in set_thread_context.
Signed-off-by: Jacek Caban <jacek@codeweavers.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2020-04-22 16:47:41 +02:00
Jacek Caban 2960a973d1 server: Create thread context object in stop_thread.
Signed-off-by: Jacek Caban <jacek@codeweavers.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2020-04-22 16:47:41 +02:00
Jacek Caban 40e849ffa4 server: Make thread context a server object.
Signed-off-by: Jacek Caban <jacek@codeweavers.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2020-04-22 16:47:41 +02:00
Jacek Caban 80ceafc2a1 server: Don't change cached thread context in set_thread_context.
Let the caller take care of that.

Signed-off-by: Jacek Caban <jacek@codeweavers.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2020-04-22 16:47:41 +02:00
Jacek Caban 89b4bdd6cd server: Don't change context flags in copy_context.
Signed-off-by: Jacek Caban <jacek@codeweavers.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2020-04-22 16:09:37 +02:00
Jacek Caban 234fa118d4 server: Get rid of separate thread suspend_context.
It's always the same as context now.

Signed-off-by: Jacek Caban <jacek@codeweavers.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2020-04-16 22:10:04 +02:00
Jacek Caban 7f9eb22af8 ntdll: Use server_select to pass context to server in send_debug_event.
Signed-off-by: Jacek Caban <jacek@codeweavers.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2020-04-16 22:10:04 +02:00
Jacek Caban dbe7694c53 server: Get rid of no longer needed get_suspend_context and set_suspend_context requests.
Signed-off-by: Jacek Caban <jacek@codeweavers.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2020-04-16 22:10:04 +02:00
Jacek Caban 96cc6950f0 ntdll: Use select request instead of get_suspend_context to transfer context back to client.
Signed-off-by: Jacek Caban <jacek@codeweavers.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2020-04-16 22:10:04 +02:00
Jacek Caban e70b684ded server: Allow passing suspend context in select request.
Signed-off-by: Jacek Caban <jacek@codeweavers.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2020-04-16 22:10:04 +02:00
Piotr Caban 321d26cbb4 server: Use correct clock in select.
Signed-off-by: Piotr Caban <piotr@codeweavers.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2020-04-09 21:04:04 +02:00
Rémi Bernon e2a1f00a38 server: Implement DBG_REPLY_LATER handling.
This flag causes the debug event to be replayed after the target thread
continues. It can be used, after suspending the thread, to resume other
threads and later return to the breaking.

This will help implementing gdb continue/step packets correctly.

Signed-off-by: Rémi Bernon <rbernon@codeweavers.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2020-03-27 21:16:13 +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 9e581ba8c5 server: Improve APC error handling when alloc_handle fails.
Whenever alloc_handle fails, we ignored the error and dequeued the
next APC. This patch makes the loop break whenever the error status
changes.

Note that the APC is still marked as executed although it failed.

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:27:45 +01:00
Nikolay Sivov b0951ba860 ntdll: Add support for querying thread suspend count.
Signed-off-by: Nikolay Sivov <nsivov@codeweavers.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2019-12-03 21:27:14 +01:00
Nikolay Sivov b934f6626e ntdll: Implement thread description as information class.
Signed-off-by: Nikolay Sivov <nsivov@codeweavers.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2019-11-26 16:32:32 +01:00
Jacek Caban c1a32a080f server: Report only one debug event per process at the time.
Instead of one per thread.

Signed-off-by: Jacek Caban <jacek@codeweavers.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2019-08-07 00:12:26 +02:00
Jacek Caban b0ae02bea6 server: Remove no longer needed break_process.
Signed-off-by: Jacek Caban <jacek@codeweavers.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2019-07-05 17:43:49 +02:00
Jacek Caban 7f9faf10c7 ntdll: Implement DbgUiIssueRemoteBreakin.
Signed-off-by: Jacek Caban <jacek@codeweavers.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2019-07-05 17:42:04 +02:00
Nikolay Sivov 19bf03ed4b ntdll: Add NtSuspendProcess()/NtResumeProcess() implementation.
Signed-off-by: Nikolay Sivov <nsivov@codeweavers.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2019-04-19 12:13:36 +02:00
Jacek Caban 4c0e81728f server: Allow creating thread kernel objects.
Signed-off-by: Jacek Caban <jacek@codeweavers.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2019-04-08 19:50:40 +02:00
Jacek Caban b2a546c92d server: Introduce kernel_object struct for generic association between server and kernel objects.
Signed-off-by: Jacek Caban <jacek@codeweavers.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2019-03-26 13:55:15 +01:00
Jacek Caban eea7702eb6 server: Support thread object type.
Signed-off-by: Jacek Caban <jacek@codeweavers.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2019-02-22 14:27:19 +01:00
Alexandre Julliard 0fd450af5b server: Specify the process in which to create a new thread.
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2018-09-20 14:50:48 +02:00
Alexandre Julliard af8f3ae333 server: Move initial thread creation out of the create_process() function.
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2018-09-20 14:50:48 +02:00
Alexandre Julliard 4a328e08ac server: Allow specifying the security descriptor for a new thread.
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2018-09-20 13:06:12 +02:00
Alexandre Julliard f9bd73c4d6 server: Allow creating image mappings for all supported CPU platforms.
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2018-01-30 10:57:00 +01:00
Alexandre Julliard 03d31ea81d server: Only update the modified parts of the context on thread suspend.
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2018-01-22 15:18:48 +01:00
Alexandre Julliard d12717b9a8 server: Add floating point and debug registers to the ARM64 context.
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2017-12-05 20:30:04 +01:00
Alexandre Julliard 4ba0f628f9 server: Add floating point and debug registers to the ARM context.
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2017-12-05 20:30:04 +01:00
Alexandre Julliard 6c61ea6a13 ntdll: Suspend a thread with its start context explicitly before attaching dlls.
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2017-11-30 12:15:51 +01:00
Dmitry Timoshkov 288814a4d8 server: Make it possible to deliver an APC to any thread alive in the process.
Signed-off-by: Dmitry Timoshkov <dmitry@baikal.ru>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2017-11-13 21:14:47 +01:00
Alexandre Julliard cb7f04ce6f server: Don't return debug registers unless explicitly requested.
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2017-09-18 15:50:34 +02:00
Alexandre Julliard abe0b1c57b server: Initialize debug registers in new threads if necessary.
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2017-07-27 17:04:04 +02:00
Alexandre Julliard 9a07d210f1 server: Add a platform-specific entry point to initialize registers of a new thread.
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2017-07-27 17:04:04 +02:00
Alexandre Julliard e0760ce933 server: Call the satisfied methods after removing the thread wait.
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2017-06-28 12:23:35 +02:00
Jacek Caban 5c0e2965bc server: Use stored APC in async_set_result.
Signed-off-by: Jacek Caban <jacek@codeweavers.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2017-04-11 19:58:12 +02:00
Gerald Pfeifer 4598d32ab4 server: Remove dead check in is_cpu_supported().
Signed-off-by: Gerald Pfeifer <gerald@pfeifer.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2017-01-25 17:17:18 +01:00
Jacek Caban ad1e0609a0 server: Get rid of no loner used cancel_async from fd_ops.
Signed-off-by: Jacek Caban <jacek@codeweavers.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2016-12-01 13:50:59 +01:00
Sebastian Lackner bae3dcc295 server: Do not hold reference on parent process.
Signed-off-by: Sebastian Lackner <sebastian@fds-team.de>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2016-04-25 18:48:19 +09:00
Alexandre Julliard f55db7882d server: Add link_name and unlink_name object operations.
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2016-02-04 21:07:19 +09:00
Sebastian Lackner 41f7f19cb5 server: Wake up APC if we fail to allocate a handle in target process.
Signed-off-by: Sebastian Lackner <sebastian@fds-team.de>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2015-11-05 20:22:38 +09:00
Sebastian Lackner 23cdc7e529 server: Unconditionally close APC handle in get_apc_result call.
Signed-off-by: Sebastian Lackner <sebastian@fds-team.de>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2015-10-29 10:59:44 +09:00
Dmitry Timoshkov 3bed65b5a9 server: For querying thread information demand THREAD_QUERY_LIMITED_INFORMATION access. 2015-08-21 14:35:04 +09:00
Dmitry Timoshkov 93e8bea2bd server: Add implicit THREAD_[QUERY|SET]_LIMITED_INFORMATION access. 2015-08-21 14:34:59 +09:00
Sebastian Lackner 905bf79337 server: Store correct entry point for first thread. 2015-07-30 11:37:15 +02:00
Sebastian Lackner 845164004b ntdll: Implement ThreadQuerySetWin32StartAddress info class in NtQueryInformationThread. 2015-07-29 21:44:03 +02:00
Sebastian Lackner 6ab494ceb5 ntdll: Implement ThreadQuerySetWin32StartAddress info class in NtSetInformationThread. 2015-07-29 21:44:03 +02:00
Sebastian Lackner 6156cf3134 server: Use a separate wineserver call to fetch thread times. 2015-07-29 21:44:03 +02:00
Sebastian Lackner 3db6d1acaf server: Avoid sending unexpected wakeup with uninitialized cookie value.
The code for SELECT_SIGNAL_AND_WAIT in select_on() calls signal_object(). This might
wake up the same thread which is currently in the wineserver call. The value for
current->wait->cookie is initialized at the end of the function, and not defined yet
at this point.
2015-07-15 16:29:11 +09:00
André Hentschel 6adcad498c server: Allow 32-bit connections on ARM64. 2015-05-06 08:41:50 +09:00
Alexandre Julliard 8843bc144d server: Allow passing an argument for the user APC async I/O callbacks. 2015-03-03 17:02:03 +09:00
Sebastian Lackner 0e2e9e4efc server: Avoid leaking file descriptor on error in create_thread function. 2014-11-18 14:14:18 +09:00
Sebastian Lackner 749e2aa36f server: Close fd if there is no space in thread inflight fd list. 2014-11-17 17:27:01 +09:00
Sebastian Lackner 35e56fb042 server: Avoid invalid memory access when thread is killed while in wake_up(). (Valgrind). 2014-06-23 10:12:02 +02:00
Marcus Meissner 3068d827da server: Use longer int in bitshift operation (Coverity). 2014-04-17 10:44:14 +02:00
Dmitry Timoshkov 383f7ba002 server: Add THREAD_[SET|QUERY]_LIMITED_INFORMATION to generic access mappings and appropriately change THREAD_ALL_ACCESS. 2014-02-06 17:08:33 +01:00
Dmitry Timoshkov 6e2de14df1 server: Fix generic access mapping for a thread. 2014-02-05 13:49:30 +01:00
Alexandre Julliard 1e78c99388 kernel32: Validate the architecture of newly created processes on the server side. 2013-11-22 12:32:48 +01:00
Alexandre Julliard 93fbb12e65 server: Implement waiting on keyed events. 2013-08-28 11:03:38 +02:00
Alexandre Julliard d4cd051cef server: Store abandoned state as a flag in the wait structure. 2013-08-27 23:48:37 +02:00
Alexandre Julliard 39644bb309 server: Pass a wait queue entry to the signaled/satisfied object functions. 2013-08-27 23:48:36 +02:00
Alexandre Julliard de9f5b33b8 server: Store the wait structure in the wait entry and add an accessor function for the thread. 2013-08-27 23:48:31 +02:00
Alexandre Julliard 947e337480 server: Make signal and wait a separate select operation. 2013-08-26 20:34:28 +02:00
Alexandre Julliard 042e0046d4 server: Make select on all handles a separate operation. 2013-08-26 20:32:52 +02:00
Alexandre Julliard c2ab7a625e server: Add a structure to pass the parameters of a select request. 2013-08-26 20:24:42 +02:00
Dmitry Timoshkov fd76b695b9 server: Set appropriate status for a terminated thread. 2013-05-13 11:10:12 +02:00
Alexandre Julliard ea919d9de4 server: Use strerror instead of perror. 2013-05-07 12:19:22 +02:00
Dmitry Timoshkov af3d73b035 server: Add a process flag indicating whether the process is terminating, use it to block thread creation in a being terminated process. 2013-05-07 11:25:49 +02:00
André Hentschel 0effd926b6 server: Remove SPARC support. 2013-03-05 11:04:07 +01:00
André Hentschel d11e72f925 server: Add ARM64 support. 2013-01-16 12:49:20 +01:00
Alexandre Julliard 6d2063f41b ntdll: Set the thread exit code when a thread is killed inside a wait. 2012-01-16 14:04:39 +01:00
André Hentschel c7becc3015 server: Remove dead initializations (clang). 2011-07-06 11:20:37 +02:00
Alexandre Julliard 055c883ee0 server: Fix the status code for get/set_thread_context on a terminated thread. 2011-05-06 14:23:25 +02:00
Alexandre Julliard 5dc9c73c31 server: Check for the need to suspend a thread again once it leaves an exception or suspend block. 2011-05-06 12:49:57 +02:00
Alexandre Julliard 90982480f0 server: Add support for suspending the thread directly in the get/set_thread_context requests. 2011-05-06 12:40:52 +02:00
Alexandre Julliard 45075b2f9c server: Add separate requests for getting/setting the thread context during suspend. 2011-05-06 12:25:34 +02:00
André Hentschel 417e926a80 server: Remove Alpha support. 2011-04-20 13:10:06 +02:00
Alexandre Julliard 500d77245c server: Retrieve the Unix thread affinity for the initial thread. 2011-04-15 10:07:52 +02:00
André Hentschel ccaeb3ed83 server: Add ARM support. 2010-09-20 12:59:53 +02:00
Alexandre Julliard 3557b9818c server: Avoid a potential server crash when a thread dies on startup. 2010-08-23 19:59:57 +02:00
Alexandre Julliard 5532927ed3 server: Make sure a thread doesn't get freed while it's processing a request. 2010-05-16 12:34:28 +02:00
Alexandre Julliard ac69fcb14f server: Check that the prefix type can support the client architecture. 2010-05-04 20:27:20 +02:00
Alexandre Julliard bbc03d5172 server: Use the prefix architecture instead of the server one to check for WoW processes. 2010-05-04 20:26:53 +02:00
Alexandre Julliard ac08b038f0 server: Initial support for Wow64 registry redirection. 2010-03-02 12:03:17 +01:00
Alexandre Julliard 9ce56b2729 server: Set the initial thread affinity from the process. 2010-02-02 16:12:01 +01:00
Alexandre Julliard 2f3fa8596b server: Allow changing a thread affinity before it is initialized. 2010-02-02 15:58:02 +01:00
Alexandre Julliard a764fe8921 server: Use the correct thread id to set affinity. 2009-11-20 11:44:54 +01:00
Juan Lang bfb4578356 server: A thread's affinity is restricted to the process affinity. 2009-10-01 11:33:33 +02:00
Juan Lang 474b2e4bfb server: Use kernel support for thread affinity when available. 2009-09-30 14:34:32 +02:00
Juan Lang 24036fe13a server: Setting a process's affinity sets all of its threads' affinities too. 2009-09-30 14:34:32 +02:00
Alexandre Julliard fd78e6e3a5 server: Restart at the head of the wait queue when we woke a thread, since this can modify the queue. 2009-06-13 12:20:49 +02:00
Alexandre Julliard 5dcf157b5b server: Hide a window before destroying it if it was still visible. 2009-06-03 11:29:15 +02:00
Alexandre Julliard 5316dd011f server: Define a generic context structure instead of using the platform-specific version. 2009-04-08 19:59:23 +02:00
Alexandre Julliard 279defe66e server: Verify that the client is using a supported CPU type. 2009-04-03 14:59:12 +02:00
Alexandre Julliard 653d2c4a8d server: Store the type of CPU that the client is running on. 2009-04-03 14:49:10 +02:00
Alexandre Julliard b06a919c3c server: Use the thread entry point field to pass the PEB in the initial thread. 2009-04-03 14:30:34 +02:00
Alexandre Julliard 9f365e7705 server: Replace EXCEPTION_RECORD by an explicit definition in debug events. 2009-01-02 20:12:46 +01:00
Alexandre Julliard bc03f0ee39 server: Simplify the debug_event_t structure. 2009-01-02 20:09:25 +01:00