Signed-off-by: Hans Leidekker hans@codeweavers.com --- dlls/taskschd/task.c | 11 ++++++++--- dlls/taskschd/tests/scheduler.c | 16 +++++++++++++++- 2 files changed, 23 insertions(+), 4 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 a9bf615dc3..60e5943fbe 100644 --- a/dlls/taskschd/tests/scheduler.c +++ b/dlls/taskschd/tests/scheduler.c @@ -1199,6 +1199,7 @@ static void test_daily_trigger(ITrigger *trigger) {'2','0','0','4','-','0','1','-','0','1','T','0','0',':','0','0',':','0','0',0}; IDailyTrigger *daily_trigger; BSTR start_boundary; + VARIANT_BOOL enabled; short interval; HRESULT hr;
@@ -1250,9 +1251,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_put_Enabled(daily_trigger, VARIANT_TRUE); + 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); }