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,18 +160,18 @@ DATETIME_SetSystemTime (DATETIME_INFO *infoPtr, DWORD flag, SYSTEMTIME *lprgSysT
lprgSysTimeArray->wYear, lprgSysTimeArray->wMonth, lprgSysTimeArray->wDay,
lprgSysTimeArray->wHour, lprgSysTimeArray->wMinute, lprgSysTimeArray->wSecond);
if (lprgSysTimeArray->wYear < 1601 || lprgSysTimeArray->wYear > 30827 ||
lprgSysTimeArray->wMonth < 1 || lprgSysTimeArray->wMonth > 12 ||
lprgSysTimeArray->wDayOfWeek > 6 ||
lprgSysTimeArray->wDay < 1 || lprgSysTimeArray->wDay > 31 ||
lprgSysTimeArray->wHour > 23 ||
lprgSysTimeArray->wMinute > 59 ||
lprgSysTimeArray->wSecond > 59 ||
lprgSysTimeArray->wMilliseconds > 999
)
return 0;
if (flag == GDT_VALID) {
if (lprgSysTimeArray->wYear < 1601 || lprgSysTimeArray->wYear > 30827 ||
lprgSysTimeArray->wMonth < 1 || lprgSysTimeArray->wMonth > 12 ||
lprgSysTimeArray->wDayOfWeek > 6 ||
lprgSysTimeArray->wDay < 1 || lprgSysTimeArray->wDay > 31 ||
lprgSysTimeArray->wHour > 23 ||
lprgSysTimeArray->wMinute > 59 ||
lprgSysTimeArray->wSecond > 59 ||
lprgSysTimeArray->wMilliseconds > 999
)
return 0;
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