Commit 4072ba5d authored by Jacek Caban's avatar Jacek Caban Committed by Alexandre Julliard

win32u: Move NtUserPostMessage implementation from user32.

parent e1db9fef
......@@ -164,7 +164,6 @@ static const struct user_callbacks user_funcs =
DestroyCaret,
EndMenu,
HideCaret,
PostMessageW,
SetSystemMenu,
ShowCaret,
free_menu_items,
......
......@@ -1193,6 +1193,7 @@ static struct unix_funcs unix_funcs =
NtUserMoveWindow,
NtUserMsgWaitForMultipleObjectsEx,
NtUserPeekMessage,
NtUserPostMessage,
NtUserPostThreadMessage,
NtUserRedrawWindow,
NtUserRegisterClassExWOW,
......
......@@ -2402,9 +2402,33 @@ static BOOL send_message_callback( HWND hwnd, UINT msg, WPARAM wparam, LPARAM lp
*/
BOOL WINAPI NtUserPostMessage( HWND hwnd, UINT msg, WPARAM wparam, LPARAM lparam )
{
/* FIXME: move implementation from user32 */
if (!user_callbacks) return 0;
return user_callbacks->pPostMessageW( hwnd, msg, wparam, lparam );
struct send_message_info info;
if (is_pointer_message( msg, wparam ))
{
SetLastError( ERROR_MESSAGE_SYNC_ONLY );
return FALSE;
}
TRACE( "hwnd %p msg %x (%s) wp %lx lp %lx\n",
hwnd, msg, debugstr_msg_name(msg, hwnd), wparam, lparam );
info.type = MSG_POSTED;
info.hwnd = hwnd;
info.msg = msg;
info.wparam = wparam;
info.lparam = lparam;
info.flags = 0;
if (is_broadcast(hwnd)) return broadcast_message( &info, NULL );
if (!hwnd) return NtUserPostThreadMessage( GetCurrentThreadId(), msg, wparam, lparam );
if (!(info.dest_tid = get_window_thread( hwnd, NULL ))) return FALSE;
if (is_exiting_thread( info.dest_tid )) return TRUE;
return put_message_in_queue( &info, NULL );
}
/**********************************************************************
......
......@@ -37,7 +37,6 @@ struct user_callbacks
BOOL (WINAPI *pDestroyCaret)(void);
BOOL (WINAPI *pEndMenu)(void);
BOOL (WINAPI *pHideCaret)( HWND hwnd );
BOOL (WINAPI *pPostMessageW)( HWND, UINT, WPARAM, LPARAM );
BOOL (WINAPI *pSetSystemMenu)( HWND hwnd, HMENU menu );
BOOL (WINAPI *pShowCaret)( HWND hwnd );
void (CDECL *free_menu_items)( void *ptr );
......
......@@ -1103,7 +1103,7 @@
@ stub NtUserPhysicalToLogicalDpiPointForWindow
@ stub NtUserPhysicalToLogicalPoint
@ stub NtUserPostKeyboardInputMessage
@ stub NtUserPostMessage
@ stdcall NtUserPostMessage(long long long long)
@ stdcall NtUserPostThreadMessage(long long long long)
@ stub NtUserPrintWindow
@ stub NtUserProcessConnect
......
......@@ -242,6 +242,7 @@ struct unix_funcs
DWORD (WINAPI *pNtUserMsgWaitForMultipleObjectsEx)( DWORD count, const HANDLE *handles,
DWORD timeout, DWORD mask, DWORD flags );
BOOL (WINAPI *pNtUserPeekMessage)( MSG *msg_out, HWND hwnd, UINT first, UINT last, UINT flags );
BOOL (WINAPI *pNtUserPostMessage)( HWND hwnd, UINT msg, WPARAM wparam, LPARAM lparam );
BOOL (WINAPI *pNtUserPostThreadMessage)( DWORD thread, UINT msg, WPARAM wparam, LPARAM lparam );
BOOL (WINAPI *pNtUserRedrawWindow)( HWND hwnd, const RECT *rect, HRGN hrgn, UINT flags );
ATOM (WINAPI *pNtUserRegisterClassExWOW)( const WNDCLASSEXW *wc, UNICODE_STRING *name,
......
......@@ -977,6 +977,12 @@ BOOL WINAPI NtUserPeekMessage( MSG *msg_out, HWND hwnd, UINT first, UINT last, U
return unix_funcs->pNtUserPeekMessage( msg_out, hwnd, first, last, flags );
}
BOOL WINAPI NtUserPostMessage( HWND hwnd, UINT msg, WPARAM wparam, LPARAM lparam )
{
if (!unix_funcs) return FALSE;
return unix_funcs->pNtUserPostMessage( hwnd, msg, wparam, lparam );
}
BOOL WINAPI NtUserPostThreadMessage( DWORD thread, UINT msg, WPARAM wparam, LPARAM lparam )
{
if (!unix_funcs) return FALSE;
......
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