Commit 31142324 authored by Fabian Bieler's avatar Fabian Bieler Committed by Alexandre Julliard

user32: Do not call NULL message callback.

parent 106badf1
......@@ -1905,6 +1905,8 @@ static BOOL process_hardware_message( MSG *msg, UINT hw_id, ULONG_PTR extra_info
static inline void call_sendmsg_callback( SENDASYNCPROC callback, HWND hwnd, UINT msg,
ULONG_PTR data, LRESULT result )
{
if (!callback) return;
if (TRACE_ON(relay))
DPRINTF( "%04x:Call message callback %p (hwnd=%p,msg=%s,data=%08lx,result=%08lx)\n",
GetCurrentThreadId(), callback, hwnd, SPY_GetMsgName( msg, hwnd ),
......
......@@ -8889,6 +8889,20 @@ static void test_dialog_messages(void)
#undef check_selection
}
static void test_nullCallback(void)
{
HWND hwnd;
MSG msg;
hwnd = CreateWindowExA(0, "TestWindowClass", "Test overlapped", WS_OVERLAPPEDWINDOW,
100, 100, 200, 200, 0, 0, 0, NULL);
ok (hwnd != 0, "Failed to create overlapped window\n");
SendMessageCallbackA(hwnd,WM_NULL,0,0,NULL,0);
while (PeekMessage( &msg, 0, 0, 0, PM_REMOVE )) DispatchMessage( &msg );
DestroyWindow(hwnd);
}
START_TEST(msg)
{
BOOL ret;
......@@ -8959,6 +8973,7 @@ START_TEST(msg)
test_SetWindowRgn();
test_sys_menu();
test_dialog_messages();
test_nullCallback();
UnhookWindowsHookEx(hCBT_hook);
if (pUnhookWinEvent)
......
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