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 ee5a7dd4b6..8b64663814 100644 --- a/dlls/taskschd/task.c +++ b/dlls/taskschd/task.c @@ -181,8 +181,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 fb6d626e14..d0477a82a4 100644 --- a/dlls/taskschd/tests/scheduler.c +++ b/dlls/taskschd/tests/scheduler.c @@ -1253,12 +1253,29 @@ 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"); + for (i = 0; i < sizeof(start_test)/sizeof(start_test[0]); i++) { start_boundary = SysAllocString(start_test[i].str); hr = IDailyTrigger_put_StartBoundary(daily_trigger, start_boundary); ok(hr == start_test[i].hr, "%u: got %08x expected %08x\n", i, hr, start_test[i].hr); SysFreeString(start_boundary); + if (hr == S_OK) + { + start_boundary = NULL; + hr = IDailyTrigger_get_StartBoundary(daily_trigger, &start_boundary); + ok(hr == S_OK, "%u: got %08x\n", i, hr); + ok(start_boundary != NULL, "start_boundary not set\n"); + ok(!lstrcmpW(start_boundary, start_test[i].str), "%u: got %s\n", i, wine_dbgstr_w(start_boundary)); + SysFreeString(start_boundary); + } }
hr = IDailyTrigger_put_StartBoundary(daily_trigger, NULL);