mstask: Handle disabled tasks in ITask::GetNextRunTime().
Signed-off-by: Dmitry Timoshkov <dmitry@baikal.ru> Signed-off-by: Alexandre Julliard <julliard@winehq.org>
This commit is contained in:
parent
d3a9af15d2
commit
e14e6bdeed
|
@ -476,6 +476,12 @@ static HRESULT WINAPI MSTASK_ITask_GetNextRunTime(ITask *iface, SYSTEMTIME *rt)
|
||||||
|
|
||||||
TRACE("(%p, %p)\n", iface, rt);
|
TRACE("(%p, %p)\n", iface, rt);
|
||||||
|
|
||||||
|
if (This->flags & TASK_FLAG_DISABLED)
|
||||||
|
{
|
||||||
|
memset(rt, 0, sizeof(*rt));
|
||||||
|
return SCHED_S_TASK_DISABLED;
|
||||||
|
}
|
||||||
|
|
||||||
GetLocalTime(¤t_st);
|
GetLocalTime(¤t_st);
|
||||||
|
|
||||||
for (i = 0; i < This->trigger_count; i++)
|
for (i = 0; i < This->trigger_count; i++)
|
||||||
|
|
|
@ -487,6 +487,19 @@ static void test_GetNextRunTime(void)
|
||||||
if (0) /* crashes under Windows */
|
if (0) /* crashes under Windows */
|
||||||
hr = ITask_GetNextRunTime(task, NULL);
|
hr = ITask_GetNextRunTime(task, NULL);
|
||||||
|
|
||||||
|
hr = ITask_SetFlags(task, TASK_FLAG_DISABLED);
|
||||||
|
ok(hr == S_OK, "got %#x\n", hr);
|
||||||
|
|
||||||
|
memset(&st, 0xff, sizeof(st));
|
||||||
|
hr = ITask_GetNextRunTime(task, &st);
|
||||||
|
ok(hr == SCHED_S_TASK_DISABLED, "got %#x\n", hr);
|
||||||
|
ok(!memcmp(&st, &st_empty, sizeof(st)), "got %u/%u/%u wday %u %u:%02u:%02u\n",
|
||||||
|
st.wDay, st.wMonth, st.wYear, st.wDayOfWeek,
|
||||||
|
st.wHour, st.wMinute, st.wSecond);
|
||||||
|
|
||||||
|
hr = ITask_SetFlags(task, 0);
|
||||||
|
ok(hr == S_OK, "got %#x\n", hr);
|
||||||
|
|
||||||
memset(&st, 0xff, sizeof(st));
|
memset(&st, 0xff, sizeof(st));
|
||||||
hr = ITask_GetNextRunTime(task, &st);
|
hr = ITask_GetNextRunTime(task, &st);
|
||||||
ok(hr == SCHED_S_TASK_NO_VALID_TRIGGERS, "got %#x\n", hr);
|
ok(hr == SCHED_S_TASK_NO_VALID_TRIGGERS, "got %#x\n", hr);
|
||||||
|
|
Loading…
Reference in New Issue