From: Jacek Caban jacek@codeweavers.com
--- dlls/winex11.drv/dllmain.c | 3 +- dlls/winex11.drv/event.c | 2 +- dlls/winex11.drv/unixlib.h | 4 +- dlls/winex11.drv/x11drv_main.c | 107 ++++++++++++++++++++++++++++++++- dlls/winex11.drv/xdnd.c | 2 +- 5 files changed, 111 insertions(+), 7 deletions(-)
diff --git a/dlls/winex11.drv/dllmain.c b/dlls/winex11.drv/dllmain.c index 99a137f66e7..8ed0e40d1ac 100644 --- a/dlls/winex11.drv/dllmain.c +++ b/dlls/winex11.drv/dllmain.c @@ -67,6 +67,7 @@ BOOL WINAPI DllMain( HINSTANCE instance, DWORD reason, void *reserved ) struct init_params params = { foreign_window_proc, + &show_systray, };
if (reason != DLL_PROCESS_ATTACH) return TRUE; @@ -81,8 +82,6 @@ BOOL WINAPI DllMain( HINSTANCE instance, DWORD reason, void *reserved )
callback_table = NtCurrentTeb()->Peb->KernelCallbackTable; memcpy( callback_table + NtUserDriverCallbackFirst, kernel_callbacks, sizeof(kernel_callbacks) ); - - show_systray = params.show_systray; return TRUE; }
diff --git a/dlls/winex11.drv/event.c b/dlls/winex11.drv/event.c index ddf5cd0433b..25ca9d885a7 100644 --- a/dlls/winex11.drv/event.c +++ b/dlls/winex11.drv/event.c @@ -1802,7 +1802,7 @@ static void handle_xdnd_position_event( HWND hwnd, XClientMessageEvent *event ) XClientMessageEvent e; DWORD effect;
- params.hwnd = hwnd; + params.hwnd = HandleToUlong( hwnd ); params.point = root_to_virtual_screen( event->data.l[2] >> 16, event->data.l[2] & 0xFFFF ); params.effect = effect = xdnd_action_to_drop_effect( event->data.l[4] );
diff --git a/dlls/winex11.drv/unixlib.h b/dlls/winex11.drv/unixlib.h index fa3685af33a..e8b243d67a1 100644 --- a/dlls/winex11.drv/unixlib.h +++ b/dlls/winex11.drv/unixlib.h @@ -50,7 +50,7 @@ struct create_desktop_params struct init_params { WNDPROC foreign_window_proc; - BOOL show_systray; + BOOL *show_systray; };
struct systray_dock_params @@ -123,7 +123,7 @@ struct format_entry /* x11drv_dnd_position_event params */ struct dnd_position_event_params { - HWND hwnd; + ULONG hwnd; POINT point; DWORD effect; }; diff --git a/dlls/winex11.drv/x11drv_main.c b/dlls/winex11.drv/x11drv_main.c index e94977f8caf..7f9ada291a0 100644 --- a/dlls/winex11.drv/x11drv_main.c +++ b/dlls/winex11.drv/x11drv_main.c @@ -714,7 +714,7 @@ static NTSTATUS x11drv_init( void *arg )
init_user_driver(); X11DRV_DisplayDevices_Init(FALSE); - params->show_systray = show_systray; + *params->show_systray = show_systray; return STATUS_SUCCESS; }
@@ -1337,3 +1337,108 @@ const unixlib_entry_t __wine_unix_call_funcs[] =
C_ASSERT( ARRAYSIZE(__wine_unix_call_funcs) == unix_funcs_count ); + + +#ifdef _WIN64 + +static NTSTATUS x11drv_wow64_init( void *arg ) +{ + struct + { + ULONG foreign_window_proc; + ULONG show_systray; + } *params32 = arg; + struct init_params params; + + params.foreign_window_proc = UlongToPtr( params32->foreign_window_proc ); + params.show_systray = UlongToPtr( params32->show_systray ); + return x11drv_init( ¶ms ); +} + +static NTSTATUS x11drv_wow64_systray_clear( void *arg ) +{ + HWND hwnd = UlongToPtr( *(ULONG *)arg ); + return x11drv_systray_clear( &hwnd ); +} + +static NTSTATUS x11drv_wow64_systray_dock( void *arg ) +{ + struct + { + UINT64 event_handle; + ULONG icon; + int cx; + int cy; + ULONG layered; + } *params32 = arg; + struct systray_dock_params params; + + params.event_handle = params32->event_handle; + params.icon = UlongToPtr( params32->icon ); + params.cx = params32->cx; + params.cy = params32->cy; + params.layered = UlongToPtr( params32->layered ); + return x11drv_systray_dock( ¶ms ); +} + +static NTSTATUS x11drv_wow64_systray_hide( void *arg ) +{ + HWND hwnd = UlongToPtr( *(ULONG *)arg ); + return x11drv_systray_hide( &hwnd ); +} + +static NTSTATUS x11drv_wow64_tablet_get_packet( void *arg ) +{ + FIXME( "%p\n", arg ); + return 0; +} + +static NTSTATUS x11drv_wow64_tablet_info( void *arg ) +{ + struct + { + UINT category; + UINT index; + ULONG output; + } *params32 = arg; + struct tablet_info_params params; + + params.category = params32->category; + params.index = params32->index; + params.output = UlongToPtr( params32->output ); + return x11drv_tablet_info( ¶ms ); +} + +static NTSTATUS x11drv_wow64_xim_preedit_state( void *arg ) +{ + struct + { + ULONG hwnd; + BOOL open; + } *params32 = arg; + struct xim_preedit_state_params params; + + params.hwnd = UlongToHandle( params32->hwnd ); + params.open = params32->open; + return x11drv_xim_preedit_state( ¶ms ); +} + +const unixlib_entry_t __wine_unix_call_wow64_funcs[] = +{ + x11drv_create_desktop, + x11drv_wow64_init, + x11drv_wow64_systray_clear, + x11drv_wow64_systray_dock, + x11drv_wow64_systray_hide, + x11drv_systray_init, + x11drv_tablet_attach_queue, + x11drv_wow64_tablet_get_packet, + x11drv_wow64_tablet_info, + x11drv_tablet_load_info, + x11drv_wow64_xim_preedit_state, + x11drv_xim_reset, +}; + +C_ASSERT( ARRAYSIZE(__wine_unix_call_wow64_funcs) == unix_funcs_count ); + +#endif /* _WIN64 */ diff --git a/dlls/winex11.drv/xdnd.c b/dlls/winex11.drv/xdnd.c index 9137f46b5dc..21a4bb7f6fb 100644 --- a/dlls/winex11.drv/xdnd.c +++ b/dlls/winex11.drv/xdnd.c @@ -177,7 +177,7 @@ NTSTATUS WINAPI x11drv_dnd_position_event( void *arg, ULONG size ) HRESULT hr;
XDNDxy = params->point; - targetWindow = window_from_point_dnd( params->hwnd, XDNDxy ); + targetWindow = window_from_point_dnd( UlongToHandle( params->hwnd ), XDNDxy );
if (!XDNDAccepted || XDNDLastTargetWnd != targetWindow) {