From fce3f9c323feaf257859d1a037f16818a11eb105 Mon Sep 17 00:00:00 2001 From: Jacek Caban Date: Tue, 3 May 2022 14:42:24 +0200 Subject: [PATCH] winex11: Move x11drv_post_drop to xdnd.c. Signed-off-by: Jacek Caban Signed-off-by: Alexandre Julliard --- dlls/winex11.drv/event.c | 12 ++---------- dlls/winex11.drv/x11drv.h | 2 ++ dlls/winex11.drv/xdnd.c | 18 ++++++++++++++++++ 3 files changed, 22 insertions(+), 10 deletions(-) diff --git a/dlls/winex11.drv/event.c b/dlls/winex11.drv/event.c index a6499400283..105caab5deb 100644 --- a/dlls/winex11.drv/event.c +++ b/dlls/winex11.drv/event.c @@ -1478,16 +1478,8 @@ static HWND find_drop_window( HWND hQueryWnd, LPPOINT lpPt ) static void post_drop( HWND hwnd, DROPFILES *drop, ULONG size ) { - HDROP handle; - - if ((handle = GlobalAlloc( GMEM_SHARE, size ))) - { - DROPFILES *ptr = GlobalLock( handle ); - memcpy( ptr, drop, size ); - ptr->fWide = TRUE; - GlobalUnlock( handle ); - PostMessageW( hwnd, WM_DROPFILES, (WPARAM)handle, 0 ); - } + drop->fWide = HandleToUlong( hwnd ); /* abuse fWide to pass window handle */ + x11drv_post_drop( drop, size ); } /********************************************************************** diff --git a/dlls/winex11.drv/x11drv.h b/dlls/winex11.drv/x11drv.h index b763a7aa345..4dc251b9ac2 100644 --- a/dlls/winex11.drv/x11drv.h +++ b/dlls/winex11.drv/x11drv.h @@ -846,6 +846,8 @@ static inline BOOL is_window_rect_mapped( const RECT *rect ) extern NTSTATUS x11drv_init( void *arg ) DECLSPEC_HIDDEN; extern NTSTATUS x11drv_clipboard_message( void *arg ) DECLSPEC_HIDDEN; +extern NTSTATUS WINAPI x11drv_post_drop( void *data, ULONG size ) DECLSPEC_HIDDEN; + /* GDI helpers */ static inline BOOL lp_to_dp( HDC hdc, POINT *points, INT count ) diff --git a/dlls/winex11.drv/xdnd.c b/dlls/winex11.drv/xdnd.c index d5ae510db49..45205c836be 100644 --- a/dlls/winex11.drv/xdnd.c +++ b/dlls/winex11.drv/xdnd.c @@ -748,3 +748,21 @@ UINT handle_dnd_event( void *params ) return 0; } } + +NTSTATUS WINAPI x11drv_post_drop( void *data, ULONG size ) +{ + HDROP handle; + + if ((handle = GlobalAlloc( GMEM_SHARE, size ))) + { + DROPFILES *ptr = GlobalLock( handle ); + HWND hwnd; + memcpy( ptr, data, size ); + hwnd = UlongToHandle( ptr->fWide ); + ptr->fWide = TRUE; + GlobalUnlock( handle ); + PostMessageW( hwnd, WM_DROPFILES, (WPARAM)handle, 0 ); + } + + return 0; +}