If exception occurs, leave critical section. Bug #4431.

svn path=/trunk/; revision=41779
This commit is contained in:
Dmitry Gorbachev 2009-07-05 14:08:10 +00:00
parent 0d5243017d
commit bc9c521a84

View file

@ -1813,6 +1813,7 @@ BOOL UserDrawCaption(
/* FIXME: Draw the Icon when pWnd == NULL but hIcon is valid */ /* FIXME: Draw the Icon when pWnd == NULL but hIcon is valid */
if (pWnd != NULL) if (pWnd != NULL)
UserDrawSysMenuButton(pWnd, hMemDc, &r, FALSE); UserDrawSysMenuButton(pWnd, hMemDc, &r, FALSE);
r.left += IconWidth; r.left += IconWidth;
r.top --; r.top --;
} }
@ -1902,9 +1903,10 @@ NtUserDrawCaptionTemp(
UINT uFlags) UINT uFlags)
{ {
PWINDOW_OBJECT pWnd = NULL; PWINDOW_OBJECT pWnd = NULL;
RECTL SafeRect;
UNICODE_STRING SafeStr = {0}; UNICODE_STRING SafeStr = {0};
BOOL Ret = FALSE; NTSTATUS Status = STATUS_SUCCESS;
RECTL SafeRect;
BOOL Ret;
UserEnterExclusive(); UserEnterExclusive();
@ -1930,17 +1932,26 @@ NtUserDrawCaptionTemp(
SafeStr.Length, SafeStr.Length,
sizeof(WCHAR)); sizeof(WCHAR));
} }
Ret = UserDrawCaption(pWnd, hDC, &SafeRect, hFont, hIcon, &SafeStr, uFlags);
} }
else
Ret = UserDrawCaption(pWnd, hDC, &SafeRect, hFont, hIcon, NULL, uFlags);
} }
_SEH2_EXCEPT(EXCEPTION_EXECUTE_HANDLER) _SEH2_EXCEPT(EXCEPTION_EXECUTE_HANDLER)
{ {
SetLastNtError(_SEH2_GetExceptionCode()); Status = _SEH2_GetExceptionCode();
} }
_SEH2_END; _SEH2_END;
if (Status != STATUS_SUCCESS)
{
SetLastNtError(Status);
UserLeave();
return FALSE;
}
if (str != NULL)
Ret = UserDrawCaption(pWnd, hDC, &SafeRect, hFont, hIcon, &SafeStr, uFlags);
else
Ret = UserDrawCaption(pWnd, hDC, &SafeRect, hFont, hIcon, NULL, uFlags);
UserLeave(); UserLeave();
return Ret; return Ret;
} }