[0.4.9][WIN32K:NTUSER] Avoid dereferencing a null pointer in NC_DoNCPaint.

Fixes BSODs CORE-15569, CORE-12963, CORE-13410

For non-technicians:
Author Thomas Faber just imprisons the BSODs into an artificial cage
made of curly-braces. The BSODs can't h(a)unt any users anymore
and inevitably starve therefore.

cherry picked from commit 0.4.12-dev-338-g
b2dcb8e0d8
This commit is contained in:
Joachim Henze 2020-10-12 23:06:29 +02:00
parent d351b32bdb
commit 995d69c8d7

View file

@ -1148,11 +1148,13 @@ NC_DoNCPaint(PWND pWnd, HDC hDC, INT Flags)
FillRect(hDC, &TempRect, IntGetSysColorBrush(COLOR_BTNFACE));
if (Parent)
{
IntGetClientRect(Parent, &ParentClientRect);
if (HASSIZEGRIP(Style, ExStyle, Parent->style, WindowRect, ParentClientRect))
{
DrawFrameControl(hDC, &TempRect, DFC_SCROLL, DFCS_SCROLLSIZEGRIP);
if (HASSIZEGRIP(Style, ExStyle, Parent->style, WindowRect, ParentClientRect))
{
DrawFrameControl(hDC, &TempRect, DFC_SCROLL, DFCS_SCROLLSIZEGRIP);
}
}
IntDrawScrollBar(pWnd, hDC, SB_VERT);