Protect BeginPaint and EndPaint from lps being NULL.

This commit is contained in:
Dmitry Timoshkov 2003-04-30 00:50:43 +00:00 committed by Alexandre Julliard
parent 0485fc19b6
commit befff55609
1 changed files with 4 additions and 0 deletions

View File

@ -159,6 +159,8 @@ HDC WINAPI BeginPaint( HWND hwnd, PAINTSTRUCT *lps )
HWND full_handle;
WND *wndPtr;
if (!lps) return 0;
if (!(full_handle = WIN_IsCurrentThread( hwnd )))
{
if (IsWindow(hwnd))
@ -239,6 +241,8 @@ HDC WINAPI BeginPaint( HWND hwnd, PAINTSTRUCT *lps )
*/
BOOL WINAPI EndPaint( HWND hwnd, const PAINTSTRUCT *lps )
{
if (!lps) return FALSE;
ReleaseDC( hwnd, lps->hdc );
ShowCaret( hwnd );
return TRUE;