Sweden-Number/server
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
..
Makefile.in server: Use l_intl.nls for case mappings. 2020-11-27 18:28:35 +01:00
async.c server: Use a callback to free the accept_req structure. 2021-02-10 15:35:46 +01:00
atom.c server: Remove support for process-local handle tables. 2021-02-16 11:13:41 +01:00
change.c server: Do not forbid closing fd handles in other processes. 2021-03-23 12:29:10 +01:00
class.c server: Ignore low word of a class instance when looking up for a window class. 2020-02-27 23:34:51 +01:00
clipboard.c server: Use the object type information to implement access mapping. 2021-02-05 22:53:46 +01:00
completion.c server: Use the object type information to implement access mapping. 2021-02-05 22:53:46 +01:00
console.c server: Do not forbid closing fd handles in other processes. 2021-03-23 12:29:10 +01:00
debugger.c server: Report load dll events upon mapping a SEC_IMAGE view. 2021-02-11 16:31:30 +01:00
device.c ntoskrnl.exe: Implement volume information queries for device files. 2021-02-15 16:20:42 +01:00
directory.c server: Add a request to return all object types. 2021-02-05 22:53:46 +01:00
event.c server: Make pulse_event() static. 2021-03-18 22:04:01 +01:00
fd.c server: Do not forbid closing fd handles in other processes. 2021-03-23 12:29:10 +01:00
file.c server: Do not forbid closing fd handles in other processes. 2021-03-23 12:29:10 +01:00
file.h server: Do not forbid closing fd handles in other processes. 2021-03-23 12:29:10 +01:00
handle.c ntdll: Use a kernel APC to call NtDuplicateObject() if DUPLICATE_CLOSE_SOURCE is used on another process. 2021-03-23 12:29:10 +01:00
handle.h server: Inherit standard handles together with explicit handle list. 2020-09-29 21:04:13 +02:00
hook.c server: Use the object type information to implement access mapping. 2021-02-05 22:53:46 +01:00
mach.c server: Don't change cached thread context in set_thread_context. 2020-04-22 16:47:41 +02:00
mailslot.c server: Do not forbid closing fd handles in other processes. 2021-03-23 12:29:10 +01:00
main.c server: Create the NLS section object for the l_intl.nls file. 2020-11-27 18:28:35 +01:00
mapping.c server: Do not forbid closing fd handles in other processes. 2021-03-23 12:29:10 +01:00
mutex.c server: Use the object type information to implement access mapping. 2021-02-05 22:53:46 +01:00
named_pipe.c server: Do not forbid closing fd handles in other processes. 2021-03-23 12:29:10 +01:00
object.c server: Use the object type information to implement access mapping. 2021-02-05 22:53:46 +01:00
object.h server: Make pulse_event() static. 2021-03-18 22:04:01 +01:00
process.c server: Track desktop users per thread instead of per process. 2021-04-21 21:00:33 +02:00
process.h server: Pass the NT process flags to the new_process request. 2021-04-16 12:07:51 +02:00
procfs.c server: Add a platform-specific entry point to initialize registers of a new thread. 2017-07-27 17:04:04 +02:00
protocol.def server: Pass the NT process flags to the new_process request. 2021-04-16 12:07:51 +02:00
ptrace.c server: Fix page size calculation in write access check. 2021-02-25 08:57:59 +01:00
queue.c server: Split the fallback to desktop async keystate. 2021-04-02 22:52:34 +02:00
region.c server: Map region to the window DPI in redraw_region(). 2018-08-24 20:12:05 +02:00
registry.c server: Prevent unloading a registry hive while the key is in use. 2021-02-17 22:21:13 +01:00
request.c server: Use the object type information to implement access mapping. 2021-02-05 22:53:46 +01:00
request.h server: Pass the NT process flags to the new_process request. 2021-04-16 12:07:51 +02:00
security.h ntdll: Implement NtQueryInformationToken(TokenLinkedToken). 2021-02-17 21:41:59 +01:00
semaphore.c server: Use the object type information to implement access mapping. 2021-02-05 22:53:46 +01:00
serial.c server: Do not forbid closing fd handles in other processes. 2021-03-23 12:29:10 +01:00
signal.c server: Use the object type information to implement access mapping. 2021-02-05 22:53:46 +01:00
sock.c server: Do not forbid closing fd handles in other processes. 2021-03-23 12:29:10 +01:00
symlink.c server: Use the object type information to implement access mapping. 2021-02-05 22:53:46 +01:00
thread.c server: Track desktop users per thread instead of per process. 2021-04-21 21:00:33 +02:00
thread.h server: Don't store the debug object in the debugger thread. 2021-02-01 16:48:09 +01:00
timer.c server: Use the object type information to implement access mapping. 2021-02-05 22:53:46 +01:00
token.c server: Merge the various token information queries. 2021-02-17 21:42:18 +01:00
trace.c server: Pass the NT process flags to the new_process request. 2021-04-16 12:07:51 +02:00
unicode.c server: Store the NT name in the fd object. 2021-02-09 14:17:51 +01:00
unicode.h server: Create the NLS section object for the l_intl.nls file. 2020-11-27 18:28:35 +01:00
user.c server: Free client-side user handles at process exit. 2009-10-15 17:56:04 +02:00
user.h server: Track desktop users per thread instead of per process. 2021-04-21 21:00:33 +02:00
window.c server: Store length of window text instead of null-terminating it. 2020-03-23 11:40:04 +01:00
wineserver.de.UTF-8.man.in server: Move WineHQ URLs to https. 2017-12-01 09:23:26 +01:00
wineserver.fr.UTF-8.man.in server: Move WineHQ URLs to https. 2017-12-01 09:23:26 +01:00
wineserver.man.in server: Move WineHQ URLs to https. 2017-12-01 09:23:26 +01:00
winstation.c server: Track desktop users per thread instead of per process. 2021-04-21 21:00:33 +02:00