user32: Do not call NULL message callback.

This commit is contained in:
Fabian Bieler 2007-02-24 19:57:22 +01:00 committed by Alexandre Julliard
parent 106badf11b
commit 311423242b
2 changed files with 17 additions and 0 deletions

View File

@ -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 ),

View File

@ -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)