diff --git a/.github/workflows/wine.yml b/.github/workflows/wine.yml index 56950ab..8adbe33 100644 --- a/.github/workflows/wine.yml +++ b/.github/workflows/wine.yml @@ -6,7 +6,7 @@ permissions: contents: read pull-requests: read env: - WINE_VERSION: 9.13 + WINE_VERSION: 9.18 jobs: build: runs-on: ubuntu-latest diff --git a/childwindow-proton.patch b/childwindow-proton.patch deleted file mode 100644 index dca846f..0000000 --- a/childwindow-proton.patch +++ /dev/null @@ -1,618 +0,0 @@ -diff --git a/dlls/win32u/ntuser_private.h b/dlls/win32u/ntuser_private.h -index 11b1a3ff8a10808e751c2e867764c90d367a21c0..7662436a588a44455c37fbd8e63995ce66b6e258 100644 ---- a/dlls/win32u/ntuser_private.h -+++ b/dlls/win32u/ntuser_private.h -@@ -257,6 +257,8 @@ extern LRESULT system_tray_call( HWND hwnd, UINT msg, WPARAM wparam, LPARAM lpar - - /* vulkan.c */ - extern void vulkan_detach_surfaces( struct list *surfaces ); -+extern void vulkan_set_parent( HWND hwnd, HWND new_parent, HWND old_parent ); -+extern void vulkan_set_region( HWND toplevel, HRGN region ); - - /* window.c */ - HANDLE alloc_user_handle( struct user_object *ptr, unsigned int type ); -diff --git a/dlls/win32u/vulkan.c b/dlls/win32u/vulkan.c -index 5b128afe3cb3c1f752ed0f90b0e3b06915d27420..29c9dfbdb72cc9dc433cdd61ae0b6fba3c3aa0de 100644 ---- a/dlls/win32u/vulkan.c -+++ b/dlls/win32u/vulkan.c -@@ -45,6 +45,10 @@ static void *vulkan_handle; - static const struct vulkan_driver_funcs *driver_funcs; - static struct vulkan_funcs vulkan_funcs; - -+/* list of surfaces attached to other processes / desktop windows */ -+static struct list offscreen_surfaces = LIST_INIT(offscreen_surfaces); -+static pthread_mutex_t vulkan_mutex = PTHREAD_MUTEX_INITIALIZER; -+ - static void (*p_vkDestroySurfaceKHR)(VkInstance, VkSurfaceKHR, const VkAllocationCallbacks *); - static VkResult (*p_vkQueuePresentKHR)(VkQueue, const VkPresentInfoKHR *); - static void *(*p_vkGetDeviceProcAddr)(VkDevice, const char *); -@@ -55,6 +59,8 @@ struct surface - struct list entry; - VkSurfaceKHR host_surface; - void *driver_private; -+ HDC offscreen_dc; -+ HRGN region; - HWND hwnd; - }; - -@@ -71,6 +77,7 @@ static inline VkSurfaceKHR surface_to_handle( struct surface *surface ) - static VkResult win32u_vkCreateWin32SurfaceKHR( VkInstance instance, const VkWin32SurfaceCreateInfoKHR *info, - const VkAllocationCallbacks *allocator, VkSurfaceKHR *handle ) - { -+ HWND toplevel = NtUserGetAncestor( info->hwnd, GA_ROOT ); - struct surface *surface; - VkResult res; - WND *win; -@@ -85,14 +92,24 @@ static VkResult win32u_vkCreateWin32SurfaceKHR( VkInstance instance, const VkWin - return res; - } - -- if (!(win = get_win_ptr( info->hwnd )) || win == WND_DESKTOP || win == WND_OTHER_PROCESS) -- list_init( &surface->entry ); -+ /* make sure the window has a pixel format selected to get consistent window surface updates */ -+ if (!win32u_get_window_pixel_format( info->hwnd )) win32u_set_window_pixel_format( info->hwnd, 1, TRUE ); -+ -+ if (!(win = get_win_ptr( toplevel )) || win == WND_DESKTOP || win == WND_OTHER_PROCESS) -+ { -+ pthread_mutex_lock( &vulkan_mutex ); -+ list_add_tail( &offscreen_surfaces, &surface->entry ); -+ pthread_mutex_unlock( &vulkan_mutex ); -+ driver_funcs->p_vulkan_surface_detach( info->hwnd, surface->driver_private, &surface->offscreen_dc ); -+ } - else - { - list_add_tail( &win->vulkan_surfaces, &surface->entry ); - release_win_ptr( win ); -+ if (toplevel != info->hwnd) driver_funcs->p_vulkan_surface_detach( info->hwnd, surface->driver_private, &surface->offscreen_dc ); - } - -+ surface->region = NtGdiCreateRectRgn( 0, 0, 0, 0 ); - surface->hwnd = info->hwnd; - *handle = surface_to_handle( surface ); - return VK_SUCCESS; -@@ -105,9 +122,14 @@ static void win32u_vkDestroySurfaceKHR( VkInstance instance, VkSurfaceKHR handle - TRACE( "instance %p, handle 0x%s, allocator %p\n", instance, wine_dbgstr_longlong(handle), allocator ); - if (allocator) FIXME( "Support for allocation callbacks not implemented yet\n" ); - -+ pthread_mutex_lock( &vulkan_mutex ); - list_remove( &surface->entry ); -+ pthread_mutex_unlock( &vulkan_mutex ); -+ -+ if (surface->offscreen_dc) NtGdiDeleteObjectApp( surface->offscreen_dc ); - p_vkDestroySurfaceKHR( instance, surface->host_surface, NULL /* allocator */ ); - driver_funcs->p_vulkan_surface_destroy( surface->hwnd, surface->driver_private ); -+ NtGdiDeleteObjectApp( surface->region ); - free( surface ); - } - -@@ -126,6 +148,26 @@ static VkResult win32u_vkQueuePresentKHR( VkQueue queue, const VkPresentInfoKHR - struct surface *surface = surface_from_handle( surfaces[i] ); - - driver_funcs->p_vulkan_surface_presented( surface->hwnd, swapchain_res ); -+ -+ if (swapchain_res >= VK_SUCCESS && surface->offscreen_dc) -+ { -+ UINT width, height; -+ RECT client_rect; -+ HDC hdc_dst; -+ -+ NtUserGetClientRect( surface->hwnd, &client_rect, get_win_monitor_dpi(surface->hwnd)); -+ width = client_rect.right - client_rect.left; -+ height = client_rect.bottom - client_rect.top; -+ -+ WARN("Copying vulkan child window %p rect %s\n", surface->hwnd, wine_dbgstr_rect(&client_rect)); -+ -+ if ((hdc_dst = NtUserGetDCEx(surface->hwnd, surface->region, DCX_USESTYLE | DCX_CACHE))) -+ { -+ NtGdiStretchBlt(hdc_dst, client_rect.left, client_rect.top, width, height, -+ surface->offscreen_dc, 0, 0, width, height, SRCCOPY, 0); -+ NtUserReleaseDC(surface->hwnd, hdc_dst); -+ } -+ } - } - - return res; -@@ -185,7 +227,11 @@ static void nulldrv_vulkan_surface_destroy( HWND hwnd, void *private ) - { - } - --static void nulldrv_vulkan_surface_detach( HWND hwnd, void *private ) -+static void nulldrv_vulkan_surface_attach( HWND hwnd, void *private ) -+{ -+} -+ -+static void nulldrv_vulkan_surface_detach( HWND hwnd, void *private, HDC *hdc ) - { - } - -@@ -207,6 +253,7 @@ static const struct vulkan_driver_funcs nulldrv_funcs = - { - .p_vulkan_surface_create = nulldrv_vulkan_surface_create, - .p_vulkan_surface_destroy = nulldrv_vulkan_surface_destroy, -+ .p_vulkan_surface_attach = nulldrv_vulkan_surface_attach, - .p_vulkan_surface_detach = nulldrv_vulkan_surface_detach, - .p_vulkan_surface_presented = nulldrv_vulkan_surface_presented, - .p_vkGetPhysicalDeviceWin32PresentationSupportKHR = nulldrv_vkGetPhysicalDeviceWin32PresentationSupportKHR, -@@ -251,10 +298,16 @@ static void lazydrv_vulkan_surface_destroy( HWND hwnd, void *private ) - return driver_funcs->p_vulkan_surface_destroy( hwnd, private ); - } - --static void lazydrv_vulkan_surface_detach( HWND hwnd, void *private ) -+static void lazydrv_vulkan_surface_attach( HWND hwnd, void *private ) -+{ -+ vulkan_driver_load(); -+ return driver_funcs->p_vulkan_surface_attach( hwnd, private ); -+} -+ -+static void lazydrv_vulkan_surface_detach( HWND hwnd, void *private, HDC *hdc ) - { - vulkan_driver_load(); -- return driver_funcs->p_vulkan_surface_detach( hwnd, private ); -+ return driver_funcs->p_vulkan_surface_detach( hwnd, private, hdc ); - } - - static void lazydrv_vulkan_surface_presented( HWND hwnd, VkResult result ) -@@ -279,6 +332,7 @@ static const struct vulkan_driver_funcs lazydrv_funcs = - { - .p_vulkan_surface_create = lazydrv_vulkan_surface_create, - .p_vulkan_surface_destroy = lazydrv_vulkan_surface_destroy, -+ .p_vulkan_surface_attach = lazydrv_vulkan_surface_attach, - .p_vulkan_surface_detach = lazydrv_vulkan_surface_detach, - .p_vulkan_surface_presented = lazydrv_vulkan_surface_presented, - }; -@@ -313,14 +367,122 @@ static void vulkan_init(void) - - void vulkan_detach_surfaces( struct list *surfaces ) - { -+ struct surface *surface; -+ -+ LIST_FOR_EACH_ENTRY( surface, surfaces, struct surface, entry ) -+ { -+ if (surface->offscreen_dc) continue; -+ driver_funcs->p_vulkan_surface_detach( surface->hwnd, surface->driver_private, &surface->offscreen_dc ); -+ } -+ -+ pthread_mutex_lock( &vulkan_mutex ); -+ list_move_tail( &offscreen_surfaces, surfaces ); -+ pthread_mutex_unlock( &vulkan_mutex ); -+} -+ -+static void append_window_surfaces( HWND toplevel, struct list *surfaces ) -+{ -+ WND *win; -+ -+ if (!(win = get_win_ptr( toplevel )) || win == WND_DESKTOP || win == WND_OTHER_PROCESS) -+ { -+ pthread_mutex_lock( &vulkan_mutex ); -+ list_move_tail( &offscreen_surfaces, surfaces ); -+ pthread_mutex_unlock( &vulkan_mutex ); -+ } -+ else -+ { -+ list_move_tail( &win->vulkan_surfaces, surfaces ); -+ release_win_ptr( win ); -+ } -+} -+ -+static void enum_window_surfaces( HWND toplevel, HWND hwnd, struct list *surfaces ) -+{ -+ struct list tmp_surfaces = LIST_INIT(tmp_surfaces); - struct surface *surface, *next; -+ WND *win; - -- LIST_FOR_EACH_ENTRY_SAFE( surface, next, surfaces, struct surface, entry ) -+ if (!(win = get_win_ptr( toplevel )) || win == WND_DESKTOP || win == WND_OTHER_PROCESS) -+ { -+ pthread_mutex_lock( &vulkan_mutex ); -+ list_move_tail( &tmp_surfaces, &offscreen_surfaces ); -+ pthread_mutex_unlock( &vulkan_mutex ); -+ } -+ else - { -- driver_funcs->p_vulkan_surface_detach( surface->hwnd, surface->driver_private ); -+ list_move_tail( &tmp_surfaces, &win->vulkan_surfaces ); -+ release_win_ptr( win ); -+ } -+ -+ LIST_FOR_EACH_ENTRY_SAFE( surface, next, &tmp_surfaces, struct surface, entry ) -+ { -+ if (surface->hwnd != hwnd && !NtUserIsChild( hwnd, surface->hwnd )) continue; - list_remove( &surface->entry ); -- list_init( &surface->entry ); -+ list_add_tail( surfaces, &surface->entry ); -+ } -+ -+ append_window_surfaces( toplevel, &tmp_surfaces ); -+} -+ -+void vulkan_set_parent( HWND hwnd, HWND new_parent, HWND old_parent ) -+{ -+ struct list surfaces = LIST_INIT(surfaces); -+ HWND new_toplevel, old_toplevel; -+ struct surface *surface; -+ -+ TRACE( "hwnd %p new_parent %p old_parent %p\n", hwnd, new_parent, old_parent ); -+ -+ if (new_parent == NtUserGetDesktopWindow()) new_toplevel = hwnd; -+ else new_toplevel = NtUserGetAncestor( new_parent, GA_ROOT ); -+ if (old_parent == NtUserGetDesktopWindow()) old_toplevel = hwnd; -+ else old_toplevel = NtUserGetAncestor( old_parent, GA_ROOT ); -+ if (old_toplevel == new_toplevel) return; -+ -+ enum_window_surfaces( old_toplevel, hwnd, &surfaces ); -+ -+ /* surfaces will be re-attached as needed from surface region updates */ -+ LIST_FOR_EACH_ENTRY( surface, &surfaces, struct surface, entry ) -+ { -+ if (surface->offscreen_dc) continue; -+ driver_funcs->p_vulkan_surface_detach( surface->hwnd, surface->driver_private, &surface->offscreen_dc ); - } -+ -+ append_window_surfaces( new_toplevel, &surfaces ); -+} -+ -+void vulkan_set_region( HWND toplevel, HRGN region ) -+{ -+ struct list surfaces = LIST_INIT(surfaces); -+ struct surface *surface; -+ -+ enum_window_surfaces( toplevel, toplevel, &surfaces ); -+ -+ LIST_FOR_EACH_ENTRY( surface, &surfaces, struct surface, entry ) -+ { -+ RECT client_rect; -+ BOOL is_clipped; -+ -+ NtUserGetClientRect( surface->hwnd, &client_rect, get_win_monitor_dpi(surface->hwnd)); -+ NtUserMapWindowPoints( surface->hwnd, toplevel, (POINT *)&client_rect, 2, 0 /* per-monitor DPI */ ); -+ is_clipped = NtGdiRectInRegion( region, &client_rect ); -+ -+ if (is_clipped && !surface->offscreen_dc) -+ { -+ TRACE( "surface %p is now clipped\n", surface->hwnd ); -+ driver_funcs->p_vulkan_surface_detach( surface->hwnd, surface->driver_private, &surface->offscreen_dc ); -+ NtGdiCombineRgn( surface->region, region, 0, RGN_COPY ); -+ } -+ else if (!is_clipped && surface->offscreen_dc) -+ { -+ TRACE( "surface %p is now unclipped\n", surface->hwnd ); -+ driver_funcs->p_vulkan_surface_attach( surface->hwnd, surface->driver_private ); -+ NtGdiDeleteObjectApp( surface->offscreen_dc ); -+ surface->offscreen_dc = NULL; -+ } -+ } -+ -+ append_window_surfaces( toplevel, &surfaces ); - } - - /*********************************************************************** -diff --git a/dlls/win32u/window.c b/dlls/win32u/window.c -index 13dd1c8d80a963161d0d342e8c030199c44479e8..4cef4b7175703f80555c2f028a3a5b702d5e355a 100644 ---- a/dlls/win32u/window.c -+++ b/dlls/win32u/window.c -@@ -463,6 +463,7 @@ HWND WINAPI NtUserSetParent( HWND hwnd, HWND parent ) - context = SetThreadDpiAwarenessContext( get_window_dpi_awareness_context( hwnd )); - - user_driver->pSetParent( full_handle, parent, old_parent ); -+ vulkan_set_parent( full_handle, parent, old_parent ); - - winpos.hwnd = hwnd; - winpos.hwndInsertAfter = HWND_TOP; -@@ -1777,7 +1777,6 @@ static void update_surface_region( HWND hwnd ) - region = NtGdiCreateRectRgn( 0, 0, visible.right - visible.left, visible.bottom - visible.top ); - NtGdiCombineRgn( shape, shape, region, RGN_AND ); - if (win->dwExStyle & WS_EX_LAYOUTRTL) NtUserMirrorRgn( hwnd, shape ); -- NtGdiDeleteObjectApp( region ); - } - - if (get_window_region( hwnd, TRUE, ®ion, &visible )) goto done; -@@ -1787,10 +1787,12 @@ static void update_surface_region( HWND hwnd ) - NtGdiOffsetRgn( region, -visible.left, -visible.top ); - if (shape) NtGdiCombineRgn( region, region, shape, RGN_AND ); - window_surface_set_clip( win->surface, region ); -- NtGdiDeleteObjectApp( region ); - } - - done: - if (shape) NtGdiDeleteObjectApp( shape ); - release_win_ptr( win ); -+ -+ vulkan_set_region( hwnd, region ); -+ if (region) NtGdiDeleteObjectApp( region ); - } - - /*********************************************************************** -diff --git a/dlls/winemac.drv/vulkan.c b/dlls/winemac.drv/vulkan.c -index d5a3df579d05b2cb19cbef4a084fad7489552925..736d0d397d5012977d4cfb44184f8008eb5adf2b 100644 ---- a/dlls/winemac.drv/vulkan.c -+++ b/dlls/winemac.drv/vulkan.c -@@ -178,7 +178,11 @@ static void macdrv_vulkan_surface_destroy(HWND hwnd, void *private) - wine_vk_surface_destroy(mac_surface); - } - --static void macdrv_vulkan_surface_detach(HWND hwnd, void *private) -+static void macdrv_vulkan_surface_attach(HWND hwnd, void *private) -+{ -+} -+ -+static void macdrv_vulkan_surface_detach(HWND hwnd, void *private, HDC *hdc) - { - } - -@@ -203,6 +207,7 @@ static const struct vulkan_driver_funcs macdrv_vulkan_driver_funcs = - { - .p_vulkan_surface_create = macdrv_vulkan_surface_create, - .p_vulkan_surface_destroy = macdrv_vulkan_surface_destroy, -+ .p_vulkan_surface_attach = macdrv_vulkan_surface_attach, - .p_vulkan_surface_detach = macdrv_vulkan_surface_detach, - .p_vulkan_surface_presented = macdrv_vulkan_surface_presented, - -diff --git a/dlls/winewayland.drv/vulkan.c b/dlls/winewayland.drv/vulkan.c -index 16084175013a4441ed3db61752340772dcd72dc3..175d8cfa49a24c66f3369375b162821660f499d6 100644 ---- a/dlls/winewayland.drv/vulkan.c -+++ b/dlls/winewayland.drv/vulkan.c -@@ -132,7 +132,11 @@ static void wayland_vulkan_surface_destroy(HWND hwnd, void *private) - wine_vk_surface_destroy(client); - } - --static void wayland_vulkan_surface_detach(HWND hwnd, void *private) -+static void wayland_vulkan_surface_attach(HWND hwnd, void *private) -+{ -+} -+ -+static void wayland_vulkan_surface_detach(HWND hwnd, void *private, HDC *hdc) - { - } - -@@ -175,6 +179,7 @@ static const struct vulkan_driver_funcs wayland_vulkan_driver_funcs = - { - .p_vulkan_surface_create = wayland_vulkan_surface_create, - .p_vulkan_surface_destroy = wayland_vulkan_surface_destroy, -+ .p_vulkan_surface_attach = wayland_vulkan_surface_attach, - .p_vulkan_surface_detach = wayland_vulkan_surface_detach, - .p_vulkan_surface_presented = wayland_vulkan_surface_presented, - -diff --git a/dlls/winex11.drv/vulkan.c b/dlls/winex11.drv/vulkan.c -index 85993bc517a5d0ac2e6736278d0f3db9c52bf82b..df6882271b440bdcf7ea32854e77dfdc16719fa3 100644 ---- a/dlls/winex11.drv/vulkan.c -+++ b/dlls/winex11.drv/vulkan.c -@@ -37,6 +37,7 @@ - - #include "wine/debug.h" - #include "x11drv.h" -+#include "xcomposite.h" - - #define VK_NO_PROTOTYPES - #define WINE_VK_HOST -@@ -74,13 +75,6 @@ static VkResult X11DRV_vulkan_surface_create( HWND hwnd, VkInstance instance, Vk - - TRACE( "%p %p %p %p\n", hwnd, instance, surface, private ); - -- /* TODO: support child window rendering. */ -- if (NtUserGetAncestor( hwnd, GA_PARENT ) != NtUserGetDesktopWindow()) -- { -- FIXME("Application requires child window rendering, which is not implemented yet!\n"); -- return VK_ERROR_INCOMPATIBLE_DRIVER; -- } -- - if (!(info.window = create_client_window( hwnd, &default_visual, default_colormap ))) - { - ERR("Failed to allocate client window for hwnd=%p\n", hwnd); -@@ -109,18 +103,50 @@ static void X11DRV_vulkan_surface_destroy( HWND hwnd, void *private ) - destroy_client_window( hwnd, client_window ); - } - --static void X11DRV_vulkan_surface_detach( HWND hwnd, void *private ) -+static void X11DRV_vulkan_surface_attach( HWND hwnd, void *private ) - { - Window client_window = (Window)private; - struct x11drv_win_data *data; - - TRACE( "%p %p\n", hwnd, private ); - -+ if ((data = get_win_data( hwnd ))) -+ { -+#ifdef SONAME_LIBXCOMPOSITE -+ if (usexcomposite) pXCompositeUnredirectWindow( gdi_display, client_window, CompositeRedirectManual ); -+#endif -+ attach_client_window( data, client_window ); -+ release_win_data( data ); -+ } -+} -+ -+static void X11DRV_vulkan_surface_detach( HWND hwnd, void *private, HDC *hdc ) -+{ -+ static const WCHAR displayW[] = {'D','I','S','P','L','A','Y'}; -+ UNICODE_STRING device_str = RTL_CONSTANT_STRING(displayW); -+ Window client_window = (Window)private; -+ struct x11drv_win_data *data; -+ -+ TRACE( "%p %p %p\n", hwnd, private, hdc ); -+ - if ((data = get_win_data( hwnd ))) - { - detach_client_window( data, client_window ); - release_win_data( data ); - } -+ -+ if (hdc && (*hdc = NtGdiOpenDCW( &device_str, NULL, NULL, 0, TRUE, NULL, NULL, NULL ))) -+ { -+ struct x11drv_escape_set_drawable escape = {0}; -+ escape.code = X11DRV_SET_DRAWABLE; -+ escape.mode = IncludeInferiors; -+ escape.drawable = client_window; -+ NtUserGetClientRect( hwnd, &escape.dc_rect, get_win_monitor_dpi(hwnd) ); -+ NtGdiExtEscape( *hdc, NULL, 0, X11DRV_ESCAPE, sizeof(escape), (LPSTR)&escape, 0, NULL ); -+#ifdef SONAME_LIBXCOMPOSITE -+ if (usexcomposite) pXCompositeRedirectWindow( gdi_display, client_window, CompositeRedirectManual ); -+#endif -+ } - } - - static void X11DRV_vulkan_surface_presented(HWND hwnd, VkResult result) -@@ -145,6 +171,7 @@ static const struct vulkan_driver_funcs x11drv_vulkan_driver_funcs = - { - .p_vulkan_surface_create = X11DRV_vulkan_surface_create, - .p_vulkan_surface_destroy = X11DRV_vulkan_surface_destroy, -+ .p_vulkan_surface_attach = X11DRV_vulkan_surface_attach, - .p_vulkan_surface_detach = X11DRV_vulkan_surface_detach, - .p_vulkan_surface_presented = X11DRV_vulkan_surface_presented, - -diff --git a/dlls/winex11.drv/window.c b/dlls/winex11.drv/window.c -index c6bf49c6ec8bc83580a42abb3eb9314189280673..3a93ed89afe11e21464bf5211dd09636a188810f 100644 ---- a/dlls/winex11.drv/window.c -+++ b/dlls/winex11.drv/window.c -@@ -1456,8 +1456,21 @@ static void sync_client_position( struct x11drv_win_data *data, - - if (!data->client_window) return; - -- changes.x = data->client_rect.left - data->whole_rect.left; -- changes.y = data->client_rect.top - data->whole_rect.top; -+ if (data->whole_window) -+ { -+ changes.x = data->client_rect.left - data->whole_rect.left; -+ changes.y = data->client_rect.top - data->whole_rect.top; -+ } -+ else -+ { -+ HWND toplevel = NtUserGetAncestor( data->hwnd, GA_ROOT ); -+ POINT pos = {data->client_rect.left, data->client_rect.top}; -+ -+ NtUserMapWindowPoints( toplevel, toplevel, &pos, 1, 0 /* per-monitor DPI */ ); -+ changes.x = pos.x; -+ changes.y = pos.y; -+ } -+ - changes.width = min( max( 1, data->client_rect.right - data->client_rect.left ), 65535 ); - changes.height = min( max( 1, data->client_rect.bottom - data->client_rect.top ), 65535 ); - -@@ -1610,11 +1623,8 @@ void detach_client_window( struct x11drv_win_data *data, Window client_window ) - - TRACE( "%p/%lx detaching client window %lx\n", data->hwnd, data->whole_window, client_window ); - -- if (data->whole_window) -- { -- client_window_events_disable( data, client_window ); -- XReparentWindow( gdi_display, client_window, get_dummy_parent(), 0, 0 ); -- } -+ client_window_events_disable( data, client_window ); -+ XReparentWindow( gdi_display, client_window, get_dummy_parent(), 0, 0 ); - - data->client_window = 0; - } -@@ -1623,20 +1633,35 @@ void detach_client_window( struct x11drv_win_data *data, Window client_window ) - /********************************************************************** - * attach_client_window - */ --static void attach_client_window( struct x11drv_win_data *data, Window client_window ) -+void attach_client_window( struct x11drv_win_data *data, Window client_window ) - { -+ Window whole_window; -+ POINT pos = {0}; -+ - if (data->client_window == client_window || !client_window) return; - - TRACE( "%p/%lx attaching client window %lx\n", data->hwnd, data->whole_window, client_window ); - - detach_client_window( data, data->client_window ); - -- if (data->whole_window) -+ if ((whole_window = data->whole_window)) - { -- client_window_events_enable( data, client_window ); -- XReparentWindow( gdi_display, client_window, data->whole_window, data->client_rect.left - data->whole_rect.left, -- data->client_rect.top - data->whole_rect.top ); -+ pos.x = data->client_rect.left - data->whole_rect.left; -+ pos.y = data->client_rect.top - data->whole_rect.top; - } -+ else -+ { -+ HWND toplevel = NtUserGetAncestor( data->hwnd, GA_ROOT ); -+ whole_window = X11DRV_get_whole_window( toplevel ); -+ -+ pos.x = data->client_rect.left; -+ pos.y = data->client_rect.top; -+ NtUserMapWindowPoints( toplevel, toplevel, &pos, 1, 0 /* per-monitor DPI */ ); -+ } -+ if (!whole_window) whole_window = get_dummy_parent(); -+ -+ client_window_events_enable( data, client_window ); -+ XReparentWindow( gdi_display, client_window, whole_window, pos.x, pos.y ); - - data->client_window = client_window; - } -@@ -1800,6 +1825,9 @@ static void destroy_whole_window( struct x11drv_win_data *data, BOOL already_des - { - TRACE( "win %p xwin %lx/%lx\n", data->hwnd, data->whole_window, data->client_window ); - -+ if (!already_destroyed) detach_client_window( data, data->client_window ); -+ else if (data->client_window) client_window_events_disable( data, data->client_window ); -+ - if (!data->whole_window) - { - if (data->embedded) -@@ -1816,8 +1844,6 @@ static void destroy_whole_window( struct x11drv_win_data *data, BOOL already_des - } - else - { -- if (!already_destroyed) detach_client_window( data, data->client_window ); -- else if (data->client_window) client_window_events_disable( data, data->client_window ); - XDeleteContext( data->display, data->whole_window, winContext ); - if (!already_destroyed) - { -@@ -1826,7 +1852,7 @@ static void destroy_whole_window( struct x11drv_win_data *data, BOOL already_des - } - } - if (data->whole_colormap) XFreeColormap( data->display, data->whole_colormap ); -- data->whole_window = data->client_window = 0; -+ data->whole_window = 0; - data->whole_colormap = 0; - data->wm_state = WithdrawnState; - data->net_wm_state = 0; -diff --git a/dlls/winex11.drv/bitblt.c b/dlls/winex11.drv/bitblt.c -index 11111111111..11111111111 100644 ---- a/dlls/winex11.drv/bitblt.c -+++ b/dlls/winex11.drv/bitblt.c -@@ -2263,7 +2263,6 @@ BOOL X11DRV_CreateWindowSurface( HWND hwnd, UINT swp_flags, const RECT *visible_ - - if (data->embedded) goto done; /* draw directly to the window */ - if (data->whole_window == root_window) goto done; /* draw directly to the window */ -- if (data->client_window) goto done; /* draw directly to the window */ - if (!client_side_graphics && !layered) goto done; /* draw directly to the window */ - - if (!get_surface_rect( visible_rect, &surface_rect )) goto done; -diff --git a/dlls/winex11.drv/x11drv.h b/dlls/winex11.drv/x11drv.h -index 1aaba9bf24b9dadb553d53ddb6796ce43e3e25a8..e919ad36c701aeee5bbcaf52a565db3e597ca8b1 100644 ---- a/dlls/winex11.drv/x11drv.h -+++ b/dlls/winex11.drv/x11drv.h -@@ -649,6 +649,7 @@ extern void read_net_wm_states( Display *display, struct x11drv_win_data *data ) - extern void update_net_wm_states( struct x11drv_win_data *data ); - extern void make_window_embedded( struct x11drv_win_data *data ); - extern Window create_client_window( HWND hwnd, const XVisualInfo *visual, Colormap colormap ); -+extern void attach_client_window( struct x11drv_win_data *data, Window client_window ); - extern void detach_client_window( struct x11drv_win_data *data, Window client_window ); - extern void destroy_client_window( HWND hwnd, Window client_window ); - extern void set_window_visual( struct x11drv_win_data *data, const XVisualInfo *vis, BOOL use_alpha ); -diff --git a/include/wine/vulkan_driver.h b/include/wine/vulkan_driver.h -index 7ddba4739f49a6063e382667b6a5784bfffb642f..74cdcd8987f149f6a248a5a30e94f872498449fc 100644 ---- a/include/wine/vulkan_driver.h -+++ b/include/wine/vulkan_driver.h -@@ -21,7 +21,7 @@ - #define __WINE_VULKAN_DRIVER_H - - /* Wine internal vulkan driver version, needs to be bumped upon vulkan_funcs changes. */ --#define WINE_VULKAN_DRIVER_VERSION 34 -+#define WINE_VULKAN_DRIVER_VERSION 35 - - struct vulkan_funcs - { -@@ -46,7 +46,8 @@ struct vulkan_driver_funcs - { - VkResult (*p_vulkan_surface_create)(HWND, VkInstance, VkSurfaceKHR *, void **); - void (*p_vulkan_surface_destroy)(HWND, void *); -- void (*p_vulkan_surface_detach)(HWND, void *); -+ void (*p_vulkan_surface_attach)(HWND, void *); -+ void (*p_vulkan_surface_detach)(HWND, void *, HDC *); - void (*p_vulkan_surface_presented)(HWND, VkResult); - - VkBool32 (*p_vkGetPhysicalDeviceWin32PresentationSupportKHR)(VkPhysicalDevice, uint32_t); diff --git a/segregrevert.patch b/segregrevert.patch deleted file mode 100644 index f3268e5..0000000 --- a/segregrevert.patch +++ /dev/null @@ -1,373 +0,0 @@ -From b6c419b8611c00937b07e5b8a0cb9ee2a09d25ef Mon Sep 17 00:00:00 2001 -From: kemal -Date: Tue, 9 Jul 2024 21:16:04 +0300 -Subject: [PATCH] Revert ea640f6cece7660ffc853b7d574fbe52af34901a and - 615d465bb1e124009272c0077cb1288be460c388 - ---- - dlls/ntdll/exception.c | 4 ++ - dlls/ntdll/tests/exception.c | 36 +++++----- - dlls/ntdll/unix/signal_x86_64.c | 112 ++++++++++++++++++++------------ - 3 files changed, 95 insertions(+), 57 deletions(-) - -diff --git a/dlls/ntdll/exception.c b/dlls/ntdll/exception.c -index bf4a53e1b6e..df9ceb4b6b2 100644 ---- a/dlls/ntdll/exception.c -+++ b/dlls/ntdll/exception.c -@@ -246,6 +246,10 @@ NTSTATUS WINAPI dispatch_exception( EXCEPTION_RECORD *rec, CONTEXT *context ) - TRACE( " info[%ld]=%p\n", i, (void *)rec->ExceptionInformation[i] ); - TRACE_CONTEXT( context ); - -+ /* Legends of Runeterra depends on having SegDs == SegSs in an exception -+ * handler. */ -+ context->SegDs = context->SegSs; -+ - if (call_vectored_handlers( rec, context ) == EXCEPTION_CONTINUE_EXECUTION) - NtContinue( context, FALSE ); - -diff --git a/dlls/ntdll/tests/exception.c b/dlls/ntdll/tests/exception.c -index acf6946736e..c7a88d48135 100644 ---- a/dlls/ntdll/tests/exception.c -+++ b/dlls/ntdll/tests/exception.c -@@ -1800,8 +1800,8 @@ static void test_thread_context(void) - ok( context.SegDs == LOWORD(expect.SegDs), "wrong SegDs %08lx/%08lx\n", context.SegDs, expect.SegDs ); - ok( context.SegEs == LOWORD(expect.SegEs), "wrong SegEs %08lx/%08lx\n", context.SegEs, expect.SegEs ); - ok( context.SegFs == LOWORD(expect.SegFs), "wrong SegFs %08lx/%08lx\n", context.SegFs, expect.SegFs ); -- if (LOWORD(expect.SegGs)) ok( context.SegGs == LOWORD(expect.SegGs), "wrong SegGs %08lx/%08lx\n", context.SegGs, expect.SegGs ); -- ok( context.SegSs == LOWORD(expect.SegSs), "wrong SegSs %08lx/%08lx\n", context.SegSs, expect.SegSs ); -+ ok( context.SegGs == LOWORD(expect.SegGs), "wrong SegGs %08lx/%08lx\n", context.SegGs, expect.SegGs ); -+ ok( context.SegSs == LOWORD(expect.SegSs), "wrong SegSs %08lx/%08lx\n", context.SegSs, expect.SegGs ); - - ok( LOWORD(context.FloatSave.ControlWord) == LOWORD(expect.x87_control), - "wrong x87 control word %#lx/%#lx.\n", context.FloatSave.ControlWord, expect.x87_control ); -@@ -2692,12 +2692,15 @@ static DWORD WINAPI prot_fault_handler( EXCEPTION_RECORD *rec, ULONG64 frame, - - ok( rec->ExceptionCode == except->status || - (except->alt_status != 0 && rec->ExceptionCode == except->alt_status), -- "Wrong exception code %lx/%lx\n", rec->ExceptionCode, except->status ); -+ "%u: Wrong exception code %lx/%lx\n", entry, rec->ExceptionCode, except->status ); - ok( context->Rip == (DWORD_PTR)code_mem + except->offset, -- "Unexpected eip %#Ix/%#Ix\n", context->Rip, (DWORD_PTR)code_mem + except->offset ); -+ "%u: Unexpected eip %#Ix/%#Ix\n", entry, -+ context->Rip, (DWORD_PTR)code_mem + except->offset ); - ok( rec->ExceptionAddress == (char*)context->Rip || - (rec->ExceptionCode == STATUS_BREAKPOINT && rec->ExceptionAddress == (char*)context->Rip + 1), -- "Unexpected exception address %p/%p\n", rec->ExceptionAddress, (char*)context->Rip ); -+ "%u: Unexpected exception address %p/%p\n", entry, -+ rec->ExceptionAddress, (char*)context->Rip ); -+ - - #ifndef __arm64ec__ - if (!is_arm64ec) -@@ -2715,9 +2718,9 @@ static DWORD WINAPI prot_fault_handler( EXCEPTION_RECORD *rec, ULONG64 frame, - ok( context->SegSs == ss, "ss %#x does not match %#x\n", context->SegSs, ss ); - ok( context->SegDs == context->SegSs, - "ds %#x does not match ss %#x\n", context->SegDs, context->SegSs ); -- ok( context->SegEs == context->SegSs, -+ todo_wine ok( context->SegEs == context->SegSs, - "es %#x does not match ss %#x\n", context->SegEs, context->SegSs ); -- ok( context->SegGs == context->SegSs, -+ todo_wine ok( context->SegGs == context->SegSs, - "gs %#x does not match ss %#x\n", context->SegGs, context->SegSs ); - todo_wine ok( context->SegFs && context->SegFs != context->SegSs, - "got fs %#x\n", context->SegFs ); -@@ -3060,12 +3063,14 @@ static void test_exceptions(void) - ok( ctx.SegDs == ds, "wrong ds %04x / %04x\n", ctx.SegDs, ds ); - ok( ctx.SegEs == es, "wrong es %04x / %04x\n", ctx.SegEs, es ); - ok( ctx.SegFs == fs, "wrong fs %04x / %04x\n", ctx.SegFs, fs ); -- ok( ctx.SegGs == gs || !gs, "wrong gs %04x / %04x\n", ctx.SegGs, gs ); -+ ok( ctx.SegGs == gs, "wrong gs %04x / %04x\n", ctx.SegGs, gs ); - ok( ctx.SegSs == ss, "wrong ss %04x / %04x\n", ctx.SegSs, ss ); -- ok( ctx.SegDs == ctx.SegSs, "wrong ds %04x / %04x\n", ctx.SegDs, ctx.SegSs ); -- ok( ctx.SegEs == ctx.SegSs, "wrong es %04x / %04x\n", ctx.SegEs, ctx.SegSs ); -+ todo_wine ok( ctx.SegDs == ctx.SegSs, "wrong ds %04x / %04x\n", ctx.SegDs, ctx.SegSs ); -+ todo_wine ok( ctx.SegEs == ctx.SegSs, "wrong es %04x / %04x\n", ctx.SegEs, ctx.SegSs ); - ok( ctx.SegFs != ctx.SegSs, "wrong fs %04x / %04x\n", ctx.SegFs, ctx.SegSs ); -- ok( ctx.SegGs == ctx.SegSs, "wrong gs %04x / %04x\n", ctx.SegGs, ctx.SegSs ); -+ todo_wine ok( ctx.SegGs == ctx.SegSs, "wrong gs %04x / %04x\n", ctx.SegGs, ctx.SegSs ); -+ if (ctx.SegDs == ctx.SegSs) /* FIXME: remove once Wine is fixed */ -+ { - ctx.SegDs = 0; - ctx.SegEs = ctx.SegFs; - ctx.SegFs = ctx.SegSs; -@@ -3087,6 +3092,7 @@ static void test_exceptions(void) - ok( ctx.SegEs == ctx.SegSs, "wrong es %04x / %04x\n", ctx.SegEs, ctx.SegSs ); - ok( ctx.SegFs != ctx.SegSs, "wrong fs %04x / %04x\n", ctx.SegFs, ctx.SegSs ); - ok( ctx.SegGs == ctx.SegSs, "wrong gs %04x / %04x\n", ctx.SegGs, ctx.SegSs ); -+ } - } - #endif - } -@@ -3723,10 +3729,10 @@ static void test_debugger(DWORD cont_status, BOOL with_WaitForDebugEventEx) - __asm__( "movw %%ss,%0" : "=r" (ss) ); - #endif - ok( ctx.SegSs == ss, "wrong ss %04x / %04x\n", ctx.SegSs, ss ); -- ok( ctx.SegDs == ctx.SegSs, "wrong ds %04x / %04x\n", ctx.SegDs, ctx.SegSs ); -- ok( ctx.SegEs == ctx.SegSs, "wrong es %04x / %04x\n", ctx.SegEs, ctx.SegSs ); -+ todo_wine ok( ctx.SegDs == ctx.SegSs, "wrong ds %04x / %04x\n", ctx.SegDs, ctx.SegSs ); -+ todo_wine ok( ctx.SegEs == ctx.SegSs, "wrong es %04x / %04x\n", ctx.SegEs, ctx.SegSs ); - ok( ctx.SegFs != ctx.SegSs, "wrong fs %04x / %04x\n", ctx.SegFs, ctx.SegSs ); -- ok( ctx.SegGs == ctx.SegSs, "wrong gs %04x / %04x\n", ctx.SegGs, ctx.SegSs ); -+ todo_wine ok( ctx.SegGs == ctx.SegSs, "wrong gs %04x / %04x\n", ctx.SegGs, ctx.SegSs ); - ctx.SegSs = 0; - ctx.SegDs = 0; - ctx.SegEs = ctx.SegFs; -@@ -3993,7 +3999,7 @@ static void test_thread_context(void) - COMPARE( SegDs ); - COMPARE( SegEs ); - COMPARE( SegFs ); -- if (expect.SegGs) COMPARE( SegGs ); -+ COMPARE( SegGs ); - COMPARE( SegSs ); - - /* AMD CPUs don't save the opcode or data pointer if no exception is -diff --git a/dlls/ntdll/unix/signal_x86_64.c b/dlls/ntdll/unix/signal_x86_64.c -index e84044fa805..d834dacdb5d 100644 ---- a/dlls/ntdll/unix/signal_x86_64.c -+++ b/dlls/ntdll/unix/signal_x86_64.c -@@ -412,16 +412,20 @@ struct syscall_frame - ULONG64 r14; /* 0060 */ - ULONG64 r15; /* 0068 */ - ULONG64 rip; /* 0070 */ -- ULONG64 cs; /* 0078 */ -+ WORD cs; /* 0078 */ -+ WORD ds; /* 007a */ -+ WORD es; /* 007c */ -+ WORD fs; /* 007e */ - ULONG64 eflags; /* 0080 */ - ULONG64 rsp; /* 0088 */ -- ULONG64 ss; /* 0090 */ -+ WORD ss; /* 0090 */ -+ WORD gs; /* 0092 */ -+ DWORD restore_flags; /* 0094 */ - ULONG64 rbp; /* 0098 */ - struct syscall_frame *prev_frame; /* 00a0 */ - void *syscall_cfa; /* 00a8 */ - DWORD syscall_flags; /* 00b0 */ -- DWORD restore_flags; /* 00b4 */ -- DWORD align[2]; /* 00b8 */ -+ DWORD align[3]; /* 00b4 */ - XMM_SAVE_AREA32 xsave; /* 00c0 */ - DECLSPEC_ALIGN(64) XSAVE_AREA_HEADER xstate; /* 02c0 */ - }; -@@ -811,7 +815,17 @@ static inline void set_sigcontext( const CONTEXT *context, ucontext_t *sigcontex - RIP_sig(sigcontext) = context->Rip; - CS_sig(sigcontext) = context->SegCs; - FS_sig(sigcontext) = context->SegFs; -+ GS_sig(sigcontext) = context->SegGs; - EFL_sig(sigcontext) = context->EFlags; -+#ifdef DS_sig -+ DS_sig(sigcontext) = context->SegDs; -+#endif -+#ifdef ES_sig -+ ES_sig(sigcontext) = context->SegEs; -+#endif -+#ifdef SS_sig -+ SS_sig(sigcontext) = context->SegSs; -+#endif - } - - -@@ -840,16 +854,6 @@ static inline void leave_handler( ucontext_t *sigcontext ) - if (fs32_sel && !is_inside_signal_stack( (void *)RSP_sig(sigcontext )) && !is_inside_syscall(sigcontext)) - __asm__ volatile( "movw %0,%%fs" :: "r" (fs32_sel) ); - #endif --#ifdef DS_sig -- DS_sig(sigcontext) = ds64_sel; --#else -- __asm__ volatile( "movw %0,%%ds" :: "r" (ds64_sel) ); --#endif --#ifdef ES_sig -- ES_sig(sigcontext) = ds64_sel; --#else -- __asm__ volatile( "movw %0,%%es" :: "r" (ds64_sel) ); --#endif - } - - -@@ -882,11 +886,23 @@ static void save_context( struct xcontext *xcontext, const ucontext_t *sigcontex - context->Rip = RIP_sig(sigcontext); - context->SegCs = CS_sig(sigcontext); - context->SegFs = FS_sig(sigcontext); -+ context->SegGs = GS_sig(sigcontext); - context->EFlags = EFL_sig(sigcontext); -- context->SegDs = ds64_sel; -- context->SegEs = ds64_sel; -- context->SegGs = ds64_sel; -- context->SegSs = ds64_sel; -+#ifdef DS_sig -+ context->SegDs = DS_sig(sigcontext); -+#else -+ __asm__("movw %%ds,%0" : "=m" (context->SegDs)); -+#endif -+#ifdef ES_sig -+ context->SegEs = ES_sig(sigcontext); -+#else -+ __asm__("movw %%es,%0" : "=m" (context->SegEs)); -+#endif -+#ifdef SS_sig -+ context->SegSs = SS_sig(sigcontext); -+#else -+ __asm__("movw %%ss,%0" : "=m" (context->SegSs)); -+#endif - context->Dr0 = amd64_thread_data()->dr0; - context->Dr1 = amd64_thread_data()->dr1; - context->Dr2 = amd64_thread_data()->dr2; -@@ -1040,6 +1056,15 @@ NTSTATUS WINAPI NtSetContextThread( HANDLE handle, const CONTEXT *context ) - frame->rbp = context->Rbp; - frame->rip = context->Rip; - frame->eflags = context->EFlags; -+ frame->cs = context->SegCs; -+ frame->ss = context->SegSs; -+ } -+ if (flags & CONTEXT_SEGMENTS) -+ { -+ frame->ds = context->SegDs; -+ frame->es = context->SegEs; -+ frame->fs = context->SegFs; -+ frame->gs = context->SegGs; - } - if (flags & CONTEXT_FLOATING_POINT) - { -@@ -1105,16 +1130,16 @@ NTSTATUS WINAPI NtGetContextThread( HANDLE handle, CONTEXT *context ) - context->Rbp = frame->rbp; - context->Rip = frame->rip; - context->EFlags = frame->eflags; -- context->SegCs = cs64_sel; -- context->SegSs = ds64_sel; -+ context->SegCs = frame->cs; -+ context->SegSs = frame->ss; - context->ContextFlags |= CONTEXT_CONTROL; - } - if (needed_flags & CONTEXT_SEGMENTS) - { -- context->SegDs = ds64_sel; -- context->SegEs = ds64_sel; -- context->SegFs = amd64_thread_data()->fs; -- context->SegGs = ds64_sel; -+ context->SegDs = frame->ds; -+ context->SegEs = frame->es; -+ context->SegFs = frame->fs; -+ context->SegGs = frame->gs; - context->ContextFlags |= CONTEXT_SEGMENTS; - } - if (needed_flags & CONTEXT_FLOATING_POINT) -@@ -1345,16 +1370,16 @@ NTSTATUS get_thread_wow64_context( HANDLE handle, void *ctx, ULONG size ) - context->Ebp = wow_frame->Ebp; - context->Eip = wow_frame->Eip; - context->EFlags = wow_frame->EFlags; -- context->SegCs = cs32_sel; -- context->SegSs = ds64_sel; -+ context->SegCs = wow_frame->SegCs; -+ context->SegSs = wow_frame->SegSs; - context->ContextFlags |= CONTEXT_I386_CONTROL; - } - if (needed_flags & CONTEXT_I386_SEGMENTS) - { -- context->SegDs = ds64_sel; -- context->SegEs = ds64_sel; -- context->SegFs = amd64_thread_data()->fs; -- context->SegGs = ds64_sel; -+ context->SegDs = wow_frame->SegDs; -+ context->SegEs = wow_frame->SegEs; -+ context->SegFs = wow_frame->SegFs; -+ context->SegGs = wow_frame->SegGs; - context->ContextFlags |= CONTEXT_I386_SEGMENTS; - } - if (needed_flags & CONTEXT_I386_EXTENDED_REGISTERS) -@@ -2561,11 +2586,11 @@ void call_init_thunk( LPTHREAD_START_ROUTINE entry, void *arg, BOOL suspend, TEB - wow_context->Esp = get_wow_teb( teb )->Tib.StackBase - 16; - wow_context->Eip = pLdrSystemDllInitBlock->pRtlUserThreadStart; - wow_context->SegCs = cs32_sel; -- wow_context->SegDs = ds64_sel; -- wow_context->SegEs = ds64_sel; -- wow_context->SegFs = thread_data->fs; -- wow_context->SegGs = ds64_sel; -- wow_context->SegSs = ds64_sel; -+ wow_context->SegDs = context.SegDs; -+ wow_context->SegEs = context.SegEs; -+ wow_context->SegFs = context.SegFs; -+ wow_context->SegGs = context.SegGs; -+ wow_context->SegSs = context.SegSs; - wow_context->EFlags = 0x202; - wow_context->FloatSave.ControlWord = context.FltSave.ControlWord; - *(XSAVE_FORMAT *)wow_context->ExtendedRegisters = context.FltSave; -@@ -2581,8 +2606,6 @@ void call_init_thunk( LPTHREAD_START_ROUTINE entry, void *arg, BOOL suspend, TEB - frame->xstate.CompactionMask = 0x8000000000000000 | xstate_supported_features_mask; - NtSetContextThread( GetCurrentThread(), ctx ); - -- frame->cs = cs64_sel; -- frame->ss = ds64_sel; - frame->rsp = (ULONG64)ctx - 8; - frame->rip = (ULONG64)pLdrInitializeThunk; - frame->rcx = (ULONG64)ctx; -@@ -2648,7 +2671,7 @@ __ASM_GLOBAL_FUNC( __wine_syscall_dispatcher, - __ASM_CFI(".cfi_adjust_cfa_offset 8\n\t") - "popq 0x80(%rcx)\n\t" - __ASM_CFI(".cfi_adjust_cfa_offset -8\n\t") -- "movl $0,0xb4(%rcx)\n\t" /* frame->restore_flags */ -+ "movl $0,0x94(%rcx)\n\t" /* frame->restore_flags */ - __ASM_LOCAL_LABEL("__wine_syscall_dispatcher_prolog_end") ":\n\t" - "movq %rax,0x00(%rcx)\n\t" - "movq %rbx,0x08(%rcx)\n\t" -@@ -2667,9 +2690,13 @@ __ASM_GLOBAL_FUNC( __wine_syscall_dispatcher, - "movq %r15,0x68(%rcx)\n\t" - __ASM_CFI_REG_IS_AT2(r15, rcx, 0xe8, 0x00) - "movw %cs,0x78(%rcx)\n\t" -+ "movw %ds,0x7a(%rcx)\n\t" -+ "movw %es,0x7c(%rcx)\n\t" -+ "movw %fs,0x7e(%rcx)\n\t" - "movq %rsp,0x88(%rcx)\n\t" - __ASM_CFI_CFA_IS_AT2(rcx, 0x88, 0x01) - "movw %ss,0x90(%rcx)\n\t" -+ "movw %gs,0x92(%rcx)\n\t" - "movq %rbp,0x98(%rcx)\n\t" - __ASM_CFI_REG_IS_AT2(rbp, rcx, 0x98, 0x01) - /* Legends of Runeterra hooks the first system call return instruction, and -@@ -2781,7 +2808,7 @@ __ASM_GLOBAL_FUNC( __wine_syscall_dispatcher, - "callq *(%r10,%rax,8)\n\t" - "leaq -0x98(%rbp),%rcx\n\t" - __ASM_LOCAL_LABEL("__wine_syscall_dispatcher_return") ":\n\t" -- "movl 0xb4(%rcx),%edx\n\t" /* frame->restore_flags */ -+ "movl 0x94(%rcx),%edx\n\t" /* frame->restore_flags */ - "testl $0x48,%edx\n\t" /* CONTEXT_FLOATING_POINT | CONTEXT_XSTATE */ - "jnz 2f\n\t" - "movaps 0x1c0(%rcx),%xmm6\n\t" -@@ -2808,7 +2835,7 @@ __ASM_GLOBAL_FUNC( __wine_syscall_dispatcher, - #endif - "xrstor64 0xc0(%rcx)\n\t" - "movq %r11,%rax\n\t" -- "movl 0xb4(%rcx),%edx\n\t" /* frame->restore_flags */ -+ "movl 0x94(%rcx),%edx\n\t" - "jmp 4f\n" - "3:\tfxrstor64 0xc0(%rcx)\n" - "4:\tmovq 0x98(%rcx),%rbp\n\t" -@@ -2899,7 +2926,7 @@ __ASM_GLOBAL_FUNC( __wine_unix_call_dispatcher, - "popq 0x70(%rcx)\n\t" /* frame->rip */ - __ASM_CFI(".cfi_adjust_cfa_offset -8\n\t") - __ASM_CFI_REG_IS_AT2(rip, rcx, 0xf0,0x00) -- "movl $0,0xb4(%rcx)\n\t" /* frame->restore_flags */ -+ "movl $0,0x94(%rcx)\n\t" /* frame->restore_flags */ - __ASM_LOCAL_LABEL("__wine_unix_call_dispatcher_prolog_end") ":\n\t" - "movq %rbx,0x08(%rcx)\n\t" - __ASM_CFI_REG_IS_AT1(rbx, rcx, 0x08) -@@ -2947,6 +2974,7 @@ __ASM_GLOBAL_FUNC( __wine_unix_call_dispatcher, - #ifdef __linux__ - "testl $12,%r14d\n\t" /* SYSCALL_HAVE_PTHREAD_TEB | SYSCALL_HAVE_WRFSGSBASE */ - "jz 2f\n\t" -+ "movw %fs,0x7e(%rcx)\n\t" - "movq %gs:0x320,%rsi\n\t" /* amd64_thread_data()->pthread_teb */ - "testl $8,%r14d\n\t" /* SYSCALL_HAVE_WRFSGSBASE */ - "jz 1f\n\t" -@@ -2970,7 +2998,7 @@ __ASM_GLOBAL_FUNC( __wine_unix_call_dispatcher, - "movdqa 0x230(%rcx),%xmm13\n\t" - "movdqa 0x240(%rcx),%xmm14\n\t" - "movdqa 0x250(%rcx),%xmm15\n\t" -- "testl $0xffff,0xb4(%rcx)\n\t" /* frame->restore_flags */ -+ "testl $0xffff,0x94(%rcx)\n\t" /* frame->restore_flags */ - "jnz " __ASM_LOCAL_LABEL("__wine_syscall_dispatcher_return") "\n\t" - /* switch to user stack */ - "movq 0x88(%rcx),%rsp\n\t" --- -2.45.2 -