90{
94 TASK_TRIGGER tmp_trigger_cond;
95
96 TRACE(
"(%p, %p)\n", iface, pTrigger);
97
98
99 if (pTrigger->cbTriggerSize != sizeof(*pTrigger))
101 tmp_trigger_cond.cbTriggerSize = pTrigger->cbTriggerSize;
102
103
104 tmp_trigger_cond.Reserved1 = 0;
105
106
107 memset(&field_time, 0,
sizeof(field_time));
108 field_time.
Year = pTrigger->wBeginYear;
109 field_time.
Month = pTrigger->wBeginMonth;
110 field_time.
Day = pTrigger->wBeginDay;
111 field_time.
Hour = pTrigger->wStartHour;
112 field_time.
Minute = pTrigger->wStartMinute;
115 tmp_trigger_cond.wBeginYear = pTrigger->wBeginYear;
116 tmp_trigger_cond.wBeginMonth = pTrigger->wBeginMonth;
117 tmp_trigger_cond.wBeginDay = pTrigger->wBeginDay;
118 tmp_trigger_cond.wStartHour = pTrigger->wStartHour;
119 tmp_trigger_cond.wStartMinute = pTrigger->wStartMinute;
120
121
122 if (pTrigger->rgFlags & TASK_TRIGGER_FLAG_HAS_END_DATE)
123 {
124 memset(&field_time, 0,
sizeof(field_time));
125 field_time.
Year = pTrigger->wEndYear;
126 field_time.
Month = pTrigger->wEndMonth;
127 field_time.
Day = pTrigger->wEndDay;
130 }
131
132
133 tmp_trigger_cond.wEndYear = pTrigger->wEndYear;
134 tmp_trigger_cond.wEndMonth = pTrigger->wEndMonth;
135 tmp_trigger_cond.wEndDay = pTrigger->wEndDay;
136
137
138 if (pTrigger->MinutesDuration <= pTrigger->MinutesInterval &&
139 pTrigger->MinutesInterval > 0)
141 tmp_trigger_cond.MinutesDuration = pTrigger->MinutesDuration;
142 tmp_trigger_cond.MinutesInterval = pTrigger->MinutesInterval;
143
144
145 tmp_trigger_cond.rgFlags = pTrigger->rgFlags;
146
147
148 tmp_trigger_cond.TriggerType = pTrigger->TriggerType;
149 switch (pTrigger->TriggerType)
150 {
151 case TASK_TIME_TRIGGER_DAILY:
152 tmp_trigger_cond.Type.Daily.DaysInterval =
153 pTrigger->Type.Daily.DaysInterval;
154 break;
155 case TASK_TIME_TRIGGER_WEEKLY:
156 tmp_trigger_cond.Type.Weekly.WeeksInterval =
157 pTrigger->Type.Weekly.WeeksInterval;
158 tmp_trigger_cond.Type.Weekly.rgfDaysOfTheWeek =
159 pTrigger->Type.Weekly.rgfDaysOfTheWeek;
160 break;
161 case TASK_TIME_TRIGGER_MONTHLYDATE:
162 tmp_trigger_cond.Type.MonthlyDate.rgfDays =
163 pTrigger->Type.MonthlyDate.rgfDays;
164 tmp_trigger_cond.Type.MonthlyDate.rgfMonths =
165 pTrigger->Type.MonthlyDate.rgfMonths;
166 break;
167 case TASK_TIME_TRIGGER_MONTHLYDOW:
168 tmp_trigger_cond.Type.MonthlyDOW.wWhichWeek =
169 pTrigger->Type.MonthlyDOW.wWhichWeek;
170 tmp_trigger_cond.Type.MonthlyDOW.rgfDaysOfTheWeek =
171 pTrigger->Type.MonthlyDOW.rgfDaysOfTheWeek;
172 tmp_trigger_cond.Type.MonthlyDOW.rgfMonths =
173 pTrigger->Type.MonthlyDOW.rgfMonths;
174 break;
175 case TASK_TIME_TRIGGER_ONCE:
176 case TASK_EVENT_TRIGGER_ON_IDLE:
177 case TASK_EVENT_TRIGGER_AT_SYSTEMSTART:
178 case TASK_EVENT_TRIGGER_AT_LOGON:
179 default:
180 tmp_trigger_cond.Type =
This->triggerCond.Type;
181 break;
182 }
183
184
185 tmp_trigger_cond.Reserved2 = 0;
186
187
188 tmp_trigger_cond.wRandomMinutesInterval = 0;
189
190
191 This->triggerCond = tmp_trigger_cond;
192
194}
BOOLEAN RtlTimeFieldsToTime(IN PTIME_FIELDS TimeFields, IN PLARGE_INTEGER Time)