Skip to content

Commit 60cf9f1

Browse files
learn-moreJoachimHenze
authored andcommitted
[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 e022d8d
1 parent 83e4a61 commit 60cf9f1

File tree

2 files changed

+3
-3
lines changed

2 files changed

+3
-3
lines changed

win32ss/user/ntuser/scrollbar.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -90,7 +90,7 @@ IntGetSBData(PWND pwnd, INT Bar)
9090
case SB_VERT:
9191
return &pSBInfo->Vert;
9292
case SB_CTL:
93-
if ( pwnd->cbwndExtra != (sizeof(SBWND)-sizeof(WND)) )
93+
if ( pwnd->cbwndExtra < (sizeof(SBWND)-sizeof(WND)) )
9494
{
9595
ERR("IntGetSBData Wrong Extra bytes for CTL Scrollbar!\n");
9696
return 0;

win32ss/user/user32/controls/scrollbar.c

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -100,7 +100,7 @@ IntGetSBData(PWND pwnd, INT Bar)
100100
case SB_VERT:
101101
return &pSBInfo->Vert;
102102
case SB_CTL:
103-
if ( pwnd->cbwndExtra != (sizeof(SBWND)-sizeof(WND)) )
103+
if ( pwnd->cbwndExtra < (sizeof(SBWND)-sizeof(WND)) )
104104
{
105105
ERR("IntGetSBData Wrong Extra bytes for CTL Scrollbar!\n");
106106
return 0;
@@ -1186,7 +1186,7 @@ ScrollBarWndProc_common(WNDPROC DefWindowProc, HWND Wnd, UINT Msg, WPARAM wParam
11861186
if (!pWnd->fnid)
11871187
{
11881188
TRACE("ScrollBar CTL size %d\n", (sizeof(SBWND)-sizeof(WND)));
1189-
if ( pWnd->cbwndExtra != (sizeof(SBWND)-sizeof(WND)) )
1189+
if ( pWnd->cbwndExtra < (sizeof(SBWND)-sizeof(WND)) )
11901190
{
11911191
ERR("Wrong Extra bytes for Scrollbar!\n");
11921192
return 0;

0 commit comments

Comments
 (0)