1
0
mirror of https://github.com/wine-mirror/wine synced 2024-07-01 07:14:31 +00:00
Commit Graph

400 Commits

Author SHA1 Message Date
Adam Rehn
2dfeb87f41 wineserver: Report non-zero exit code for abnormal process termination.
Signed-off-by: Adam Rehn <adam@tensorworks.com.au>
2024-06-11 16:51:27 +02:00
Elizabeth Figura
ed297ecba5 server: Inherit the source token's label in token_duplicate().
And assign it in token_create_admin().

Wine-Bug: https://bugs.winehq.org/show_bug.cgi?id=56640
2024-06-06 22:29:56 +02:00
Dmitry Timoshkov
c4c30d4615 server: Remove limitation for waiting on idle_event of the current process.
Signed-off-by: Dmitry Timoshkov <dmitry@baikal.ru>
2024-06-06 20:46:03 +02:00
Paul Gofman
deb273a926 ntdll: Implement NtQuerySystemInformation(SystemProcessIdInformation). 2024-05-01 16:54:00 +02:00
Brendan Shanks
9b4e3718ed server: Replace sprintf with snprintf to avoid deprecation warnings on macOS. 2024-03-28 19:51:35 +01:00
Zebediah Figura
e92ba2de43 server: Create processes using a limited administrator token by default.
Wine-Bug: https://bugs.winehq.org/show_bug.cgi?id=40613
2024-03-08 09:49:52 +01:00
Zebediah Figura
95a91bd816 ntdll: Implement NtSetInformationProcess(ProcessAccessToken). 2024-03-08 09:49:52 +01:00
Rémi Bernon
c43b1ecbc3 server: Keep a list of processes that can receive rawinput messages. 2024-02-28 19:51:20 +01:00
Eric Pouech
9897719562 server: Allow 0-write length in WriteProcessMemory().
Adapt to Win >= 10 behavior.

Wine-Bug: https://bugs.winehq.org/show_bug.cgi?id=56357
Signed-off-by: Eric Pouech <epouech@codeweavers.com>
2024-02-26 22:44:35 +01:00
Rémi Bernon
74bf784b29 server: Use the startup info to connect the process winstation.
This changes the todos in the tests as it fixes the thread input not
being attached, but then exposes a different todo.
2024-02-23 17:11:00 +01:00
Alexandre Julliard
e05c6c8211 server: Don't update the entry point in the image information for ARM64EC modules. 2024-02-08 17:07:22 +01:00
Alexandre Julliard
bd703632fd server: Don't update the machine in the image information for ARM64EC modules. 2024-02-08 13:05:28 +01:00
Eric Pouech
626b2f1898 server: Preserve handle flags when inheriting a std handle.
Signed-off-by: Eric Pouech <epouech@codeweavers.com>
2024-02-06 11:39:58 +01:00
Eric Pouech
82b0bb3c24 server: Separate console and new group flag (CreateProcess).
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>
2023-08-23 17:38:51 +02:00
Alexandre Julliard
4356fe0d83 ntdll: Support the PS_ATTRIBUTE_MACHINE_TYPE attribute for new processes. 2023-05-24 15:43:54 +02:00
Rémi Bernon
37478a8695 server: Set missing error status for get_process_image_name. 2022-11-22 18:27:31 +01:00
Rémi Bernon
a2395ecf96 server: Use the client provided rawinput registered device array. 2022-07-28 20:08:58 +02:00
Eric Pouech
95202ea4da server: Use negative values for console pseudo handles.
Signed-off-by: Eric Pouech <eric.pouech@gmail.com>
Signed-off-by: Jacek Caban <jacek@codeweavers.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2022-04-12 21:39:42 +02:00
Alexandre Julliard
990cc1c64b server: Define a server-side structure for SID.
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2022-01-25 12:32:11 +01:00
Alexandre Julliard
841b8862fb server: Define a server-side structure for ACE.
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2022-01-25 12:21:14 +01:00
Alexandre Julliard
c36f81fa75 server: Define a server-side structure for ACL.
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2022-01-25 12:10:40 +01:00
Alexandre Julliard
14645b06a7 server: Don't return image information for terminating processes.
Fixes a test failure caused by 8eacd3e507.

Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2022-01-03 17:00:24 +01:00
Paul Gofman
8eacd3e507 server: Store PE image info in process structure.
Wine-Bug: https://bugs.winehq.org/show_bug.cgi?id=51829
Signed-off-by: Paul Gofman <pgofman@codeweavers.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2022-01-02 13:53:08 +01:00
Alexandre Julliard
a7ac3de3b3 configure: Assume that sys/socket.h is available on Unix.
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2021-12-09 18:43:51 +01:00
Jinoh Kang
3e2f443003 server: Fix querying debug port with restricted DACL.
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>
2021-12-09 17:14:59 +01:00
Damjan Jovanovic
93852599c2 server: Implement vm counters on FreeBSD.
Signed-off-by: Damjan Jovanovic <damjan.jov@gmail.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2021-11-19 18:59:02 +01:00
Rémi Bernon
c37a6e8e40 server: Wait for process exit more often and using increasing delay.
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>
2021-11-12 22:42:51 +01:00
Huw Davies
6fdae1979b configure: Stop checking for poll.h and sys/poll.h - always use poll.h.
Signed-off-by: Huw Davies <huw@codeweavers.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2021-10-31 17:56:54 +01:00
Paul Gofman
98a5466380 ntdll: Implement SystemExtendedProcessInformation system info class.
Signed-off-by: Paul Gofman <pgofman@codeweavers.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2021-10-27 22:40:50 +02:00
Paul Gofman
b5f3ddd185 ntdll: Return sufficient info size at once from NtQuerySystemInformation(SystemProcessInformation).
Signed-off-by: Paul Gofman <pgofman@codeweavers.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2021-10-27 22:40:50 +02:00
Alexandre Julliard
c954e5b9e6 server: Avoid using wine/port.h.
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2021-10-07 18:03:11 +02:00
Gabriel Ivăncescu
2fe70331d9 ntdll: Implement JobObjectBasicProcessIdList for NtQueryInformationJobObject.
Signed-off-by: Gabriel Ivăncescu <gabrielopcode@gmail.com>
Signed-off-by: Huw Davies <huw@codeweavers.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2021-09-14 21:24:14 +02:00
Alexandre Julliard
b08b4b8213 server: Store the entry point as image-relative in pe_image_info_t.
Wine-Bug: https://bugs.winehq.org/show_bug.cgi?id=51539
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2021-07-30 12:14:30 +02:00
Alexandre Julliard
2b5cefc92e server: Store the session id in the process token.
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2021-07-01 22:34:31 +02:00
Alexandre Julliard
b20cbd0d57 ntdll: Return the session id in NtQuerySystemInformation(SystemProcessInformation).
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2021-07-01 22:34:31 +02:00
Alexandre Julliard
bf4105b731 ntdll: Implement NtQueryInformationProcess(ProcessSessionInformation).
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2021-07-01 22:34:31 +02:00
Alexandre Julliard
ad93413c71 server: Store session id in the process and return it at process init time.
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2021-07-01 22:34:31 +02:00
Zebediah Figura
4cca8b67d0 server: Create linked tokens as impersonation tokens.
Wine-Bug: https://bugs.winehq.org/show_bug.cgi?id=51347
Signed-off-by: Zebediah Figura <z.figura12@gmail.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2021-06-30 18:46:16 +02:00
Alexandre Julliard
2ff7a7676c server: Add a native_machine global variable.
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2021-06-24 11:00:24 +02:00
Paul Gofman
e1c3ee6d51 server: Do not allow parenting non-empty job.
Fixes a regression introduced by 21f5597de4

Signed-off-by: Paul Gofman <pgofman@codeweavers.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2021-05-27 21:24:59 +02:00
Alexandre Julliard
4e8fcc41ca ntdll: Replace __wine_make_process_system by a Wine-specific NtSetInformationProcess() class.
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2021-05-24 18:31:27 +02:00
Paul Gofman
d430efb64a server: Support process job lists.
Signed-off-by: Paul Gofman <pgofman@codeweavers.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2021-05-20 21:48:57 +02:00
Paul Gofman
ddd161f339 ntdll: Validate job handles at process creation.
Signed-off-by: Paul Gofman <pgofman@codeweavers.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2021-05-20 21:48:57 +02:00
Paul Gofman
de0dc0e8ac server: Send completions for existing job processes when adding completion port.
Signed-off-by: Paul Gofman <pgofman@codeweavers.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2021-05-19 10:40:41 +02:00
Paul Gofman
21f5597de4 server: Support nested jobs.
Signed-off-by: Paul Gofman <pgofman@codeweavers.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2021-05-19 10:40:21 +02:00
Alexandre Julliard
5864bc88de ntdll: Always send the native PEB pointer to the server.
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2021-05-13 16:45:28 +02:00
Alexandre Julliard
d743c1e6c3 server: Send TEB and PEB in the process_init_done request.
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2021-05-13 16:45:28 +02:00
Alexandre Julliard
339ed57643 server: Get rid of the CPU type and functions.
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2021-04-27 10:42:04 +02:00
Alexandre Julliard
a51f26badf server: Return the process machine from the main exe instead of a CPU flag.
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2021-04-23 20:02:06 +02:00
Rémi Bernon
769a2616ae server: Track desktop users per thread instead of per process.
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>
2021-04-21 21:00:33 +02:00