Commit 7ba3c31d authored by Jacek Caban's avatar Jacek Caban Committed by Alexandre Julliard

win32u: Move send_internal_message_timeout implementation from user32.

parent b666d908
......@@ -1184,7 +1184,7 @@ static HGLOBAL dde_get_pair(HGLOBAL shm)
*
* Post a DDE message
*/
static BOOL post_dde_message( HWND hwnd, UINT msg, WPARAM wparam, LPARAM lparam, DWORD dest_tid, DWORD type )
BOOL post_dde_message( HWND hwnd, UINT msg, WPARAM wparam, LPARAM lparam, DWORD dest_tid, DWORD type )
{
void* ptr = NULL;
int size = 0;
......@@ -2295,47 +2295,6 @@ NTSTATUS send_hardware_message( HWND hwnd, const INPUT *input, const RAWINPUT *r
/***********************************************************************
* MSG_SendInternalMessageTimeout
*
* Same as SendMessageTimeoutW but sends the message to a specific thread
* without requiring a window handle. Only works for internal Wine messages.
*/
LRESULT WINAPI MSG_SendInternalMessageTimeout( DWORD dest_pid, DWORD dest_tid,
UINT msg, WPARAM wparam, LPARAM lparam,
UINT flags, UINT timeout, PDWORD_PTR res_ptr )
{
struct send_message_info info;
LRESULT ret, result;
assert( msg & 0x80000000 ); /* must be an internal Wine message */
info.type = MSG_UNICODE;
info.dest_tid = dest_tid;
info.hwnd = 0;
info.msg = msg;
info.wparam = wparam;
info.lparam = lparam;
info.flags = flags;
info.timeout = timeout;
if (USER_IsExitingThread( dest_tid )) return 0;
if (dest_tid == GetCurrentThreadId())
{
result = handle_internal_message( 0, msg, wparam, lparam );
ret = 1;
}
else
{
if (dest_pid != GetCurrentProcessId()) info.type = MSG_OTHER_PROCESS;
ret = send_inter_thread_message( &info, &result );
}
if (ret && res_ptr) *res_ptr = result;
return ret;
}
/***********************************************************************
* SendMessageTimeoutW (USER32.@)
*/
LRESULT WINAPI SendMessageTimeoutW( HWND hwnd, UINT msg, WPARAM wparam, LPARAM lparam,
......
......@@ -176,9 +176,9 @@ static const struct user_callbacks user_funcs =
free_win_ptr,
MENU_IsMenuActive,
notify_ime,
post_dde_message,
process_hardware_message,
register_builtin_classes,
MSG_SendInternalMessageTimeout,
MENU_SetMenu,
SCROLL_SetStandardScrollPainted,
(void *)__wine_set_user_driver,
......
......@@ -83,6 +83,8 @@ 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 BOOL post_dde_message( HWND hwnd, UINT msg, WPARAM wparam, LPARAM lparam, DWORD dest_tid,
DWORD type ) 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,
......@@ -100,9 +102,6 @@ extern RECT get_primary_monitor_rect(void) DECLSPEC_HIDDEN;
extern DWORD get_input_codepage( void ) DECLSPEC_HIDDEN;
extern BOOL map_wparam_AtoW( UINT message, WPARAM *wparam, enum wm_char_mapping mapping ) DECLSPEC_HIDDEN;
extern NTSTATUS send_hardware_message( HWND hwnd, const INPUT *input, const RAWINPUT *rawinput, UINT flags ) DECLSPEC_HIDDEN;
extern LRESULT WINAPI MSG_SendInternalMessageTimeout( DWORD dest_pid, DWORD dest_tid,
UINT msg, WPARAM wparam, LPARAM lparam,
UINT flags, UINT timeout, PDWORD_PTR res_ptr ) DECLSPEC_HIDDEN;
extern HPEN SYSCOLOR_GetPen( INT index ) DECLSPEC_HIDDEN;
extern HBRUSH SYSCOLOR_Get55AABrush(void) DECLSPEC_HIDDEN;
extern void SYSPARAMS_Init(void) DECLSPEC_HIDDEN;
......
......@@ -200,16 +200,14 @@ static LRESULT call_hook( struct win_hook_params *info )
switch(info->id)
{
case WH_KEYBOARD_LL:
if (!user_callbacks) break;
user_callbacks->send_ll_message( info->pid, info->tid, WM_WINE_KEYBOARD_LL_HOOK,
info->wparam, (LPARAM)&h_extra, SMTO_ABORTIFHUNG,
get_ll_hook_timeout(), &ret );
send_internal_message_timeout( info->pid, info->tid, WM_WINE_KEYBOARD_LL_HOOK,
info->wparam, (LPARAM)&h_extra, SMTO_ABORTIFHUNG,
get_ll_hook_timeout(), &ret );
break;
case WH_MOUSE_LL:
if (!user_callbacks) break;
user_callbacks->send_ll_message( info->pid, info->tid, WM_WINE_MOUSE_LL_HOOK,
info->wparam, (LPARAM)&h_extra, SMTO_ABORTIFHUNG,
get_ll_hook_timeout(), &ret );
send_internal_message_timeout( info->pid, info->tid, WM_WINE_MOUSE_LL_HOOK,
info->wparam, (LPARAM)&h_extra, SMTO_ABORTIFHUNG,
get_ll_hook_timeout(), &ret );
break;
default:
ERR("Unknown hook id %d\n", info->id);
......
......@@ -49,10 +49,11 @@ 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 *post_dde_message)( HWND hwnd, UINT msg, WPARAM wparam, LPARAM lparam, DWORD dest_tid,
DWORD type );
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 );
......
......@@ -351,6 +351,9 @@ 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_internal_message_timeout( DWORD dest_pid, DWORD dest_tid, UINT msg, WPARAM wparam,
LPARAM lparam, UINT flags, UINT timeout,
PDWORD_PTR res_ptr ) DECLSPEC_HIDDEN;
extern LRESULT send_message( HWND hwnd, UINT msg, WPARAM wparam, LPARAM lparam ) DECLSPEC_HIDDEN;
/* sysparams.c */
......
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