We were using bit 1 of RTL_USER_PROCESS_PARAMETERS for two different cases:
- rightfully, as a sign to block ctrl-c events from being processed by
handlers (and by default, terminating the process)
- But this was also used to request for the creation of a new process group.
This patch properly separates the two use cases, by using the
ProcessGroupId field in RTL_USER_PROCESS_PARAMETERS (checked that Win10
behaves as this patch in RtlCreateUserProcess wrt.
RTL_USER_PROCESS_PARAMETERS ProcessGroupId usage input/output).
Introduce process_group_id in startup_info_t and use it to pass it to
server. ProcessGroupId field in RTL_USER_PROCESS_PARAMETERS is now properly
set.
Note: this will change some external behavior.
- before this patch, a child process created with Ctrl-C disabled
(ConsoleFlags set), couldn't turn it on as the process was detached
from unix console.
- now, SIGINT handling is moved to kernelbase (and can be turned on/off at
application will),
- when creating a new windows group id, the child will be detached from
unix console, so will no longer receives the SIGINT from ctrl-c in unix
console (if parent was attached to this unix console).
Signed-off-by: Eric Pouech <epouech@codeweavers.com>
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>
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>
Fixes a regression introduced by 21f5597de4
Signed-off-by: Paul Gofman <pgofman@codeweavers.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
As some thread may use a different desktop from their process.
This fixes the user32 win tests, which leaks a desktop that never gets
closed. The test_shell_window test creates a new desktop, which spawns
explorer.exe process, incrementing the desktop user count to 1, then
associates the desktop to a thread, which closes it on exit.
Never the user count is incremented to 2, and closing the thread desktop
doesn't either check whether the desktop process should be terminated.
Reversely, it is possible to create a desktop, associate it with a
thread /and/ a process, and this time the desktop process would be
terminated when the process exits, although the thread may still be
using it.
Tracking the users per thread is more robust and fixes the problem as
set_thread_desktop increments the desktop user count, and thread exit
decrements it.
Signed-off-by: Rémi Bernon <rbernon@codeweavers.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
test_exit_process_async() essentially validates this. The only reason it
currently succeeds (instead of incorrectly returning ERROR_BROKEN_PIPE) is that
due to the use of DuplicateHandle() the source handle is never actually closed.
Signed-off-by: Zebediah Figura <z.figura12@gmail.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>