diff --git a/dlls/taskschd/task.c b/dlls/taskschd/task.c index 5d7f467ef90..6a1acc81eb8 100644 --- a/dlls/taskschd/task.c +++ b/dlls/taskschd/task.c @@ -38,6 +38,7 @@ WINE_DEFAULT_DEBUG_CHANNEL(taskschd); typedef struct { IDailyTrigger IDailyTrigger_iface; LONG ref; + short interval; } DailyTrigger; static inline DailyTrigger *impl_from_IDailyTrigger(IDailyTrigger *iface) @@ -217,15 +218,24 @@ static HRESULT WINAPI DailyTrigger_put_Enabled(IDailyTrigger *iface, VARIANT_BOO static HRESULT WINAPI DailyTrigger_get_DaysInterval(IDailyTrigger *iface, short *days) { DailyTrigger *This = impl_from_IDailyTrigger(iface); - FIXME("(%p)->(%p)\n", This, days); - return E_NOTIMPL; + + TRACE("(%p)->(%p)\n", This, days); + + *days = This->interval; + return S_OK; } static HRESULT WINAPI DailyTrigger_put_DaysInterval(IDailyTrigger *iface, short days) { DailyTrigger *This = impl_from_IDailyTrigger(iface); - FIXME("(%p)->(%d)\n", This, days); - return E_NOTIMPL; + + TRACE("(%p)->(%d)\n", This, days); + + if(days <= 0) + return E_INVALIDARG; + + This->interval = days; + return S_OK; } static HRESULT WINAPI DailyTrigger_get_RandomDelay(IDailyTrigger *iface, BSTR *pRandomDelay) @@ -279,6 +289,7 @@ static HRESULT DailyTrigger_create(ITrigger **trigger) daily_trigger->IDailyTrigger_iface.lpVtbl = &DailyTrigger_vtbl; daily_trigger->ref = 1; + daily_trigger->interval = 1; *trigger = (ITrigger*)&daily_trigger->IDailyTrigger_iface; return S_OK; diff --git a/dlls/taskschd/tests/scheduler.c b/dlls/taskschd/tests/scheduler.c index 41c0ea89c51..efd5f60ebd2 100644 --- a/dlls/taskschd/tests/scheduler.c +++ b/dlls/taskschd/tests/scheduler.c @@ -1174,11 +1174,35 @@ todo_wine static void test_daily_trigger(ITrigger *trigger) { IDailyTrigger *daily_trigger; + short interval; HRESULT hr; hr = ITrigger_QueryInterface(trigger, &IID_IDailyTrigger, (void**)&daily_trigger); ok(hr == S_OK, "Could not get IDailyTrigger iface: %08x\n", hr); + interval = -1; + hr = IDailyTrigger_get_DaysInterval(daily_trigger, &interval); + ok(hr == S_OK, "get_DaysInterval failed: %08x\n", hr); + ok(interval == 1, "interval = %d\n", interval); + + hr = IDailyTrigger_put_DaysInterval(daily_trigger, -2); + ok(hr == E_INVALIDARG, "put_DaysInterval failed: %08x\n", hr); + hr = IDailyTrigger_put_DaysInterval(daily_trigger, 0); + ok(hr == E_INVALIDARG, "put_DaysInterval failed: %08x\n", hr); + + interval = -1; + hr = IDailyTrigger_get_DaysInterval(daily_trigger, &interval); + ok(hr == S_OK, "get_DaysInterval failed: %08x\n", hr); + ok(interval == 1, "interval = %d\n", interval); + + hr = IDailyTrigger_put_DaysInterval(daily_trigger, 2); + ok(hr == S_OK, "put_DaysInterval failed: %08x\n", hr); + + interval = -1; + hr = IDailyTrigger_get_DaysInterval(daily_trigger, &interval); + ok(hr == S_OK, "get_DaysInterval failed: %08x\n", hr); + ok(interval == 2, "interval = %d\n", interval); + IDailyTrigger_Release(daily_trigger); }