@jacek sorry I somehow missed your comment on the other MR
I'm not sure I like the patch as is...
- I wonder if kernelbase.CtrlRoutine should only be called for CUI programs... MSDN doc is as usual imprecise (it speaks about all descendants, and all descendants attached to the same console)
- quick test show that a GUI process isn't killed by GenerateConsoleCtrlEvent
+ tested parent + console, cp_flags=0 and pgid = parent's pgid
+ tested parent + console, cp_flags=detached + new group, pgid = child.id
=> it doesn't fully anwser whether CtrlRoutine is called or not for GUI
- it assumes pgid are inherited for gui (but we don't have proper tests AFAICT)
moreover it means that we'd want two different behaviors when receiving SIGINT (whether it's a genuine unix signal or one sent by the server if we follow the tests result above)
perhaps, the solution would be in the default_ctrl_handler to only terminate the program if attached to a console, or in the program group of a unix console
remark: Wine unix console is the sole case where launching a GUI program from command line doesn't return immediately to prompt (native & builtin cmd implementation only wait on CUI programs completion). But that's conform to unix behavior.
note: I'm not even sure tweeking with setsid whould be useful as anyway the unix console is in raw mode, so only conhost regenerates the signals
--
https://gitlab.winehq.org/wine/wine/-/merge_requests/3312#note_39749
CFI directives allow the context stored on the stack by raise_func_trampoline
to be used to unwind to any exception handlers as required when dispatching
an exception. As the dispatcher may change its input context in e.g.
BTCpuResetToConsistentState and these changes also need to be used when
unwinding make sure to pass this copy of the context to
KiUserExceptionDispatcher as opposed to the copy initially stored on the stack,
which is not taken into account when unwinding.
--
v2: ntdll: Avoid storing a second ctx copy in the aarch64 raise trampoline
ntdll: Add aarch64 DWARF register definitions.
https://gitlab.winehq.org/wine/wine/-/merge_requests/3365
What about my suggestion from !3290? Something like the attached [patch](/uploads/86c669e3c725b4f009338e80379552f4/patch.diff) should make it work, but we'd probably need some adjustments to `setsid` heuristics as well.
--
https://gitlab.winehq.org/wine/wine/-/merge_requests/3312#note_39734