Skip to content
Snippets Groups Projects
Commit beae14de authored by Andreas Mohr's avatar Andreas Mohr Committed by Alexandre Julliard
Browse files

Protect EndDialog() from invalid window handles.

parent c3bc0fa2
No related branches found
No related tags found
No related merge requests found
......@@ -1099,12 +1099,18 @@ BOOL16 WINAPI EndDialog16( HWND16 hwnd, INT16 retval )
BOOL WINAPI EndDialog( HWND hwnd, INT retval )
{
WND * wndPtr = WIN_FindWndPtr( hwnd );
DIALOGINFO * dlgInfo = (DIALOGINFO *)wndPtr->wExtra;
DIALOGINFO * dlgInfo;
HWND hOwner = 0;
TRACE("%04x %d\n", hwnd, retval );
if( dlgInfo )
if (!wndPtr)
{
ERR("got invalid window handle (%04x); buggy app !?\n", hwnd);
return TRUE; /* the sun is shining even for buggy apps */
}
if ((dlgInfo = (DIALOGINFO *)wndPtr->wExtra))
{
dlgInfo->idResult = retval;
dlgInfo->flags |= DF_END;
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment