win32u: Move SendMessageCallbackW 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-04 16:59:02 +02:00 committed by Alexandre Julliard
parent 2c01eb392b
commit b99778a531
3 changed files with 29 additions and 19 deletions

View File

@ -2296,24 +2296,8 @@ BOOL WINAPI SendMessageCallbackA( HWND hwnd, UINT msg, WPARAM wparam, LPARAM lpa
BOOL WINAPI SendMessageCallbackW( HWND hwnd, UINT msg, WPARAM wparam, LPARAM lparam,
SENDASYNCPROC callback, ULONG_PTR data )
{
struct send_message_info info;
if (is_pointer_message( msg, wparam ))
{
SetLastError( ERROR_MESSAGE_SYNC_ONLY );
return FALSE;
}
info.type = MSG_CALLBACK;
info.hwnd = hwnd;
info.msg = msg;
info.wparam = wparam;
info.lparam = lparam;
info.callback = callback;
info.data = data;
info.flags = 0;
return send_message( &info, NULL, TRUE );
struct send_message_callback_params params = { .callback = callback, .data = data };
return NtUserMessageCall( hwnd, msg, wparam, lparam, &params, FNID_SENDMESSAGECALLBACK, FALSE );
}

View File

@ -2372,6 +2372,31 @@ static BOOL send_notify_message( HWND hwnd, UINT msg, WPARAM wparam, LPARAM lpar
return process_message( &info, NULL, ansi );
}
/* see SendMessageCallbackW */
static BOOL send_message_callback( HWND hwnd, UINT msg, WPARAM wparam, LPARAM lparam,
const struct send_message_callback_params *params, BOOL ansi )
{
struct send_message_info info;
if (is_pointer_message( msg, wparam ))
{
SetLastError( ERROR_MESSAGE_SYNC_ONLY );
return FALSE;
}
info.type = MSG_CALLBACK;
info.hwnd = hwnd;
info.msg = msg;
info.wparam = wparam;
info.lparam = lparam;
info.callback = params->callback;
info.data = params->data;
info.flags = 0;
info.wm_char = WMCHAR_MAP_SENDMESSAGETIMEOUT;
return process_message( &info, NULL, ansi );
}
/***********************************************************************
* NtUserPostMessage (win32u.@)
*/
@ -2402,6 +2427,8 @@ LRESULT WINAPI NtUserMessageCall( HWND hwnd, UINT msg, WPARAM wparam, LPARAM lpa
}
case FNID_SENDNOTIFYMESSAGE:
return send_notify_message( hwnd, msg, wparam, lparam, ansi );
case FNID_SENDMESSAGECALLBACK:
return send_message_callback( hwnd, msg, wparam, lparam, (void *)result_info, ansi );
case FNID_SPYENTER:
spy_enter_message( ansi, hwnd, msg, wparam, lparam );
return 0;

View File

@ -466,7 +466,6 @@ static void test_message_call(void)
res = NtUserMessageCall( hwnd, WM_USER, 1, 2, &callback_params,
FNID_SENDMESSAGECALLBACK, FALSE );
todo_wine
ok( res == 1, "res = %Iu\n", res );
DestroyWindow( hwnd );