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

This fixes Civ II trying to create scrollbars based on 'native' scrollbars.
This commit is contained in:
Mark Jansen 2019-01-18 00:07:23 +01:00
parent 342414c7d6
commit e022d8d7cb
No known key found for this signature in database
GPG key ID: B39240EE84BEAE8B
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;