Commit 7cc0b970 authored by Kanit Therdsteerasukdi's avatar Kanit Therdsteerasukdi Committed by Alexandre Julliard

comctl32: datetime: Test for out of range dates in DTM_SETSYSTEMTIME only when flag=GDT_VALID.

parent 6630439f
......@@ -160,6 +160,7 @@ DATETIME_SetSystemTime (DATETIME_INFO *infoPtr, DWORD flag, SYSTEMTIME *lprgSysT
lprgSysTimeArray->wYear, lprgSysTimeArray->wMonth, lprgSysTimeArray->wDay,
lprgSysTimeArray->wHour, lprgSysTimeArray->wMinute, lprgSysTimeArray->wSecond);
if (flag == GDT_VALID) {
if (lprgSysTimeArray->wYear < 1601 || lprgSysTimeArray->wYear > 30827 ||
lprgSysTimeArray->wMonth < 1 || lprgSysTimeArray->wMonth > 12 ||
lprgSysTimeArray->wDayOfWeek > 6 ||
......@@ -171,7 +172,6 @@ DATETIME_SetSystemTime (DATETIME_INFO *infoPtr, DWORD flag, SYSTEMTIME *lprgSysT
)
return 0;
if (flag == GDT_VALID) {
infoPtr->dateValid = TRUE;
MONTHCAL_CopyTime (lprgSysTimeArray, &infoPtr->date);
SendMessageW (infoPtr->hMonthCal, MCM_SETCURSEL, 0, (LPARAM)(&infoPtr->date));
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment