Commit Graph

85 Commits

Author SHA1 Message Date
Jacek Caban 5b56bad50b server: Make window struct a server object.
Signed-off-by: Jacek Caban <jacek@codeweavers.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2022-02-09 18:37:32 +01:00
Alexandre Julliard 1381be977b server: Add sys/types.h include in a few more files.
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2021-10-11 11:44:02 +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
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
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
Paul Gofman ae106feed2 server: Do not dereference symlinks specified as root directory.
Signed-off-by: Paul Gofman <pgofman@codeweavers.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2020-11-26 23:25:38 +01:00
Zebediah Figura fa1b0fcf6c server: Check duplicated handle access against the calling thread token and target process token.
Signed-off-by: Zebediah Figura <z.figura12@gmail.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2020-09-24 15:22:36 +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
Huw Davies aec5ccfc06 server: Don't allow an empty desktop name.
Signed-off-by: Huw Davies <huw@codeweavers.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2020-06-24 18:34:15 +02:00
Alexandre Julliard 7b41b7510f server: Add a helper function for splitting a path into individual elements.
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2020-03-24 19:43:38 +01:00
Paul Gofman 74a74556dd server: Support creating processes with specified parent.
Wine-Bug: https://bugs.winehq.org/show_bug.cgi?id=47817
Signed-off-by: Paul Gofman <gofmanp@gmail.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2019-12-13 13:13:36 +01: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
Alexandre Julliard 3ea7f7d2f4 server: Set the security descriptor at object creation.time.
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2016-02-12 23:07:30 +09:00
Alexandre Julliard ff9d90bbb0 server: Use a standard object for object attribute roots instead of a directory.
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2016-02-12 23:07:30 +09:00
Alexandre Julliard 7ad32cf56a server: Allow lookup_name to distinguish the case of an empty path.
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2016-02-09 20:36:16 +09:00
Alexandre Julliard 7a5b14d456 server: Add a function to open a named object inside any parent, not only directories.
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2016-02-08 16:55:00 +09:00
Alexandre Julliard 0458a7d0e3 server: Use the lookup_name operation when creating a named object.
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2016-02-08 14:24:15 +09:00
Alexandre Julliard e2ccc978a3 server: Implement the lookup_name operation for window stations.
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2016-02-08 14:10:39 +09:00
Alexandre Julliard b21a324070 server: Use the link_name operation to create named objects.
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2016-02-05 00:20:01 +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
Alexandre Julliard a69d7b29e3 server: Don't return an error if the created window station already exists.
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2016-02-02 21:47:56 +09:00
Alexandre Julliard 34d5994953 user32: Add some tests for window station and desktop object names.
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2016-02-01 17:53:35 +09:00
Alexandre Julliard 008f14f03f server: Directly return a structure in get_req_unicode_str().
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2016-01-29 21:25:12 +09:00
Alexandre Julliard ed268bbf91 server: Use a common helper function to implement open object calls.
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2016-01-29 21:25:12 +09:00
Sebastian Lackner df39830846 server: Fix invalid memory accesss caused by destroying winstation before desktop.
Signed-off-by: Sebastian Lackner <sebastian@fds-team.de>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2016-01-22 16:40:30 +09:00
Alexandre Julliard d15f47412e server: Always print the full path of objects when dumping them.
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2016-01-22 01:26:15 +09:00
Alexandre Julliard fcc977c139 server: Store the desktop object names inside their window station.
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2016-01-20 22:40:58 +09:00
Alexandre Julliard 546289dc59 server: Create window stations objects in a standard directory.
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2016-01-20 22:02:03 +09:00
Sebastian Lackner 19a3f6b5cb user32: Make sure explorer.exe process is spawned for the correct desktop.
If an invalid combination of winstation/desktop is active for the
current process, the handle inheritance doesn't work, and no desktop is
created.

Signed-off-by: Sebastian Lackner <sebastian@fds-team.de>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2015-12-04 13:22:55 +09:00
Qian Hong ca4b3f0f73 server: Fixed winstation object leak in open_input_desktop. 2013-11-11 13:27:27 +01:00
Qian Hong f7835dea2d user32: Implement OpenInputDesktop. 2013-11-08 16:29:44 +01:00
Alexandre Julliard be417d6890 server: When changing a process desktop, start the close timeout on the old desktop if necessary. 2013-04-30 18:44:46 +02:00
Vincent Povirk 4c83138f72 server: Implement RegisterHotKey/UnregisterHotKey. 2011-06-21 14:51:08 +02:00
Alexandre Julliard 85358b10f3 server: Add a more general way of posting messages to the desktop window. 2011-04-05 13:36:56 +02:00
Alexandre Julliard c64c36f573 server: Store all desktop cursor information in a separate structure. 2011-03-31 19:54:22 +02:00
Alexandre Julliard 06b78feade server: Store the global key state in the server. 2011-02-25 13:50:25 +01:00
Alexandre Julliard 02e8174067 server: Store the cursor clip rectangle in the server. 2011-02-25 13:50:19 +01:00
Alexandre Julliard 183c41b49a server: Store the global cursor position in the server. 2011-02-25 11:25:15 +01:00
Alexandre Julliard ac4aac747c server: Make the foreground thread input per-desktop instead of global. 2011-02-25 11:19:46 +01:00
Alexandre Julliard 60efdd55ea server: Don't set last error in close_handle(), return the error code instead. 2009-12-01 13:59:41 +01:00
Alexandre Julliard 81e6edbda9 server: Add support for a top-level message parent window in parallel to the desktop window. 2008-06-25 14:43:39 +02:00
Alexandre Julliard a789375f8b server: Don't touch the users count when a system process switches desktops. 2008-05-05 21:02:34 +02:00
Maarten Lankhorst 3fd1fc7600 server: Make enum_desktop enumerate all the desktops on the window station with the DESKTOP_ENUMERATE right. 2008-04-17 14:32:01 +02:00
Maarten Lankhorst 81069001ea server: Make enum_winstations enumerate all the window stations with WINSTA_ENUMERATE right. 2008-04-17 13:22:50 +02:00
Maarten Lankhorst 70a6495a31 user32: Implement BroadcastSystemMessage. 2008-04-03 12:00:02 +02:00
Alexandre Julliard 34fe91bf2b user32: Implemented EnumDesktopWindows. 2008-03-19 11:13:46 +01:00
Maarten Lankhorst 8b164ce484 server: Fix reference leak in enum_desktop. 2008-03-07 11:01:07 +01:00