user32: Limit broadcast messages to system and registered ones.
Signed-off-by: Nikolay Sivov <nsivov@codeweavers.com> Signed-off-by: Alexandre Julliard <julliard@winehq.org>
This commit is contained in:
parent
d154c8424d
commit
ad7cb43657
|
@ -3232,6 +3232,10 @@ static LRESULT send_inter_thread_callback( HWND hwnd, UINT msg, WPARAM wp, LPARA
|
|||
return send_inter_thread_message( info, result );
|
||||
}
|
||||
|
||||
static BOOL is_message_broadcastable(UINT msg)
|
||||
{
|
||||
return msg < WM_USER || msg >= 0xc000;
|
||||
}
|
||||
|
||||
/***********************************************************************
|
||||
* send_message
|
||||
|
@ -3246,7 +3250,8 @@ static BOOL send_message( struct send_message_info *info, DWORD_PTR *res_ptr, BO
|
|||
|
||||
if (is_broadcast(info->hwnd))
|
||||
{
|
||||
EnumWindows( broadcast_message_callback, (LPARAM)info );
|
||||
if (is_message_broadcastable( info->msg ))
|
||||
EnumWindows( broadcast_message_callback, (LPARAM)info );
|
||||
if (res_ptr) *res_ptr = 1;
|
||||
return TRUE;
|
||||
}
|
||||
|
@ -3659,7 +3664,8 @@ BOOL WINAPI PostMessageW( HWND hwnd, UINT msg, WPARAM wparam, LPARAM lparam )
|
|||
|
||||
if (is_broadcast(hwnd))
|
||||
{
|
||||
EnumWindows( broadcast_message_callback, (LPARAM)&info );
|
||||
if (is_message_broadcastable( info.msg ))
|
||||
EnumWindows( broadcast_message_callback, (LPARAM)&info );
|
||||
return TRUE;
|
||||
}
|
||||
|
||||
|
|
|
@ -14047,7 +14047,6 @@ static void test_broadcast(void)
|
|||
}
|
||||
else
|
||||
{
|
||||
todo_wine
|
||||
ok(!ret, "%d: message %04x, got %d, error %d\n", i, messages[i], ret, GetLastError());
|
||||
}
|
||||
|
||||
|
@ -14064,7 +14063,6 @@ static void test_broadcast(void)
|
|||
}
|
||||
else
|
||||
{
|
||||
todo_wine
|
||||
ok(!ret, "%d: got %d, error %d\n", i, ret, GetLastError());
|
||||
}
|
||||
|
||||
|
@ -14082,7 +14080,6 @@ static void test_broadcast(void)
|
|||
}
|
||||
else
|
||||
{
|
||||
todo_wine
|
||||
ok(g_broadcast_lparam == 0xdead, "%d: message %04x, got %#lx, error %d\n", i, messages[i],
|
||||
g_broadcast_lparam, GetLastError());
|
||||
}
|
||||
|
@ -14102,7 +14099,6 @@ static void test_broadcast(void)
|
|||
}
|
||||
else
|
||||
{
|
||||
todo_wine
|
||||
ok(g_broadcast_lparam == 0xdead, "%d: message %04x, got %#lx, error %d\n", i, messages[i],
|
||||
g_broadcast_lparam, GetLastError());
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue