diff --git a/dlls/taskschd/task.c b/dlls/taskschd/task.c index 12b2cb5d178..e417c05382a 100644 --- a/dlls/taskschd/task.c +++ b/dlls/taskschd/task.c @@ -999,8 +999,13 @@ static HRESULT WINAPI TaskSettings_get_StopIfGoingOnBatteries(ITaskSettings *ifa static HRESULT WINAPI TaskSettings_put_StopIfGoingOnBatteries(ITaskSettings *iface, VARIANT_BOOL stop) { - FIXME("%p,%d: stub\n", iface, stop); - return E_NOTIMPL; + TaskSettings *taskset = impl_from_ITaskSettings(iface); + + TRACE("%p,%d\n", iface, stop); + + taskset->stop_if_going_on_batteries = stop ? TRUE : FALSE; + + return S_OK; } static HRESULT WINAPI TaskSettings_get_DisallowStartIfOnBatteries(ITaskSettings *iface, VARIANT_BOOL *disallow) diff --git a/dlls/taskschd/tests/scheduler.c b/dlls/taskschd/tests/scheduler.c index 906d033d56c..e2f85b1b730 100644 --- a/dlls/taskschd/tests/scheduler.c +++ b/dlls/taskschd/tests/scheduler.c @@ -1111,6 +1111,9 @@ static void change_settings(ITaskDefinition *taskdef, struct settings *test) ok(hr == S_OK, "expected S_OK, got %#x\n", hr); hr = ITaskSettings_put_StopIfGoingOnBatteries(set, test->stop_if_going_on_batteries); + ok(hr == S_OK, "expected S_OK, got %#x\n", hr); + + hr = ITaskSettings_put_DisallowStartIfOnBatteries(set, test->disallow_start_if_on_batteries); todo_wine ok(hr == S_OK, "expected S_OK, got %#x\n", hr); /* FIXME: Remove once implemented */ @@ -1120,9 +1123,6 @@ todo_wine return; } - hr = ITaskSettings_put_DisallowStartIfOnBatteries(set, test->disallow_start_if_on_batteries); - ok(hr == S_OK, "expected S_OK, got %#x\n", hr); - hr = ITaskSettings_put_AllowHardTerminate(set, test->allow_hard_terminate); ok(hr == S_OK, "expected S_OK, got %#x\n", hr);