From 64c08e68c03862ec5773cbde2584567a78199f8e Mon Sep 17 00:00:00 2001 From: Hans Leidekker Date: Tue, 28 Nov 2017 15:21:59 +0100 Subject: [PATCH] taskschd: Implement ITaskSettings_put_ExecutionTimeLimit. Signed-off-by: Hans Leidekker Signed-off-by: Alexandre Julliard --- dlls/taskschd/task.c | 10 +++++++++- dlls/taskschd/tests/scheduler.c | 6 +++--- 2 files changed, 12 insertions(+), 4 deletions(-) diff --git a/dlls/taskschd/task.c b/dlls/taskschd/task.c index 188944fe7e7..7d0d8fa3b73 100644 --- a/dlls/taskschd/task.c +++ b/dlls/taskschd/task.c @@ -1138,8 +1138,16 @@ static HRESULT WINAPI TaskSettings_get_ExecutionTimeLimit(ITaskSettings *iface, static HRESULT WINAPI TaskSettings_put_ExecutionTimeLimit(ITaskSettings *iface, BSTR limit) { + TaskSettings *taskset = impl_from_ITaskSettings(iface); + WCHAR *str = NULL; + TRACE("%p,%s\n", iface, debugstr_w(limit)); - return E_NOTIMPL; + + if (limit && !(str = heap_strdupW(limit))) return E_OUTOFMEMORY; + heap_free(taskset->execution_time_limit); + taskset->execution_time_limit = str; + + return S_OK; } static HRESULT WINAPI TaskSettings_get_Enabled(ITaskSettings *iface, VARIANT_BOOL *enabled) diff --git a/dlls/taskschd/tests/scheduler.c b/dlls/taskschd/tests/scheduler.c index 9e3e3811c48..f710219e980 100644 --- a/dlls/taskschd/tests/scheduler.c +++ b/dlls/taskschd/tests/scheduler.c @@ -1129,6 +1129,9 @@ static void change_settings(ITaskDefinition *taskdef, struct settings *test) hr = ITaskSettings_put_ExecutionTimeLimit(set, NULL); else hr = ITaskSettings_put_ExecutionTimeLimit(set, test->execution_time_limit); + ok(hr == S_OK, "expected S_OK, got %#x\n", hr); + + hr = ITaskSettings_put_Enabled(set, test->enabled); todo_wine ok(hr == S_OK, "expected S_OK, got %#x\n", hr); /* FIXME: Remove once implemented */ @@ -1138,9 +1141,6 @@ todo_wine return; } - hr = ITaskSettings_put_Enabled(set, test->enabled); - ok(hr == S_OK, "expected S_OK, got %#x\n", hr); - if (!test->delete_expired_task_after[0]) hr = ITaskSettings_put_DeleteExpiredTaskAfter(set, NULL); else