diff --git a/dlls/taskschd/task.c b/dlls/taskschd/task.c index 166e58774da..1c20f837c2c 100644 --- a/dlls/taskschd/task.c +++ b/dlls/taskschd/task.c @@ -2093,8 +2093,19 @@ static HRESULT WINAPI TaskDefinition_get_Actions(ITaskDefinition *iface, IAction static HRESULT WINAPI TaskDefinition_put_Actions(ITaskDefinition *iface, IActionCollection *actions) { - FIXME("%p,%p: stub\n", iface, actions); - return E_NOTIMPL; + TaskDefinition *taskdef = impl_from_ITaskDefinition(iface); + + TRACE("%p,%p\n", iface, actions); + + if (!actions) return E_POINTER; + + if (taskdef->actions) + IActionCollection_Release(taskdef->actions); + + IActionCollection_AddRef(actions); + taskdef->actions = actions; + + return S_OK; } static const WCHAR Task[] = {'T','a','s','k',0}; diff --git a/dlls/taskschd/tests/scheduler.c b/dlls/taskschd/tests/scheduler.c index 3d1d18ee5ef..1df79d5a992 100644 --- a/dlls/taskschd/tests/scheduler.c +++ b/dlls/taskschd/tests/scheduler.c @@ -1096,6 +1096,7 @@ static void change_settings(ITaskDefinition *taskdef, struct settings *test) ITaskSettings *set; ITriggerCollection *triggers; IPrincipal *principal; + IActionCollection *actions; hr = ITaskDefinition_get_Settings(taskdef, &set); ok(hr == S_OK, "get_Settings error %#x\n", hr); @@ -1178,6 +1179,15 @@ static void change_settings(ITaskDefinition *taskdef, struct settings *test) ok(hr == S_OK, "expected S_OK, got %#x\n", hr); if (principal) IPrincipal_Release(principal); + actions = NULL; + hr = ITaskDefinition_get_Actions(taskdef, &actions); + ok(hr == S_OK, "expected S_OK, got %#x\n", hr); + ok(actions != NULL, "actions not set\n"); + + hr = ITaskDefinition_put_Actions(taskdef, actions); + ok(hr == S_OK, "expected S_OK, got %#x\n", hr); + if (actions) IActionCollection_Release(actions); + /* FIXME: set IIdleSettings and INetworkSettings */ ITaskSettings_Release(set);