diff --git a/patches/patchinstall.sh b/patches/patchinstall.sh index 31457043..660cdadc 100755 --- a/patches/patchinstall.sh +++ b/patches/patchinstall.sh @@ -247,6 +247,7 @@ patch_enable_all () enable_quartz_Silence_FIXMEs="$1" enable_riched20_Class_Tests="$1" enable_riched20_IText_Interface="$1" + enable_server_Desktop_Refcount="$1" enable_server_FileEndOfFileInformation="$1" enable_server_File_Permissions="$1" enable_server_Inherited_ACLs="$1" @@ -878,6 +879,9 @@ patch_enable () riched20-IText_Interface) enable_riched20_IText_Interface="$2" ;; + server-Desktop_Refcount) + enable_server_Desktop_Refcount="$2" + ;; server-FileEndOfFileInformation) enable_server_FileEndOfFileInformation="$2" ;; @@ -1653,6 +1657,13 @@ if test "$enable_xaudio2_7_CreateFX_FXEcho" -eq 1; then enable_xaudio2_revert=1 fi +if test "$enable_ws2_32_TransmitFile" -eq 1; then + if test "$enable_server_Desktop_Refcount" -gt 1; then + abort "Patchset server-Desktop_Refcount disabled, but ws2_32-TransmitFile depends on that." + fi + enable_server_Desktop_Refcount=1 +fi + if test "$enable_winex11_WM_WINDOWPOSCHANGING" -eq 1; then if test "$enable_winex11__NET_ACTIVE_WINDOW" -gt 1; then abort "Patchset winex11-_NET_ACTIVE_WINDOW disabled, but winex11-WM_WINDOWPOSCHANGING depends on that." @@ -5475,6 +5486,31 @@ if test "$enable_riched20_IText_Interface" -eq 1; then ) >> "$patchlist" fi +# Patchset server-Desktop_Refcount +# | +# | This patchset fixes the following Wine bugs: +# | * [#46967] GOG Galaxy doesn't run in virtual desktop. +# | +# | Modified files: +# | * dlls/user32/tests/winstation.c, include/wine/server_protocol.h, programs/explorer/desktop.c, server/async.c, +# | server/atom.c, server/change.c, server/clipboard.c, server/completion.c, server/console.c, server/debugger.c, +# | server/device.c, server/directory.c, server/event.c, server/fd.c, server/file.c, server/handle.c, server/handle.h, +# | server/hook.c, server/mailslot.c, server/mapping.c, server/mutex.c, server/named_pipe.c, server/object.c, +# | server/object.h, server/process.c, server/queue.c, server/registry.c, server/request.c, server/semaphore.c, +# | server/serial.c, server/signal.c, server/snapshot.c, server/sock.c, server/symlink.c, server/thread.c, server/timer.c, +# | server/token.c, server/winstation.c +# | +if test "$enable_server_Desktop_Refcount" -eq 1; then + patch_apply server-Desktop_Refcount/0001-server-Introduce-a-new-alloc_handle-object-callback..patch + patch_apply server-Desktop_Refcount/0002-server-Track-desktop-handle-count-more-correctly.patch + patch_apply server-Desktop_Refcount/0004-server-Assign-random-name-when-no-name-was-passed-to.patch + ( + printf '%s\n' '+ { "Sebastian Lackner", "server: Introduce a new alloc_handle object callback.", 2 },'; + printf '%s\n' '+ { "Sebastian Lackner", "server: Track desktop handle count more correctly.", 1 },'; + printf '%s\n' '+ { "Sebastian Lackner", "server: Assign random name when no name was passed to create_winstation.", 1 },'; + ) >> "$patchlist" +fi + # Patchset server-FileEndOfFileInformation # | # | Modified files: @@ -7396,6 +7432,9 @@ fi # Patchset ws2_32-TransmitFile # | +# | This patchset has the following (direct or indirect) dependencies: +# | * server-Desktop_Refcount +# | # | Modified files: # | * dlls/ws2_32/socket.c, dlls/ws2_32/tests/sock.c, include/winsock.h, server/protocol.def, server/sock.c # | diff --git a/patches/server-Desktop_Refcount/0001-server-Introduce-a-new-alloc_handle-object-callback..patch b/patches/server-Desktop_Refcount/0001-server-Introduce-a-new-alloc_handle-object-callback..patch index 845e0266..7ce8205c 100644 --- a/patches/server-Desktop_Refcount/0001-server-Introduce-a-new-alloc_handle-object-callback..patch +++ b/patches/server-Desktop_Refcount/0001-server-Introduce-a-new-alloc_handle-object-callback..patch @@ -1,299 +1,312 @@ -From a38788ceb03df268149adad0c74b300220003eca Mon Sep 17 00:00:00 2001 +From e5632cdae888ce1ed2274dc44d08eee6d2e9603e Mon Sep 17 00:00:00 2001 From: Sebastian Lackner Date: Fri, 4 Dec 2015 10:36:47 +0100 Subject: [PATCH] server: Introduce a new alloc_handle object callback. (v2) Signed-off-by: Sebastian Lackner --- - server/async.c | 2 ++ - server/atom.c | 1 + - server/change.c | 1 + - server/clipboard.c | 1 + - server/completion.c | 1 + - server/console.c | 3 +++ - server/debugger.c | 2 ++ - server/device.c | 4 ++++ - server/directory.c | 2 ++ - server/event.c | 2 ++ - server/fd.c | 4 ++++ - server/file.c | 1 + - server/handle.c | 13 +++++++++++-- - server/hook.c | 1 + - server/mailslot.c | 3 +++ - server/mapping.c | 3 +++ - server/mutex.c | 1 + - server/named_pipe.c | 7 ++++++- - server/object.c | 4 ++++ - server/object.h | 5 ++++- - server/process.c | 3 +++ - server/queue.c | 2 ++ - server/registry.c | 1 + - server/request.c | 1 + - server/semaphore.c | 1 + - server/serial.c | 1 + - server/signal.c | 1 + - server/snapshot.c | 1 + - server/sock.c | 2 ++ - server/symlink.c | 1 + - server/thread.c | 2 ++ - server/timer.c | 1 + - server/token.c | 1 + - server/winstation.c | 2 ++ - 34 files changed, 77 insertions(+), 4 deletions(-) + include/wine/server_protocol.h | 2 +- + server/async.c | 2 ++ + server/atom.c | 1 + + server/change.c | 1 + + server/clipboard.c | 1 + + server/completion.c | 1 + + server/console.c | 3 +++ + server/debugger.c | 2 ++ + server/device.c | 4 ++++ + server/directory.c | 2 ++ + server/event.c | 2 ++ + server/fd.c | 4 ++++ + server/file.c | 1 + + server/handle.c | 13 +++++++++++-- + server/hook.c | 1 + + server/mailslot.c | 3 +++ + server/mapping.c | 3 +++ + server/mutex.c | 1 + + server/named_pipe.c | 7 ++++++- + server/object.c | 4 ++++ + server/object.h | 5 ++++- + server/process.c | 3 +++ + server/queue.c | 2 ++ + server/registry.c | 1 + + server/request.c | 1 + + server/semaphore.c | 1 + + server/serial.c | 1 + + server/signal.c | 1 + + server/snapshot.c | 1 + + server/sock.c | 2 ++ + server/symlink.c | 1 + + server/thread.c | 2 ++ + server/timer.c | 1 + + server/token.c | 1 + + server/winstation.c | 2 ++ + 35 files changed, 78 insertions(+), 5 deletions(-) +diff --git a/include/wine/server_protocol.h b/include/wine/server_protocol.h +index 9e26aa4..973f6df 100644 +--- a/include/wine/server_protocol.h ++++ b/include/wine/server_protocol.h +@@ -6677,6 +6677,6 @@ union generic_reply + struct resume_process_reply resume_process_reply; + }; + +-#define SERVER_PROTOCOL_VERSION 579 ++#define SERVER_PROTOCOL_VERSION 580 + + #endif /* __WINE_WINE_SERVER_PROTOCOL_H */ diff --git a/server/async.c b/server/async.c -index cadeda3..aab4085 100644 +index 75989e5..b5aff66 100644 --- a/server/async.c +++ b/server/async.c -@@ -79,6 +79,7 @@ static const struct object_ops async_ops = - no_link_name, /* link_name */ +@@ -81,6 +81,7 @@ static const struct object_ops async_ops = NULL, /* unlink_name */ no_open_file, /* open_file */ + no_kernel_obj_list, /* get_kernel_obj_list */ + no_alloc_handle, /* alloc_handle */ no_close_handle, /* close_handle */ async_destroy /* destroy */ }; -@@ -467,6 +468,7 @@ static const struct object_ops iosb_ops = - no_link_name, /* link_name */ +@@ -471,6 +472,7 @@ static const struct object_ops iosb_ops = NULL, /* unlink_name */ no_open_file, /* open_file */ + no_kernel_obj_list, /* get_kernel_obj_list */ + no_alloc_handle, /* alloc_handle */ no_close_handle, /* close_handle */ iosb_destroy /* destroy */ }; diff --git a/server/atom.c b/server/atom.c -index 3ff7540..7bebf13 100644 +index 11b7ac5..e27b6f4 100644 --- a/server/atom.c +++ b/server/atom.c -@@ -90,6 +90,7 @@ static const struct object_ops atom_table_ops = - no_link_name, /* link_name */ +@@ -92,6 +92,7 @@ static const struct object_ops atom_table_ops = NULL, /* unlink_name */ no_open_file, /* open_file */ + no_kernel_obj_list, /* get_kernel_obj_list */ + no_alloc_handle, /* alloc_handle */ no_close_handle, /* close_handle */ atom_table_destroy /* destroy */ }; diff --git a/server/change.c b/server/change.c -index d00a885..a4ed5df 100644 +index 2be6a83..dee48ce 100644 --- a/server/change.c +++ b/server/change.c -@@ -172,6 +172,7 @@ static const struct object_ops dir_ops = - no_link_name, /* link_name */ +@@ -127,6 +127,7 @@ static const struct object_ops dir_ops = NULL, /* unlink_name */ no_open_file, /* open_file */ + no_kernel_obj_list, /* get_kernel_obj_list */ + no_alloc_handle, /* alloc_handle */ dir_close_handle, /* close_handle */ dir_destroy /* destroy */ }; diff --git a/server/clipboard.c b/server/clipboard.c -index 162725b..0898150 100644 +index 673aabb..5888754 100644 --- a/server/clipboard.c +++ b/server/clipboard.c -@@ -87,6 +87,7 @@ static const struct object_ops clipboard_ops = - no_link_name, /* link_name */ +@@ -89,6 +89,7 @@ static const struct object_ops clipboard_ops = NULL, /* unlink_name */ no_open_file, /* open_file */ + no_kernel_obj_list, /* get_kernel_obj_list */ + no_alloc_handle, /* alloc_handle */ no_close_handle, /* close_handle */ clipboard_destroy /* destroy */ }; diff --git a/server/completion.c b/server/completion.c -index 8b8983a..72dbc5b 100644 +index 1a074c8..c0d2ccf 100644 --- a/server/completion.c +++ b/server/completion.c -@@ -75,6 +75,7 @@ static const struct object_ops completion_ops = - directory_link_name, /* link_name */ +@@ -77,6 +77,7 @@ static const struct object_ops completion_ops = default_unlink_name, /* unlink_name */ no_open_file, /* open_file */ + no_kernel_obj_list, /* get_kernel_obj_list */ + no_alloc_handle, /* alloc_handle */ no_close_handle, /* close_handle */ completion_destroy /* destroy */ }; diff --git a/server/console.c b/server/console.c -index e1ae086..d9c60f9 100644 +index c322708..f437e74 100644 --- a/server/console.c +++ b/server/console.c -@@ -87,6 +87,7 @@ static const struct object_ops console_input_ops = - no_link_name, /* link_name */ +@@ -90,6 +90,7 @@ static const struct object_ops console_input_ops = NULL, /* unlink_name */ no_open_file, /* open_file */ + no_kernel_obj_list, /* get_kernel_obj_list */ + no_alloc_handle, /* alloc_handle */ no_close_handle, /* close_handle */ console_input_destroy /* destroy */ }; -@@ -121,6 +122,7 @@ static const struct object_ops console_input_events_ops = - no_link_name, /* link_name */ +@@ -128,6 +129,7 @@ static const struct object_ops console_input_events_ops = NULL, /* unlink_name */ no_open_file, /* open_file */ + no_kernel_obj_list, /* get_kernel_obj_list */ + no_alloc_handle, /* alloc_handle */ no_close_handle, /* close_handle */ console_input_events_destroy /* destroy */ }; -@@ -177,6 +179,7 @@ static const struct object_ops screen_buffer_ops = - no_link_name, /* link_name */ +@@ -186,6 +188,7 @@ static const struct object_ops screen_buffer_ops = NULL, /* unlink_name */ no_open_file, /* open_file */ + no_kernel_obj_list, /* get_kernel_obj_list */ + no_alloc_handle, /* alloc_handle */ no_close_handle, /* close_handle */ screen_buffer_destroy /* destroy */ }; diff --git a/server/debugger.c b/server/debugger.c -index 79b7e52..d658fc0 100644 +index 9a29ef4..1c68ee0 100644 --- a/server/debugger.c +++ b/server/debugger.c -@@ -84,6 +84,7 @@ static const struct object_ops debug_event_ops = - no_link_name, /* link_name */ +@@ -86,6 +86,7 @@ static const struct object_ops debug_event_ops = NULL, /* unlink_name */ no_open_file, /* open_file */ + no_kernel_obj_list, /* get_kernel_obj_list */ + no_alloc_handle, /* alloc_handle */ no_close_handle, /* close_handle */ debug_event_destroy /* destroy */ }; -@@ -110,6 +111,7 @@ static const struct object_ops debug_ctx_ops = - no_link_name, /* link_name */ +@@ -114,6 +115,7 @@ static const struct object_ops debug_ctx_ops = NULL, /* unlink_name */ no_open_file, /* open_file */ + no_kernel_obj_list, /* get_kernel_obj_list */ + no_alloc_handle, /* alloc_handle */ no_close_handle, /* close_handle */ debug_ctx_destroy /* destroy */ }; diff --git a/server/device.c b/server/device.c -index ac7d88f..55e6c7d 100644 +index 8340cb1..6573bd4 100644 --- a/server/device.c +++ b/server/device.c -@@ -75,6 +75,7 @@ static const struct object_ops irp_call_ops = - no_link_name, /* link_name */ +@@ -79,6 +79,7 @@ static const struct object_ops irp_call_ops = NULL, /* unlink_name */ no_open_file, /* open_file */ + no_kernel_obj_list, /* get_kernel_obj_list */ + no_alloc_handle, /* alloc_handle */ no_close_handle, /* close_handle */ irp_call_destroy /* destroy */ }; -@@ -111,6 +112,7 @@ static const struct object_ops device_manager_ops = - no_link_name, /* link_name */ +@@ -120,6 +121,7 @@ static const struct object_ops device_manager_ops = NULL, /* unlink_name */ no_open_file, /* open_file */ + no_kernel_obj_list, /* get_kernel_obj_list */ + no_alloc_handle, /* alloc_handle */ no_close_handle, /* close_handle */ device_manager_destroy /* destroy */ }; -@@ -152,6 +154,7 @@ static const struct object_ops device_ops = - directory_link_name, /* link_name */ +@@ -164,6 +166,7 @@ static const struct object_ops device_ops = default_unlink_name, /* unlink_name */ device_open_file, /* open_file */ + device_get_kernel_obj_list, /* get_kernel_obj_list */ + no_alloc_handle, /* alloc_handle */ no_close_handle, /* close_handle */ device_destroy /* destroy */ }; -@@ -197,6 +200,7 @@ static const struct object_ops device_file_ops = - no_link_name, /* link_name */ +@@ -211,6 +214,7 @@ static const struct object_ops device_file_ops = NULL, /* unlink_name */ no_open_file, /* open_file */ + no_kernel_obj_list, /* get_kernel_obj_list */ + no_alloc_handle, /* alloc_handle */ device_file_close_handle, /* close_handle */ device_file_destroy /* destroy */ }; diff --git a/server/directory.c b/server/directory.c -index 6aa3a55..699eb70f 100644 +index 55cbad3..1ab0c73 100644 --- a/server/directory.c +++ b/server/directory.c -@@ -67,6 +67,7 @@ static const struct object_ops object_type_ops = - directory_link_name, /* link_name */ +@@ -69,6 +69,7 @@ static const struct object_ops object_type_ops = default_unlink_name, /* unlink_name */ no_open_file, /* open_file */ + no_kernel_obj_list, /* get_kernel_obj_list */ + no_alloc_handle, /* alloc_handle */ no_close_handle, /* close_handle */ no_destroy /* destroy */ }; -@@ -102,6 +103,7 @@ static const struct object_ops directory_ops = - directory_link_name, /* link_name */ +@@ -106,6 +107,7 @@ static const struct object_ops directory_ops = default_unlink_name, /* unlink_name */ no_open_file, /* open_file */ + no_kernel_obj_list, /* get_kernel_obj_list */ + no_alloc_handle, /* alloc_handle */ no_close_handle, /* close_handle */ directory_destroy /* destroy */ }; diff --git a/server/event.c b/server/event.c -index cfc0f6a..608fafb 100644 +index 79287e7..ad8fddb 100644 --- a/server/event.c +++ b/server/event.c -@@ -68,6 +68,7 @@ static const struct object_ops event_ops = - directory_link_name, /* link_name */ +@@ -76,6 +76,7 @@ static const struct object_ops event_ops = default_unlink_name, /* unlink_name */ no_open_file, /* open_file */ + event_get_kernel_obj_list, /* get_kernel_obj_list */ + no_alloc_handle, /* alloc_handle */ no_close_handle, /* close_handle */ - no_destroy /* destroy */ + event_destroy /* destroy */ }; -@@ -101,6 +102,7 @@ static const struct object_ops keyed_event_ops = - directory_link_name, /* link_name */ +@@ -111,6 +112,7 @@ static const struct object_ops keyed_event_ops = default_unlink_name, /* unlink_name */ no_open_file, /* open_file */ + no_kernel_obj_list, /* get_kernel_obj_list */ + no_alloc_handle, /* alloc_handle */ no_close_handle, /* close_handle */ no_destroy /* destroy */ }; diff --git a/server/fd.c b/server/fd.c -index 119fae6..5dcd382 100644 +index 2a38780..e628cdb 100644 --- a/server/fd.c +++ b/server/fd.c -@@ -218,6 +218,7 @@ static const struct object_ops fd_ops = - no_link_name, /* link_name */ +@@ -222,6 +222,7 @@ static const struct object_ops fd_ops = NULL, /* unlink_name */ no_open_file, /* open_file */ + no_kernel_obj_list, /* get_kernel_obj_list */ + no_alloc_handle, /* alloc_handle */ no_close_handle, /* close_handle */ fd_destroy /* destroy */ }; -@@ -257,6 +258,7 @@ static const struct object_ops device_ops = - no_link_name, /* link_name */ +@@ -263,6 +264,7 @@ static const struct object_ops device_ops = NULL, /* unlink_name */ no_open_file, /* open_file */ + no_kernel_obj_list, /* get_kernel_obj_list */ + no_alloc_handle, /* alloc_handle */ no_close_handle, /* close_handle */ device_destroy /* destroy */ }; -@@ -295,6 +297,7 @@ static const struct object_ops inode_ops = - no_link_name, /* link_name */ +@@ -303,6 +305,7 @@ static const struct object_ops inode_ops = NULL, /* unlink_name */ no_open_file, /* open_file */ + no_kernel_obj_list, /* get_kernel_obj_list */ + no_alloc_handle, /* alloc_handle */ no_close_handle, /* close_handle */ inode_destroy /* destroy */ }; -@@ -335,6 +338,7 @@ static const struct object_ops file_lock_ops = - no_link_name, /* link_name */ +@@ -345,6 +348,7 @@ static const struct object_ops file_lock_ops = NULL, /* unlink_name */ no_open_file, /* open_file */ + no_kernel_obj_list, /* get_kernel_obj_list */ + no_alloc_handle, /* alloc_handle */ no_close_handle, /* close_handle */ no_destroy /* destroy */ }; diff --git a/server/file.c b/server/file.c -index 8d39f30..2d9134c 100644 +index 224ab7d..ca9a368 100644 --- a/server/file.c +++ b/server/file.c -@@ -95,6 +95,7 @@ static const struct object_ops file_ops = - no_link_name, /* link_name */ +@@ -96,6 +96,7 @@ static const struct object_ops file_ops = NULL, /* unlink_name */ file_open_file, /* open_file */ + no_kernel_obj_list, /* get_kernel_obj_list */ + no_alloc_handle, /* alloc_handle */ fd_close_handle, /* close_handle */ file_destroy /* destroy */ }; diff --git a/server/handle.c b/server/handle.c -index 35ab860..782baef 100644 +index 6ca4489..879098a 100644 --- a/server/handle.c +++ b/server/handle.c -@@ -133,6 +133,7 @@ static const struct object_ops handle_table_ops = - no_link_name, /* link_name */ +@@ -135,6 +135,7 @@ static const struct object_ops handle_table_ops = NULL, /* unlink_name */ no_open_file, /* open_file */ + no_kernel_obj_list, /* get_kernel_obj_list */ + no_alloc_handle, /* alloc_handle */ no_close_handle, /* close_handle */ handle_table_destroy /* destroy */ }; -@@ -232,7 +233,7 @@ static int grow_handle_table( struct handle_table *table ) +@@ -234,7 +235,7 @@ static int grow_handle_table( struct handle_table *table ) } /* allocate the first free entry in the handle table */ @@ -302,7 +315,7 @@ index 35ab860..782baef 100644 { struct handle_entry *entry = table->entries + table->free; int i; -@@ -248,6 +249,10 @@ static obj_handle_t alloc_entry( struct handle_table *table, void *obj, unsigned +@@ -250,6 +251,10 @@ static obj_handle_t alloc_entry( struct handle_table *table, void *obj, unsigned table->free = i + 1; entry->ptr = grab_object_for_handle( obj ); entry->access = access; @@ -313,7 +326,7 @@ index 35ab860..782baef 100644 return index_to_handle(i); } -@@ -373,7 +378,11 @@ struct handle_table *copy_handle_table( struct process *process, struct process +@@ -375,7 +380,11 @@ struct handle_table *copy_handle_table( struct process *process, struct process for (i = 0; i <= table->last; i++, ptr++) { if (!ptr->ptr) continue; @@ -327,136 +340,136 @@ index 35ab860..782baef 100644 } } diff --git a/server/hook.c b/server/hook.c -index 3a0e4b4..dc653b8 100644 +index f5d7639..22b1482 100644 --- a/server/hook.c +++ b/server/hook.c -@@ -91,6 +91,7 @@ static const struct object_ops hook_table_ops = - no_link_name, /* link_name */ +@@ -93,6 +93,7 @@ static const struct object_ops hook_table_ops = NULL, /* unlink_name */ no_open_file, /* open_file */ + no_kernel_obj_list, /* get_kernel_obj_list */ + no_alloc_handle, /* alloc_handle */ no_close_handle, /* close_handle */ hook_table_destroy /* destroy */ }; diff --git a/server/mailslot.c b/server/mailslot.c -index 95308c4..bc9089b 100644 +index fc1caa9..57d0775 100644 --- a/server/mailslot.c +++ b/server/mailslot.c -@@ -89,6 +89,7 @@ static const struct object_ops mailslot_ops = - mailslot_link_name, /* link_name */ +@@ -91,6 +91,7 @@ static const struct object_ops mailslot_ops = default_unlink_name, /* unlink_name */ mailslot_open_file, /* open_file */ + no_kernel_obj_list, /* get_kernel_obj_list */ + no_alloc_handle, /* alloc_handle */ fd_close_handle, /* close_handle */ mailslot_destroy /* destroy */ }; -@@ -145,6 +146,7 @@ static const struct object_ops mail_writer_ops = - no_link_name, /* link_name */ +@@ -149,6 +150,7 @@ static const struct object_ops mail_writer_ops = NULL, /* unlink_name */ no_open_file, /* open_file */ + no_kernel_obj_list, /* get_kernel_obj_list */ + no_alloc_handle, /* alloc_handle */ fd_close_handle, /* close_handle */ mail_writer_destroy /* destroy */ }; -@@ -202,6 +204,7 @@ static const struct object_ops mailslot_device_ops = - directory_link_name, /* link_name */ +@@ -208,6 +210,7 @@ static const struct object_ops mailslot_device_ops = default_unlink_name, /* unlink_name */ mailslot_device_open_file, /* open_file */ + no_kernel_obj_list, /* get_kernel_obj_list */ + no_alloc_handle, /* alloc_handle */ fd_close_handle, /* close_handle */ mailslot_device_destroy /* destroy */ }; diff --git a/server/mapping.c b/server/mapping.c -index bc59b21..ca803a4 100644 +index 1b3df08..819181a 100644 --- a/server/mapping.c +++ b/server/mapping.c -@@ -77,6 +77,7 @@ static const struct object_ops ranges_ops = - no_link_name, /* link_name */ +@@ -103,6 +103,7 @@ static const struct object_ops ranges_ops = NULL, /* unlink_name */ no_open_file, /* open_file */ + no_kernel_obj_list, /* get_kernel_obj_list */ + no_alloc_handle, /* alloc_handle */ no_close_handle, /* close_handle */ ranges_destroy /* destroy */ }; -@@ -111,6 +112,7 @@ static const struct object_ops shared_map_ops = - no_link_name, /* link_name */ +@@ -139,6 +140,7 @@ static const struct object_ops shared_map_ops = NULL, /* unlink_name */ no_open_file, /* open_file */ + no_kernel_obj_list, /* get_kernel_obj_list */ + no_alloc_handle, /* alloc_handle */ no_close_handle, /* close_handle */ shared_map_destroy /* destroy */ }; -@@ -166,6 +168,7 @@ static const struct object_ops mapping_ops = - directory_link_name, /* link_name */ +@@ -196,6 +198,7 @@ static const struct object_ops mapping_ops = default_unlink_name, /* unlink_name */ no_open_file, /* open_file */ + no_kernel_obj_list, /* get_kernel_obj_list */ + no_alloc_handle, /* alloc_handle */ fd_close_handle, /* close_handle */ mapping_destroy /* destroy */ }; diff --git a/server/mutex.c b/server/mutex.c -index d1887e4..a2a0a24 100644 +index f5f969b..a4ab6bd 100644 --- a/server/mutex.c +++ b/server/mutex.c -@@ -71,6 +71,7 @@ static const struct object_ops mutex_ops = - directory_link_name, /* link_name */ +@@ -73,6 +73,7 @@ static const struct object_ops mutex_ops = default_unlink_name, /* unlink_name */ no_open_file, /* open_file */ + no_kernel_obj_list, /* get_kernel_obj_list */ + no_alloc_handle, /* alloc_handle */ no_close_handle, /* close_handle */ mutex_destroy /* destroy */ }; diff --git a/server/named_pipe.c b/server/named_pipe.c -index 19a5426..8bb2283 100644 +index ceb9894..6892081 100644 --- a/server/named_pipe.c +++ b/server/named_pipe.c -@@ -134,6 +134,7 @@ static const struct object_ops named_pipe_ops = - named_pipe_link_name, /* link_name */ +@@ -130,6 +130,7 @@ static const struct object_ops named_pipe_ops = default_unlink_name, /* unlink_name */ named_pipe_open_file, /* open_file */ + no_kernel_obj_list, /* get_kernel_obj_list */ + no_alloc_handle, /* alloc_handle */ no_close_handle, /* close_handle */ named_pipe_destroy /* destroy */ }; -@@ -176,6 +177,7 @@ static const struct object_ops pipe_server_ops = - no_link_name, /* link_name */ +@@ -173,6 +174,7 @@ static const struct object_ops pipe_server_ops = NULL, /* unlink_name */ no_open_file, /* open_file */ + no_kernel_obj_list, /* get_kernel_obj_list */ + no_alloc_handle, /* alloc_handle */ fd_close_handle, /* close_handle */ pipe_server_destroy /* destroy */ }; -@@ -217,6 +219,7 @@ static const struct object_ops pipe_client_ops = - no_link_name, /* link_name */ +@@ -216,6 +218,7 @@ static const struct object_ops pipe_client_ops = NULL, /* unlink_name */ no_open_file, /* open_file */ + no_kernel_obj_list, /* get_kernel_obj_list */ + no_alloc_handle, /* alloc_handle */ fd_close_handle, /* close_handle */ pipe_end_destroy /* destroy */ }; -@@ -262,7 +265,8 @@ static const struct object_ops named_pipe_device_ops = - directory_link_name, /* link_name */ +@@ -263,7 +266,8 @@ static const struct object_ops named_pipe_device_ops = default_unlink_name, /* unlink_name */ named_pipe_device_open_file, /* open_file */ + no_kernel_obj_list, /* get_kernel_obj_list */ - no_close_handle, /* close_handle */ + no_alloc_handle, /* alloc_handle */ + fd_close_handle, /* close_handle */ named_pipe_device_destroy /* destroy */ }; -@@ -290,6 +294,7 @@ static const struct object_ops named_pipe_device_file_ops = - no_link_name, /* link_name */ +@@ -293,6 +297,7 @@ static const struct object_ops named_pipe_device_file_ops = NULL, /* unlink_name */ no_open_file, /* open_file */ + no_kernel_obj_list, /* get_kernel_obj_list */ + no_alloc_handle, /* alloc_handle */ fd_close_handle, /* close_handle */ named_pipe_device_file_destroy /* destroy */ }; diff --git a/server/object.c b/server/object.c -index 4455718..14cd38e 100644 +index 048da50..fbac8f7 100644 --- a/server/object.c +++ b/server/object.c -@@ -692,6 +692,10 @@ struct object *no_open_file( struct object *obj, unsigned int access, unsigned i +@@ -693,6 +693,10 @@ struct object *no_open_file( struct object *obj, unsigned int access, unsigned i return NULL; } @@ -468,13 +481,13 @@ index 4455718..14cd38e 100644 { return 1; /* ok to close */ diff --git a/server/object.h b/server/object.h -index b5c50e1..72ad852 100644 +index ca5a191..d913e65 100644 --- a/server/object.h +++ b/server/object.h -@@ -89,8 +89,10 @@ struct object_ops - /* open a file object to access this object */ - struct object *(*open_file)(struct object *, unsigned int access, unsigned int sharing, +@@ -93,8 +93,10 @@ struct object_ops unsigned int options); + /* return list of kernel objects */ + struct list *(*get_kernel_obj_list)(struct object *); + /* allocate a handle to this object */ + void (*alloc_handle)(struct object *, struct process *, obj_handle_t); /* close a handle to this object */ @@ -483,226 +496,226 @@ index b5c50e1..72ad852 100644 /* destroy on refcount == 0 */ void (*destroy)(struct object *); }; -@@ -163,6 +165,7 @@ extern int no_link_name( struct object *obj, struct object_name *name, struct ob - extern void default_unlink_name( struct object *obj, struct object_name *name ); +@@ -169,6 +171,7 @@ extern void default_unlink_name( struct object *obj, struct object_name *name ); extern struct object *no_open_file( struct object *obj, unsigned int access, unsigned int sharing, unsigned int options ); + extern struct list *no_kernel_obj_list( struct object *obj ); +extern void no_alloc_handle( struct object *obj, struct process *process, obj_handle_t handle ); extern int no_close_handle( struct object *obj, struct process *process, obj_handle_t handle ); extern void no_destroy( struct object *obj ); #ifdef DEBUG_OBJECTS diff --git a/server/process.c b/server/process.c -index 3bd545a..5274dc3 100644 +index f0b44a8..c059d19 100644 --- a/server/process.c +++ b/server/process.c -@@ -84,6 +84,7 @@ static const struct object_ops process_ops = - no_link_name, /* link_name */ +@@ -91,6 +91,7 @@ static const struct object_ops process_ops = NULL, /* unlink_name */ no_open_file, /* open_file */ + process_get_kernel_obj_list, /* get_kernel_obj_list */ + no_alloc_handle, /* alloc_handle */ no_close_handle, /* close_handle */ process_destroy /* destroy */ }; -@@ -133,6 +134,7 @@ static const struct object_ops startup_info_ops = - no_link_name, /* link_name */ +@@ -142,6 +143,7 @@ static const struct object_ops startup_info_ops = NULL, /* unlink_name */ no_open_file, /* open_file */ + no_kernel_obj_list, /* get_kernel_obj_list */ + no_alloc_handle, /* alloc_handle */ no_close_handle, /* close_handle */ startup_info_destroy /* destroy */ }; -@@ -176,6 +178,7 @@ static const struct object_ops job_ops = - directory_link_name, /* link_name */ +@@ -187,6 +189,7 @@ static const struct object_ops job_ops = default_unlink_name, /* unlink_name */ no_open_file, /* open_file */ + no_kernel_obj_list, /* get_kernel_obj_list */ + no_alloc_handle, /* alloc_handle */ job_close_handle, /* close_handle */ job_destroy /* destroy */ }; diff --git a/server/queue.c b/server/queue.c -index f274dfb..ca9d677 100644 +index 56fa4d9..b5d0677 100644 --- a/server/queue.c +++ b/server/queue.c -@@ -181,6 +181,7 @@ static const struct object_ops msg_queue_ops = - no_link_name, /* link_name */ +@@ -194,6 +194,7 @@ static const struct object_ops msg_queue_ops = NULL, /* unlink_name */ no_open_file, /* open_file */ + no_kernel_obj_list, /* get_kernel_obj_list */ + no_alloc_handle, /* alloc_handle */ no_close_handle, /* close_handle */ msg_queue_destroy /* destroy */ }; -@@ -216,6 +217,7 @@ static const struct object_ops thread_input_ops = - no_link_name, /* link_name */ +@@ -231,6 +232,7 @@ static const struct object_ops thread_input_ops = NULL, /* unlink_name */ no_open_file, /* open_file */ + no_kernel_obj_list, /* get_kernel_obj_list */ + no_alloc_handle, /* alloc_handle */ no_close_handle, /* close_handle */ thread_input_destroy /* destroy */ }; diff --git a/server/registry.c b/server/registry.c -index 9e6815d..21a6be5 100644 +index 1757fd3..e56134e 100644 --- a/server/registry.c +++ b/server/registry.c -@@ -170,6 +170,7 @@ static const struct object_ops key_ops = - no_link_name, /* link_name */ +@@ -172,6 +172,7 @@ static const struct object_ops key_ops = NULL, /* unlink_name */ no_open_file, /* open_file */ + no_kernel_obj_list, /* get_kernel_obj_list */ + no_alloc_handle, /* alloc_handle */ key_close_handle, /* close_handle */ key_destroy /* destroy */ }; diff --git a/server/request.c b/server/request.c -index c10c4e6..4d0e673 100644 +index 73878cf..f089ccc 100644 --- a/server/request.c +++ b/server/request.c -@@ -107,6 +107,7 @@ static const struct object_ops master_socket_ops = - no_link_name, /* link_name */ +@@ -109,6 +109,7 @@ static const struct object_ops master_socket_ops = NULL, /* unlink_name */ no_open_file, /* open_file */ + no_kernel_obj_list, /* get_kernel_obj_list */ + no_alloc_handle, /* alloc_handle */ no_close_handle, /* close_handle */ master_socket_destroy /* destroy */ }; diff --git a/server/semaphore.c b/server/semaphore.c -index 08ff153..15e7392 100644 +index 36e3e79..1913871 100644 --- a/server/semaphore.c +++ b/server/semaphore.c -@@ -68,6 +68,7 @@ static const struct object_ops semaphore_ops = - directory_link_name, /* link_name */ +@@ -70,6 +70,7 @@ static const struct object_ops semaphore_ops = default_unlink_name, /* unlink_name */ no_open_file, /* open_file */ + no_kernel_obj_list, /* get_kernel_obj_list */ + no_alloc_handle, /* alloc_handle */ no_close_handle, /* close_handle */ no_destroy /* destroy */ }; diff --git a/server/serial.c b/server/serial.c -index f0adf92..1722149 100644 +index 2848e1d..966b8bc 100644 --- a/server/serial.c +++ b/server/serial.c -@@ -102,6 +102,7 @@ static const struct object_ops serial_ops = - no_link_name, /* link_name */ +@@ -104,6 +104,7 @@ static const struct object_ops serial_ops = NULL, /* unlink_name */ no_open_file, /* open_file */ + no_kernel_obj_list, /* get_kernel_obj_list */ + no_alloc_handle, /* alloc_handle */ fd_close_handle, /* close_handle */ serial_destroy /* destroy */ }; diff --git a/server/signal.c b/server/signal.c -index 74416fa..4b2b8c4 100644 +index ca20039..a2e0efe 100644 --- a/server/signal.c +++ b/server/signal.c -@@ -77,6 +77,7 @@ static const struct object_ops handler_ops = - no_link_name, /* link_name */ +@@ -79,6 +79,7 @@ static const struct object_ops handler_ops = NULL, /* unlink_name */ no_open_file, /* open_file */ + no_kernel_obj_list, /* get_kernel_obj_list */ + no_alloc_handle, /* alloc_handle */ no_close_handle, /* close_handle */ handler_destroy /* destroy */ }; diff --git a/server/snapshot.c b/server/snapshot.c -index e35588a..6e788ab 100644 +index 7d0d742..2ad9d5d 100644 --- a/server/snapshot.c +++ b/server/snapshot.c -@@ -71,6 +71,7 @@ static const struct object_ops snapshot_ops = - no_link_name, /* link_name */ +@@ -73,6 +73,7 @@ static const struct object_ops snapshot_ops = NULL, /* unlink_name */ no_open_file, /* open_file */ + no_kernel_obj_list, /* get_kernel_obj_list */ + no_alloc_handle, /* alloc_handle */ no_close_handle, /* close_handle */ snapshot_destroy /* destroy */ }; diff --git a/server/sock.c b/server/sock.c -index a8e6e28..cd9a8fa 100644 +index 4a10aac..f951f23 100644 --- a/server/sock.c +++ b/server/sock.c -@@ -155,6 +155,7 @@ static const struct object_ops sock_ops = - no_link_name, /* link_name */ +@@ -156,6 +156,7 @@ static const struct object_ops sock_ops = NULL, /* unlink_name */ no_open_file, /* open_file */ + no_kernel_obj_list, /* get_kernel_obj_list */ + no_alloc_handle, /* alloc_handle */ fd_close_handle, /* close_handle */ sock_destroy /* destroy */ }; -@@ -980,6 +981,7 @@ static const struct object_ops ifchange_ops = - no_link_name, /* link_name */ +@@ -972,6 +973,7 @@ static const struct object_ops ifchange_ops = NULL, /* unlink_name */ no_open_file, /* open_file */ + no_kernel_obj_list, /* get_kernel_obj_list */ + no_alloc_handle, /* alloc_handle */ no_close_handle, /* close_handle */ ifchange_destroy /* destroy */ }; diff --git a/server/symlink.c b/server/symlink.c -index 9199bc5..ecc0e43 100644 +index 6b66b23..52387be 100644 --- a/server/symlink.c +++ b/server/symlink.c -@@ -70,6 +70,7 @@ static const struct object_ops symlink_ops = - directory_link_name, /* link_name */ +@@ -72,6 +72,7 @@ static const struct object_ops symlink_ops = default_unlink_name, /* unlink_name */ no_open_file, /* open_file */ + no_kernel_obj_list, /* get_kernel_obj_list */ + no_alloc_handle, /* alloc_handle */ no_close_handle, /* close_handle */ symlink_destroy /* destroy */ }; diff --git a/server/thread.c b/server/thread.c -index 7162fc3..7e9419b 100644 +index 8c45419..bcb8526 100644 --- a/server/thread.c +++ b/server/thread.c -@@ -120,6 +120,7 @@ static const struct object_ops thread_apc_ops = - no_link_name, /* link_name */ +@@ -123,6 +123,7 @@ static const struct object_ops thread_apc_ops = NULL, /* unlink_name */ no_open_file, /* open_file */ + no_kernel_obj_list, /* get_kernel_obj_list */ + no_alloc_handle, /* alloc_handle */ no_close_handle, /* close_handle */ thread_apc_destroy /* destroy */ }; -@@ -151,6 +152,7 @@ static const struct object_ops thread_ops = - no_link_name, /* link_name */ +@@ -159,6 +160,7 @@ static const struct object_ops thread_ops = NULL, /* unlink_name */ no_open_file, /* open_file */ + thread_get_kernel_obj_list, /* get_kernel_obj_list */ + no_alloc_handle, /* alloc_handle */ no_close_handle, /* close_handle */ destroy_thread /* destroy */ }; diff --git a/server/timer.c b/server/timer.c -index 3a786fb..95df28f 100644 +index f2403fc..75d289c 100644 --- a/server/timer.c +++ b/server/timer.c -@@ -75,6 +75,7 @@ static const struct object_ops timer_ops = - directory_link_name, /* link_name */ +@@ -80,6 +80,7 @@ static const struct object_ops timer_ops = default_unlink_name, /* unlink_name */ no_open_file, /* open_file */ + no_kernel_obj_list, /* get_kernel_obj_list */ + no_alloc_handle, /* alloc_handle */ no_close_handle, /* close_handle */ timer_destroy /* destroy */ }; diff --git a/server/token.c b/server/token.c -index d88f16c..57c2267 100644 +index 1a41ad0..71f8552 100644 --- a/server/token.c +++ b/server/token.c -@@ -155,6 +155,7 @@ static const struct object_ops token_ops = - no_link_name, /* link_name */ +@@ -164,6 +164,7 @@ static const struct object_ops token_ops = NULL, /* unlink_name */ no_open_file, /* open_file */ + no_kernel_obj_list, /* get_kernel_obj_list */ + no_alloc_handle, /* alloc_handle */ no_close_handle, /* close_handle */ token_destroy /* destroy */ }; diff --git a/server/winstation.c b/server/winstation.c -index a0be058..5f96be8 100644 +index 845043b..d7e8a5c 100644 --- a/server/winstation.c +++ b/server/winstation.c -@@ -75,6 +75,7 @@ static const struct object_ops winstation_ops = - directory_link_name, /* link_name */ +@@ -77,6 +77,7 @@ static const struct object_ops winstation_ops = default_unlink_name, /* unlink_name */ no_open_file, /* open_file */ + no_kernel_obj_list, /* get_kernel_obj_list */ + no_alloc_handle, /* alloc_handle */ winstation_close_handle, /* close_handle */ winstation_destroy /* destroy */ }; -@@ -98,6 +99,7 @@ static const struct object_ops desktop_ops = - desktop_link_name, /* link_name */ +@@ -102,6 +103,7 @@ static const struct object_ops desktop_ops = default_unlink_name, /* unlink_name */ no_open_file, /* open_file */ + no_kernel_obj_list, /* get_kernel_obj_list */ + no_alloc_handle, /* alloc_handle */ desktop_close_handle, /* close_handle */ desktop_destroy /* destroy */ diff --git a/patches/server-Desktop_Refcount/0002-server-Track-desktop-handle-count-more-correctly.patch b/patches/server-Desktop_Refcount/0002-server-Track-desktop-handle-count-more-correctly.patch index 6ef73440..ab7e3b7b 100644 --- a/patches/server-Desktop_Refcount/0002-server-Track-desktop-handle-count-more-correctly.patch +++ b/patches/server-Desktop_Refcount/0002-server-Track-desktop-handle-count-more-correctly.patch @@ -1,7 +1,7 @@ -From 02981c79c3ad972000fd3f397371f284ce9fade6 Mon Sep 17 00:00:00 2001 +From eb47d6b708c171ca94c3e6d22a7c783d5d016256 Mon Sep 17 00:00:00 2001 From: Sebastian Lackner Date: Fri, 4 Dec 2015 01:22:29 +0100 -Subject: server: Track desktop handle count more correctly. +Subject: [PATCH 2/3] server: Track desktop handle count more correctly. Desktop objects should stay valid, as long as there is a handle from a (non-system) process. Counting only process->desktop references is not @@ -17,7 +17,7 @@ Signed-off-by: Sebastian Lackner 5 files changed, 65 insertions(+), 47 deletions(-) diff --git a/programs/explorer/desktop.c b/programs/explorer/desktop.c -index 2b8502b..b59ed4e 100644 +index 27b9b24..381012a 100644 --- a/programs/explorer/desktop.c +++ b/programs/explorer/desktop.c @@ -37,6 +37,8 @@ @@ -29,7 +29,7 @@ index 2b8502b..b59ed4e 100644 #define DESKTOP_CLASS_ATOM ((LPCWSTR)MAKEINTATOM(32769)) #define DESKTOP_ALL_ACCESS 0x01ff -@@ -1024,8 +1026,22 @@ void manage_desktop( WCHAR *arg ) +@@ -1030,8 +1032,22 @@ void manage_desktop( WCHAR *arg ) /* run the desktop message loop */ if (hwnd) { @@ -54,10 +54,10 @@ index 2b8502b..b59ed4e 100644 } diff --git a/server/handle.c b/server/handle.c -index eb83a3b..38f38d5 100644 +index 4737825..f993a18 100644 --- a/server/handle.c +++ b/server/handle.c -@@ -490,7 +490,7 @@ obj_handle_t find_inherited_handle( struct process *process, const struct object +@@ -498,7 +498,7 @@ obj_handle_t find_inherited_handle( struct process *process, const struct object /* enumerate handles of a given type */ /* this is needed for window stations and desktops */ obj_handle_t enumerate_handles( struct process *process, const struct object_ops *ops, @@ -66,7 +66,7 @@ index eb83a3b..38f38d5 100644 { struct handle_table *table = process->handles; unsigned int i; -@@ -503,6 +503,7 @@ obj_handle_t enumerate_handles( struct process *process, const struct object_ops +@@ -511,6 +511,7 @@ obj_handle_t enumerate_handles( struct process *process, const struct object_ops if (!entry->ptr) continue; if (entry->ptr->ops != ops) continue; *index = i + 1; @@ -88,7 +88,7 @@ index f1deb79..1347836 100644 extern struct handle_table *alloc_handle_table( struct process *process, int count ); extern struct handle_table *copy_handle_table( struct process *process, struct process *parent ); diff --git a/server/process.c b/server/process.c -index cc9c01c..b43e1f8 100644 +index c1b39f8..7b41ca3 100644 --- a/server/process.c +++ b/server/process.c @@ -838,7 +838,6 @@ static void process_killed( struct process *process ) @@ -100,10 +100,10 @@ index cc9c01c..b43e1f8 100644 process->desktop = 0; close_process_handles( process ); diff --git a/server/winstation.c b/server/winstation.c -index 17c312a..46ade3b 100644 +index f0a5287..fde6b68 100644 --- a/server/winstation.c +++ b/server/winstation.c -@@ -51,6 +51,7 @@ static unsigned int winstation_map_access( struct object *obj, unsigned int acce +@@ -53,6 +53,7 @@ static unsigned int winstation_map_access( struct object *obj, unsigned int acce static void desktop_dump( struct object *obj, int verbose ); static struct object_type *desktop_get_type( struct object *obj ); static int desktop_link_name( struct object *obj, struct object_name *name, struct object *parent ); @@ -111,16 +111,16 @@ index 17c312a..46ade3b 100644 static int desktop_close_handle( struct object *obj, struct process *process, obj_handle_t handle ); static void desktop_destroy( struct object *obj ); static unsigned int desktop_map_access( struct object *obj, unsigned int access ); -@@ -97,7 +98,7 @@ static const struct object_ops desktop_ops = - desktop_link_name, /* link_name */ +@@ -76,7 +77,7 @@ static const struct object_ops winstation_ops = default_unlink_name, /* unlink_name */ no_open_file, /* open_file */ + no_kernel_obj_list, /* get_kernel_obj_list */ - no_alloc_handle, /* alloc_handle */ + desktop_alloc_handle, /* alloc_handle */ - desktop_close_handle, /* close_handle */ - desktop_destroy /* destroy */ + winstation_close_handle, /* close_handle */ + winstation_destroy /* destroy */ }; -@@ -253,14 +254,54 @@ static int desktop_link_name( struct object *obj, struct object_name *name, stru +@@ -273,14 +274,54 @@ static int desktop_link_name( struct object *obj, struct object_name *name, stru return 1; } @@ -175,7 +175,7 @@ index 17c312a..46ade3b 100644 return 1; } -@@ -268,6 +309,7 @@ static void desktop_destroy( struct object *obj ) +@@ -288,6 +329,7 @@ static void desktop_destroy( struct object *obj ) { struct desktop *desktop = (struct desktop *)obj; @@ -183,7 +183,7 @@ index 17c312a..46ade3b 100644 free_hotkeys( desktop, 0 ); if (desktop->top_window) destroy_window( desktop->top_window ); if (desktop->msg_window) destroy_window( desktop->msg_window ); -@@ -294,40 +336,6 @@ struct desktop *get_thread_desktop( struct thread *thread, unsigned int access ) +@@ -314,40 +356,6 @@ struct desktop *get_thread_desktop( struct thread *thread, unsigned int access ) return get_desktop_obj( thread->process, thread->desktop, access ); } @@ -224,7 +224,7 @@ index 17c312a..46ade3b 100644 /* set the process default desktop handle */ void set_process_default_desktop( struct process *process, struct desktop *desktop, obj_handle_t handle ) -@@ -344,12 +352,6 @@ void set_process_default_desktop( struct process *process, struct desktop *deskt +@@ -364,12 +372,6 @@ void set_process_default_desktop( struct process *process, struct desktop *deskt LIST_FOR_EACH_ENTRY( thread, &process->thread_list, struct thread, proc_entry ) if (!thread->desktop) thread->desktop = handle; @@ -237,7 +237,7 @@ index 17c312a..46ade3b 100644 if (old_desktop) release_object( old_desktop ); } -@@ -399,8 +401,8 @@ done: +@@ -419,8 +421,8 @@ done: void close_process_desktop( struct process *process ) { struct desktop *desktop; @@ -249,5 +249,5 @@ index 17c312a..46ade3b 100644 remove_desktop_user( desktop ); release_object( desktop ); -- -2.7.0 +1.9.1 diff --git a/patches/server-Desktop_Refcount/0004-server-Assign-random-name-when-no-name-was-passed-to.patch b/patches/server-Desktop_Refcount/0004-server-Assign-random-name-when-no-name-was-passed-to.patch index 77c400e7..45ae1388 100644 --- a/patches/server-Desktop_Refcount/0004-server-Assign-random-name-when-no-name-was-passed-to.patch +++ b/patches/server-Desktop_Refcount/0004-server-Assign-random-name-when-no-name-was-passed-to.patch @@ -1,7 +1,7 @@ -From 5ae23a4a5d6c964035bdb8ecddb3fe7a74dc691d Mon Sep 17 00:00:00 2001 +From 7db6d5b2412223cc16ff726502c7b3c66eab41c3 Mon Sep 17 00:00:00 2001 From: Sebastian Lackner Date: Wed, 24 Feb 2016 19:18:52 +0100 -Subject: server: Assign random name when no name was passed to +Subject: [PATCH 3/3] server: Assign random name when no name was passed to create_winstation. --- @@ -10,7 +10,7 @@ Subject: server: Assign random name when no name was passed to 2 files changed, 25 insertions(+), 3 deletions(-) diff --git a/dlls/user32/tests/winstation.c b/dlls/user32/tests/winstation.c -index 94be4c9..33f50d8 100644 +index 6bebfe9..1ca71a1 100644 --- a/dlls/user32/tests/winstation.c +++ b/dlls/user32/tests/winstation.c @@ -220,8 +220,8 @@ static void test_handles(void) @@ -25,10 +25,10 @@ index 94be4c9..33f50d8 100644 SetLastError( 0xdeadbeef ); w3 = OpenWindowStationA( "", TRUE, WINSTA_ALL_ACCESS ); diff --git a/server/winstation.c b/server/winstation.c -index 0034343..39131d5 100644 +index fde6b68..f96936f 100644 --- a/server/winstation.c +++ b/server/winstation.c -@@ -111,9 +111,30 @@ static const struct object_ops desktop_ops = +@@ -113,9 +113,30 @@ static const struct object_ops desktop_ops = static struct winstation *create_winstation( struct object *root, const struct unicode_str *name, unsigned int attr, unsigned int flags ) { @@ -60,7 +60,7 @@ index 0034343..39131d5 100644 { if (get_error() != STATUS_OBJECT_NAME_EXISTS) { -@@ -131,6 +152,7 @@ static struct winstation *create_winstation( struct object *root, const struct u +@@ -133,6 +154,7 @@ static struct winstation *create_winstation( struct object *root, const struct u } else clear_error(); } @@ -69,5 +69,5 @@ index 0034343..39131d5 100644 } -- -2.8.0 +1.9.1 diff --git a/patches/server-Desktop_Refcount/definition b/patches/server-Desktop_Refcount/definition index 0870a8d3..fcd617bc 100644 --- a/patches/server-Desktop_Refcount/definition +++ b/patches/server-Desktop_Refcount/definition @@ -1,3 +1,3 @@ Fixes: Fix possible leak of explorer.exe processes and implement proper desktop refcounting Fixes: Assign random name when trying to create Window Station without name -Disabled: True +Fixes: [46967] GOG Galaxy doesn't run in virtual desktop. diff --git a/patches/ws2_32-TransmitFile/0002-ws2_32-Add-support-for-TF_REUSE_SOCKET-to-TransmitFi.patch b/patches/ws2_32-TransmitFile/0002-ws2_32-Add-support-for-TF_REUSE_SOCKET-to-TransmitFi.patch index 8e1fe87e..cbd65a5b 100644 --- a/patches/ws2_32-TransmitFile/0002-ws2_32-Add-support-for-TF_REUSE_SOCKET-to-TransmitFi.patch +++ b/patches/ws2_32-TransmitFile/0002-ws2_32-Add-support-for-TF_REUSE_SOCKET-to-TransmitFi.patch @@ -1,21 +1,21 @@ -From 4b387117f10718d3796709bb6851fd8c46898f25 Mon Sep 17 00:00:00 2001 +From 9565c624d9d70dc5433a89be22ea14ae58e52d28 Mon Sep 17 00:00:00 2001 From: "Erich E. Hoover" Date: Thu, 16 Jan 2014 19:08:30 -0700 Subject: [PATCH] ws2_32: Add support for TF_REUSE_SOCKET to TransmitFile. --- - dlls/ws2_32/socket.c | 13 ++++++++- + dlls/ws2_32/socket.c | 13 +++++++++- dlls/ws2_32/tests/sock.c | 1 - include/winsock.h | 1 + - server/protocol.def | 6 ++++ - server/sock.c | 63 +++++++++++++++++++++++++++++++++++----- + server/protocol.def | 6 +++++ + server/sock.c | 63 ++++++++++++++++++++++++++++++++++++++++++------ 5 files changed, 74 insertions(+), 10 deletions(-) diff --git a/dlls/ws2_32/socket.c b/dlls/ws2_32/socket.c -index 9a720458a22..00c47151e16 100644 +index 6be4324..3cdd76b 100644 --- a/dlls/ws2_32/socket.c +++ b/dlls/ws2_32/socket.c -@@ -3092,6 +3092,17 @@ static NTSTATUS WS2_transmitfile_base( int fd, struct ws2_transmitfile_async *ws +@@ -3103,6 +3103,17 @@ static NTSTATUS WS2_transmitfile_base( int fd, struct ws2_transmitfile_async *ws if (status != STATUS_SUCCESS) return status; @@ -33,7 +33,7 @@ index 9a720458a22..00c47151e16 100644 if (wsa->flags & TF_DISCONNECT) { /* we can't use WS_closesocket because it modifies the last error */ -@@ -3134,7 +3145,7 @@ static BOOL WINAPI WS2_TransmitFile( SOCKET s, HANDLE h, DWORD file_bytes, DWORD +@@ -3145,7 +3156,7 @@ static BOOL WINAPI WS2_TransmitFile( SOCKET s, HANDLE h, DWORD file_bytes, DWORD LPOVERLAPPED overlapped, LPTRANSMIT_FILE_BUFFERS buffers, DWORD flags ) { @@ -43,10 +43,10 @@ index 9a720458a22..00c47151e16 100644 socklen_t uaddrlen = sizeof(uaddr); struct ws2_transmitfile_async *wsa; diff --git a/dlls/ws2_32/tests/sock.c b/dlls/ws2_32/tests/sock.c -index bcbc56bcb1e..ad80f1614e5 100644 +index dbcb2b2..c14f5f9 100644 --- a/dlls/ws2_32/tests/sock.c +++ b/dlls/ws2_32/tests/sock.c -@@ -9099,7 +9099,6 @@ static void test_TransmitFile(void) +@@ -9095,7 +9095,6 @@ static void test_TransmitFile(void) err, WSAENOTSOCK); /* Test TransmitFile with a UDP datagram socket */ @@ -55,7 +55,7 @@ index bcbc56bcb1e..ad80f1614e5 100644 bret = pTransmitFile(client, NULL, 0, 0, NULL, NULL, 0); err = WSAGetLastError(); diff --git a/include/winsock.h b/include/winsock.h -index 789e1da8172..86ce4ffcf05 100644 +index 789e1da..86ce4ff 100644 --- a/include/winsock.h +++ b/include/winsock.h @@ -829,6 +829,7 @@ typedef struct WS(WSAData) @@ -67,10 +67,10 @@ index 789e1da8172..86ce4ffcf05 100644 #define FD_WINE_NONBLOCKING 0x20000000 #define FD_WINE_CONNECTED 0x40000000 diff --git a/server/protocol.def b/server/protocol.def -index a001556ca10..89487916d0b 100644 +index 8795c67..94c1535 100644 --- a/server/protocol.def +++ b/server/protocol.def -@@ -1378,6 +1378,12 @@ enum server_fd_type +@@ -1382,6 +1382,12 @@ enum server_fd_type @END @@ -84,7 +84,7 @@ index a001556ca10..89487916d0b 100644 @REQ(set_socket_event) obj_handle_t handle; /* handle to the socket */ diff --git a/server/sock.c b/server/sock.c -index 44874fa55c4..fea7bd1f275 100644 +index 77c3db8..8b85e59 100644 --- a/server/sock.c +++ b/server/sock.c @@ -86,6 +86,7 @@ @@ -103,16 +103,16 @@ index 44874fa55c4..fea7bd1f275 100644 static int sock_get_ntstatus( int err ); static unsigned int sock_get_error( int err ); -@@ -155,7 +157,7 @@ static const struct object_ops sock_ops = - NULL, /* unlink_name */ +@@ -157,7 +159,7 @@ static const struct object_ops sock_ops = no_open_file, /* open_file */ no_kernel_obj_list, /* get_kernel_obj_list */ + no_alloc_handle, /* alloc_handle */ - fd_close_handle, /* close_handle */ + sock_close_handle, /* close_handle */ sock_destroy /* destroy */ }; -@@ -607,6 +609,46 @@ static struct fd *sock_get_fd( struct object *obj ) +@@ -609,6 +611,46 @@ static struct fd *sock_get_fd( struct object *obj ) return (struct fd *)grab_object( sock->fd ); } @@ -159,7 +159,7 @@ index 44874fa55c4..fea7bd1f275 100644 static void sock_destroy( struct object *obj ) { struct sock *sock = (struct sock *)obj; -@@ -660,14 +702,8 @@ static struct object *create_socket( int family, int type, int protocol, unsigne +@@ -662,14 +704,8 @@ static struct object *create_socket( int family, int type, int protocol, unsigne struct sock *sock; int sockfd; @@ -175,7 +175,7 @@ index 44874fa55c4..fea7bd1f275 100644 if (!(sock = alloc_object( &sock_ops ))) { close( sockfd ); -@@ -1218,6 +1254,17 @@ DECL_HANDLER(accept_into_socket) +@@ -1222,6 +1258,17 @@ DECL_HANDLER(accept_into_socket) release_object( sock ); } @@ -194,5 +194,5 @@ index 44874fa55c4..fea7bd1f275 100644 DECL_HANDLER(set_socket_event) { -- -2.20.1 +1.9.1 diff --git a/patches/ws2_32-TransmitFile/definition b/patches/ws2_32-TransmitFile/definition index f5bdddd2..dde30b29 100644 --- a/patches/ws2_32-TransmitFile/definition +++ b/patches/ws2_32-TransmitFile/definition @@ -1,2 +1,2 @@ # Fixes: [5048] Support for TransmitFile -#Depends: server-Desktop_Refcount +Depends: server-Desktop_Refcount diff --git a/patches/ws2_32-WSACleanup/0001-ws2_32-Proper-WSACleanup-implementation-using-winese.patch b/patches/ws2_32-WSACleanup/0001-ws2_32-Proper-WSACleanup-implementation-using-winese.patch index d4969bd9..0fef2c8e 100644 --- a/patches/ws2_32-WSACleanup/0001-ws2_32-Proper-WSACleanup-implementation-using-winese.patch +++ b/patches/ws2_32-WSACleanup/0001-ws2_32-Proper-WSACleanup-implementation-using-winese.patch @@ -118,7 +118,7 @@ index 84f54f6..9ad4e87 100644 + unsigned int index = 0; + obj_handle_t sock; + -+ while ((sock = enumerate_handles(current->process, &sock_ops, &index))) ++ while ((sock = enumerate_handles(current->process, &sock_ops, &index, NULL))) + close_handle(current->process, sock); +} --