[0.4.11] [WIN32SS] Require at least the amount of extra memory, not exact amount

This fixes Civ II trying to create scrollbars based on 'native' scrollbars.
Fixes 2 application crashes CORE-15576 & CORE-13924

cherry picked from commit 0.4.12-dev-417-g
e022d8d7cb
This commit is contained in:
Mark Jansen 2019-01-18 00:07:23 +01:00 committed by Joachim Henze
parent 83e4a612e3
commit 60cf9f11e1
2 changed files with 3 additions and 3 deletions

View file

@ -90,7 +90,7 @@ IntGetSBData(PWND pwnd, INT Bar)
case SB_VERT:
return &pSBInfo->Vert;
case SB_CTL:
if ( pwnd->cbwndExtra != (sizeof(SBWND)-sizeof(WND)) )
if ( pwnd->cbwndExtra < (sizeof(SBWND)-sizeof(WND)) )
{
ERR("IntGetSBData Wrong Extra bytes for CTL Scrollbar!\n");
return 0;

View file

@ -100,7 +100,7 @@ IntGetSBData(PWND pwnd, INT Bar)
case SB_VERT:
return &pSBInfo->Vert;
case SB_CTL:
if ( pwnd->cbwndExtra != (sizeof(SBWND)-sizeof(WND)) )
if ( pwnd->cbwndExtra < (sizeof(SBWND)-sizeof(WND)) )
{
ERR("IntGetSBData Wrong Extra bytes for CTL Scrollbar!\n");
return 0;
@ -1186,7 +1186,7 @@ ScrollBarWndProc_common(WNDPROC DefWindowProc, HWND Wnd, UINT Msg, WPARAM wParam
if (!pWnd->fnid)
{
TRACE("ScrollBar CTL size %d\n", (sizeof(SBWND)-sizeof(WND)));
if ( pWnd->cbwndExtra != (sizeof(SBWND)-sizeof(WND)) )
if ( pWnd->cbwndExtra < (sizeof(SBWND)-sizeof(WND)) )
{
ERR("Wrong Extra bytes for Scrollbar!\n");
return 0;