comctl32: monthcal: Reject out of range dates in MCM_SETCURSEL.
This commit is contained in:
parent
9a5c5178c2
commit
d0f75b5993
|
@ -1038,6 +1038,8 @@ MONTHCAL_SetCurSel(MONTHCAL_INFO *infoPtr, LPARAM lParam)
|
||||||
if((infoPtr==NULL) ||(lpSel==NULL)) return FALSE;
|
if((infoPtr==NULL) ||(lpSel==NULL)) return FALSE;
|
||||||
if(GetWindowLongW(infoPtr->hwndSelf, GWL_STYLE) & MCS_MULTISELECT) return FALSE;
|
if(GetWindowLongW(infoPtr->hwndSelf, GWL_STYLE) & MCS_MULTISELECT) return FALSE;
|
||||||
|
|
||||||
|
if(!MONTHCAL_ValidateTime(*lpSel)) return FALSE;
|
||||||
|
|
||||||
infoPtr->currentMonth=lpSel->wMonth;
|
infoPtr->currentMonth=lpSel->wMonth;
|
||||||
infoPtr->currentYear=lpSel->wYear;
|
infoPtr->currentYear=lpSel->wYear;
|
||||||
|
|
||||||
|
|
|
@ -206,7 +206,7 @@ static void test_monthcal_currDate(HWND hwnd)
|
||||||
/* Overflow matters, check for wDay */
|
/* Overflow matters, check for wDay */
|
||||||
st_test.wDay += 4;
|
st_test.wDay += 4;
|
||||||
res = SendMessage(hwnd, MCM_SETCURSEL, 0, (LPARAM)&st_test);
|
res = SendMessage(hwnd, MCM_SETCURSEL, 0, (LPARAM)&st_test);
|
||||||
todo_wine {expect(0,res);}
|
expect(0,res);
|
||||||
|
|
||||||
/* correct wDay before checking for wMonth */
|
/* correct wDay before checking for wMonth */
|
||||||
st_test.wDay -= 4;
|
st_test.wDay -= 4;
|
||||||
|
@ -215,7 +215,7 @@ static void test_monthcal_currDate(HWND hwnd)
|
||||||
/* Overflow matters, check for wMonth */
|
/* Overflow matters, check for wMonth */
|
||||||
st_test.wMonth += 4;
|
st_test.wMonth += 4;
|
||||||
res = SendMessage(hwnd, MCM_SETCURSEL, 0, (LPARAM)&st_test);
|
res = SendMessage(hwnd, MCM_SETCURSEL, 0, (LPARAM)&st_test);
|
||||||
todo_wine {expect(0,res);}
|
expect(0,res);
|
||||||
|
|
||||||
/* checking if gets the information right, modify st_new */
|
/* checking if gets the information right, modify st_new */
|
||||||
st_new.wYear += 4;
|
st_new.wYear += 4;
|
||||||
|
@ -231,7 +231,7 @@ static void test_monthcal_currDate(HWND hwnd)
|
||||||
/* st_new change to st_origin, above settings with overflow */
|
/* st_new change to st_origin, above settings with overflow */
|
||||||
/* should not change the current settings */
|
/* should not change the current settings */
|
||||||
expect(st_original.wYear, st_new.wYear);
|
expect(st_original.wYear, st_new.wYear);
|
||||||
todo_wine {expect(st_original.wMonth, st_new.wMonth);}
|
expect(st_original.wMonth, st_new.wMonth);
|
||||||
expect(st_original.wDay, st_new.wDay);
|
expect(st_original.wDay, st_new.wDay);
|
||||||
expect(st_original.wHour, st_new.wHour);
|
expect(st_original.wHour, st_new.wHour);
|
||||||
expect(st_original.wMinute, st_new.wMinute);
|
expect(st_original.wMinute, st_new.wMinute);
|
||||||
|
|
Loading…
Reference in New Issue