Signed-off-by: Hans Leidekker hans@codeweavers.com --- dlls/taskschd/task.c | 11 ++++++++--- dlls/taskschd/tests/scheduler.c | 17 +++++++++++++++++ 2 files changed, 25 insertions(+), 3 deletions(-)
diff --git a/dlls/taskschd/task.c b/dlls/taskschd/task.c index d720d50f87..a8b819c360 100644 --- a/dlls/taskschd/task.c +++ b/dlls/taskschd/task.c @@ -224,8 +224,13 @@ static HRESULT WINAPI DailyTrigger_put_EndBoundary(IDailyTrigger *iface, BSTR en static HRESULT WINAPI DailyTrigger_get_Enabled(IDailyTrigger *iface, VARIANT_BOOL *enabled) { DailyTrigger *This = impl_from_IDailyTrigger(iface); - FIXME("(%p)->(%p)\n", This, enabled); - return E_NOTIMPL; + + TRACE("(%p)->(%p)\n", This, enabled); + + if (!enabled) return E_POINTER; + + *enabled = This->enabled ? VARIANT_TRUE : VARIANT_FALSE; + return S_OK; }
static HRESULT WINAPI DailyTrigger_put_Enabled(IDailyTrigger *iface, VARIANT_BOOL enabled) @@ -314,7 +319,7 @@ static HRESULT DailyTrigger_create(ITrigger **trigger) daily_trigger->ref = 1; daily_trigger->interval = 1; daily_trigger->start_boundary = NULL; - daily_trigger->enabled = FALSE; + daily_trigger->enabled = TRUE;
*trigger = (ITrigger*)&daily_trigger->IDailyTrigger_iface; return S_OK; diff --git a/dlls/taskschd/tests/scheduler.c b/dlls/taskschd/tests/scheduler.c index d0477a82a4..c60fd1d9d7 100644 --- a/dlls/taskschd/tests/scheduler.c +++ b/dlls/taskschd/tests/scheduler.c @@ -1223,6 +1223,7 @@ static void test_daily_trigger(ITrigger *trigger) }; IDailyTrigger *daily_trigger; BSTR start_boundary; + VARIANT_BOOL enabled; short interval; HRESULT hr; ULONG i; @@ -1281,6 +1282,22 @@ static void test_daily_trigger(ITrigger *trigger) hr = IDailyTrigger_put_StartBoundary(daily_trigger, NULL); ok(hr == S_OK, "put_StartBoundary failed: %08x\n", hr);
+ hr = IDailyTrigger_get_Enabled(daily_trigger, NULL); + ok(hr == E_POINTER, "get_Enabled failed: %08x\n", hr); + + enabled = VARIANT_FALSE; + hr = IDailyTrigger_get_Enabled(daily_trigger, &enabled); + ok(hr == S_OK, "get_Enabled failed: %08x\n", hr); + ok(enabled == VARIANT_TRUE, "got %d\n", enabled); + + hr = IDailyTrigger_put_Enabled(daily_trigger, VARIANT_FALSE); + ok(hr == S_OK, "put_Enabled failed: %08x\n", hr); + + enabled = VARIANT_TRUE; + hr = IDailyTrigger_get_Enabled(daily_trigger, &enabled); + ok(hr == S_OK, "get_Enabled failed: %08x\n", hr); + ok(enabled == VARIANT_FALSE, "got %d\n", enabled); + IDailyTrigger_Release(daily_trigger); }