win32u: Move NtUserPostThreadMessage implementation from user32.

Signed-off-by: Jacek Caban <jacek@codeweavers.com>
Signed-off-by: Huw Davies <huw@codeweavers.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
This commit is contained in:
Jacek Caban 2022-04-06 11:05:19 +02:00 committed by Alexandre Julliard
parent 6062065723
commit e1db9fef05
7 changed files with 36 additions and 29 deletions

View file

@ -1807,7 +1807,7 @@ BOOL WINAPI PostMessageW( HWND hwnd, UINT msg, WPARAM wparam, LPARAM lparam )
return TRUE;
}
if (!hwnd) return PostThreadMessageW( GetCurrentThreadId(), msg, wparam, lparam );
if (!hwnd) return NtUserPostThreadMessage( GetCurrentThreadId(), msg, wparam, lparam );
if (!(info.dest_tid = GetWindowThreadProcessId( hwnd, NULL ))) return FALSE;
@ -1823,32 +1823,7 @@ BOOL WINAPI PostMessageW( HWND hwnd, UINT msg, WPARAM wparam, LPARAM lparam )
BOOL WINAPI PostThreadMessageA( DWORD thread, UINT msg, WPARAM wparam, LPARAM lparam )
{
if (!map_wparam_AtoW( msg, &wparam, WMCHAR_MAP_POSTMESSAGE )) return TRUE;
return PostThreadMessageW( thread, msg, wparam, lparam );
}
/**********************************************************************
* PostThreadMessageW (USER32.@)
*/
BOOL WINAPI PostThreadMessageW( DWORD thread, UINT msg, WPARAM wparam, LPARAM lparam )
{
struct send_message_info info;
if (is_pointer_message( msg, wparam ))
{
SetLastError( ERROR_MESSAGE_SYNC_ONLY );
return FALSE;
}
if (USER_IsExitingThread( thread )) return TRUE;
info.type = MSG_POSTED;
info.dest_tid = thread;
info.hwnd = 0;
info.msg = msg;
info.wparam = wparam;
info.lparam = lparam;
info.flags = 0;
return put_message_in_queue( &info, NULL );
return NtUserPostThreadMessage( thread, msg, wparam, lparam );
}

View file

@ -571,7 +571,7 @@
@ stdcall PostMessageW(long long long long)
@ stdcall PostQuitMessage(long)
@ stdcall PostThreadMessageA(long long long long)
@ stdcall PostThreadMessageW(long long long long)
@ stdcall PostThreadMessageW(long long long long) NtUserPostThreadMessage
@ stdcall PrintWindow(long long long)
@ stdcall PrivateExtractIconExA(str long ptr ptr long)
@ stdcall PrivateExtractIconExW(wstr long ptr ptr long)

View file

@ -1193,6 +1193,7 @@ static struct unix_funcs unix_funcs =
NtUserMoveWindow,
NtUserMsgWaitForMultipleObjectsEx,
NtUserPeekMessage,
NtUserPostThreadMessage,
NtUserRedrawWindow,
NtUserRegisterClassExWOW,
NtUserRegisterHotKey,

View file

@ -2407,6 +2407,30 @@ BOOL WINAPI NtUserPostMessage( HWND hwnd, UINT msg, WPARAM wparam, LPARAM lparam
return user_callbacks->pPostMessageW( hwnd, msg, wparam, lparam );
}
/**********************************************************************
* NtUserPostThreadMessage (win32u.@)
*/
BOOL WINAPI NtUserPostThreadMessage( DWORD thread, UINT msg, WPARAM wparam, LPARAM lparam )
{
struct send_message_info info;
if (is_pointer_message( msg, wparam ))
{
SetLastError( ERROR_MESSAGE_SYNC_ONLY );
return FALSE;
}
if (is_exiting_thread( thread )) return TRUE;
info.type = MSG_POSTED;
info.dest_tid = thread;
info.hwnd = 0;
info.msg = msg;
info.wparam = wparam;
info.lparam = lparam;
info.flags = 0;
return put_message_in_queue( &info, NULL );
}
LRESULT WINAPI NtUserMessageCall( HWND hwnd, UINT msg, WPARAM wparam, LPARAM lparam,
void *result_info, DWORD type, BOOL ansi )
{

View file

@ -1104,7 +1104,7 @@
@ stub NtUserPhysicalToLogicalPoint
@ stub NtUserPostKeyboardInputMessage
@ stub NtUserPostMessage
@ stub NtUserPostThreadMessage
@ stdcall NtUserPostThreadMessage(long long long long)
@ stub NtUserPrintWindow
@ stub NtUserProcessConnect
@ stub NtUserProcessInkFeedbackCommand

View file

@ -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 *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,
UNICODE_STRING *version,

View file

@ -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 NtUserPostThreadMessage( DWORD thread, UINT msg, WPARAM wparam, LPARAM lparam )
{
if (!unix_funcs) return FALSE;
return unix_funcs->pNtUserPostThreadMessage( thread, msg, wparam, lparam );
}
BOOL WINAPI NtUserRedrawWindow( HWND hwnd, const RECT *rect, HRGN hrgn, UINT flags )
{
if (!unix_funcs) return FALSE;