Signed-off-by: Hans Leidekker hans@codeweavers.com --- dlls/taskschd/task.c | 11 +++++++++-- dlls/taskschd/tests/scheduler.c | 17 +++++++++++++++++ 2 files changed, 26 insertions(+), 2 deletions(-)
diff --git a/dlls/taskschd/task.c b/dlls/taskschd/task.c index 84e84913fc..d720d50f87 100644 --- a/dlls/taskschd/task.c +++ b/dlls/taskschd/task.c @@ -182,8 +182,15 @@ static HRESULT WINAPI DailyTrigger_put_ExecutionTimeLimit(IDailyTrigger *iface, static HRESULT WINAPI DailyTrigger_get_StartBoundary(IDailyTrigger *iface, BSTR *start) { DailyTrigger *This = impl_from_IDailyTrigger(iface); - FIXME("(%p)->(%p)\n", This, start); - return E_NOTIMPL; + + TRACE("(%p)->(%p)\n", This, start); + + if (!start) return E_POINTER; + + if (!This->start_boundary) *start = NULL; + else if (!(*start = SysAllocString(This->start_boundary))) return E_OUTOFMEMORY; + + return S_OK; }
static HRESULT WINAPI DailyTrigger_put_StartBoundary(IDailyTrigger *iface, BSTR start) diff --git a/dlls/taskschd/tests/scheduler.c b/dlls/taskschd/tests/scheduler.c index 0f3010e30f..a9bf615dc3 100644 --- a/dlls/taskschd/tests/scheduler.c +++ b/dlls/taskschd/tests/scheduler.c @@ -1228,14 +1228,31 @@ static void test_daily_trigger(ITrigger *trigger) ok(hr == S_OK, "get_DaysInterval failed: %08x\n", hr); ok(interval == 2, "interval = %d\n", interval);
+ hr = IDailyTrigger_get_StartBoundary(daily_trigger, NULL); + ok(hr == E_POINTER, "get_StartBoundary failed: %08x\n", hr); + + start_boundary = (BSTR)0xdeadbeef; + hr = IDailyTrigger_get_StartBoundary(daily_trigger, &start_boundary); + ok(hr == S_OK, "get_StartBoundary failed: %08x\n", hr); + ok(start_boundary == NULL, "start_boundary not set\n"); + start_boundary = SysAllocString(startW); hr = IDailyTrigger_put_StartBoundary(daily_trigger, start_boundary); ok(hr == S_OK, "put_StartBoundary failed: %08x\n", hr); SysFreeString(start_boundary);
+ start_boundary = NULL; + hr = IDailyTrigger_get_StartBoundary(daily_trigger, &start_boundary); + ok(hr == S_OK, "get_StartBoundary failed: %08x\n", hr); + ok(start_boundary != NULL, "start_boundary not set\n"); + ok(!lstrcmpW(start_boundary, startW), "wrong string\n"); + 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); + ok(hr == S_OK, "put_Enabled failed: %08x\n", hr); + IDailyTrigger_Release(daily_trigger); }