Commit 6badbee3 authored by Jacek Caban's avatar Jacek Caban Committed by Alexandre Julliard

win32u: Move process_sent_messages implementation from user32.

parent 2656d667
......@@ -1545,8 +1545,8 @@ static BOOL post_dde_message( struct packed_message *data, const struct send_mes
*
* Unpack a posted DDE message received from another process.
*/
static BOOL unpack_dde_message( HWND hwnd, UINT message, WPARAM *wparam, LPARAM *lparam,
void **buffer, size_t size )
BOOL unpack_dde_message( HWND hwnd, UINT message, WPARAM *wparam, LPARAM *lparam,
void **buffer, size_t size )
{
UINT_PTR uiLo, uiHi;
HGLOBAL hMem = 0;
......@@ -2084,8 +2084,8 @@ static BOOL process_mouse_message( MSG *msg, UINT hw_id, ULONG_PTR extra_info, H
*
* Process a hardware message; return TRUE if message should be passed on to the app
*/
static BOOL process_hardware_message( MSG *msg, UINT hw_id, const struct hardware_msg_data *msg_data,
HWND hwnd_filter, UINT first, UINT last, BOOL remove )
BOOL process_hardware_message( MSG *msg, UINT hw_id, const struct hardware_msg_data *msg_data,
HWND hwnd_filter, UINT first, UINT last, BOOL remove )
{
DPI_AWARENESS_CONTEXT context;
BOOL ret = FALSE;
......@@ -2377,8 +2377,7 @@ static int peek_message( MSG *msg, HWND hwnd, UINT first, UINT last, UINT flags,
*/
static inline void process_sent_messages(void)
{
MSG msg;
peek_message( &msg, 0, 0, 0, PM_REMOVE | PM_QS_SENDMESSAGE, 0 );
NtUserCallNoParam( NtUserProcessSentMessages );
}
......
......@@ -177,11 +177,13 @@ static const struct user_callbacks user_funcs =
free_win_ptr,
MENU_IsMenuActive,
notify_ime,
process_hardware_message,
register_builtin_classes,
MSG_SendInternalMessageTimeout,
MENU_SetMenu,
SCROLL_SetStandardScrollPainted,
(void *)__wine_set_user_driver,
unpack_dde_message,
register_imm,
unregister_imm,
};
......@@ -194,6 +196,7 @@ static BOOL WINAPI User32LoadDriver( const WCHAR *path, ULONG size )
static const void *kernel_callback_table[NtUserCallCount] =
{
User32CallEnumDisplayMonitor,
User32CallSendAsyncCallback,
User32CallWinEventHook,
User32CallWindowProc,
User32CallWindowsHook,
......
......@@ -83,7 +83,10 @@ extern BOOL rawinput_device_get_usages(HANDLE handle, USAGE *usage_page, USAGE *
extern struct rawinput_thread_data *rawinput_thread_data(void);
extern void rawinput_update_device_list(void);
extern void create_offscreen_window_surface( const RECT *visible_rect, struct window_surface **surface ) DECLSPEC_HIDDEN;
extern BOOL process_hardware_message( MSG *msg, UINT hw_id, const struct hardware_msg_data *msg_data,
HWND hwnd_filter, UINT first, UINT last, BOOL remove ) DECLSPEC_HIDDEN;
extern BOOL unpack_dde_message( HWND hwnd, UINT message, WPARAM *wparam, LPARAM *lparam,
void **buffer, size_t size ) DECLSPEC_HIDDEN;
extern void CLIPBOARD_ReleaseOwner( HWND hwnd ) DECLSPEC_HIDDEN;
extern BOOL FOCUS_MouseActivate( HWND hwnd ) DECLSPEC_HIDDEN;
......@@ -124,6 +127,7 @@ extern ATOM get_class_info( HINSTANCE instance, const WCHAR *name, WNDCLASSEXW *
/* kernel callbacks */
BOOL WINAPI User32CallEnumDisplayMonitor( struct enum_display_monitor_params *params, ULONG size );
BOOL WINAPI User32CallSendAsyncCallback( const struct send_async_params *params, ULONG size );
BOOL WINAPI User32CallWinEventHook( const struct win_event_hook_params *params, ULONG size );
BOOL WINAPI User32CallWindowProc( struct win_proc_params *params, ULONG size );
BOOL WINAPI User32CallWindowsHook( const struct win_hook_params *params, ULONG size );
......
......@@ -1295,6 +1295,12 @@ void get_winproc_params( struct win_proc_params *params )
}
}
BOOL WINAPI User32CallSendAsyncCallback( const struct send_async_params *params, ULONG size )
{
params->callback( params->hwnd, params->msg, params->data, params->result );
return TRUE;
}
/**********************************************************************
* CallWindowProcA (USER32.@)
*
......
......@@ -28,6 +28,8 @@
struct dce;
struct tagWND;
struct hardware_msg_data;
struct user_callbacks
{
BOOL (WINAPI *pAdjustWindowRectEx)( RECT *, DWORD, BOOL, DWORD );
......@@ -48,11 +50,15 @@ struct user_callbacks
void (CDECL *free_win_ptr)( struct tagWND *win );
HWND (CDECL *is_menu_active)(void);
void (CDECL *notify_ime)( HWND hwnd, UINT param );
BOOL (CDECL *process_hardware_message)( MSG *msg, UINT hw_id, const struct hardware_msg_data *msg_data,
HWND hwnd_filter, UINT first, UINT last, BOOL remove );
void (CDECL *register_builtin_classes)(void);
LRESULT (WINAPI *send_ll_message)( DWORD, DWORD, UINT, WPARAM, LPARAM, UINT, UINT, PDWORD_PTR );
BOOL (CDECL *set_menu)( HWND hwnd, HMENU menu );
void (WINAPI *set_standard_scroll_painted)( HWND hwnd, INT bar, BOOL visible );
void (CDECL *set_user_driver)( void *, UINT );
BOOL (CDECL *unpack_dde_message)( HWND hwnd, UINT message, WPARAM *wparam, LPARAM *lparam,
void **buffer, size_t size );
BOOL (WINAPI *register_imm)( HWND hwnd );
void (WINAPI *unregister_imm)( HWND hwnd );
};
......
......@@ -1506,6 +1506,14 @@ POINT map_dpi_point( POINT pt, UINT dpi_from, UINT dpi_to )
return pt;
}
/**********************************************************************
* point_phys_to_win_dpi
*/
POINT point_phys_to_win_dpi( HWND hwnd, POINT pt )
{
return map_dpi_point( pt, get_win_monitor_dpi( hwnd ), get_dpi_for_window( hwnd ));
}
/* map value from system dpi to standard 96 dpi for storing in the registry */
static int map_from_system_dpi( int val )
{
......@@ -4634,6 +4642,8 @@ ULONG_PTR WINAPI NtUserCallNoParam( ULONG code )
/* temporary exports */
case NtUserExitingThread:
exiting_thread_id = GetCurrentThreadId();
case NtUserProcessSentMessages:
process_sent_messages();
return 0;
case NtUserThreadDetach:
thread_detach();
......
......@@ -344,6 +344,7 @@ extern HMENU get_menu( HWND hwnd ) DECLSPEC_HIDDEN;
extern LRESULT dispatch_message( const MSG *msg, BOOL ansi ) DECLSPEC_HIDDEN;
extern BOOL kill_system_timer( HWND hwnd, UINT_PTR id ) DECLSPEC_HIDDEN;
extern LRESULT post_message( HWND hwnd, UINT msg, WPARAM wparam, LPARAM lparam ) DECLSPEC_HIDDEN;
extern void process_sent_messages(void) DECLSPEC_HIDDEN;
extern BOOL reply_message_result( LRESULT result, MSG *msg ) DECLSPEC_HIDDEN;
extern LRESULT send_message( HWND hwnd, UINT msg, WPARAM wparam, LPARAM lparam ) DECLSPEC_HIDDEN;
......@@ -361,6 +362,7 @@ extern RECT get_virtual_screen_rect( UINT dpi ) DECLSPEC_HIDDEN;
extern BOOL is_exiting_thread( DWORD tid ) DECLSPEC_HIDDEN;
extern POINT map_dpi_point( POINT pt, UINT dpi_from, UINT dpi_to ) DECLSPEC_HIDDEN;
extern RECT map_dpi_rect( RECT rect, UINT dpi_from, UINT dpi_to ) DECLSPEC_HIDDEN;
extern POINT point_phys_to_win_dpi( HWND hwnd, POINT pt ) DECLSPEC_HIDDEN;
extern HMONITOR monitor_from_point( POINT pt, DWORD flags, UINT dpi ) DECLSPEC_HIDDEN;
extern HMONITOR monitor_from_rect( const RECT *rect, DWORD flags, UINT dpi ) DECLSPEC_HIDDEN;
extern HMONITOR monitor_from_window( HWND hwnd, DWORD flags, UINT dpi ) DECLSPEC_HIDDEN;
......
......@@ -28,6 +28,7 @@ enum
{
/* user32 callbacks */
NtUserCallEnumDisplayMonitor,
NtUserCallSendAsyncCallback,
NtUserCallWinEventHook,
NtUserCallWindowProc,
NtUserCallWindowsHook,
......@@ -50,6 +51,16 @@ struct enum_display_monitor_params
LPARAM lparam;
};
/* NtUserCallSendAsyncCallback params */
struct send_async_params
{
SENDASYNCPROC callback;
HWND hwnd;
UINT msg;
ULONG_PTR data;
LRESULT result;
};
/* NtUserCallWinEventHook params */
struct win_event_hook_params
{
......@@ -128,6 +139,7 @@ enum
NtUserReleaseCapture,
/* temporary exports */
NtUserExitingThread,
NtUserProcessSentMessages,
NtUserThreadDetach,
};
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment