53 ITaskTrigger_AddRef(iface);
89 const PTASK_TRIGGER pTrigger)
94 TASK_TRIGGER tmp_trigger_cond;
96 TRACE(
"(%p, %p)\n", iface, pTrigger);
99 if (pTrigger->cbTriggerSize !=
sizeof(*pTrigger))
101 tmp_trigger_cond.cbTriggerSize = pTrigger->cbTriggerSize;
104 tmp_trigger_cond.Reserved1 = 0;
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;
122 if (pTrigger->rgFlags & TASK_TRIGGER_FLAG_HAS_END_DATE)
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;
133 tmp_trigger_cond.wEndYear = pTrigger->wEndYear;
134 tmp_trigger_cond.wEndMonth = pTrigger->wEndMonth;
135 tmp_trigger_cond.wEndDay = pTrigger->wEndDay;
138 if (pTrigger->MinutesDuration <= pTrigger->MinutesInterval &&
139 pTrigger->MinutesInterval > 0)
141 tmp_trigger_cond.MinutesDuration = pTrigger->MinutesDuration;
142 tmp_trigger_cond.MinutesInterval = pTrigger->MinutesInterval;
145 tmp_trigger_cond.rgFlags = pTrigger->rgFlags;
148 tmp_trigger_cond.TriggerType = pTrigger->TriggerType;
149 switch (pTrigger->TriggerType)
151 case TASK_TIME_TRIGGER_DAILY:
152 tmp_trigger_cond.Type.Daily.DaysInterval =
153 pTrigger->Type.Daily.DaysInterval;
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;
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;
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;
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:
180 tmp_trigger_cond.Type =
This->triggerCond.Type;
185 tmp_trigger_cond.Reserved2 = 0;
188 tmp_trigger_cond.wRandomMinutesInterval = 0;
191 This->triggerCond = tmp_trigger_cond;
198 PTASK_TRIGGER pTrigger)
202 TRACE(
"(%p, %p)\n", iface, pTrigger);
207 pTrigger->cbTriggerSize =
This->triggerCond.cbTriggerSize;
208 pTrigger->Reserved1 = 0;
209 pTrigger->wBeginYear =
This->triggerCond.wBeginYear;
210 pTrigger->wBeginMonth =
This->triggerCond.wBeginMonth;
211 pTrigger->wBeginDay =
This->triggerCond.wBeginDay;
212 pTrigger->wEndYear =
This->triggerCond.wEndYear;
213 pTrigger->wEndMonth =
This->triggerCond.wEndMonth;
214 pTrigger->wEndDay =
This->triggerCond.wEndDay;
215 pTrigger->wStartHour =
This->triggerCond.wStartHour;
216 pTrigger->wStartMinute =
This->triggerCond.wStartMinute;
217 pTrigger->MinutesDuration =
This->triggerCond.MinutesDuration;
218 pTrigger->MinutesInterval =
This->triggerCond.MinutesInterval;
219 pTrigger->rgFlags =
This->triggerCond.rgFlags;
220 pTrigger->TriggerType =
This->triggerCond.TriggerType;
221 switch (
This->triggerCond.TriggerType)
223 case TASK_TIME_TRIGGER_DAILY:
224 pTrigger->Type.Daily.DaysInterval =
225 This->triggerCond.Type.Daily.DaysInterval;
227 case TASK_TIME_TRIGGER_WEEKLY:
228 pTrigger->Type.Weekly.WeeksInterval =
229 This->triggerCond.Type.Weekly.WeeksInterval;
230 pTrigger->Type.Weekly.rgfDaysOfTheWeek =
231 This->triggerCond.Type.Weekly.rgfDaysOfTheWeek;
233 case TASK_TIME_TRIGGER_MONTHLYDATE:
234 pTrigger->Type.MonthlyDate.rgfDays =
235 This->triggerCond.Type.MonthlyDate.rgfDays;
236 pTrigger->Type.MonthlyDate.rgfMonths =
237 This->triggerCond.Type.MonthlyDate.rgfMonths;
239 case TASK_TIME_TRIGGER_MONTHLYDOW:
240 pTrigger->Type.MonthlyDOW.wWhichWeek =
241 This->triggerCond.Type.MonthlyDOW.wWhichWeek;
242 pTrigger->Type.MonthlyDOW.rgfDaysOfTheWeek =
243 This->triggerCond.Type.MonthlyDOW.rgfDaysOfTheWeek;
244 pTrigger->Type.MonthlyDOW.rgfMonths =
245 This->triggerCond.Type.MonthlyDOW.rgfMonths;
247 case TASK_TIME_TRIGGER_ONCE:
248 case TASK_EVENT_TRIGGER_ON_IDLE:
249 case TASK_EVENT_TRIGGER_AT_SYSTEMSTART:
250 case TASK_EVENT_TRIGGER_AT_LOGON:
254 pTrigger->Reserved2 = 0;
255 pTrigger->wRandomMinutesInterval = 0;
263 FIXME(
"Not implemented\n");
281 TRACE(
"(%p)\n", ppObj);
292 memset(&
This->triggerCond, 0,
sizeof(TASK_TRIGGER));
294 This->triggerCond.cbTriggerSize =
sizeof(
This->triggerCond);
295 This->triggerCond.wBeginYear =
time.wYear;
296 This->triggerCond.wBeginMonth =
time.wMonth;
297 This->triggerCond.wBeginDay =
time.wDay;
298 This->triggerCond.wStartHour =
time.wHour;
299 This->triggerCond.wStartMinute =
time.wMinute;
300 This->triggerCond.rgFlags = TASK_TRIGGER_FLAG_DISABLED;
301 This->triggerCond.TriggerType = TASK_TIME_TRIGGER_DAILY,
302 This->triggerCond.Type.Daily.DaysInterval = 1;
304 *ppObj = &
This->ITaskTrigger_iface;
#define InterlockedIncrement
#define InterlockedDecrement
#define WINE_DEFAULT_DEBUG_CHANNEL(t)
#define HeapFree(x, y, z)
VOID WINAPI GetLocalTime(OUT LPSYSTEMTIME lpSystemTime)
static HRESULT WINAPI MSTASK_ITaskTrigger_GetTrigger(ITaskTrigger *iface, PTASK_TRIGGER pTrigger)
static HRESULT WINAPI MSTASK_ITaskTrigger_GetTriggerString(ITaskTrigger *iface, LPWSTR *ppwszTrigger)
static ULONG WINAPI MSTASK_ITaskTrigger_AddRef(ITaskTrigger *iface)
HRESULT TaskTriggerConstructor(LPVOID *ppObj)
static ULONG WINAPI MSTASK_ITaskTrigger_Release(ITaskTrigger *iface)
static HRESULT WINAPI MSTASK_ITaskTrigger_SetTrigger(ITaskTrigger *iface, const PTASK_TRIGGER pTrigger)
static const ITaskTriggerVtbl MSTASK_ITaskTriggerVtbl
static HRESULT WINAPI MSTASK_ITaskTrigger_QueryInterface(ITaskTrigger *iface, REFIID riid, void **ppvObject)
static TaskTriggerImpl * impl_from_ITaskTrigger(ITaskTrigger *iface)
BOOLEAN RtlTimeFieldsToTime(IN PTIME_FIELDS TimeFields, IN PLARGE_INTEGER Time)
#define IsEqualGUID(rguid1, rguid2)
ITaskTrigger ITaskTrigger_iface
#define CONTAINING_RECORD(address, type, field)
_In_ void _In_ PCCERT_CONTEXT _In_opt_ LPFILETIME _In_ DWORD _In_ DWORD _Outptr_opt_ void ** ppvObject