Hans Leidekker : taskschd: Implement ITaskSettings_put_DisallowStartIfOnBatteries.

Alexandre Julliard julliard at winehq.org
Tue Nov 28 15:11:05 CST 2017


Module: wine
Branch: master
Commit: 2032eedfa65cc00e15d6b829c777570052282582
URL:    http://source.winehq.org/git/wine.git/?a=commit;h=2032eedfa65cc00e15d6b829c777570052282582

Author: Hans Leidekker <hans at codeweavers.com>
Date:   Tue Nov 28 15:21:55 2017 +0100

taskschd: Implement ITaskSettings_put_DisallowStartIfOnBatteries.

Signed-off-by: Hans Leidekker <hans at codeweavers.com>
Signed-off-by: Alexandre Julliard <julliard at winehq.org>

---

 dlls/taskschd/task.c            | 9 +++++++--
 dlls/taskschd/tests/scheduler.c | 6 +++---
 2 files changed, 10 insertions(+), 5 deletions(-)

diff --git a/dlls/taskschd/task.c b/dlls/taskschd/task.c
index 70340be..0419ed0 100644
--- a/dlls/taskschd/task.c
+++ b/dlls/taskschd/task.c
@@ -1023,8 +1023,13 @@ static HRESULT WINAPI TaskSettings_get_DisallowStartIfOnBatteries(ITaskSettings
 
 static HRESULT WINAPI TaskSettings_put_DisallowStartIfOnBatteries(ITaskSettings *iface, VARIANT_BOOL disallow)
 {
-    FIXME("%p,%d: stub\n", iface, disallow);
-    return E_NOTIMPL;
+    TaskSettings *taskset = impl_from_ITaskSettings(iface);
+
+    TRACE("%p,%d\n", iface, disallow);
+
+    taskset->disallow_start_if_on_batteries = disallow ? TRUE : FALSE;
+
+    return S_OK;
 }
 
 static HRESULT WINAPI TaskSettings_get_AllowHardTerminate(ITaskSettings *iface, VARIANT_BOOL *allow)
diff --git a/dlls/taskschd/tests/scheduler.c b/dlls/taskschd/tests/scheduler.c
index e2f85b1..4d038e1 100644
--- a/dlls/taskschd/tests/scheduler.c
+++ b/dlls/taskschd/tests/scheduler.c
@@ -1114,6 +1114,9 @@ static void change_settings(ITaskDefinition *taskdef, struct settings *test)
     ok(hr == S_OK, "expected S_OK, got %#x\n", hr);
 
     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);
 todo_wine
     ok(hr == S_OK, "expected S_OK, got %#x\n", hr);
     /* FIXME: Remove once implemented */
@@ -1123,9 +1126,6 @@ todo_wine
         return;
     }
 
-    hr = ITaskSettings_put_AllowHardTerminate(set, test->allow_hard_terminate);
-    ok(hr == S_OK, "expected S_OK, got %#x\n", hr);
-
     hr = ITaskSettings_put_StartWhenAvailable(set, test->start_when_available);
     ok(hr == S_OK, "expected S_OK, got %#x\n", hr);
 




More information about the wine-cvs mailing list