Commit 6e4e8fb0 authored by Louis Lenders's avatar Louis Lenders Committed by Alexandre Julliard

user32: UpdateWindow doesn't accept a NULL hwnd.

parent 1f93a476
......@@ -1202,6 +1202,12 @@ BOOL WINAPI RedrawWindow( HWND hwnd, const RECT *rect, HRGN hrgn, UINT flags )
*/
BOOL WINAPI UpdateWindow( HWND hwnd )
{
if (!hwnd)
{
SetLastError( ERROR_INVALID_WINDOW_HANDLE );
return FALSE;
}
return RedrawWindow( hwnd, NULL, 0, RDW_UPDATENOW | RDW_ALLCHILDREN );
}
......
......@@ -6161,6 +6161,16 @@ static void test_paint_messages(void)
flush_events();
ok_sequence( WmEmptySeq, "WmEmptySeq", FALSE );
trace("testing UpdateWindow(NULL)\n");
SetLastError(0xdeadbeef);
ok(!UpdateWindow(NULL), "UpdateWindow(NULL) should fail\n");
ok(GetLastError() == ERROR_INVALID_WINDOW_HANDLE ||
broken( GetLastError() == 0xdeadbeef ) /* win9x */,
"wrong error code %d\n", GetLastError());
check_update_rgn( hwnd, 0 );
flush_events();
ok_sequence( WmEmptySeq, "WmEmptySeq", FALSE );
/* now with frame */
SetRectRgn( hrgn, -5, -5, 20, 20 );
......
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