Rafał Harabień
77481d36d3
ntdll: Allow getting/setting x86_64 context of x86 processes in wine64.
...
WoW64 process has two separate contexts:
- x86 context used most of the time (e.g. by application code)
- x86_64 context used by system when it quits x86 emulation and jumps to
the kernel code
A notable exception are debug registers - their state is shared. Some
debuggers make use of that fact and sets/gets debug registers of x86
processes using x86_64 thread context.
Add support for setting and getting debug registers using x86_64
thread context. Getting other registers is allowed too and will return
values from x86 thread context.
Fixes hardware breakpoints in IDA 7.0 disassembler (x86_64 app) when
debugging x86 (32 bit) applications.
Signed-off-by: Rafał Harabień <rafalh92@outlook.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2021-03-09 21:33:43 +01:00
Dmitry Timoshkov
050dc49b38
server: Set error to STATUS_UNSUCCESSFUL when the server fails to queue APC for a thread.
...
I've left another case of returning STATUS_PROCESS_IS_TERMINATING since
that's not covered by the tests.
Wine-Bug: https://bugs.winehq.org/show_bug.cgi?id=50704
Signed-off-by: Dmitry Timoshkov <dmitry@baikal.ru>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2021-03-03 21:54:44 +01:00
Zebediah Figura
44fc44880f
server: Always set the async result when the APC object is destroyed.
...
This can happen if the async is terminated while there is no thread to queue
the APC to (as in the relevant test), or if the client dies before getting the
APC, or before transferring the APC results back to the server.
This also fixes a leak of async objects present since 61abc500f5
. If a process
dies while accept asyncs are pending, the asyncs will be terminated but will
not find a valid thread to queue the APC to, and thus async_set_result() and
the completion callback are never called.
Signed-off-by: Zebediah Figura <z.figura12@gmail.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2021-02-25 08:54:41 +01:00
Alexandre Julliard
584427fc89
server: Avoid redefining the DuplicateHandle() constants.
...
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2021-02-16 21:20:47 +01:00
Alexandre Julliard
d6ef9401b3
server: Use the object type information to implement access mapping.
...
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2021-02-05 22:53:46 +01:00
Alexandre Julliard
4d646de90d
server: Add generic mapping masks for all object types.
...
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2021-02-05 15:38:22 +01:00
Alexandre Julliard
c6f2aacb57
server: Add a type descriptor to all server objects.
...
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2021-02-04 21:25:32 +01:00
Alexandre Julliard
d514c64a8c
server: Move the ldt_copy pointer to the init_first_thread request.
...
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2021-02-02 10:26:20 +01:00
Alexandre Julliard
44699c324f
server: Add a separate request to initialize the first thread of a process.
...
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2021-02-02 10:22:56 +01:00
Alexandre Julliard
2b6426da65
server: Don't store the debug object in the debugger thread.
...
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2021-02-01 16:48:09 +01:00
Alexandre Julliard
7999af8244
ntdll: Implement NtWaitForDebugEvent().
...
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2021-02-01 16:48:09 +01:00
Alexandre Julliard
c1a042cefb
server: Rename debug_ctx to debug_obj.
...
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2021-01-27 10:39:25 +01:00
Paul Gofman
419abd49a1
ntdll: Support AVX registers for other thread in Nt{Get|Set}ContextThread().
...
Signed-off-by: Paul Gofman <pgofman@codeweavers.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2020-10-13 22:30:05 +02:00
Alexandre Julliard
2e51f9aae3
server: Add an object operation to retrieve an object name.
...
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2020-09-22 16:55:08 +02:00
Zebediah Figura
1ff8fe20bf
server: Remove no longer used snapshot requests.
...
Signed-off-by: Zebediah Figura <zfigura@codeweavers.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2020-07-07 19:24:27 +02:00
Alexandre Julliard
64731a8e9f
ntdll: Fix a few more thread information access rights.
...
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2020-06-30 11:05:53 +02:00
Rémi Bernon
e1e34cdc37
ntdll: Correctly implement ThreadHideFromDebugger.
...
At least, store the thread information, instead of pretending and
failing to correctly validate handles and access rights.
Signed-off-by: Rémi Bernon <rbernon@codeweavers.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2020-06-30 11:05:53 +02:00
Changping Yu
59ce4e3eb8
kernel32: Adjust thread creation insertion order.
...
Signed-off-by: Changping Yu <dead.ash@hotmail.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2020-06-29 21:07:43 +02:00
Sebastian Lackner
847b93c740
ntdll: Implement NtQueryInformationThread(ThreadTimes) using procfs.
...
Based on a patch by Ray Hinchliffe <ray@pobox.co.uk>.
Wine-Bug: https://bugs.winehq.org/show_bug.cgi?id=20230
Signed-off-by: Zebediah Figura <z.figura12@gmail.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2020-06-29 19:51:46 +02:00
Alexandre Julliard
42bd67b576
ntdll: Don't call terminate_thread request if not necessary.
...
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2020-05-29 16:17:32 +02:00
Jacek Caban
341068aa61
server: Delay setting system registers until suspending select is waken.
...
Signed-off-by: Jacek Caban <jacek@codeweavers.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2020-04-28 22:05:42 +02:00
Jacek Caban
e5a9c256ce
server: Don't try to synchronize system registers on not initialized threads in get_thread_context request.
...
Signed-off-by: Jacek Caban <jacek@codeweavers.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2020-04-28 22:05:36 +02:00
Jacek Caban
c3fac6e36c
server: Fix setting context flags in get_thread_context.
...
Wine-Bug: https://bugs.winehq.org/show_bug.cgi?id=49011
Signed-off-by: Jacek Caban <jacek@codeweavers.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2020-04-27 11:30:30 +02:00
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